@php $thermal = \App\Models\SystemSetting::getValue('grn_template', 'a4') === 'thermal'; $taxSummary = $purchase->items->groupBy(fn ($item) => ($item->tax_type ?: 'non_taxable').'|'.number_format((float) $item->tax_rate, 2, '.', '')); @endphp
{{ $purchase->branch?->address }}
{{ $purchase->branch?->phone }}
{{ $purchase->branch?->email }}
GRN No: {{ $purchase->purchase_no }}
Date: {{ $purchase->purchase_date?->format('Y-m-d H:i') }}
Supplier: {{ $purchase->supplier_name ?: '-' }}
@if($thermal && $purchase->supplier_invoice_no)Supplier Invoice: {{ $purchase->supplier_invoice_no }}
@endifReceived By: {{ $purchase->user?->name ?: '-' }}
Prices in {{ $currency }}
| Product | Qty | Price | Total |
|---|---|---|---|
| {{ $item->product_name }}@if($barcode){{ $barcode }}@endif | {{ rtrim(rtrim(number_format($item->quantity, 2), '0'), '.') }}@if($item->uom){{ $item->uom }}@endif | {{ $amount($buyingPrice) }} | {{ $amount($item->line_total) }} |
Note: {{ $purchase->note }}
@endif @else| Barcode | Product | Qty Received | B.Price Before VAT | VAT Type | VAT Amount | B.Price After VAT | Total |
|---|---|---|---|---|---|---|---|
| {{ $item->barcode ?: ($item->product?->barcode ?: '-') }} | {{ $item->product_name }} | {{ number_format($item->quantity, 2) }} | {{ \App\Models\SystemSetting::formatMoney($item->unit_cost) }} | {{ \App\Models\TaxRate::typeLabel($item->tax_type ?: 'non_taxable', $item->tax_rate) }} | {{ \App\Models\SystemSetting::formatMoney($item->tax_amount) }} | {{ \App\Models\SystemSetting::formatMoney($item->unit_cost_after_tax) }} | {{ \App\Models\SystemSetting::formatMoney($item->line_total) }} |
| Totals | {{ number_format($purchase->items->sum('quantity'), 2) }} | {{ \App\Models\SystemSetting::formatMoney($purchase->items->sum('tax_amount')) }} | {{ \App\Models\SystemSetting::formatMoney($purchase->items->sum('line_total')) }} | ||||
| VAT Summary | Before VAT | VAT | After VAT |
|---|---|---|---|
| {{ \App\Models\TaxRate::typeLabel($type, $rate) }} | {{ \App\Models\SystemSetting::formatMoney($items->sum(fn ($item) => (float) $item->line_total - (float) $item->tax_amount)) }} | {{ \App\Models\SystemSetting::formatMoney($items->sum('tax_amount')) }} | {{ \App\Models\SystemSetting::formatMoney($items->sum('line_total')) }} |