@if(isset($noData) && $noData)
MAINT
inventory management

No Sales Data Available

There are no sales in the database to generate an invoice.

Please create a sale first to test the invoice generation.

@else
{{ $sale->branch->name ?? '-' }}
ISSUED TO:
CUSTOMER: {{ $sale->customer->name ?? 'Unknown Customer' }}
EMAIL: {{ $sale->customer->email ?? 'Unknown Email' }}
PHONE: {{ $sale->customer->phone ?? 'Unknown Phone' }}
ADDRESS: {{ $sale->customer->address ?? 'Unknown Address' }}
INVOICE NO: {{ $sale->invoice_no }}
BRANCH: {{ $sale->branch->name ?? 'Unknown Branch' }}
BRANCH EMAIL: {{ $sale->branch->email ?? 'Unknown Branch' }}
DATE: {{ $invoiceDate }}
STATUS: {{ $sale->status }}
@foreach($sale->saleItems as $item) @endforeach
DESCRIPTION UNIT PRICE QTY TOTAL
{{ $item->item->name ?? 'Unknown Item' }} {{ number_format($item->unit_price, 2) }} RWF {{ number_format($item->quantity, 0) }} {{ number_format($item->unit_price * $item->quantity, 2) }} RWF
{{-- --}}
SUBTOTAL ${{ number_format($subtotal, 2) }}
Tax {{ $taxRate }}%
TOTAL {{ number_format($total, 2) }} RWF
{{-- --}}
@endif