From a1a3ccb2275d548f79d4d4cddef5d9bbe435bbdd Mon Sep 17 00:00:00 2001 From: Ludovic CANDELLIER Date: Wed, 1 Sep 2021 10:25:59 +0200 Subject: [PATCH] fix filter on prices by tariff --- .../PriceLists/partials/filters.blade.php | 4 +- .../views/Admin/Shop/Tariffs/create.blade.php | 6 +- .../views/Admin/Shop/Tariffs/edit.blade.php | 7 +- .../views/Admin/Shop/Tariffs/form.blade.php | 76 ++++++++++--------- 4 files changed, 45 insertions(+), 48 deletions(-) diff --git a/resources/views/Admin/Shop/PriceLists/partials/filters.blade.php b/resources/views/Admin/Shop/PriceLists/partials/filters.blade.php index e07f8121..13f66a55 100644 --- a/resources/views/Admin/Shop/PriceLists/partials/filters.blade.php +++ b/resources/views/Admin/Shop/PriceLists/partials/filters.blade.php @@ -1,3 +1,3 @@ -
- + +
diff --git a/resources/views/Admin/Shop/Tariffs/create.blade.php b/resources/views/Admin/Shop/Tariffs/create.blade.php index 602e848c..1614c705 100644 --- a/resources/views/Admin/Shop/Tariffs/create.blade.php +++ b/resources/views/Admin/Shop/Tariffs/create.blade.php @@ -5,9 +5,5 @@ ]) @section('content') - - {{ Form::open(['route' => 'Admin.Shop.Tariffs.store', 'id' => 'tariff-form', 'autocomplete' => 'off']) }} - @include('Admin.Shop.Tariffs.form') - - + @include('Admin.Shop.Tariffs.form') @endsection diff --git a/resources/views/Admin/Shop/Tariffs/edit.blade.php b/resources/views/Admin/Shop/Tariffs/edit.blade.php index 41b896e8..05412460 100644 --- a/resources/views/Admin/Shop/Tariffs/edit.blade.php +++ b/resources/views/Admin/Shop/Tariffs/edit.blade.php @@ -4,10 +4,5 @@ 'breadcrumb' => [__('shop.tariffs.title')] ]) @section('content') - - {{ Form::open(['route' => 'Admin.Shop.Tariffs.store', 'id' => 'tariffs-form', 'autocomplete' => 'off']) }} - - @include('Admin.Shop.Tariffs.form') - - + @include('Admin.Shop.Tariffs.form') @endsection diff --git a/resources/views/Admin/Shop/Tariffs/form.blade.php b/resources/views/Admin/Shop/Tariffs/form.blade.php index c7dbab53..66725ec0 100644 --- a/resources/views/Admin/Shop/Tariffs/form.blade.php +++ b/resources/views/Admin/Shop/Tariffs/form.blade.php @@ -1,57 +1,62 @@
-
-
- {{ Form::label('name', 'Nom') }} - @include('components.input', ['name' => 'name', 'value' => $tariff['name'] ?? null, 'required' => true]) -
-
- {{ Form::label('name', 'Etat') }} - @include('components.select', ['name' => 'status_id', 'list' => $statuses ?? [], 'value' => $tariff['status_id'] ?? null, 'required' => true, 'with_empty' => '']) -
-
+ {{ Form::open(['route' => 'Admin.Shop.Tariffs.store', 'id' => 'tariffs-form', 'autocomplete' => 'off']) }} + -
-
- {{ Form::label('name', 'Code') }} - @include('components.input', ['name' => 'code', 'value' => $tariff['code'] ?? null, 'required' => true]) +
+
+ {{ Form::label('name', 'Nom') }} + @include('components.input', ['name' => 'name', 'value' => $tariff['name'] ?? null, 'required' => true]) +
+
+ {{ Form::label('name', 'Etat') }} + @include('components.select', ['name' => 'status_id', 'list' => $statuses ?? [], 'value' => $tariff['status_id'] ?? null, 'required' => true, 'with_empty' => '']) +
-
- {{ Form::label('name', 'Ref') }} - @include('components.input', ['name' => 'ref', 'value' => $tariff['ref'] ?? null, 'required' => true]) -
-
-
-
- {{ Form::label('name', 'Canal de vente par défaut') }} - @include('components.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $tariff['sale_channel_id'] ?? null, 'required' => true, 'with_empty' => '']) +
+
+ {{ Form::label('name', 'Code') }} + @include('components.input', ['name' => 'code', 'value' => $tariff['code'] ?? null, 'required' => true]) +
+
+ {{ Form::label('name', 'Ref') }} + @include('components.input', ['name' => 'ref', 'value' => $tariff['ref'] ?? null, 'required' => true]) +
-
- {{ Form::label('name', 'Unité du tarif') }} - @include('components.select', ['name' => 'tariff_unity_id', 'list' => $tariff_unities ?? [], 'value' => $tariff['tariff_unity_id'] ?? null, 'required' => true, 'with_empty' => '']) + +
+
+ {{ Form::label('name', 'Canal de vente par défaut') }} + @include('components.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $tariff['sale_channel_id'] ?? null, 'required' => true, 'with_empty' => '']) +
+
+ {{ Form::label('name', 'Unité du tarif') }} + @include('components.select', ['name' => 'tariff_unity_id', 'list' => $tariff_unities ?? [], 'value' => $tariff['tariff_unity_id'] ?? null, 'required' => true, 'with_empty' => '']) +
-
-
-
- {{ Form::label('description', 'Description') }} - @include('components.textarea', ['name' => 'description', 'value' => $tariff['description'] ?? null, 'class' => 'editor', 'required' => false]) +
+
+ {{ Form::label('description', 'Description') }} + @include('components.textarea', ['name' => 'description', 'value' => $tariff['description'] ?? null, 'class' => 'editor', 'required' => false]) +
-
+ +
@if ($tariff['id'] ?? false) @component('components.card', ['title' => 'Liste de prix']) - @include('components.datatable', ['route' => route('Admin.Shop.PriceLists.index'), 'model' => 'price_lists', 'with_filters' => false, 'with_print' => false, 'dataTable' => $datatables['price_lists'], 'create_callback' => 'PriceListCreate();', 'edit_callback' => 'PriceListEdit(id);', 'delete_callback' => 'PriceListRefresh();']) + @include('components.datatable', ['route' => route('Admin.Shop.PriceLists.index'), 'model' => 'price_lists', 'with_filters' => true, 'with_print' => false, 'dataTable' => $datatables['price_lists'], 'create_callback' => 'PriceListCreate();', 'edit_callback' => 'PriceListEdit(id);', 'delete_callback' => 'PriceListRefresh();']) @component('components.layout.modal', ['title' => 'Filtres', 'id' => 'modal-price_lists-filters']) - @include('Admin.Shop.PriceLists.partials.filters') + @include('Admin.Shop.PriceLists.partials.filters', ['model' => 'price_lists']) @endcomponent @endcomponent @endif @@ -62,6 +67,7 @@ @include('components.save') @include('load.form.editor') +@include('load.form.select2') @include('load.layout.modal') @push('js') @@ -71,7 +77,7 @@ }); function PriceListCreate() { - var tariff_id = $('#tariff_id').val(); + var tariff_id = $('#id').val(); var url_open = "{{ route('Admin.Shop.PriceLists.modalCreate') }}/" + tariff_id; var url_save = "{{ route('Admin.Shop.PriceLists.storeAjax') }}"; openModal("{{ __('price_list') }}", '#price_list-form', url_open, url_save, "PriceListRefresh();");