@php $company = null; try { $company = \Illuminate\Support\Facades\DB::table('company_settings')->where('id', 1)->first(); } catch (\Throwable $e) { $company = null; } $businessName = $company->business_name ?? 'اسم النشاط التجاري'; $logoUrl = (!empty($company->logo_path)) ? asset('storage/'.$company->logo_path) : null; $printedBy = auth()->check() ? (auth()->user()->name ?? '-') : '-'; $printedAt = now()->format('d/m/Y H:i'); $branchLabel = 'كل الفروع'; if ((int)($branchId ?? 0)) { $b = $branches->firstWhere('id', (int)$branchId); $branchLabel = $b ? ($b->branch_no.' - '.$b->name) : ('فرع #' . (int)$branchId); } $supplierLabel = 'كل الموردين'; if (!empty($supplierId) && (int)$supplierId) { $s = $suppliers->firstWhere('id', (int)$supplierId); $supplierLabel = $s ? $s->name : ('مورد #' . (int)$supplierId); } @endphp
الرئيسية
@csrf
تقرير شامل تقرير المبيعات تقرير المشتريات تقرير المصروفات
{{ $businessName }}
تقرير المشتريات
الفترة: {{ $from }} → {{ $to }}
الفرع: {{ $branchLabel }}
المورد: {{ $supplierLabel }}
@if(!empty($q))
بحث: {{ $q }}
@endif
طبع بواسطة: {{ $printedBy }}
تاريخ الطباعة: {{ $printedAt }}
عدد الفواتير
{{ (int)($totals->invoices_count ?? 0) }}
إجمالي المشتريات
{{ number_format((float)($totals->total ?? 0), 2) }}
@forelse($rows as $r) @empty @endforelse
ID الفرع المورد فاتورة الفرع فاتورة المورد التاريخ قبل الضريبة الضريبة الإجمالي
{{ $r->id }} {{ $r->branch_no }}-{{ $r->branch_name }} {{ $r->supplier_name ?? '' }} {{ $r->inv_no_branch }} {{ $r->supplier_bill_no }} {{ \Carbon\Carbon::parse($r->bill_date)->format('d/m/Y') }} {{ number_format((float)$r->subtotal, 2) }} {{ number_format((float)$r->vat_amount, 2) }} {{ number_format((float)$r->total, 2) }}
لا توجد بيانات