fix shipping

This commit is contained in:
Ludovic CANDELLIER
2023-07-16 17:54:44 +02:00
parent 1675745e2a
commit b8c31f6049
36 changed files with 640 additions and 897 deletions

View File

@@ -1,55 +1,78 @@
<div class="row">
<div class="col-xs-12 col-xl-8">
<div class="row mb-3">
<div class="col-6">
{{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
@include('components.form.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $delivery['sale_channel_id'] ?? null, 'with_empty' => '', 'class' => 'select2'])
</div>
<div class="col-6">
<div class="row">
<div class="col-5">
{{ Form::label('active', __('Actif')) }}<br/>
@include("components.form.toggle", ['name' => 'active', 'value' => $delivery['active'] ?? false, 'on' => __('active'), 'off' => __('inactive')])
</div>
<div class="col-3">
{{ Form::label('is_public', __('Type')) }}
@include('components.form.toggle', ['name' => 'is_public', 'value' => $delivery['is_public'] ?? false, 'on' => __('public'), 'off' => __('administré')])
</div>
<div class="col-4">
{{ Form::label('at_house', __('Défaut')) }}
@include('components.form.checkboxes.icheck', ['name' => 'at_house', 'value' => $delivery['at_house'] ?? null])
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('name', __('Nom')) }}
@include('components.form.input', ['name' => 'name', 'value' => $delivery['name'] ?? null, 'required' => true])
</div>
</div>
<div class="col-xs-12 col-xl-8">
<div class="row mb-3">
<div class="col-6">
{{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
@include('components.form.select', [
'name' => 'sale_channel_id',
'list' => $sale_channels ?? [],
'value' => $delivery['sale_channel_id'] ?? null,
'with_empty' => '',
'class' => 'select2'
])
</div>
<div class="col-6">
<div class="row">
<div class="col-5">
{{ Form::label('active', __('Actif')) }}<br/>
@include("components.form.toggle", [
'name' => 'active',
'value' => $delivery['active'] ?? false,
'on' => __('active'),
'off' => __('inactive')
])
</div>
<div class="col-3">
{{ Form::label('is_public', __('Type')) }}
@include('components.form.toggle', [
'name' => 'is_public',
'value' => $delivery['is_public'] ?? false,
'on' => __('public'),
'off' => __('administré')
])
</div>
<div class="col-4">
{{ Form::label('at_house', __('Défaut')) }}
@include('components.form.checkboxes.icheck', [
'name' => 'at_house',
'value' => $delivery['at_house'] ?? null
])
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('name', __('Nom')) }}
@include('components.form.input', [
'name' => 'name',
'value' => $delivery['name'] ?? null,
'required' => true
])
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('', __('Description')) }}
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('', __('Description')) }}
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
</div>
</div>
@include('components.address', ['with_country' => false])
@include('components.address', ['with_country' => false])
<div class="row mb-3">
<div class="col-3">
{{ Form::label('event_date_begin', __('Date de début')) }}
@include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
</div>
<div class="col-3">
{{ Form::label('event_date_end', __('Date de fin')) }}
@include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
</div>
<div class="row mb-3">
<div class="col-3">
{{ Form::label('event_date_begin', __('Date de début')) }}
@include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
</div>
<div class="col-3">
{{ Form::label('event_date_end', __('Date de fin')) }}
@include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
</div>
</div>
</div>
</div>
</div>
</div>
@include('components.save')
@@ -59,11 +82,11 @@
@push('js')
<script>
$(function() {
initSelect2();
initDatepicker();
initSaveForm('#delivery-form');
});
</script>
@endpush
<script>
$(function() {
initSelect2();
initDatepicker();
initSaveForm('#delivery-form');
});
</script>
@endpush

View File

