Files
opensem/resources/views/Admin/Shop/Invoices/partials/payments.blade.php
2023-12-21 23:04:42 +01:00

57 lines
1.8 KiB
PHP

<div class="row mb-3">
<div class="col">
<h4>
<x-form.buttons.button-add id="add_payment" class="btn-xs" />
Règlements
</h4>
</div>
</div>
@if ($payments ?? false)
<table class="table">
<thead>
<th>Date</th>
<th>Type</th>
<th class="text-right">Montant</th>
<th>Ref</th>
</thead>
<tbody>
@foreach ($payments as $payment)
<tr>
<td>{{ $payment['date'] }}</td>
<td>{{ $payment_types[$payment['payment_type']] }}</td>
<td class="text-right font-weight-bold">{{ sprintf('%01.2f', $payment['amount']) }} </td>
<td>{{ $payment['reference'] }}</td>
</tr>
@endforeach
</tbody>
</table>
@endif
@include('load.form.datepicker')
@push('js')
<script>
$('#add_payment').click(function() {
InvoicePaymentCreate();
});
function InvoicePaymentCreate() {
var url_open = "{{ route('Admin.Shop.InvoicePayments.create') }}";
var url_save = "{{ route('Admin.Shop.InvoicePayments.store') }}";
openModal("Ajouter un paiement", '#invoice_payment-form', url_open, url_save,
"InvoicePaymentRefresh();", 'sm');
}
function InvoicePaymentEdit(id) {
var url_open = "{{ route('Admin.Shop.InvoicePayments.edit') }}/" + id;
var url_save = "{{ route('Admin.Shop.InvoicePayments.store') }}";
openModal("Editer un paiement", '#invoice_payment-form', url_open, url_save,
"InvoicePaymentRefresh();", 'sm');
}
function InvoicePaymentRefresh() {
}
</script>
@endpush