{{-- Header --}}
@if(!empty($setting->logo))
@endif @if(!empty($setting->company_name_ar))
{{ $setting->company_name_ar }}
@endif
{{ $setting->CompanyName }}
@if(!empty($setting->CompanyAdress))
{{ $setting->CompanyAdress }}
@endif @if(!empty($setting->CompanyPhone))
{{ $setting->CompanyPhone }}
@endif @if(!empty($setting->email))
{{ $setting->email }}
@endif @if(!empty($setting->vat_number))
الرقم الضريبي / Vat No : {{ $setting->vat_number }}
@endif
فاتورة ضريبية مبسطة
Simplified Tax Invoice
{{-- Info Rows --}}
Invoice No {{ $sale->Ref }} رقم الفاتورة
Date {{ $sale->date }} {{ $sale->time }} تاريخ
@if($sale->user)
Seller {{ $sale->user->username }} البائع
@endif @if($sale->client)
Customer {{ $sale->client->name }} العميل
@endif @if($sale->warehouse)
Warehouse {{ $sale->warehouse->name }} المستودع
@endif
{{-- Items --}} @foreach($details as $d) @endforeach
Product / المنتج Qty / كمية Rate / معدل Amount / مجموع
{{ $d['name'] }} {{ number_format($d['quantity'], 2) }} {{ $d['unit_sale'] }} {{ number_format($d['total'] / max($d['quantity'], 1), 2) }} {{ number_format($d['total'], 2) }}
{{-- Totals --}} @php $subtotal = collect($details)->sum('total'); $taxNet = (float) $sale->TaxNet; $discount = (float) $sale->discount; $discountMethod = $sale->discount_Method ?? '2'; $shipping = (float) $sale->shipping; $grandTotal = (float) $sale->GrandTotal; $paidAmount = (float) $sale->paid_amount; $due = $grandTotal - $paidAmount; if ($discountMethod === '1') { $discountAmount = ($subtotal + $taxNet + $shipping) * $discount / (100 + $discount); } else { $discountAmount = $discount; } @endphp @if($taxNet > 0) @endif @if($discountAmount > 0) @endif @if($shipping > 0) @endif
Sub Total : {{ $symbol }} {{ number_format($subtotal, 2) }} المجموع الفرعي
VAT : {{ $symbol }} {{ number_format($taxNet, 2) }} قيمة الضريبة
Discount : {{ $symbol }} {{ number_format($discountAmount, 2) }} تخفيض
Shipping : {{ $symbol }} {{ number_format($shipping, 2) }} الشحن
Grand Total : {{ $symbol }} {{ number_format($grandTotal, 2) }} المبلغ الإجمالي
@if($due > 0.01) @endif
Paid Amount : {{ $symbol }} {{ number_format($paidAmount, 2) }} المبلغ المدفوع
Balance : {{ $symbol }} {{ number_format($due, 2) }} الرصيد
{{-- Payment Status Badge --}}
@if($due <= 0.01) Paid / مدفوع @elseif($paidAmount > 0) Partial / جزئي @else Unpaid / غير مدفوع @endif
{{-- Payments --}} @if($payments->count() > 0) @foreach($payments as $p) @endforeach
Paid By / طريقة الدفع Amount / المبلغ Change / الباقي
{{ $p->payment_method ? $p->payment_method->name : '---' }} {{ number_format($p->montant, 2) }} {{ number_format($p->change, 2) }}
@endif