diff --git a/app/Datatables/Shop/PriceListsDataTable.php b/app/Datatables/Shop/PriceListsDataTable.php index 4d940708..dbd8f857 100644 --- a/app/Datatables/Shop/PriceListsDataTable.php +++ b/app/Datatables/Shop/PriceListsDataTable.php @@ -35,7 +35,10 @@ class PriceListsDataTable extends DataTable ->editColumn('status', function (PriceList $price_list) { return PriceLists::getStatus($price_list['status_id']); }) - ->rawColumns(['action']); + ->editColumn('tariff_id', function (PriceList $price_list) { + return view('Admin.Shop.PriceLists.partials.table-prices', ['prices' => $price_list['price_list_values']]); + }) + ->rawColumns(['tariff_id','action']); return parent::modifier($datatables); } @@ -45,6 +48,7 @@ class PriceListsDataTable extends DataTable Column::make('status_id')->data('status')->title('etat'), Column::make('name')->title('Nom'), Column::make('sale_channel.name')->title('Canal de vente'), + Column::make('tariff_id')->title('Liste de prix'), self::makeColumnButtons(), ]; } diff --git a/resources/views/Admin/Shop/PriceLists/partials/table-prices.blade.php b/resources/views/Admin/Shop/PriceLists/partials/table-prices.blade.php index f82c7cf7..1adea401 100644 --- a/resources/views/Admin/Shop/PriceLists/partials/table-prices.blade.php +++ b/resources/views/Admin/Shop/PriceLists/partials/table-prices.blade.php @@ -1,27 +1,12 @@ -@if (count($generic['prices'] ?? [])) +@if (count($prices ?? []))
| - - - {{ $generic['category']['name'] ?? null }} - | - @foreach ($generic['prices'] as $price) -- {{ $price['quantity'] ?? null }} {{ $price['unity_id'] ?? null }} - | - @endforeach -
|---|---|
| - {{ $generic['name'] ?? null }} + {{ $price['quantity'] ?? null }} | - @foreach ($generic['prices'] as $price)- {{ $price['price_taxed'] ?? null }} + {{ $price['price'] ?? null }} | @endforeach