@php $vatRate = $order->company->getVatRate(); $vatPercent = $vatRate * 100; $currencyConfig = config('currencies.available.' . $order->company->currency, []); $lang = $currencyConfig['language'] ?? 'en'; $translations = [ 'en' => [ 'invoice' => 'INVOICE', 'invoice_number' => 'Invoice Number:', 'date' => 'Date:', 'customer' => 'Customer:', 'payment_status' => 'Payment Status:', 'payment_method' => 'Payment Method:', 'due_date' => 'Due Date:', 'description' => 'Description', 'unit_price' => 'Unit Price', 'qty' => 'Qty', 'vat' => 'VAT', 'total' => 'Total', 'subtotal' => 'Subtotal:', 'discount' => 'Discount', 'grand_total' => 'TOTAL:', 'thank_you' => 'Thank you for your business!', 'generated_by' => 'Generated by Bilpleie System', ], 'no' => [ 'invoice' => 'FAKTURA', 'invoice_number' => 'Fakturanummer:', 'date' => 'Dato:', 'customer' => 'Kunde:', 'payment_status' => 'Betalingsstatus:', 'payment_method' => 'Betalingsmåte:', 'due_date' => 'Forfallsdato:', 'description' => 'Beskrivelse', 'unit_price' => 'Enhetspris', 'qty' => 'Antall', 'vat' => 'Mva', 'total' => 'Sum', 'subtotal' => 'Netto:', 'discount' => 'Rabatt', 'grand_total' => 'Å BETALE:', 'thank_you' => 'Takk for handelen!', 'generated_by' => 'Generert av Bilpleie System', ], ]; $t = $translations[$lang] ?? $translations['en']; @endphp
| {{ $t['invoice_number'] }} | {{ $order->order_number }} | {{ $t['date'] }} | {{ $order->created_at->format('d M Y') }} | ||
| {{ $t['customer'] }} | {{ $order->customer->getFullName() }} | {{ $t['payment_status'] }} | {{ $order->payment_status->label() }} | ||
| {{ $t['payment_method'] }} | {{ $order->payment_method->label() }} | @if($order->payment_method->value === 'postpaid' && $order->postpaid_deadline){{ $t['due_date'] }} | {{ $order->postpaid_deadline->format('d M Y') }} | @else@endif |
| {{ $t['description'] }} | {{ $t['unit_price'] }} | {{ $t['qty'] }} | {{ $t['vat'] }} | {{ $t['total'] }} |
|---|---|---|---|---|
|
@foreach($order->washCategories as $category)
{{ $category->name }}@if(!$loop->last), @endif
@endforeach
{{ $vehicle->getDisplayName() }} - {{ $vehicle->plate_number }}
|
{{ $order->company->formatPrice($vehicle->pivot->subtotal) }} | 1 | {{ $vatPercent }}% | {{ $order->company->formatPrice($vehicle->pivot->subtotal + $vehicle->pivot->vat_value) }} |
| {{ $t['subtotal'] }} | {{ $order->company->formatPrice($order->subtotal) }} |
| {{ $t['discount'] }} @if($order->coupon_code)({{ $order->coupon_code }})@endif: | -{{ $order->company->formatPrice($order->discount_amount) }} |
| {{ $t['vat'] }} ({{ $vatPercent }}%): | {{ $order->company->formatPrice($order->vat_value) }} |
| {{ $t['grand_total'] }} | {{ $order->company->formatPrice($order->total) }} |