fixes
This commit is contained in:
@@ -13,8 +13,7 @@ class VarietiesDataTable extends DataTable
|
|||||||
|
|
||||||
public function query(Variety $model)
|
public function query(Variety $model)
|
||||||
{
|
{
|
||||||
// $model = $model::with('specie')->withCount('Articles')->select('botanic_varieties.*');
|
$model = $model::joinRelationship('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with(['image', 'Specie', 'tags'])->withCount(['Articles', 'tags', 'images']);
|
||||||
$model = $model::joinRelationship('Specie')->select('botanic_varieties.*', 'botanic_species.name as specie_name')->with(['image', 'Specie'])->withCount(['Articles', 'tags']);
|
|
||||||
return $this->buildQuery($model);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,7 +24,14 @@ class VarietiesDataTable extends DataTable
|
|||||||
->editColumn('thumb', function (Variety $variety) {
|
->editColumn('thumb', function (Variety $variety) {
|
||||||
return Varieties::getThumb($variety->image);
|
return Varieties::getThumb($variety->image);
|
||||||
})
|
})
|
||||||
->rawColumns(['thumb', 'action']);
|
->editColumn('tags2', function (Variety $variety) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($variety->tags as $tag) {
|
||||||
|
$html .= '<span class="btn btn-xs btn-secondary pb-2">' . $tag->slug . '</span> ';
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->rawColumns(['thumb', 'tags2', 'action']);
|
||||||
return parent::modifier($datatables);
|
return parent::modifier($datatables);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,8 +42,10 @@ class VarietiesDataTable extends DataTable
|
|||||||
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
Column::make('Specie.name')->data('specie_name')->title('Espèce'),
|
||||||
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('articles_count')->title('Nb articles')->class('text-right')->searchable(false),
|
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
Column::make('tags_count')->title('Nb tags')->class('text-right')->searchable(false),
|
Column::make('articles_count')->title('#Art')->class('text-right')->searchable(false),
|
||||||
|
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
||||||
|
Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class ArticlesDataTable extends DataTable
|
|||||||
|
|
||||||
public function query(Article $model)
|
public function query(Article $model)
|
||||||
{
|
{
|
||||||
$model = $model::with(['article_nature', 'image'])->withCount(['categories', 'tags', 'offers']);
|
$model = $model::with(['article_nature', 'image'])->withCount(['categories', 'images', 'offers', 'tags']);
|
||||||
$model = self::filterByArticleNature($model);
|
$model = self::filterByArticleNature($model);
|
||||||
return $this->buildQuery($model);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
@@ -35,7 +35,14 @@ class ArticlesDataTable extends DataTable
|
|||||||
->editColumn('article_nature.name', function (Article $article) {
|
->editColumn('article_nature.name', function (Article $article) {
|
||||||
return $article->article_nature ? $article->article_nature->name : '';
|
return $article->article_nature ? $article->article_nature->name : '';
|
||||||
})
|
})
|
||||||
->rawColumns(['thumb', 'action']);
|
->editColumn('tags2', function (Article $article) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($article->tags as $tag) {
|
||||||
|
$html .= '<span class="btn btn-xs btn-secondary pb-2">' . $tag->slug . '</span> ';
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->rawColumns(['tags2', 'thumb', 'action']);
|
||||||
return parent::modifier($datatables);
|
return parent::modifier($datatables);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,9 +52,11 @@ class ArticlesDataTable extends DataTable
|
|||||||
Column::make('article_nature.name')->title('Nature'),
|
Column::make('article_nature.name')->title('Nature'),
|
||||||
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
Column::make('thumb')->title('')->searchable(false)->orderable(false)->width(40)->class('text-center'),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('tags_count')->title('Tags')->class('text-right')->searchable(false),
|
Column::make('tags2')->title('Tags')->searchable(false)->orderable(false),
|
||||||
Column::make('categories_count')->title('Rayons')->class('text-right')->searchable(false),
|
Column::make('tags_count')->title('#Tag')->class('text-right')->searchable(false),
|
||||||
Column::make('offers_count')->title('Offres')->class('text-right')->searchable(false),
|
Column::make('categories_count')->title('#Ray')->class('text-right')->searchable(false),
|
||||||
|
Column::make('offers_count')->title('#Ofr')->class('text-right')->searchable(false),
|
||||||
|
Column::make('images_count')->title('#Pho')->class('text-right')->searchable(false),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ use App\Models\Shop\Offer;
|
|||||||
class OffersDataTable extends DataTable
|
class OffersDataTable extends DataTable
|
||||||
{
|
{
|
||||||
public $model_name = 'offers';
|
public $model_name = 'offers';
|
||||||
|
public $sortedColumn = 1;
|
||||||
|
|
||||||
public function query(Offer $model)
|
public function query(Offer $model)
|
||||||
{
|
{
|
||||||
@@ -30,13 +31,36 @@ class OffersDataTable extends DataTable
|
|||||||
return $package_id ? $model->byPackage($package_id) : $model;
|
return $package_id ? $model->byPackage($package_id) : $model;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('status_id', function (Offer $offer) {
|
||||||
|
return view("components.form.toggle", [
|
||||||
|
'value' => $offer->status_id,
|
||||||
|
'on' => __('active'),
|
||||||
|
'off' => __('inactive'),
|
||||||
|
'meta' => 'data-id='.$offer->id,
|
||||||
|
'size' => 'sm',
|
||||||
|
]);
|
||||||
|
})
|
||||||
|
->editColumn('stock_delayed', function (Offer $offer) {
|
||||||
|
return $offer->stock_delayed . ' - ' . $offer->delay_type;
|
||||||
|
})
|
||||||
|
->rawColumns(['active', 'action']);
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
|
Column::make('status_id')->title('')->width(40),
|
||||||
Column::make('article.name')->title('Article'),
|
Column::make('article.name')->title('Article'),
|
||||||
Column::make('article.article_nature.name')->title('Nature'),
|
Column::make('article.article_nature.name')->title('Nature'),
|
||||||
Column::make('variation.name')->title('Déclinaison'),
|
Column::make('variation.name')->title('Déclinaison'),
|
||||||
Column::make('tariff.name')->title('Tarif'),
|
Column::make('tariff.name')->title('Tarif'),
|
||||||
|
Column::make('stock_current')->title('Appro im'),
|
||||||
|
Column::make('stock_delayed')->title('Appro délai'),
|
||||||
|
Column::make('stock_ondemand')->title('Dmde'),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,18 +13,29 @@ class TagsDataTable extends DataTable
|
|||||||
|
|
||||||
public function query(Tag $model)
|
public function query(Tag $model)
|
||||||
{
|
{
|
||||||
$model = $model::with('group')->withCount(['articles', 'species', 'varieties']);
|
$model = $model::with('group')->withCount(['articles', 'shelves', 'species', 'varieties']);
|
||||||
return $this->buildQuery($model);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function modifier($datatables)
|
||||||
|
{
|
||||||
|
$datatables
|
||||||
|
->editColumn('name', function (Tag $tag) {
|
||||||
|
return $tag->name;
|
||||||
|
})
|
||||||
|
->rawColumns(['active', 'action']);
|
||||||
|
return parent::modifier($datatables);
|
||||||
|
}
|
||||||
|
|
||||||
protected function getColumns()
|
protected function getColumns()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
Column::make('group.name')->title('Groupe'),
|
Column::make('group.name')->title('Groupe'),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('articles_count')->title('Articles')->class('text-right')->searchable(false),
|
Column::make('articles_count')->title('#Art')->class('text-right')->searchable(false),
|
||||||
Column::make('species_count')->title('Espèces')->class('text-right')->searchable(false),
|
Column::make('species_count')->title('#Esp')->class('text-right')->searchable(false),
|
||||||
Column::make('varieties_count')->title('Variétés')->class('text-right')->searchable(false),
|
Column::make('varieties_count')->title('#Var')->class('text-right')->searchable(false),
|
||||||
|
Column::make('shelves_count')->title('#Ray')->class('text-right')->searchable(false),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class TariffsDataTable extends DataTable
|
|||||||
|
|
||||||
public function query(Tariff $model)
|
public function query(Tariff $model)
|
||||||
{
|
{
|
||||||
$model = $model->with(['sale_channel'])->select(['shop_tariffs.*']);
|
$model = $model->with(['sale_channels'])->select(['shop_tariffs.*']);
|
||||||
return $this->buildQuery($model);
|
return $this->buildQuery($model);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -23,7 +23,14 @@ class TariffsDataTable extends DataTable
|
|||||||
->editColumn('status', function (Tariff $tariff) {
|
->editColumn('status', function (Tariff $tariff) {
|
||||||
return Tariffs::getStatus($tariff['status_id']);
|
return Tariffs::getStatus($tariff['status_id']);
|
||||||
})
|
})
|
||||||
->rawColumns(['action'])
|
->editColumn('sale_channels2', function (Tariff $tariff) {
|
||||||
|
$html = '';
|
||||||
|
foreach ($tariff->sale_channels as $sale_channel) {
|
||||||
|
$html .= $sale_channel->code . ', ';
|
||||||
|
}
|
||||||
|
return $html;
|
||||||
|
})
|
||||||
|
->rawColumns(['sale_channels2', 'action'])
|
||||||
;
|
;
|
||||||
return parent::modifier($datatables);
|
return parent::modifier($datatables);
|
||||||
}
|
}
|
||||||
@@ -33,7 +40,7 @@ class TariffsDataTable extends DataTable
|
|||||||
return [
|
return [
|
||||||
Column::make('status_id')->data('status')->title('status'),
|
Column::make('status_id')->data('status')->title('status'),
|
||||||
Column::make('name')->title('Nom'),
|
Column::make('name')->title('Nom'),
|
||||||
Column::make('sale_channel.name')->title('Canal de vente par défaut'),
|
Column::make('sale_channels2')->title('Canaux de vente'),
|
||||||
Column::make('code')->title('Code'),
|
Column::make('code')->title('Code'),
|
||||||
Column::make('ref')->title('Référence'),
|
Column::make('ref')->title('Référence'),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ class VariationsDataTable extends DataTable
|
|||||||
public function modifier($datatables)
|
public function modifier($datatables)
|
||||||
{
|
{
|
||||||
$datatables
|
$datatables
|
||||||
|
->editColumn('unity_value', function (Variation $variation) {
|
||||||
|
return $variation->unity ? $variation->unity->value : '';
|
||||||
|
})
|
||||||
->rawColumns(['description','action'])
|
->rawColumns(['description','action'])
|
||||||
;
|
;
|
||||||
return parent::modifier($datatables);
|
return parent::modifier($datatables);
|
||||||
@@ -29,9 +32,9 @@ class VariationsDataTable extends DataTable
|
|||||||
return [
|
return [
|
||||||
Column::make('package.value')->title('Package'),
|
Column::make('package.value')->title('Package'),
|
||||||
Column::make('quantity')->title('Quantité')->class('text-right')->with(80),
|
Column::make('quantity')->title('Quantité')->class('text-right')->with(80),
|
||||||
Column::make('unity.value')->title('Unité')->searchable(false)->with(80),
|
Column::make('unity_value')->title('Unité')->searchable(false)->with(80),
|
||||||
Column::make('description')->title('Description'),
|
Column::make('description')->title('Description'),
|
||||||
Column::make('offers_count')->title('Offres')->searchable(false)->class('text-right'),
|
Column::make('offers_count')->title('#Ofr')->searchable(false)->class('text-right'),
|
||||||
$this->makeColumnButtons(),
|
$this->makeColumnButtons(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,4 +74,11 @@ class OfferController extends Controller
|
|||||||
$data['tariff'] = Tariffs::getPrices($id);
|
$data['tariff'] = Tariffs::getPrices($id);
|
||||||
return view('Admin.Shop.Offers.partials.tariff', $data);
|
return view('Admin.Shop.Offers.partials.tariff', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function toggleActive(Request $request)
|
||||||
|
{
|
||||||
|
$data = Offers::toggle_active($request->input('id'), ($request->input('active') == 'true') ? 1 : 0);
|
||||||
|
return response()->json(['error' => 0]);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Shelve extends Model
|
|||||||
use HasRelationships;
|
use HasRelationships;
|
||||||
|
|
||||||
protected $guarded = ['id'];
|
protected $guarded = ['id'];
|
||||||
protected $table = 'shop_shelves';
|
protected $table = 'shop_categories';
|
||||||
|
|
||||||
public function articles()
|
public function articles()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ namespace App\Models\Shop;
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
use Spatie\Translatable\HasTranslations;
|
use Spatie\Translatable\HasTranslations;
|
||||||
|
use App\Models\Botanic\Specie;
|
||||||
|
use App\Models\Botanic\Variety;
|
||||||
|
|
||||||
class Tag extends Model
|
class Tag extends Model
|
||||||
{
|
{
|
||||||
@@ -25,19 +27,24 @@ class Tag extends Model
|
|||||||
return $this->morphedByMany(Article::class, 'taggable');
|
return $this->morphedByMany(Article::class, 'taggable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function varieties()
|
public function group()
|
||||||
{
|
{
|
||||||
return $this->morphedByMany(\App\Models\Botanic\Variety::class, 'taggable');
|
return $this->hasOne(TagGroup::class, 'id', 'tag_group_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function shelves()
|
||||||
|
{
|
||||||
|
return $this->morphedByMany(Shelve::class, 'taggable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function species()
|
public function species()
|
||||||
{
|
{
|
||||||
return $this->morphedByMany(\App\Models\Botanic\Specie::class, 'taggable');
|
return $this->morphedByMany(Specie::class, 'taggable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function group()
|
public function varieties()
|
||||||
{
|
{
|
||||||
return $this->hasOne(TagGroup::class, 'id', 'tag_group_id');
|
return $this->morphedByMany(Variety::class, 'taggable');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function scopeByGroup($query, $id)
|
public function scopeByGroup($query, $id)
|
||||||
|
|||||||
@@ -21,6 +21,12 @@ class Tariff extends Model
|
|||||||
return $this->belongsTo(SaleChannel::class);
|
return $this->belongsTo(SaleChannel::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sale_channels()
|
||||||
|
{
|
||||||
|
// return $this->HasManyThrough(SaleChannel::class, PriceList::class);
|
||||||
|
return $this->HasManyThrough(SaleChannel::class, PriceList::class, 'id', 'id', 'id', 'sale_channel_id');
|
||||||
|
}
|
||||||
|
|
||||||
public function tariff_unity()
|
public function tariff_unity()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(TariffUnity::class);
|
return $this->belongsTo(TariffUnity::class);
|
||||||
|
|||||||
@@ -51,4 +51,10 @@ class Offers
|
|||||||
{
|
{
|
||||||
return Offer::destroy($id);
|
return Offer::destroy($id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function toggle_active($id, $active)
|
||||||
|
{
|
||||||
|
return self::update(['status_id' => $active], $id);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class Unities
|
|||||||
|
|
||||||
public static function getName($id)
|
public static function getName($id)
|
||||||
{
|
{
|
||||||
return self::get($id)->value;
|
return self::get($id)->value ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get($id)
|
public static function get($id)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Variations
|
|||||||
|
|
||||||
public static function getName($variation)
|
public static function getName($variation)
|
||||||
{
|
{
|
||||||
return $variation->package->value . ' ' . $variation->quantity . ' ' . $variation->unity->value;
|
return $variation->package->value . ' ' . $variation->quantity . ' ' . ($variation->unity->value ?? null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function buildName($data)
|
public static function buildName($data)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('Botanic.species.title'),
|
'title' => __('botanic.species.title'),
|
||||||
'subtitle' => __('Botanic.species.edit'),
|
'subtitle' => __('botanic.species.edit'),
|
||||||
'breadcrumb' => [__('Botanic.species.title'), __('Botanic.species.list')]
|
'breadcrumb' => [__('botanic.species.title'), __('botanic.species.list')]
|
||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
@extends('layout.index', [
|
@extends('layout.index', [
|
||||||
'title' => __('Botanic.varieties.title'),
|
'title' => __('botanic.varieties.title'),
|
||||||
'subtitle' => __('Botanic.varieties.add'),
|
'subtitle' => __('botanic.varieties.add'),
|
||||||
'breadcrumb' => [__('Botanic.varieties.title'), __('Botanic.varieties.add')]
|
'breadcrumb' => [__('botanic.varieties.title'), __('botanic.varieties.add')]
|
||||||
])
|
])
|
||||||
|
|
||||||
@include('boilerplate::load.fileinput')
|
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{{ Form::open(['route' => 'Admin.Botanic.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
{{ Form::open(['route' => 'Admin.Botanic.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||||
|
|
||||||
@include('Admin.Botanic.Varieties.form')
|
@include('Admin.Botanic.Varieties.form')
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -5,10 +5,8 @@
|
|||||||
])
|
])
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{{ Form::open(['route' => 'Admin.Botanic.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
{{ Form::open(['route' => 'Admin.Botanic.Varieties.store', 'id' => 'form', 'autocomplete' => 'off', 'files' => true]) }}
|
||||||
<input type="hidden" name="id" id="id" value="{{ $variety['id'] }}">
|
<input type="hidden" name="id" id="id" value="{{ $variety['id'] }}">
|
||||||
@include('Admin.Botanic.Varieties.form')
|
@include('Admin.Botanic.Varieties.form')
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@endsection
|
@endsection
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
{{ Form::label('model', 'Familles de produit') }}<br>
|
{{ Form::label('model', 'Familles de produit') }}<br>
|
||||||
@include('components.form.select', ['name' => 'product_type', 'id_name' => 'product_type', 'list' => $models_options, 'value' => $article['product_type'] ?? null, 'class' => 'select2', 'with_empty' => ''])
|
@include('components.form.select', ['name' => 'product_type', 'id_name' => 'product_type', 'list' => $models_options, 'value' => $article['product_type'] ?? null, 'class' => 'select2', 'with_empty' => '', 'required' => true])
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
{{ Form::label('model_id', 'Produit') }}<br>
|
{{ Form::label('model_id', 'Produit') }}<br>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
@component('components.card')
|
@component('components.card')
|
||||||
@include('components.datatable', ['route' => route('Admin.Shop.Offers.index'), 'model' => 'offers', 'with_filters' => true])
|
@include('components.datatable', ['route' => route('Admin.Shop.Offers.index'), 'model' => 'offers', 'with_filters' => true, 'callback' => 'handleOffer();'])
|
||||||
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-offers-filters'])
|
@component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-offers-filters'])
|
||||||
@include('Admin.Shop.Offers.partials.filters', ['model' => 'offers'])
|
@include('Admin.Shop.Offers.partials.filters', ['model' => 'offers'])
|
||||||
@endcomponent
|
@endcomponent
|
||||||
@@ -14,3 +14,16 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@include('load.form.select2')
|
@include('load.form.select2')
|
||||||
|
@include('load.form.toggle')
|
||||||
|
|
||||||
|
@push('js')
|
||||||
|
<script>
|
||||||
|
function handleOffer() {
|
||||||
|
initToggle("{{ route('Admin.Shop.Offers.toggleActive') }}");
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).ready(function () {
|
||||||
|
initSelect2();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
@endpush
|
||||||
|
|||||||
@@ -6,11 +6,11 @@
|
|||||||
{{ Form::label('ref', 'Référence') }}<br>
|
{{ Form::label('ref', 'Référence') }}<br>
|
||||||
{{ $article['ref'] ?? null }}
|
{{ $article['ref'] ?? null }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-5">
|
<div class="col-6">
|
||||||
{{ Form::label('name', 'Nom') }}<br>
|
{{ Form::label('name', 'Nom') }}<br>
|
||||||
{{ $article['name'] ?? null }}
|
{{ $article['name'] ?? null }}
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
<div class="col-3" class="text-right">
|
||||||
{!! $article['image'] !!}
|
{!! $article['image'] !!}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
@foreach ($prices as $price)
|
@foreach ($prices as $price)
|
||||||
<td>
|
<td>
|
||||||
{{ $price['quantity'] ?? null }} : {{ $price['price'] ?? null }} €
|
{{ $price['code'] ?? null }} - {{ $price['quantity'] ?? null }} : {{ $price['price_taxed'] ?? null }} €
|
||||||
</td>
|
</td>
|
||||||
@endforeach
|
@endforeach
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -10,4 +10,5 @@ Route::prefix('Offers')->name('Offers.')->group(function () {
|
|||||||
Route::get('previewArticle/{id?}', 'OfferController@previewArticle')->name('previewArticle');
|
Route::get('previewArticle/{id?}', 'OfferController@previewArticle')->name('previewArticle');
|
||||||
Route::get('previewVariation/{id?}', 'OfferController@previewVariation')->name('previewVariation');
|
Route::get('previewVariation/{id?}', 'OfferController@previewVariation')->name('previewVariation');
|
||||||
Route::get('previewTariff/{id?}', 'OfferController@previewTariff')->name('previewTariff');
|
Route::get('previewTariff/{id?}', 'OfferController@previewTariff')->name('previewTariff');
|
||||||
|
Route::post('toggleActive', 'OfferController@toggleActive')->name('toggleActive');
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user