{{-- resources/views/accounting/invoices/index.blade.php --}} @extends('admin.admin_dashboard') @section('admin')
@can('invoices.view')
@foreach($invoices as $key => $inv) @endforeach
# Date Ref Customer/Buyer Total Action
{{ $key + 1 + ($invoices->currentPage() - 1) * $invoices->perPage() }} {{ \Carbon\Carbon::parse($inv->invoice_date)->format('Y-m-d') }} {{ $inv->reference }} {{ optional($inv->buyer)->name ?? optional($inv->customer)->name ?? '—' }} {{ number_format($inv->grand_total, 2) }}
{{ $invoices->links('vendor.pagination.bootstrap-5') }}
@endcan
{{-- SweetAlert2 for delete confirmation --}} @endsection