@php $total = (float) ($bill->supplier_bill_details_total ?? 0); $paid = (float) ($bill->supplier_bill_details_paid ?? 0); $returnedTotal = (float) ($bill->supplier_bill_details_returned_total ?? 0); $due = $total - $paid - $returnedTotal; $location = $location ?? ($bill->location ?? null); $appFontLocationId = $location?->id ?? (function_exists('current_location_id') ? current_location_id() : session('location_id')); $appFontFile = (string) ( ($receiptSettings['receipt_font_file'] ?? '') ?: ($receiptSettings['ui_font_file'] ?? '') ?: ($receiptSettings['app_font_file'] ?? '') ?: ($appFontLocationId ? (\App\Models\Setting::get('receipt_font_file', '', $appFontLocationId) ?: \App\Models\Setting::get('ui_font_file', '', $appFontLocationId) ?: \App\Models\Setting::get('app_font_file', '', $appFontLocationId)) : '') ); $appFontUrl = $appFontFile !== '' ? asset('fonts/' . rawurlencode($appFontFile)) : ''; @endphp
| # | Product | Batch | MFD | EXP | Qty | Unit Cost | Line Total |
|---|---|---|---|---|---|---|---|
| {{ $i + 1 }} |
{{ $productName ?? ('#'.(string) $item->supp_bill_product_id) }}
@if(!empty($productSku) || !empty($productBarcode))
@if(!empty($productSku)) SKU: {{ $productSku }} @endif
@if(!empty($productSku) && !empty($productBarcode)) ยท @endif
@if(!empty($productBarcode)) Barcode: {{ $productBarcode }} @endif
@endif
|
@php
$batchLabel = trim((string) ($item->supp_bill_batch_name ?? ''));
if ($batchLabel === '') {
$batchLabel = trim((string) ($item->badge->price_name ?? ''));
}
if ($batchLabel === '') {
$batchLabel = (string) ($item->supp_bill_badge_id ?? '');
}
@endphp
{{ $batchLabel }} | {{ optional($item->supp_bill_batch_mfg ?? null)->format('Y-m-d') }} | {{ optional($item->supp_bill_batch_exp ?? null)->format('Y-m-d') }} | {{ number_format((float) ($item->supp_bill_qty ?? 0), 3) }} | {{ number_format((float) ($item->supp_bill_buy_price ?? 0), 2) }} | {{ number_format($lineTotal, 2) }} |
| Grand Total | {{ number_format($total, 2) }} |
| Paid | {{ number_format($paid, 2) }} |
| Returns | {{ number_format($returnedTotal, 2) }} |
| Payment Due | {{ number_format(max(0, $due), 2) }} |