@extends('layouts.app') @section('title', 'Invoice') @section('content')
{{-- ========================================================= PAGE HEADER ========================================================== --}}

Invoice

Stationery Distribution Order

{{ $invoice->invoice_number }}

Generated: {{ \Carbon\Carbon::parse($invoice->generated_at)->format('d M Y, h:i A') }}
{{-- ========================================================= INVOICE ========================================================== --}}
{{-- ================================================= BUSINESS HEADER ================================================== --}}

Z&T Stationery

Stationery Distribution System

INVOICE

Invoice No: {{ $invoice->invoice_number }}

Date: {{ \Carbon\Carbon::parse($invoice->generated_at)->format('d M Y') }}


{{-- ================================================= CUSTOMER + ORDER INFORMATION ================================================== --}}
{{-- CUSTOMER --}}
Customer Information

Name: {{ $invoice->order->customer->customer_name ?? 'N/A' }}

Shop: {{ $invoice->order->customer->shop_name ?? 'N/A' }}

Phone: {{ $invoice->order->customer->customer_phonenum ?? 'N/A' }}

Area: @if($invoice->order->customer->area) {{ $invoice->order->customer->area->area_name ?? 'N/A' }} @else N/A @endif

{{-- ORDER INFORMATION --}}
Order Information

Order No: {{ $invoice->order->serial_number }}

Status: {{ $invoice->order->status->status_name ?? 'N/A' }}

Taken By: {{ $invoice->order->takenBy->user_name ?? 'N/A' }}

Order Date: {{ $invoice->order->taken_at ? \Carbon\Carbon::parse($invoice->order->taken_at)->format('d M Y') : 'N/A' }}

{{-- ================================================= ORDER ITEMS ================================================== --}}
@forelse($items as $index => $item) @empty @endforelse
# Item Name Item Code Quantity Unit Price Subtotal
{{ $index + 1 }} {{ $item->item_name }} {{ $item->item_code ?? 'N/A' }} {{ $item->quantity }} Rs. {{ number_format((float) $item->sale_price, 2) }} Rs. {{ number_format((float) $item->subtotal, 2) }}
No items found.
{{-- ================================================= TOTAL ================================================== --}}
@if($invoice->order->instructions ?? false)
Instructions

{{ $invoice->order->instructions }}

@endif
Total Amount: Rs. {{ number_format((float) $invoice->order->total_amount, 2) }}
Grand Total:

Rs. {{ number_format((float) $invoice->order->total_amount, 2) }}


{{-- ================================================= ACTION BUTTONS ================================================== --}}
Back to Orders
{{-- ========================================================= PRINT CSS ========================================================== --}} @endsection