{{-- جزء مشترك لتقارير المبيعات حسب طريقة الدفع (نقدي / شبكة / آجل) المتغيرات: $reportTitle (عنوان التقرير)، $Invoices (نتائج البحث - اختياري) --}} @extends('layouts.master') @section('css') @endsection @section('title') {{ $reportTitle }} @endsection @section('page-header') @endsection @section('content') @php $isAr = app()->getLocale() == 'ar'; $searched = request()->filled('start_at') && request()->filled('end_at'); @endphp @if ($errors->any()) @endif
@include('partials.excel-button')
@if ($searched && isset($Invoices)) @php $avt = App\Models\Avt::find(1); $saleavt = $avt ? $avt->AVT : 0; $totalprice = 0; $totaldiscount = 0; $totaltax = 0; @endphp
@foreach ($Invoices as $invoice) @php $net = $invoice->Price - $invoice->discount; $tax = $net * $saleavt; $totalprice += $net; $totaldiscount += $invoice->discount; $totaltax += $tax; @endphp @endforeach
{{ __('home.Invoice_no') }} {{ __('home.sallerName') }} {{ __('home.clietName') }} {{ __('home.date') }} {{ __('home.branch') }} {{ $isAr ? 'الخصم' : 'Discount' }} {{ __('home.total') }} {{ __('home.operations') }}
{{ $invoice->id }} {{ $invoice->user->name ?? '-' }} {{ $invoice->customer->name ?? '-' }} {{ $invoice->created_at }} {{ $invoice->branch->name ?? '-' }} {{ round($invoice->discount, 2) }} {{ round($net + $tax, 2) }} {{ $isAr ? 'عرض' : 'Show' }}
{{ $isAr ? 'عدد الفواتير' : 'Invoices count' }} {{ count($Invoices) }}
{{ $isAr ? 'إجمالي الخصم' : 'Total discount' }} {{ round($totaldiscount, 2) }}
{{ $isAr ? 'الإجمالي بدون ضريبة' : 'Total before tax' }} {{ round($totalprice, 2) }}
{{ __('report.totaltax') }} {{ round($totaltax, 2) }}
{{ $isAr ? 'الإجمالي شامل الضريبة' : 'Grand total (incl. tax)' }} {{ round($totalprice + $totaltax, 2) }}
@endif
@endsection @section('js') @endsection