@extends('pdf.layouts.order-interior') @section('title','Invoice') @section('content') @php $isQuotationOrder = !empty($order->quotation_id); @endphp

INVOICE

{{-- CLIENT INFO --}} @if($order->shippingAddress) @endif @if($order->courier) @if($order->tracking_id) @endif @endif
Name: {{ $order->user->name ?? '-' }} Date: {{ now()->format('d-M-Y') }}
Contact: {{ $order->user->phone ?? '-' }} Invoice No: {{ $order->order_number }}
Billing Address: {{ $order->billingFullAddress ?? '-' }}
Shipping Address: {{ $order->shippingAddress->name }} , {{ $order->shippingAddress->address_line1 }}, {{ $order->shippingAddress->city }}, {{ $order->shippingAddress->state }}, {{ $order->shippingAddress->phone }}
Courier: {{ $order->courier->name }}, Tracking ID : {{ $order->tracking_id }}, @if($order->courier->website) Track Shipment @endif
{{-- ITEM TABLE --}} @if(!$isQuotationOrder) @endif @foreach($order->items as $item) @if(!$isQuotationOrder) @endif @endforeach
No ItemUnit Qty PriceAmount
{{ $loop->iteration }}
{{ $item->product_name }}
{{-- Variant SKU --}} @if($item->variant) SKU: {{ $item->variant->sku ?? '-' }}
@endif {{-- Master catalog --}} @if($item->product) CATALOG: {{ $item->product->master_catalogue_name ?? '-' }} ({{ $item->product->master_catalogue_code ?? '-' }})
@endif {{-- Curtain Details --}} @if(!empty($item->curtain_details)) @php $cd = $item->curtain_details; $modelName = \App\Models\ProductModel::where('id', $cd['model_id'] ?? null)->value('name'); @endphp Model: {{ $modelName ?? '-' }}
Size: {{ $cd['width'] ?? '-' }} × {{ $cd['height'] ?? '-' }} cm
Panels: {{ $cd['panels'] ?? '-' }}
Fabric: {{ $cd['fabric_meter'] ?? '-' }} m
Stitch Rate: ₹{{ $cd['stitch_rate'] ?? '-' }}
Stitch Total: ₹{{ $cd['stitch_total'] ?? '-' }} @endif
Nos {{ $item->quantity }} ₹ {{ number_format($item->price,2) }} @if(!$isQuotationOrder) ₹ {{ number_format($item->total ?? $item->price,2) }} @else ₹ {{ number_format($item->calculated_total ?? ($item->price * $item->quantity),2) }} @endif
{{-- TOTAL SECTION --}} @if($isQuotationOrder) @else @endif
Subtotal : ₹ {{ number_format($order->sub_total,2) }}
Tax : ₹ {{ number_format($order->tax,2) }}
Delivery Fee : ₹ {{ number_format($order->delivery_fee,2) }}
Discount : ₹ {{ number_format($order->discount,2) }}
Grand Total : ₹ {{ number_format($order->total_amount,2) }}
{{-- PAYMENT STATUS --}} @if($isQuotationOrder) @php $paidAmount = $order->paid_amount ?? 0; // You can store partial payment in orders table $remainingAmount = $order->total_amount - $paidAmount; @endphp
Payment Status : @if($paidAmount > 0 && $paidAmount < $order->total_amount) Partial Paid (₹ {{ number_format($paidAmount,2) }})
Remaining: ₹ {{ number_format($remainingAmount,2) }} @elseif($paidAmount >= $order->total_amount) Paid in Full @else Pending @endif
@else {{-- Normal full payment --}}
Payment Status : {{ ucfirst($order->payment_status) }}
@endif {{-- PAYMENT DETAILS --}} {{-- Razorpay Details --}} @if($order->razorpay_order_id) @endif {{-- Coupon --}} @if($order->coupon_code) @endif
Payment Details
Payment Method {{ ucfirst($order->payment_status) }}
Status @if($order->payment_status=='success') Paid @elseif($order->payment_status=='pending') Pending @elseif($order->payment_status=='failed') Failed @endif
Razorpay Order ID {{ $order->razorpay_order_id }}
Razorpay Payment ID {{ $order->razorpay_payment_id }}
Razorpay Signature {{ $order->razorpay_signature }}
Coupon Applied {{ $order->coupon_code }}
Authorized Signature
@endsection