Fixes on prices & add ArticlePriceGeneric

This commit is contained in:
Ludovic CANDELLIER
2020-07-31 00:21:49 +02:00
parent ef791fbcf2
commit 1e685cfefb
18 changed files with 374 additions and 52 deletions

View 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(),
];
}
}

View File

@@ -1,27 +0,0 @@
<?php
namespace App\DataTables\Shop;
use Yajra\DataTables\Html\Column;
use App\DataTables\ParentDataTable as DataTable;
use App\Models\Shop\ArticlePrice;
class ArticlePricessDataTable extends DataTable
{
public $model_name = 'ArticlePrices';
public function query(ArticlePrice $model)
{
$model = $model::with(['Article', 'ArticleAttributes']);
return self::buildQuery($model);
}
protected function getColumns()
{
return [
Column::make('name'),
self::makeColumnButtons(),
];
}
}