salesentry filters
This commit is contained in:
@ -42,10 +42,14 @@ class SalesEntryController extends Controller
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
public function index(Request $request)
|
||||
{
|
||||
$filters = $request->all();
|
||||
$data['title'] = 'Sales Entries';
|
||||
$data['salesEntries'] = SalesEntry::all();
|
||||
$data['stockList'] = $this->stockRepository->pluck();
|
||||
$data['productList'] = $this->productRepository->pluck();
|
||||
$data['categoryList'] = $this->categoryRepository->pluck();
|
||||
$data['salesEntries'] = $this->salesEntryRepository->findAll($filters);
|
||||
return view('salesEntry::salesEntry.index', $data);
|
||||
}
|
||||
|
||||
@ -55,9 +59,9 @@ class SalesEntryController extends Controller
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'New Sales Entry';
|
||||
$data['categoryList'] = $this->categoryRepository->pluck();
|
||||
$data['stockList'] = $this->stockRepository->pluck();
|
||||
$data['productList'] = $this->productRepository->pluck();
|
||||
$data['categoryList'] = $this->categoryRepository->pluck();
|
||||
$data['customerList'] = $this->customerRepository->pluck();
|
||||
$data['sizes'] = $this->fieldRepository->getDropdownByAlias('size');
|
||||
$data['paymentModes'] = $this->fieldRepository->getDropdownByAlias('payment-mode');
|
||||
@ -127,9 +131,11 @@ class SalesEntryController extends Controller
|
||||
$productList= $this->productRepository->pluck('id');
|
||||
$stockList= $this->stockRepository->pluck('id');
|
||||
$categoryList= $this->categoryRepository->pluck('id');
|
||||
$sizes = $this->fieldRepository->getDropdownByAlias('size');
|
||||
$paymentModes = $this->fieldRepository->getDropdownByAlias('payment-mode');
|
||||
|
||||
return response()->json([
|
||||
'view' => view('salesEntry::salesEntry.clone-product', compact('data', 'numInc', 'script', 'productList'))->render(),
|
||||
'view' => view('salesEntry::salesEntry.clone-product', compact('data', 'numInc', 'script', 'productList', 'categoryList', 'stockList', 'sizes', 'paymentModes'))->render(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user