@php $storeName = \App\Models\Setting::get('store_name', 'Gestock Pro'); $storeLogo = \App\Models\Setting::get('store_logo'); $currency = currency_symbol(); $locale = app()->getLocale(); $isRTL = $locale === 'ar'; $dir = $isRTL ? 'rtl' : 'ltr'; $dateFrom = $request->filled('date_from') ? $request->date_from : now()->startOfMonth()->format('Y-m-d'); $dateTo = $request->filled('date_to') ? $request->date_to : now()->endOfMonth()->format('Y-m-d'); $statusFilter = $request->filled('status') ? $request->status : trans('messages.all_status'); @endphp {{ trans('messages.sales_report_title') }}
@if($storeLogo) {{ $storeName }} @else

{{ $storeName }}

@endif

{{ trans('messages.sales_report_title') }}

{{ trans('messages.from_date') }}: {{ $dateFrom }}

{{ trans('messages.to_date') }}: {{ $dateTo }}

{{ trans('messages.status') }}: {{ is_string($statusFilter) ? $statusFilter : trans('messages.' . $statusFilter) }}

{{ trans('messages.date') }}: {{ now()->format('Y-m-d H:i') }}

{{ trans('messages.total_sales') }}

{{ $currency }} {{ number_format($totalSales, 2) }}

{{ trans('messages.total') }} {{ trans('messages.paid') }}

{{ $currency }} {{ number_format($totalPaid, 2) }}

{{ trans('messages.total') }} {{ trans('messages.due') }}

{{ $currency }} {{ number_format($totalDue, 2) }}

{{ trans('messages.total_profit') }}

{{ $currency }} {{ number_format($totalProfit, 2) }}
@forelse($invoices as $invoice) @empty @endforelse
{{ trans('messages.invoice_number') }} {{ trans('messages.date') }} {{ trans('messages.customer') }} {{ trans('messages.total') }} {{ trans('messages.paid') }} {{ trans('messages.due') }} {{ trans('messages.profit') }} {{ trans('messages.status') }}
{{ $invoice->invoice_number }} {{ $invoice->created_at->format('Y-m-d') }} {{ $invoice->customer?->name ?? $invoice->customer_name }} {{ $currency }} {{ number_format($invoice->total, 2) }} {{ $currency }} {{ number_format($invoice->paid_amount, 2) }} {{ $currency }} {{ number_format($invoice->due_amount, 2) }} {{ $currency }} {{ number_format($invoice->profit, 2) }} @php $badgeClass = match($invoice->status) { 'paid' => 'success', 'partially_paid' => 'warning', 'draft' => 'secondary', 'returned' => 'danger', default => 'info' }; @endphp {{ trans('messages.' . $invoice->status) }}
{{ trans('messages.no_invoices_found') }}