add datatbles for invoices, add pdf icon, refactor icons components, add autocomplete on search, adapt searching to meilisearch

This commit is contained in:
ludo
2024-02-04 02:51:38 +01:00
parent 067532b6fc
commit 4c6f9b3b61
39 changed files with 503 additions and 211 deletions

View File

@@ -0,0 +1,2 @@
<form id="{{ $model }}-filters">
</form>

View File

@@ -0,0 +1,26 @@
@include('components.datatable', [
'route' => route('Shop.Invoices.index'),
'model' => 'invoices',
'with_add' => false,
'with_filters' => true,
'with_exports' => false,
'with_print' => false,
'show_callback' => 'InvoiceView(id);',
])
@component('components.layout.modal-filters', ['title' => 'Filters', 'id' => 'modal-invoices-filters'])
@include('Shop.Invoices.partials.filters', ['model' => 'invoices'])
@endcomponent
@push('js')
<script>
function InvoiceView(id) {
var url_open = "{{ route('Shop.Invoices.view') }}/" + id;
openModal("Voir une facture", '#invoice-form', url_open, false, false, 'xl', {{ !($with_add ?? false) }});
}
function InvoiceRefresh() {
reloadDatatable("invoices");
}
</script>
@endpush

View File

@@ -0,0 +1,60 @@
<div class="row mb-3">
<div class="col-6">
<h3>
@if ($invoice['customer']['company'])
{{ $invoice['customer']['company'] }}<br />
@endif
{{ $invoice['customer']['last_name'] }} {{ $invoice['customer']['first_name'] }}
</h3>
<div class="row">
<div class="col-6">
<x-card title="Adresse de facturation">
@if ($invoice['address'])
{{ $invoice['address']['address'] }}<br />
@isset($invoice['address']['address2'])
{{ $invoice['address']['address2'] }}<br />
@endisset
{{ $invoice['address']['zipcode'] }}
{{ $invoice['address']['city'] }}<br />
@endif
</x-card>
</div>
<div class="col-6">
<x-card title="Adresse de livraison">
@if ($invoice['order']['delivery_address'])
{{ $invoice['order']['delivery_address']['address'] }}<br />
@isset($invoice['order']['delivery_address']['address2'])
{{ $invoice['order']['delivery_address']['address2'] }}<br />
@endisset
{{ $invoice['order']['delivery_address']['zipcode'] }}
{{ $invoice['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;">
Facture {{ $invoice['ref'] }}<br />
du {{ Carbon\Carbon::parse($invoice['created_at'])->isoFormat('LLLL') }}
</div>
<div class="col-6">
Statut : {{ $invoice['status'] }}
</div>
</div>
<div class="row mb-3">
<div class="col-6">
Canal de vente : {{ $invoice['order']['sale_channel']['name'] }}
</div>
<div class="col-6">
Règlement : {{ $invoice['payment_type'] }}
</div>
</div>
</div>
</div>
@include('Admin.Shop.Orders.partials.detail', [
'detail_type' => 'facture',
'order' => $invoice['order'],
])