@php $adminProfile = $admin ?? \App\Models\Admin::query()->find(session('admin_id')); $shopName = $adminProfile?->display_shop_name ?: ($adminProfile?->shop_name ?: ($adminProfile?->name ?? config('app.name', 'Easy IMS'))); $dateFrom = \Illuminate\Support\Carbon::parse($report['from_date']); $dateTo = \Illuminate\Support\Carbon::parse($report['to_date']); @endphp

{{ $shopName }}

@if ($adminProfile?->display_address || $adminProfile?->phone)
{{ $adminProfile?->display_address }} @if ($adminProfile?->display_address && $adminProfile?->phone)   |   @endif {{ $adminProfile?->phone }}
@endif

{{ __('Daily Activity Report') }}

{{ __('From Date') }}: {{ $dateFrom->format('d-M-Y') }} {{ __('To Date') }}: {{ $dateTo->format('d-M-Y') }} {{ __('Generated') }}: {{ \Illuminate\Support\Carbon::parse($report['generated_at'])->format('d-M-Y h:i A') }}
@foreach ([ __('Total Sale') => $report['total_sales'], __('Total Sale Return') => $report['total_sale_returns'], __('Total Discount') => $report['total_discount'], __('Total Cash in Hand') => $report['cash_in_hand'], __('Total Profit on Sale') => $report['total_profit'], __('Total Due Sale') => $report['total_due_sale'], __('Total Invoices') => $report['invoice_count'], __('Total Units') => $report['total_units'], ] as $label => $value)
{{ $label }}{{ number_format((float) $value, $label === __('Total Invoices') ? 0 : 2) }}
@endforeach

{{ __('Purchases List') }}

@forelse ($report['purchases'] as $purchase) @empty @endforelse
{{ __('Date') }}{{ __('Invoice') }}{{ __('Supplier') }}{{ __('Total') }}{{ __('Paid') }}{{ __('Due') }}
{{ \Illuminate\Support\Carbon::parse($purchase->purchase_date)->format('d-M-Y') }} {{ $purchase->invoice_no ?: '-' }} {{ $purchase->supplier?->display_name ?? __('Supplier') }} {{ number_format((float) $purchase->grand_total, 2) }} {{ number_format((float) ($purchase->received_amount ?? 0), 2) }} {{ number_format((float) $purchase->remaining_amount, 2) }}
{{ __('No purchases found for selected filters.') }}

{{ __('Due Sale Clients List') }}

@forelse ($report['due_clients'] as $client) @empty @endforelse
{{ __('Customer') }}{{ __('Phone') }}{{ __('Invoices') }}{{ __('Due') }}
{{ $client['name'] }}{{ $client['phone'] }}{{ number_format($client['invoice_count']) }}{{ number_format($client['due'], 2) }}
{{ __('No due sale clients found.') }}

{{ __('Sale Product Qty') }}

@forelse ($report['product_sales'] as $product) @empty @endforelse
{{ __('Product') }}{{ __('Quantity') }}
{{ $product['name'] }}{{ number_format($product['quantity'], 2) }}
{{ __('No sold products found.') }}