@push('title') View GRN: {{ $grn->grn_no }} @endpush

GRN / View Details

@if($grn->status == 'approved' && $grn->payment_status != 'paid') @endif @if($grn->status == 'approved') @endif
{{-- General Information --}}
General Information
GRN Code
{{ $grn->grn_no }}
Receipt Date
{{ date('Y-M-d', strtotime($grn->date)) }}
Status
@if($grn->status == 'approved') Received & Approved @else Draft Receipt @endif
Supplier
{{ $grn->supplier->name ?? 'N/A' }}
@if($grn->supplier && $grn->supplier->reps->count() > 0)
Rep: {{ $grn->supplier->reps->first()->name }} | {{ $grn->supplier->reps->first()->phone ?? 'No Phone' }}
@endif
Warehouse
{{ $grn->warehouse->name ?? 'N/A' }}
Payment Status
@if($grn->payment_status == 'paid') Fully Paid @elseif($grn->payment_status == 'partial') Partially Paid @else Pending @endif
Invoice Number
{{ $grn->invoice_no ?? 'N/A' }}
{{-- Items Table --}}
Received Items
@php $items_subtotal = 0; @endphp @foreach($grn->items as $index => $item) @php $line_total = ($item->received_qty * $item->unit_cost) - $item->discount_amount; $items_subtotal += $line_total; @endphp @endforeach
# Item Details Paid Qty Free Qty Cost Retail Discount Subtotal
{{ $index + 1 }}
{{ $item->product->name }}
{{ $item->productVariation->variation_id ? ($item->productVariation->variationType->name ?? 'N/A') : 'Default' }}
{{ floatval($item->received_qty) }} {{ floatval($item->free_qty) }} {{ number_format($item->unit_cost, 2) }} {{ number_format($item->price_retail, 2) }} -{{ number_format($item->discount_amount, 2) }} @if($item->discount_type == 'percentage')
({{ floatval($item->discount_value) }}%)
@endif
{{ number_format($line_total, 2) }}
@if($grn->notes)
Internal Notes

{{ $grn->notes }}

@endif {{-- Linked Returns --}} @php $linkedReturns = \App\Models\PurchaseReturn::where('grn_id', $grn->id)->get(); @endphp @if($linkedReturns->count() > 0)
Returns Adjusted in this GRN
@foreach($linkedReturns as $ret) @endforeach
Reference Date Adjustment Amount
{{ $ret->pr_code }} {{ $ret->return_date }} - Rs {{ number_format($ret->total_amount, 2) }}
@endif {{-- Payment History --}} @if($grn->status == 'approved')
Payment History
@forelse($grn->payments as $payment) @empty @endforelse
Date Method Notes Amount
{{ \Carbon\Carbon::parse($payment->payment_date)->format('d M Y') }} {{ $payment->payment_method }} {{ $payment->notes ?? '-' }} Rs {{ number_format($payment->amount, 2) }}
No payments recorded for this GRN.
@endif
{{-- Financial Summary --}}
Financial Summary
Items Subtotal: Rs {{ number_format($items_subtotal, 2) }}
Order Discount: -Rs {{ number_format($grn->order_discount, 2) }} @if($grn->order_discount_type == 'percentage') ({{ floatval($grn->order_discount_value) }}%) @endif
@if($grn->return_adjustment > 0)
Returns Offset: -Rs {{ number_format($grn->return_adjustment, 2) }}
@endif
Grand Total Rs {{ number_format($grn->grand_total, 2) }}
Total Paid Rs {{ number_format($grn->paid_amount, 2) }}
Pending Balance Rs {{ number_format($grn->grand_total - $grn->paid_amount, 2) }}
Payment Status
@if($grn->payment_status == 'paid') Fully Paid @elseif($grn->payment_status == 'partial') Partially Paid @else Payment Pending @endif
@if($grn->status == 'approved' && $grn->payment_status != 'paid') @endif @if($grn->status == 'draft')
@can(['update_grn_management']) @endcan @can(['delete_grn_management']) @endcan
@endif
{{-- Audit Details --}}
Metadata
Recorded By: {{ $grn->creator->name ?? 'System' }}
Recorded At: {{ $grn->created_at->format('Y-M-d H:i') }}
@if($grn->approved_by)
Approved By: {{ $grn->approver->name ?? 'N/A' }}
@endif @if($grn->updated_at > $grn->created_at)
Last Updated: {{ $grn->updated_at->format('Y-M-d H:i') }}
@endif
{{-- Modals --}} @if($grn->status == 'draft') @endif