@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); } $catLabel = 'كل المصروفات'; if (!empty($categoryId) && (int)$categoryId) { $c = $categories->firstWhere('id', (int)$categoryId); $catLabel = $c ? $c->name : ('مصروف #' . (int)$categoryId); } $subLabel = 'كل التفاصيل'; if (!empty($subId) && (int)$subId) { $sc = $subcats->firstWhere('id', (int)$subId); $subLabel = $sc ? $sc->name : ('تفصيل #' . (int)$subId); } @endphp
الرئيسية
@csrf
تقرير شامل تقرير المبيعات تقرير المشتريات تقرير المصروفات
{{ $businessName }}
تقرير المصروفات
الفترة: {{ $from }} → {{ $to }}
الفرع: {{ $branchLabel }}
المصروف: {{ $catLabel }}
التفصيل: {{ $subLabel }}
@if(!empty($q))
بحث: {{ $q }}
@endif
طبع بواسطة: {{ $printedBy }}
تاريخ الطباعة: {{ $printedAt }}
قبل الضريبة
{{ number_format((float)($totals->subtotal ?? 0), 2) }}
الضريبة
{{ number_format((float)($totals->vat_amount ?? 0), 2) }}
الإجمالي
{{ number_format((float)($totals->total ?? 0), 2) }}
@forelse($rows as $r) @empty @endforelse
التاريخ الفرع المصروف التفصيل رقم الفاتورة قبل الضريبة الضريبة الإجمالي ملاحظات
{{ \Carbon\Carbon::parse($r->bill_date)->format('d/m/Y') }} {{ $r->branch_no }} - {{ $r->branch_name }} {{ $r->category_name ?? '' }} {{ $r->subcategory_name ?? '' }} {{ $r->bill_no ?? ($r->inv_no_branch ?? '') }} {{ number_format((float)($r->subtotal ?? 0), 2) }} {{ number_format((float)($r->vat_amount ?? 0), 2) }} {{ number_format((float)($r->total ?? 0), 2) }} {{ $r->notes ?? '' }}
لا توجد بيانات