@extends('layouts.app') @section('title',$sale->invoice_no) @section('content')

{{ $sale->invoice_no }}

{{ strtoupper($sale->status) }}

{{ $sale->invoice_date->format('d F Y') }} · {{ str_replace('_',' ',ucfirst($sale->invoice_type)) }}

@if($sale->status==='draft')
@csrf
@elseThermalA4 PrintPDFCreate return@endif
Invoice items{{ $sale->items->count() }} line(s)
@if($sale->invoice_type!=='non_tax_invoice')@endif@foreach($sale->items as $i=>$item)@if($sale->invoice_type!=='non_tax_invoice')@endif@endforeach
#Description / الوصفUnitQtyPrice{{ $sale->invoice_type==='non_tax_invoice'?'Amount':'Taxable' }}VATTotal
{{ $i+1 }}{{ $item->product_name_en_snapshot }}{{ $item->product_name_ar_snapshot }}{{ $item->unit_snapshot }}{{ number_format((float)$item->quantity,4) }}{{ number_format((float)$item->unit_price,2) }}{{ number_format((float)$item->taxable_amount,2) }}{{ number_format((float)$item->vat_amount,2) }}{{ number_format((float)$item->line_total,2) }}
Customer
{{ $sale->customer->name_en }}
{{ $sale->customer->name_ar }}
{{ $sale->customer->customer_code }}@if($sale->invoice_type!=='non_tax_invoice') · VAT {{ $sale->customer->vat_number?:'Not registered' }}@endif
{{ $sale->warehouse->code }} · {{ $sale->warehouse->name_en }}
Gross{{ number_format((float)$sale->gross_total,2) }}
Discount{{ number_format((float)$sale->discount_total,2) }}
{{ $sale->invoice_type==='non_tax_invoice'?'Subtotal':'Taxable' }}{{ number_format((float)$sale->taxable_total,2) }}
@if($sale->invoice_type!=='non_tax_invoice')
VAT{{ number_format((float)$sale->vat_total,2) }}
@endif
Grand totalSAR {{ number_format((float)$sale->grand_total,2) }}
Paid{{ number_format((float)$sale->paid_total,2) }}
Balance{{ number_format((float)$sale->balance_total,2) }}
@if(auth()->user()->hasPermission('sales.view_profit'))
Gross profit{{ number_format((float)$sale->profit_total,2) }}
@endif
@if($sale->payments->count())
Payments
@foreach($sale->payments as $payment)
{{ ucfirst($payment->payment_method) }}{{ number_format((float)$payment->amount,2) }}
@endforeach
@endif
@endsection