@@ -1,11 +1,14 @@
@extends('layout.index', [
'title' => __('shop.deliveries.title'),
'subtitle' => __('shop.deliveries.add'),
'breadcrumb' => [__('shop.deliveries.title'), __('shop.deliveries.add')]
'title' => __('shop.delivery_packages.title'),
'subtitle' => __('shop.delivery_packages.add'),
])
@section('content')
{{ Form::open(['route' => 'Admin.Shop.Deliveries.store', 'id' => 'delivery-form', 'autocomplete' => 'off']) }}
@include('Admin.Shop.Deliveries.form')
</form>
{{ Form::open([
'route' => 'Admin.Shop.DeliveryPackages.store',
'id' => 'delivery_package-form',
'autocomplete' => 'off'
]) }}
@include('Admin.Shop.DeliveryPackage.form')
</form>
@endsection

View File

@@ -1,12 +1,15 @@
@extends('layout.index', [
'title' => __('shop.deliveries.title'),
'subtitle' => __('shop.deliveries.edit'),
'breadcrumb' => [__('shop.deliveries.title')]
'title' => __('shop.delivery_packages.title'),
'subtitle' => __('shop.delivery_packages.edit'),
])
@section('content')
{{ Form::open(['route' => 'Admin.Shop.Deliveries.store', 'id' => 'delivery-form', 'autocomplete' => 'off']) }}
<input type="hidden" name="id" value="{{ $delivery['id'] }}">
@include('Admin.Shop.Deliveries.form')
</form>
{{ Form::open([
'route' => 'Admin.Shop.DeliveryPackages.store',
'id' => 'delivery_package-form',
'autocomplete' => 'off'
]) }}
<input type="hidden" name="id" value="{{ $package['id'] }}">
@include('Admin.Shop.DeliveryPackages.form')
</form>
@endsection

View File

@@ -1,69 +1,27 @@
<div class="row">
<div class="col-xs-12 col-xl-8">
<div class="row mb-3">
<div class="col-6">
{{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
@include('components.form.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $delivery['sale_channel_id'] ?? null, 'with_empty' => '', 'class' => 'select2'])
</div>
<div class="col-6">
<div class="row">
<div class="col-5">
{{ Form::label('active', __('Actif')) }}<br/>
@include("components.form.toggle", ['name' => 'active', 'value' => $delivery['active'] ?? false, 'on' => __('active'), 'off' => __('inactive')])
</div>
<div class="col-3">
{{ Form::label('is_public', __('Type')) }}
@include('components.form.toggle', ['name' => 'is_public', 'value' => $delivery['is_public'] ?? false, 'on' => __('public'), 'off' => __('administré')])
</div>
<div class="col-4">
{{ Form::label('at_house', __('Défaut')) }}
@include('components.form.checkboxes.icheck', ['name' => 'at_house', 'value' => $delivery['at_house'] ?? null])
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('name', __('Nom')) }}
@include('components.form.input', ['name' => 'name', 'value' => $delivery['name'] ?? null, 'required' => true])
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('', __('Description')) }}
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
</div>
</div>
@include('components.address', ['with_country' => false])
<div class="row mb-3">
<div class="col-3">
{{ Form::label('event_date_begin', __('Date de début')) }}
@include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
</div>
<div class="col-3">
{{ Form::label('event_date_end', __('Date de fin')) }}
@include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
</div>
</div>
</div>
<div class="col-xs-3">
<x-form.inputs.number name="weight" value="{{ $package['weight'] ?? 0 }}" label="Poids" />
</div>
<div class="col-xs-3">
<x-form.inputs.number name="weight_flyer" value="{{ $package['weight_flyer'] ?? 0 }}" label="Poids Flyer" />
</div>
<div class="col-xs-3">
<x-form.inputs.number name="weight_packaging" value="{{ $package['weight_packaging'] ?? 0 }}" label="Poids packaging" />
</div>
<div class="col-xs-3">
<x-form.inputs.number name="weight" value="{{ $package['weight_useful'] ?? 0 }}" label="Poids utile" />
</div>
</div>
@include('components.save')
<x-save />
@include('load.form.select2')
@include('load.form.save')
@push('js')
<script>
$(function() {
initSelect2();
initDatepicker();
initSaveForm('#delivery-form');
});
</script>
<script>
$(function() {
initSaveForm('#delivery_package-form');
});
</script>
@endpush

