GRN: {{ $grn->grn_number }}

@if ($grn->status === 'draft') @can('goods-receipt-note-post') @endcan @can('goods-receipt-note-edit') Edit @endcan @endif @if ($grn->status === 'posted') @php $hasPostedPayments = $grn->payments()->where('status', 'posted')->exists(); @endphp @if (!$hasPostedPayments) @can('goods-receipt-note-reverse') {{-- Currently Do Not Needed Hide it
@csrf
--}} @endcan @endif @endif
@push('header') @endpush

{{ config('app.name') }}
Goods Receipt Note
Printed by: {{ auth()->user()->name }} | {{ now()->format('d-M-Y h:i A') }}

@if($grn->status === 'posted') @endif
GRN Number: {{ $grn->grn_number }} Warehouse: {{ $grn->warehouse->warehouse_name }}
Supplier: {{ $grn->supplier->supplier_name }} Receipt Date: {{ \Carbon\Carbon::parse($grn->receipt_date)->format('d M Y') }}
Invoice #: {{ $grn->supplier_invoice_number ?? '—' }} Invoice Date: {{ $grn->supplier_invoice_date ? \Carbon\Carbon::parse($grn->supplier_invoice_date)->format('d M Y') : '—' }}
Received By: {{ $grn->receivedBy->name ?? 'N/A' }} Status: {{ ucfirst($grn->status) }}
Grand Total: ₨ {{ number_format($grn->items->sum('total_value_with_taxes') ?: $grn->grand_total, 2) }} Payment Status: {{ ucfirst($grn->payment_status) }}
{{-- GRN Items Table --}} @if($grn->items->count() > 0) @if($grn->supplier->supplier_name === 'Unilever Pakistan') @endif @php $totals = [ 'qty_in_purchase_uom' => 0, 'extended_value' => 0, 'discount_value' => 0, 'fmr_allowance' => 0, 'discounted_value_before_tax' => 0, 'excise_duty' => 0, 'sales_tax_value' => 0, 'advance_income_tax' => 0, 'other_charges' => 0, 'withholding_tax' => 0, 'quantity_received' => 0, 'total_value_with_taxes' => 0, ]; @endphp @foreach ($grn->items as $item) @php $totals['qty_in_purchase_uom'] += round((float)($item->qty_in_purchase_uom ?? 0), 2); $totals['extended_value'] += round((float)($item->extended_value ?? 0), 2); $totals['discount_value'] += round((float)($item->discount_value ?? 0), 2); $totals['fmr_allowance'] += round((float)($item->fmr_allowance ?? 0), 2); $totals['discounted_value_before_tax'] += round((float)($item->discounted_value_before_tax ?? 0), 2); $totals['excise_duty'] += round((float)($item->excise_duty ?? 0), 2); $totals['sales_tax_value'] += round((float)($item->sales_tax_value ?? 0), 2); $totals['advance_income_tax'] += round((float)($item->advance_income_tax ?? 0), 2); $totals['other_charges'] += round((float)($item->other_charges ?? 0), 2); $totals['withholding_tax'] += round((float)($item->withholding_tax ?? 0), 2); $totals['quantity_received'] += round((float)($item->quantity_received ?? 0), 2); $totals['total_value_with_taxes'] += round((float)($item->total_value_with_taxes ?? $item->total_cost ?? 0), 2); @endphp @if($grn->supplier->supplier_name === 'Unilever Pakistan') @endif @endforeach @if($grn->supplier->supplier_name === 'Unilever Pakistan') @endif
# Product Qty UP/Case Ext. Value Discount FMR Before Tax Excise Sales Tax Adv. IT Other ChgWHTQty Rec Unit Cost Sell Price Total W/Tax
{{ $item->line_no }} {{ $item->product->product_code }}
{{ $item->product->product_name }} @if ($item->is_promotional)
Promotional @endif @if ($item->batch_number || $item->lot_number)
@if ($item->batch_number) Batch: {{ $item->batch_number }} @endif @if ($item->lot_number) | Lot: {{ $item->lot_number }} @endif @endif @if ($item->expiry_date)
Exp: {{ \Carbon\Carbon::parse($item->expiry_date)->format('d M Y') }} @endif
{{ number_format($item->qty_in_purchase_uom ?? 0, 2) }} {{ number_format($item->unit_price_per_case ?? 0, 2) }} {{ number_format($item->extended_value ?? 0, 2) }} {{ number_format($item->discount_value ?? 0, 2) }} {{ number_format($item->fmr_allowance ?? 0, 2) }} {{ number_format($item->discounted_value_before_tax ?? 0, 2) }} {{ number_format($item->excise_duty ?? 0, 2) }} {{ number_format($item->sales_tax_value ?? 0, 2) }} {{ number_format($item->advance_income_tax ?? 0, 2) }} {{ number_format($item->other_charges ?? 0, 2) }} {{ number_format($item->withholding_tax ?? 0, 2) }} {{ number_format($item->quantity_received, 2) }} @if ($item->quantity_rejected > 0)
(Rej: {{ number_format($item->quantity_rejected, 2) }}) @endif
{{ number_format($item->unit_cost, 2) }} @if ($item->selling_price) {{ number_format($item->selling_price, 2) }} @else @endif {{ number_format($item->total_value_with_taxes ?? $item->total_cost, 2) }}
Totals {{ number_format($totals['qty_in_purchase_uom'], 2) }} {{ number_format($totals['extended_value'], 2) }} {{ number_format($totals['discount_value'], 2) }} {{ number_format($totals['fmr_allowance'], 2) }} {{ number_format($totals['discounted_value_before_tax'], 2) }} {{ number_format($totals['excise_duty'], 2) }} {{ number_format($totals['sales_tax_value'], 2) }} {{ number_format($totals['advance_income_tax'], 2) }} {{ number_format($totals['other_charges'], 2) }}{{ number_format($totals['withholding_tax'], 2) }}{{ number_format($totals['quantity_received'], 2) }} ₨ {{ number_format($totals['total_value_with_taxes'], 2) }}
@endif @if ($grn->notes)
Notes: {{ $grn->notes }}
@endif {{-- Payment History --}} @if ($grn->payments()->count() > 0)

Payment History

@foreach ($grn->payments()->orderBy('payment_date')->get() as $payment) @endforeach
Payment # Date Method Status Allocated Action
{{ $payment->payment_number }} {{ \Carbon\Carbon::parse($payment->payment_date)->format('d M Y') }} {{ ucwords(str_replace('_', ' ', $payment->payment_method)) }} {{ ucfirst($payment->status) }} {{ number_format($payment->pivot->allocated_amount, 2) }} View
@endif {{-- Payment Summary --}} @if ($grn->status === 'posted')
Payment Status: {{ ucfirst($grn->payment_status) }} Total Amount: ₨ {{ number_format($grn->grand_total, 2) }}
Total Paid: ₨ {{ number_format($grn->total_paid, 2) }} Balance Due: ₨ {{ number_format($grn->balance, 2) }}
@endif