[WIP] Tentative d'ajout des tarifs dans le tableau
This commit is contained in:
@@ -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(),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,27 +1,12 @@
|
||||
@if (count($generic['prices'] ?? []))
|
||||
@if (count($prices ?? []))
|
||||
<table class="table table-bordered table-hover table-striped w-100 mb-0 dataTable">
|
||||
<input type="hidden" name="price_generics[0]" value="{{ $generic['id'] }}">
|
||||
<thead>
|
||||
<th>
|
||||
<button type="button" class="btn btn-xs btn-danger delete-generic-price-btn mt-2" data-card-widget="collapse" data-toggle="tooltip" title="supprimer" data-id="{{ $generic['id'] }}">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
|
||||
{{ $generic['category']['name'] ?? null }}
|
||||
</th>
|
||||
@foreach ($generic['prices'] as $price)
|
||||
<th>
|
||||
{{ $price['quantity'] ?? null }} {{ $price['unity_id'] ?? null }}
|
||||
</th>
|
||||
@endforeach
|
||||
</thead>
|
||||
<tr>
|
||||
@foreach ($prices as $price)
|
||||
<td>
|
||||
{{ $generic['name'] ?? null }}
|
||||
{{ $price['quantity'] ?? null }}
|
||||
</td>
|
||||
@foreach ($generic['prices'] as $price)
|
||||
<td>
|
||||
{{ $price['price_taxed'] ?? null }}
|
||||
{{ $price['price'] ?? null }}
|
||||
</td>
|
||||
@endforeach
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user