@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; $dueDisplay = max(0, $due); $status = $bill->supplier_bill_details_status ?? (($bill->supplier_bill_details_close_status ?? 0) == 1 ? 'closed' : 'open'); $paymentStatus = 'UNPAID'; if ($status === 'cancelled') { $paymentStatus = 'CANCELLED'; } elseif ($due <= 0.00001) { $paymentStatus = 'PAID'; } elseif ($paid > 0.00001 || $returnedTotal > 0.00001) { $paymentStatus = 'PARTIAL'; } @endphp
| Product | Batch | MFD | EXP | Qty | Unit Cost | Line Total |
|---|---|---|---|---|---|---|
|
{{ $productName ?? ('#'.(string) $item->supp_bill_product_id) }}
@if(!empty($productSku)) SKU: {{ $productSku }} @endif
@if(!empty($productSku) && !empty($productBarcode)) ยท @endif
@if(!empty($productBarcode)) Barcode: {{ $productBarcode }} @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) }} |
| No items | ||||||