@php $address = $order->address_snapshot ?? []; $customerName = $address['name'] ?? $order->user->name ?? '-'; $customerMobile = $address['mobile'] ?? $order->user->mobile ?? '-'; $customerAddress = collect([ $address['address_line_1'] ?? null, $address['address_line_2'] ?? null, $address['city'] ?? null, $address['state'] ?? null, $address['pincode'] ?? $order->selected_pincode, ])->filter()->join(', '); $signaturePath = public_path('backend/template/images/signature.png'); @endphp {{-- Company identity (logo + name/address/contact) lives in the repeating page header (pdf/invoice-page-header.blade.php via SetHTMLHeader), so it prints on EVERY page — not as a body row that only page 1 gets. --}}
{{-- Identifier cells: nowrap so invoice/order numbers always sit on ONE line instead of breaking mid-number. --}} {{-- Invoice number highlighted in the brand green --}}

Bill From

{{ $invoice['company_name'] }}

@if ($invoice['company_address'] !== '-')

{{ $invoice['company_address'] }}

@endif @if ($invoice['company_phone'] !== '-')

Ph: {{ $invoice['company_phone'] }}

@endif @if ($invoice['company_email'] !== '-')

Email: {{ $invoice['company_email'] }}

@endif

Bill To

{{ $customerAddress ?: '-' }}

Ph: {{ $customerMobile }}

Email: {{ $order->user->email ?? '-' }}

Customer Name

{{ $customerName }}

Invoice No

{{ $invoice['invoice_no'] }}

Invoice Date

{{ $invoice['invoice_date'] }}

GSTIN

{{ $invoice['gstin'] }}

Sales Order No

{{ $order->order_no }}

Subject: {{ $invoice['subject'] }}

{{-- TOP-LEVEL items table: when the item list is long (20+ lines), mPDF splits it across pages and repeats this at the top of every page — a table nested inside .invoice-table never gets that. --}} @foreach ($order->items as $item) @php $mrp = (float) ($item->pricing->mrp ?? $item->price); $lineMrp = $mrp * (int) $item->quantity; $discount = max(0, $lineMrp - (float) $item->total); @endphp @endforeach {{-- Zero-value charge rows are noise on the printed bill — show only what was actually charged (the Price Details box itemises the rest). --}} @if ($invoice['tax_total'] > 0) @endif @if ($invoice['other_charges'] > 0) @endif @if ($invoice['delivery_fee'] > 0) @endif @if ($invoice['delivery_tip'] > 0) @endif
S.No Product Name Unit Price Quantity Discount Total
{{ $loop->iteration }} {{ $item->product_name }} {{ $item->pricing_label ?? $item->pricing->unit->name ?? '-' }} ₹{{ number_format($mrp, 2) }} {{ $item->quantity }} ₹{{ number_format($discount, 2) }} ₹{{ number_format((float) $item->total, 2) }}
Sub Total {{ $invoice['total_quantity'] }} ₹{{ number_format($invoice['product_discount'], 2) }} ₹{{ number_format($invoice['subtotal'], 2) }}
Tax ₹{{ number_format($invoice['tax_total'], 2) }}
Other Charges ₹{{ number_format($invoice['other_charges'], 2) }}
Delivery Fee ₹{{ number_format($invoice['delivery_fee'], 2) }}
Delivery Tip ₹{{ number_format($invoice['delivery_tip'], 2) }}
Total ₹{{ number_format($invoice['grand_total'], 2) }}

Amount Chargeable (in words)

{{ $invoice['amount_words'] }}

Bank Details

Price Details

Account Holder Name{{ $invoice['bank']['account_holder'] }}
Bank Name{{ $invoice['bank']['bank_name'] }}
Branch Name{{ $invoice['bank']['branch_name'] }}
Account Number{{ $invoice['bank']['account_number'] }}
IFSC Code{{ $invoice['bank']['ifsc_code'] }}
@if ($invoice['product_discount'] > 0) @endif @if ($invoice['coupon_discount'] > 0) @endif @if ($invoice['tax_total'] > 0) @endif @if ($invoice['delivery_tip'] > 0) @endif
Order Amount (MRP)₹{{ number_format($invoice['mrp_total'], 2) }}
Product Discount-₹{{ number_format($invoice['product_discount'], 2) }}
Coupon{{ $invoice['coupon_code'] ? ' ('.$invoice['coupon_code'].')' : '' }}-₹{{ number_format($invoice['coupon_discount'], 2) }}
Tax₹{{ number_format($invoice['tax_total'], 2) }}
Delivery Fee {{ $invoice['delivery_fee'] > 0 ? '₹'.number_format($invoice['delivery_fee'], 2) : 'FREE' }}
Delivery Tip₹{{ number_format($invoice['delivery_tip'], 2) }}
Total Amount ₹{{ number_format($invoice['grand_total'], 2) }}

Terms of Instructions

    @foreach ($invoice['terms'] as $term)
  • {{ $term }}
  • @endforeach
Notes
{{ $invoice['notes'] }}
@if (file_exists($signaturePath)) @endif

For {{ $invoice['company_name'] }}

(Authorized Signature) Date: {{ $invoice['invoice_date'] }}