{{-- Header --}}
فاتورة ضريبية مبسطة
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 --}}
| Product / المنتج |
Qty / كمية |
Rate / معدل |
Amount / مجموع |
@foreach($details as $d)
| {{ $d['name'] }} |
{{ number_format($d['quantity'], 2) }} {{ $d['unit_sale'] }} |
{{ number_format($d['total'] / max($d['quantity'], 1), 2) }} |
{{ number_format($d['total'], 2) }} |
@endforeach
{{-- 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
| Sub Total |
: |
{{ $symbol }} {{ number_format($subtotal, 2) }} |
المجموع الفرعي |
@if($taxNet > 0)
| VAT |
: |
{{ $symbol }} {{ number_format($taxNet, 2) }} |
قيمة الضريبة |
@endif
@if($discountAmount > 0)
| Discount |
: |
{{ $symbol }} {{ number_format($discountAmount, 2) }} |
تخفيض |
@endif
@if($shipping > 0)
| Shipping |
: |
{{ $symbol }} {{ number_format($shipping, 2) }} |
الشحن |
@endif
| Grand Total |
: |
{{ $symbol }} {{ number_format($grandTotal, 2) }} |
المبلغ الإجمالي |
| Paid Amount |
: |
{{ $symbol }} {{ number_format($paidAmount, 2) }} |
المبلغ المدفوع |
@if($due > 0.01)
| Balance |
: |
{{ $symbol }} {{ number_format($due, 2) }} |
الرصيد |
@endif
{{-- Payment Status Badge --}}
@if($due <= 0.01)
Paid / مدفوع
@elseif($paidAmount > 0)
Partial / جزئي
@else
Unpaid / غير مدفوع
@endif
{{-- Payments --}}
@if($payments->count() > 0)
| Paid By / طريقة الدفع |
Amount / المبلغ |
Change / الباقي |
@foreach($payments as $p)
| {{ $p->payment_method ? $p->payment_method->name : '---' }} |
{{ number_format($p->montant, 2) }} |
{{ number_format($p->change, 2) }} |
@endforeach
@endif