@php $avtSetting = App\Models\Avt::find(1); $avtRate = $avtSetting ? $avtSetting->AVT : 0.15; // الافتراضي 15% إذا لم يوجد @endphp @foreach ($data as $product) @php // حساب الإجماليات والخصومات // الحساب الموحد (نفس الشاشة والطباعة و PDF) $items = App\Models\offer_price_to_customer_items::where('order_id', $product->id)->get(); $totalWithTax = \App\Support\QuotationTotals::calculate($items, $product->discount ?? 0, $avtRate)['grand_total']; @endphp @endforeach
{{ __('home.Invoice_no') }} {{ __('home.clietName') }} {{ __('home.date') }} {{ __('home.branch') }} {{ __('home.total') }} {{ __('home.operations') }}
{{ $product->id }} {{ $product->customer->name }} {{ $product->created_at->format('Y-m-d') }} {{ $product->branch->name }} {{ number_format($totalWithTax, 2) }}
@csrf