@include('purchase::partials.styles')

{{ $po->po_number }} {{ $po->status }}

@if($po->status === 'DRAFT') ✏️ Edit
@csrf
@endif @if($po->status === 'SENT') @can('purchase.purchase-orders.approve')
@csrf
@endcan @endif @if(in_array($po->status, ['CONFIRMED', 'PARTIALLY_RECEIVED'])) 📥 Create GRN @endif
@if(session('success'))
{{ session('success') }}
@endif @if(session('error'))
{{ session('error') }}
@endif
📋 Order Details
PO Number
{{ $po->po_number }}
PO Date
{{ $po->po_date->format('d M Y') }}
Expected Date
{{ $po->expected_date?->format('d M Y') ?? '-' }}
Delivery Date
{{ $po->delivery_date?->format('d M Y') ?? '-' }}
Status
{{ $po->status }}
Payment Terms
{{ $po->payment_terms ?? '-' }}
@if($po->purchaseRequest) @endif
🏢 Vendor Details
Code
{{ $po->vendor->vendor_code }}
@if($po->vendor->billing_address)
Address
{{ $po->vendor->billing_address }}
@endif @if($po->vendor->billing_city)
City / State
{{ $po->vendor->billing_city }}{{ $po->vendor->billing_state ? ', ' . $po->vendor->billing_state : '' }} {{ $po->vendor->billing_pincode }}
@endif @if($po->vendor->gst_number)
GSTIN
{{ $po->vendor->gst_number }}
@endif @if($po->vendor->phone)
Phone
{{ $po->vendor->phone }}
@endif
@if($po->shipping_address)
📦 Ship To
Address
{{ $po->shipping_address }}
City
{{ $po->shipping_city ?? '-' }}
State
{{ $po->shipping_state ?? '-' }}
PIN Code
{{ $po->shipping_pincode ?? '-' }}
@endif
📦 Order Items
@forelse($po->items as $idx => $item) @php $imageUrl = null; if ($item->variation && $item->variation->image_path) { $imageUrl = asset('storage/' . $item->variation->image_path); } elseif ($item->product && $item->product->primaryImage) { $imageUrl = asset('storage/' . $item->product->primaryImage->image_path); } @endphp @empty @endforelse
# Product Unit Qty Received Rate Disc% Tax% Total
{{ $idx + 1 }}
@if($imageUrl) @else
@endif
{{ $item->product->name ?? 'N/A' }}
@if($item->variation) {{ $item->variation->variation_name ?: $item->variation->sku }} @endif @if($item->product?->sku)SKU: {{ $item->product->sku }}@endif @if($item->product?->hsn_code)HSN: {{ $item->product->hsn_code }}@endif
{{ $item->unit->short_name ?? $item->unit->name ?? '-' }} {{ number_format($item->qty, 3) }} {{ number_format($item->received_qty, 3) }} ₹{{ number_format($item->rate, 2) }} {{ number_format($item->discount_percent, 2) }}% {{ number_format($item->tax_percent, 2) }}% ₹{{ number_format($item->total, 2) }}
No items found
🧮 Summary
Subtotal₹{{ number_format($po->subtotal, 2) }}
Tax₹{{ number_format($po->tax_amount, 2) }}
Discount-₹{{ number_format($po->discount_amount, 2) }}
@if($po->shipping_charge > 0)
Shipping₹{{ number_format($po->shipping_charge, 2) }}
@endif
Total Amount₹{{ number_format($po->total_amount, 2) }}
📝 Terms & Notes
@if($po->terms_conditions)
Terms & Conditions

{{ $po->terms_conditions }}

@endif @if($po->notes)
Notes

{{ $po->notes }}

@endif @if(!$po->terms_conditions && !$po->notes)

No terms or notes

@endif
🕐 Audit Information
Created By
{{ $po->creator->name ?? '-' }}
Created At
{{ $po->created_at->format('d M Y, h:i A') }}
@if($po->sent_at)
Sent At
{{ $po->sent_at->format('d M Y, h:i A') }}
@endif @if($po->confirmed_at)
Confirmed At
{{ $po->confirmed_at->format('d M Y, h:i A') }}
@endif