View File

@@ -1,26 +1,23 @@
@extends('layout.index', [
'title' => __('shop.deliveries.title'),
'subtitle' => __('shop.deliveries.list'),
'breadcrumb' => [__('shop.deliveries.title')]
'title' => __('shop.delivery_packages.title'),
'subtitle' => __('shop.delivery_packages.list'),
])
@section('content')
@component('components.card')
@include('components.datatable', ['route' => route('Admin.Shop.Deliveries.index'), 'model' => 'deliveries', 'callback' => 'handleDelivery();'])
@endcomponent
<x-card>
@include('components.datatable', [
'route' => route('Admin.Shop.DeliveryPackages.index'),
'model' => 'delivery_packages',
])
</x-card>
@endsection
@include('load.form.select2')
@include('load.form.toggle')
@push('js')
<script>
function handleDelivery() {
initToggle("{{ route('Admin.Shop.Deliveries.toggleActive') }}");
}
$(document).ready(function () {
initSelect2();
});
</script>
@endpush
<script>
$(document).ready(function () {
initSelect2();
});
</script>
@endpush

View File

@@ -1,36 +0,0 @@
@extends('layout.index', [
'title' => __('products.title'),
'subtitle' => __('products.title'),
'breadcrumb' => [__('products.title')]
])
@section('content')
<form action="{{ route('Shop.Products') }}" method="GET">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<div class="box box-info">
<div class="box-body">
<div class="col-md-6">
<h3>{{ name }}</h3>
<h4>
{{ $product.section.name }}<br>
</h4>
</div>
<div class="col-md-6 text-right">
<h2>{{ $prix_total }} </h2>
<h4>{{ $residence['type_produit']['name'] }}</h4>
</div>
<div class="col-md-12">
@include('Hestimmo.modules.Lot.partials.carousel')
</div>
</div>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -1,11 +1,14 @@
@extends('layout.index', [
'title' => __('shop.deliveries.title'),
'subtitle' => __('shop.deliveries.add'),
'breadcrumb' => [__('shop.deliveries.title'), __('shop.deliveries.add')]
'title' => __('shop.delivery_type_calculations.title'),
'subtitle' => __('shop.delivery_type_calculations.add'),
])
@section('content')
{{ Form::open(['route' => 'Admin.Shop.Deliveries.store', 'id' => 'delivery-form', 'autocomplete' => 'off']) }}
@include('Admin.Shop.Deliveries.form')
</form>
{{ Form::open([
'route' => 'Admin.Shop.DeliveryTypeCalculations.store',
'id' => 'delivery_type_calculation-form',
'autocomplete' => 'off'
]) }}
@include('Admin.Shop.DeliveryTypeCalculations.form')
</form>
@endsection

View File

@@ -1,12 +1,15 @@
@extends('layout.index', [
'title' => __('shop.deliveries.title'),
'subtitle' => __('shop.deliveries.edit'),
'breadcrumb' => [__('shop.deliveries.title')]
'title' => __('shop.delivery_type_calculations.title'),
'subtitle' => __('shop.delivery_type_calculations.edit'),
])
@section('content')
{{ Form::open(['route' => 'Admin.Shop.Deliveries.store', 'id' => 'delivery-form', 'autocomplete' => 'off']) }}
<input type="hidden" name="id" value="{{ $delivery['id'] }}">
@include('Admin.Shop.Deliveries.form')
</form>
{{ Form::open([
'route' => 'Admin.Shop.DeliveryTypeCalculations.store',
'id' => 'delivery_type_calculation-form',
'autocomplete' => 'off'
]) }}
<input type="hidden" name="id" value="{{ $calcul['id'] ?? null }}">
@include('Admin.Shop.DeliveryTypeCalculations.form')
</form>
@endsection

