EV3-172 Módosítási lehetőség a kosárban part2 working
This commit is contained in:
parent
dcd97ebcd1
commit
294adb58ce
@ -1758,6 +1758,9 @@ public function getDataTableContent(): JsonResponse
|
||||
if (substr($searchStr, 0, 2) == '**') {
|
||||
$special['type'] = str_replace('*', '', $searchStr);
|
||||
$special['profitCenterId'] = $profitCenterId;
|
||||
if (\request()->get('orderId')) {
|
||||
$special['orderId'] = (int) \request()->get('orderId');
|
||||
}
|
||||
$searchStr = null;
|
||||
}
|
||||
} else {
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Order;
|
||||
use App\Models\OrderArchive;
|
||||
use App\Models\PriceList;
|
||||
use App\Models\Product;
|
||||
@ -216,6 +217,30 @@ private function getSupplierProductSpecialWeekly($supplierId, $products, $option
|
||||
return $products;
|
||||
}
|
||||
|
||||
private function getSupplierProductSpecialCart($supplierId, $products, $options)
|
||||
{
|
||||
debug(__FUNCTION__);
|
||||
if (empty($options['orderId'])) {
|
||||
debug('empty orderId');
|
||||
return $products;
|
||||
}
|
||||
$Order = Order::find($options['orderId']);
|
||||
if (! $Order || ! $Order->productSelected) {
|
||||
return $products;
|
||||
}
|
||||
$productSelected = json_decode($Order->productSelected, true);
|
||||
debug($productSelected);
|
||||
$selectedIds = array_filter(
|
||||
array_keys($productSelected),
|
||||
fn ($id) => isset($productSelected[$id]) && $productSelected[$id] != 0
|
||||
);
|
||||
debug($selectedIds);
|
||||
$products->whereIn('id', $selectedIds);
|
||||
$products->orderBy('name');
|
||||
|
||||
return $products;
|
||||
}
|
||||
|
||||
private function getSupplierProductSpecial($supplierId, $products, $options)
|
||||
{
|
||||
$functionName = 'getSupplierProductSpecial'.ucfirst($options['type']);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -1,7 +1,7 @@
|
||||
{
|
||||
"/js/app.js": "/js/app.js?id=788435874adbbf8e5ddc27cc9d18e00e",
|
||||
"/js/admin.js": "/js/admin.js?id=ba79095db4031ff8fcb2db67804629a7",
|
||||
"/js/module.js": "/js/module.js?id=bb6e002fb4bc0accde646b3f3597ba4a",
|
||||
"/js/module.js": "/js/module.js?id=94c7ad4c0738fb483ae92ee6d32dacfe",
|
||||
"/js/components.js": "/js/components.js?id=34668cee8ac371c98657beffcff579b8",
|
||||
"/css/app.css": "/css/app.css?id=883a2d68194f1a6064f55eaedb17e768",
|
||||
"/fonts/vendor/bootstrap-icons/bootstrap-icons.woff2?92ea18a81d737146ff044ddb52010366": "/fonts/vendor/bootstrap-icons/bootstrap-icons.woff2?92ea18a81d737146ff044ddb52010366?id=9ad5aa740d7d5e6a0191b309b9b1986c",
|
||||
|
||||
@ -1159,7 +1159,7 @@ solution before template
|
||||
this.clickSpecialCart = function () {
|
||||
debug('clickSpecialCart');
|
||||
root.setDatatableHeaderText('Termékek szűrve: Kosár termékek');
|
||||
dataTableSearchStr='**specialCart**';
|
||||
dataTableSearchStr='**cart**';
|
||||
$('.dataTableOrderProductSelect').DataTable().ajax.reload();
|
||||
}
|
||||
|
||||
@ -1261,6 +1261,7 @@ solution before template
|
||||
data.groupId=selectedProductGroup;
|
||||
data.supplierId=Order.supplierId;
|
||||
data.deliveryDate=Order.deliveryDate;
|
||||
data.orderId=Order.id;
|
||||
}
|
||||
},
|
||||
buttons: {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user