@php $db_settings = \App\Models\Setting::get(); $settings = []; foreach ($db_settings as $row) { $settings[$row->name] = $row->value; } @endphp
@if (isset($settings['icon']) && is_file('storage/settings/' . $settings['icon'])) @endif

{{ $settings['website_name'] ?? '' }}

{{ $settings['address'] ?? '' }}

{{ $settings['number_1'] ?? '' }}{{ $settings['number_2'] ? ', ' . $settings['number_2'] : '' }}

@if (isset($settings['icon']) && is_file('storage/settings/' . $settings['icon'])) @endif

Order Receipt

Order No
{{ $item?->order_name }}
Date
{{ date_fmt($item->date) }}
Supplier Name
{{ $item?->supp?->name }}
@php $counter = 1; $total = 0; @endphp @foreach ($item?->det as $rw) @php $total += (float) $rw?->unit_price * $rw?->quantity; @endphp @endforeach
# Product Quantity Amount Sub Total
{{ $counter++ }} {{ $rw?->prd?->name }} {{ $rw?->quantity }} {{ number_format($rw?->unit_price, 2) }} {{ number_format($rw?->unit_price * $rw?->quantity, 2) }}
Total {{ number_format($total, 2) }}

Payment Summary

@php $firstPayment = $item?->payment?->first(); @endphp @php $paidTotal = 0; @endphp @foreach($item->payment as $payment) @php $paidTotal += $payment->payment_amount; @endphp @endforeach
Total Paid: {{ number_format($paidTotal, 2) }}
Balance: {{ number_format($total - $paidTotal, 2) }}
Thank you for choosing {{ $settings['website_name'] ?? '' }}!