@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 Purchase Print - {{ $bill->supplier_bill_details_billnumber }} @include('pos.supplier.bill._print_header', ['bill' => $bill, 'location' => $location, 'receiptSettings' => ($receiptSettings ?? [])])

Purchase (GRN)

Date: {{ optional($bill->supplier_bill_details_create_date)->format('Y-m-d') }}
Reference No: {{ $bill->supplier_bill_details_billnumber }}
Supplier: {{ $bill->supplier->supplier_name ?? '' }}
Location: {{ $location->name ?? ($bill->location->name ?? '') }}
Status: {{ strtoupper($bill->supplier_bill_details_status ?? 'draft') }}
Added By: {{ $bill->createdByUser->name ?? '' }}
@if(!empty($bill->supplier_bill_details_close_remark ?? null))
Note: {{ $bill->supplier_bill_details_close_remark }}
@endif
@foreach($bill->items as $i => $item) @php $lineTotal = (float) ($item->supp_bill_buy_price ?? 0) * (float) ($item->supp_bill_qty ?? 0); $productName = $item->product->name ?? $item->product->product_name ?? $item->product->product_code ?? null; $productSku = $item->product->sku ?? $item->product->product_code ?? null; $productBarcode = $item->product->barcode ?? null; @endphp @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 @endforeach
# 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
{{ $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) }}