View File

@@ -1,69 +1,34 @@
<div class="row">
<div class="col-xs-12 col-xl-8">
<div class="row mb-3">
<div class="col-6">
{{ Form::label('sale_channel_id', __('shop.sale_channels.name')) }}
@include('components.form.select', ['name' => 'sale_channel_id', 'list' => $sale_channels ?? [], 'value' => $delivery['sale_channel_id'] ?? null, 'with_empty' => '', 'class' => 'select2'])
</div>
<div class="col-6">
<div class="row">
<div class="col-5">
{{ Form::label('active', __('Actif')) }}<br/>
@include("components.form.toggle", ['name' => 'active', 'value' => $delivery['active'] ?? false, 'on' => __('active'), 'off' => __('inactive')])
</div>
<div class="col-3">
{{ Form::label('is_public', __('Type')) }}
@include('components.form.toggle', ['name' => 'is_public', 'value' => $delivery['is_public'] ?? false, 'on' => __('public'), 'off' => __('administré')])
</div>
<div class="col-4">
{{ Form::label('at_house', __('Défaut')) }}
@include('components.form.checkboxes.icheck', ['name' => 'at_house', 'value' => $delivery['at_house'] ?? null])
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('name', __('Nom')) }}
@include('components.form.input', ['name' => 'name', 'value' => $delivery['name'] ?? null, 'required' => true])
</div>
</div>
<div class="row mb-3">
<div class="col-12">
{{ Form::label('', __('Description')) }}
<textarea name="description" class="form-control">{{ $delivery['description'] ?? '' }}</textarea>
</div>
</div>
@include('components.address', ['with_country' => false])
<div class="row mb-3">
<div class="col-3">
{{ Form::label('event_date_begin', __('Date de début')) }}
@include('components.form.datepicker', ['name' => 'event_date_begin', 'value' => $delivery['event_date_begin'] ?? null])
</div>
<div class="col-3">
{{ Form::label('event_date_end', __('Date de fin')) }}
@include('components.form.datepicker', ['name' => 'event_date_end', 'value' => $delivery['event_date_end'] ?? null])
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
@include('components.form.select', [
'name' => 'type_id',
'value' => $calcul['type_id'] ?? false,
'list' => $delivery_types ?? [],
'label' => __('shop.delivery_types.name'),
])
</div>
</div>
@include('components.save')
<div class="row mb-3">
<div class="col-6">
<x-form.inputs.number name="weight" value="{{ $calcul['weight'] ?? 0}}" label="Poids" />
</div>
<div class="col-6">
<x-form.inputs.money name="price" value="{{ $calcul['price'] ?? 0}}" label="Prix" />
</div>
</div>
<x-save />
@include('load.form.select2')
@include('load.form.save')
@push('js')
<script>
$(function() {
initSelect2();
initDatepicker();
initSaveForm('#delivery-form');
});
</script>
@endpush
<script>
$(function() {
initSelect2();
initSaveForm('#delivery_type_calculation-form');
});
</script>
@endpush

View File

@@ -9,6 +9,7 @@
@include('components.datatable', [
'route' => route('Admin.Shop.DeliveryTypeCalculations.index'),
'model' => 'delivery_type_calculations',
'with_filters' => true,
])
@endcomponent
@endsection

View File

@@ -1,5 +1,10 @@
<form id="{{ $model }}-filters">
<div class="row mb-3">
</div>
<div class="row mb-3">
@include('components.form.select', [
'name' => 'type_id',
'value' => $filters['type_id'] ?? false,
'list' => $delivery_types ?? [],
'label' => __('shop.delivery_types.name'),
])
</div>
</form>

View File

