@php /** @var \App\Models\Order $order */ $checkout = config('checkout'); $customer = $order->customer; $items = $order->items; $paymentMethod = $order->payment_method; $grossTotal = (float) $order->grand_total; $amountPaid = (float) $order->amount_paid; $refundedTotal = (float) $order->refunded_total; $netPaidTotal = max(0, $amountPaid - $refundedTotal); $outstandingTotal = (float) $order->outstanding_total; if ($outstandingTotal <= 0 && $amountPaid <= 0 && !in_array($order->status->value, ['cancelled', 'refunded'], true)) { $outstandingTotal = $grossTotal; } $isPaid = $amountPaid + 0.01 >= $grossTotal && $outstandingTotal <= 0.01; $isPartiallyPaid = $amountPaid > 0 && !$isPaid && $refundedTotal + 0.01 < $amountPaid; $buyerName = $order->buyer_name ?? $customer?->full_name ?? $customer?->company_name ?? $order->ship_contact_name; $buyerEmail = $order->buyer_email ?? $customer?->email ?? $order->placedBy?->email; $currency = $order->currency ?? 'USD'; $fmt = static fn ($v) => $currency.' '.number_format((float) $v, 2, '.', ','); $logoPath = public_path('images/logo-vidamansa.png'); $logoSrc = file_exists($logoPath) ? 'data:image/png;base64,'.base64_encode(file_get_contents($logoPath)) : null; @endphp
| Product | SKU | Qty | Unit price | Line total |
|---|---|---|---|---|
|
{{ $item->product_title }}
@if ($item->variant_title) {{ $item->variant_title }}@endif |
{{ $item->sku }} | {{ $item->quantity }} | {{ $fmt($item->unit_price) }} | {{ $fmt($item->line_total) }} |
| Subtotal | {{ $fmt($order->subtotal) }} |
|
Discount
@if ($order->discount_code)
{{ $order->discount_code }} @endif |
-{{ $fmt($order->discount_total) }} |
|
Shipping
@if ($order->shipping_service_name)
{{ collect([$order->shipping_carrier_name, $order->shipping_service_name])->filter()->join(' - ') }} @endif |
{{ $fmt($order->shipping_total) }} |
| Tax | {{ $fmt($order->tax_total) }} |
| Gross order total | {{ $fmt($order->grand_total) }} |
| Amount paid | {{ $fmt($amountPaid) }} |
| Refunded | -{{ $fmt($refundedTotal) }} |
| Net paid | {{ $fmt($netPaidTotal) }} |
| Outstanding balance | {{ $fmt(max(0, $outstandingTotal)) }} |
| Terms | NET {{ $order->payment_terms_days ?? '—' }} |
| Due date | {{ $order->payment_due_at?->format('M d, Y') ?? '—' }} |
| Approved decision | {{ $order->credit_application_id ? '#'.$order->credit_application_id : '—' }} |
| Bank | {{ $b['bank_name'] ?? '' }} |
| Beneficiary | {{ $b['beneficiary_name'] ?? '' }} |
| Beneficiary address | {{ $b['beneficiary_address'] ?? '' }} |
| ABA / Routing | {{ $b['routing_number'] ?? '' }} |
| Account number | {{ $b['account_number'] ?? '' }} |
| SWIFT / BIC | {{ $b['swift'] }} |
| Memo / Reference | {{ $b['memo_reference'] }} |
| Notes | {{ $b['notes'] }} |