@php $items = $order->items; $first = $items->first(); // Currency symbol & rate (similar to order-details) $symbol = session('currency_symbol', '₹'); $shortcut = session('currency_shortcut', 'INR'); $rate = (float) session('currency_rate', 1); if ($first) { if (!empty($first->converted_currency_symbol)) { $symbol = $first->converted_currency_symbol; } if (!empty($first->converted_currency_value)) { $rate = (float) $first->converted_currency_value; } } // Helper for formatting currency like your other pages function inv_format_amount($symbol, $shortcut, $amount) { if ($shortcut === 'AED') { return number_format($amount, 2) . ' ' . $symbol; } return $symbol . ' ' . number_format($amount, 2); } // SUBTOTAL (converted) – if controller already set it, reuse $subtotalConverted = $order->subtotal_amount ?? $items->sum(function ($item) { if (!is_null($item->sub_total_converted)) { return (float) $item->sub_total_converted; } $rate = $item->converted_currency_value ?? (float) session('currency_rate', 1); $qty = $item->product_quantity ?? 1; $base = ($item->product_price ?? 0) * $qty; return $base * $rate; }); // SHIPPING (converted) $shippingConverted = $order->shipping_amount ?? ( $first->shipping_charge_total_converted ?? ( ($first->shipping_charge_converted ?? 0) + ($first->fuel_surcharge_converted ?? 0) + ($first->gst_converted ?? 0) + ($first->payment_gateway_charge_converted ?? 0) ) ); // DISCOUNT (converted) $discountConverted = $order->discount_amount ?? ($first->discounted_per ?? 0); // GRAND TOTAL (converted) $grandConverted = $order->grand_total ?? ($first->final_amount_converted ?? ($subtotalConverted + $shippingConverted - $discountConverted)); @endphp
{{-- HEADER: Company + Logos --}}

Uthhan Global Store

From: Golden Era Consumer Durables

1299, 2nd Floor, 41st Cross, 25th Main Rd, Jayanagara 9th Block,

Jayanagar, Bengaluru, Karnataka 560056


{{-- Invoice Meta --}}

Proforma Invoice: #{{ $order->order_id }}

Billed Date: {{ $order->order_created_at ? \Carbon\Carbon::parse($order->order_created_at)->format('d/m/Y') : 'N/A' }}

@if($order->user_email)

Email: {{ $order->user_email }}

@endif
{{-- Billing Address --}}
Billing Address
{{ $order->user_name }}
Address: {{ $order->user_address }}
City: {{ $order->user_city }}, State: {{ $order->user_state }}
Pincode: {{ $order->user_pincode }}
Mobile No: @if($order->user_country_code) {{ $order->user_country_code }} @endif {{ $order->user_phone }}
{{-- Order Summary Table --}}
Order Summary
@forelse($items as $index => $item) @php $qty = $item->product_quantity ?? 1; $rateItem = $item->converted_currency_value ?? $rate; $basePrice = $item->product_price ?? 0; // line subtotal (converted) if (!is_null($item->sub_total_converted)) { $lineSubtotal = (float) $item->sub_total_converted; } elseif (!is_null($item->sub_total)) { $lineSubtotal = (float) $item->sub_total * $rateItem; } else { $lineSubtotal = ($basePrice * $qty) * $rateItem; } // unit price (converted) $unitPriceConverted = $qty > 0 ? $lineSubtotal / $qty : $lineSubtotal; @endphp @empty @endforelse
Sl. No. Name Price Qty Total
{{ $index + 1 }} {{ $item->product_name }} {{ inv_format_amount($symbol, $shortcut, $unitPriceConverted) }} {{ $qty }} {{ inv_format_amount($symbol, $shortcut, $lineSubtotal) }}
No products found. Products may have been cancelled.
{{-- Totals (Sub total, Discount, Shipping, Grand total) --}} @if($items->count() > 0) @if($discountConverted > 0) @endif @if($shippingConverted > 0) @endif
Sub Total {{ inv_format_amount($symbol, $shortcut, $subtotalConverted) }}
Discount - {{ inv_format_amount($symbol, $shortcut, $discountConverted) }}
Shipping Charge {{ inv_format_amount($symbol, $shortcut, $shippingConverted) }}
Grand Total {{ inv_format_amount($symbol, $shortcut, $grandConverted) }}
@endif Download PDF