@@ -1,36 +0,0 @@
@extends('layout.index', [
'title' => __('products.title'),
'subtitle' => __('products.title'),
'breadcrumb' => [__('products.title')]
])
@section('content')
<form action="{{ route('Shop.Products') }}" method="GET">
<div class="row">
<div class="col-md-offset-2 col-md-8">
<div class="box box-info">
<div class="box-body">
<div class="col-md-6">
<h3>{{ name }}</h3>
<h4>
{{ $product.section.name }}<br>
</h4>
</div>
<div class="col-md-6 text-right">
<h2>{{ $prix_total }} </h2>
<h4>{{ $residence['type_produit']['name'] }}</h4>
</div>
<div class="col-md-12">
@include('Hestimmo.modules.Lot.partials.carousel')
</div>
</div>
</div>
</div>
</div>
</form>
@endsection

View File

@@ -1,115 +1,122 @@
@extends('layout.index', [
'title' => __('shop.orders.title'),
'subtitle' => __('shop.orders.edit'),
'breadcrumb' => ['Commandes']
'title' => __('shop.orders.title'),
'subtitle' => __('shop.orders.edit'),
'breadcrumb' => ['Commandes']
])
@section('content')
{{ Form::open(['route' => 'Admin.Shop.Orders.store', 'id' => 'order-form', 'autocomplete' => 'off']) }}
<input type="hidden" name="id" value="{{ $order['id'] ?? null }}">
<x-card>
<div class="row">
<div class="col-6">
<h4>{{ $order['delivery']['name'] }} </h4>
</div>
<div class="col-6 text-right">
@include('components.form.buttons.button-save')
</div>
</div>
{{ Form::open(['route' => 'Admin.Shop.Orders.store', 'id' => 'order-form', 'autocomplete' => 'off']) }}
<input type="hidden" name="id" value="{{ $order['id'] ?? null }}">
<x-card>
<div class="row">
<div class="col-6">
<h4>{{ $order['delivery']['name'] }} </h4>
</div>
<div class="col-6 text-right">
@include('components.form.buttons.button-save')
</div>
</div>
<div class="row mb-3">
<div class="col-6">
<h3>{{ $order['customer']['last_name'] }} {{ $order['customer']['first_name'] }}</h3>
<div class="row">
<div class="col-6">
<x-card title="Adresse de facturation" classBody="mt-3">
@if ($order['address'])
{{ $order['address']['address'] }}<br/>
@isset ($order['address']['address2']) {{ $order['address']['address2'] }}<br/> @endisset
{{ $order['address']['zipcode'] }} {{ $order['address']['city'] }}<br/>
@endif
</x-card>
</div>
<div class="col-6">
<x-card title="Adresse de livraison" classBody="mt-3">
@if ($order['delivery_address'])
{{ $order['delivery_address']['address'] }}<br/>
@isset ($order['delivery_address']['address2']) {{ $order['delivery_address']['address2'] }}<br/> @endisset
{{ $order['delivery_address']['zipcode'] }} {{ $order['delivery_address']['city'] }}<br/>
@endif
</x-card>
</div>
</div>
</div>
<div class="col-6">
<div class="row mb-3">
<div class="col-6" style="font-size: 1.2em; font-weight: 500;">
Commande <br/>
du {{ Carbon\Carbon::parse($order['created_at'])->isoFormat('LLLL') }}
</div>
<div class="col-6">
@include('components.form.select', [
'label' => 'Statut',
'name' => 'status',
'list' => $statuses ?? [],
'value' => $order['status'],
'class' => 'select2',
])
</div>
</div>
<div class="row mb-3">
<div class="col-6">
@include('components.form.select', [
'label' => 'Canal de vente',
'name' => 'sale_channel_id',
'list' => $sale_channels ?? [],
'value' => $order['sale_channel_id'],
'class' => 'select2',
])
</div>
<div class="col-6">
@include('components.form.select', [
'label' => 'Règlement',
'name' => 'payment_type',
'list' => $payment_types ?? [],
'value' => $order['payment_type'],
'class' => 'select2',
])
</div>
</div>
<div class="row mb-3">
<div class="col-4">
@include('components.form.select', [
'label' => 'Type de livraison',
'name' => 'delivery_type_id',
'list' => $delivery_types ?? [],
'value' => $order['delivery_type_id'],
'with_empty' => '',
])
</div>
<div class="col-4">
@include('components.form.input', [
'label' => 'Référence colis',
'name' => 'delivery_ref',
'value' => $order['delivery_ref'] ?? null,
])
</div>
<div class="col-4">
@include('components.form.input', [
'label' => 'Lien suivi',
'name' => 'delivery_link',
'value' => $order['delivery_link'] ?? null,
])
</div>
<div class="row mb-3">
<div class="col-6">
<h3>
{{ $order['customer']['last_name'] }} {{ $order['customer']['first_name'] }}
</h3>
<div class="row">
<div class="col-6">
<x-card title="Adresse de facturation" classBody="mt-3">
@if ($order['address'])
{{ $order['address']['address'] }}<br/>
@isset ($order['address']['address2'])
{{ $order['address']['address2'] }}<br/>
@endisset
{{ $order['address']['zipcode'] }} {{ $order['address']['city'] }}<br/>
@endif
</x-card>
</div>
<div class="col-6">
<x-card title="Adresse de livraison" classBody="mt-3">
@if ($order['delivery_address'])
{{ $order['delivery_address']['address'] }}<br/>
@isset ($order['delivery_address']['address2'])
{{ $order['delivery_address']['address2'] }}<br/>
@endisset
{{ $order['delivery_address']['zipcode'] }}
{{ $order['delivery_address']['city'] }}<br/>
@endif
</x-card>
</div>
</div>
</div>
<div class="col-6">
<div class="row mb-3">
<div class="col-6" style="font-size: 1.2em; font-weight: 500;">
Commande <br/>
du {{ Carbon\Carbon::parse($order['created_at'])->isoFormat('LLLL') }}
</div>
<div class="col-6">
@include('components.form.select', [
'label' => 'Statut',
'name' => 'status',
'list' => $statuses ?? [],
'value' => $order['status'],
'class' => 'select2',
])
</div>
</div>
<div class="row mb-3">
<div class="col-6">
@include('components.form.select', [
'label' => 'Canal de vente',
'name' => 'sale_channel_id',
'list' => $sale_channels ?? [],
'value' => $order['sale_channel_id'],
'class' => 'select2',
])
</div>
<div class="col-6">
@include('components.form.select', [
'label' => 'Règlement',
'name' => 'payment_type',
'list' => $payment_types ?? [],
'value' => $order['payment_type'],
'class' => 'select2',
])
</div>
</div>
<div class="row mb-3">
<div class="col-4">
@include('components.form.select', [
'label' => 'Type de livraison',
'name' => 'delivery_type_id',
'list' => $delivery_types ?? [],
'value' => $order['delivery_type_id'],
'with_empty' => '',
])
</div>
<div class="col-4">
@include('components.form.input', [
'label' => 'Référence colis',
'name' => 'delivery_ref',
'value' => $order['delivery_ref'] ?? null,
])
</div>
<div class="col-4">
@include('components.form.input', [
'label' => 'Lien suivi',
'name' => 'delivery_link',
'value' => $order['delivery_link'] ?? null,
])
</div>
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
@include('Admin.Shop.Orders.partials.detail', ['detail_type' => 'commande'])
</div>
</div>
</x-card>
{{ Form::close() }}
</div>
</div>
</div>
<div class="row mb-3">
<div class="col-12">
@include('Admin.Shop.Orders.partials.detail', ['detail_type' => 'commande'])
</div>
</div>
</x-card>
{{ Form::close() }}
@endsection