Fixes on prices & add ArticlePriceGeneric
This commit is contained in:
30
app/DataTables/Shop/ArticlePriceGenericsDataTable.php
Normal file
30
app/DataTables/Shop/ArticlePriceGenericsDataTable.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\DataTables\Shop;
|
||||
|
||||
use Yajra\DataTables\Html\Column;
|
||||
use App\DataTables\ParentDataTable as DataTable;
|
||||
use App\Models\Shop\ArticlePriceGeneric;
|
||||
|
||||
class ArticlePriceGenericsDataTable extends DataTable
|
||||
{
|
||||
public $model_name = 'article-price-generics';
|
||||
|
||||
public function query(ArticlePriceGeneric $model)
|
||||
{
|
||||
$model = $model::withCount('article_prices');
|
||||
return self::buildQuery($model);
|
||||
}
|
||||
|
||||
protected function getColumns()
|
||||
{
|
||||
return [
|
||||
Column::make('name')->title('Nom'),
|
||||
Column::make('price')->title('Prix HT')->class('text-right'),
|
||||
Column::make('price_taxed')->title('Prix TTC')->class('text-right'),
|
||||
Column::make('article_prices_count')->title('Nb de tarifs')->class('text-right'),
|
||||
self::makeColumnButtons(),
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user