This commit is contained in:
Ludovic CANDELLIER
2021-04-08 16:59:06 +02:00
parent 0dd3df2984
commit 31e60dee45
17 changed files with 710 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace App\Datatables\Shop;
use Yajra\DataTables\Html\Column;
use App\Datatables\ParentDataTable as DataTable;
use App\Models\Shop\PriceGeneric;
class PriceGenericsDataTable extends DataTable
{
public $model_name = 'price_generics';
public function query(PriceGeneric $model)
{
$model = $model::with(['category','priceByUnit'])->withCount('prices');
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('category.name')->title('Catégorie'),
Column::make('name')->title('Nom'),
Column::make('price_by_unit.price')->title('Prix HT')->class('text-right'),
Column::make('price_by_unit.price_taxed')->title('Prix TTC')->class('text-right'),
Column::make('prices_count')->title('Nb tarifs')->class('text-right'),
self::makeColumnButtons(),
];
}
}