Sale Report (Invoice Wise)

Run time: {{ $runAt->format('Y-m-d h:i A') }}
User: {{ auth()->user()->name ?? 'System' }}
Duration: {{ $startDate }} to {{ $endDate }}
@foreach($rowsByDate as $group)
Date: {{ $group['date'] }}
@foreach($group['lines'] as $line) @endforeach
Invoice User Items Income Cost Profit
{{ $line['invoice_number'] }} {{ $line['user_name'] }} {{ number_format($line['item_count'], 2) }} {{ number_format($line['income'], 2) }} {{ number_format($line['cost'], 2) }} {{ number_format($line['profit'], 2) }}
Sub Amount ({{ $group['date'] }}) {{ number_format($group['sub_amount'], 2) }} {{ number_format($group['sub_cost'], 2) }} {{ number_format($group['sub_amount'] - $group['sub_cost'], 2) }}
@endforeach @php $totalProfit = $totalAmount - $totalCost; @endphp
Net Amount {{ number_format($totalAmount, 2) }} {{ number_format($totalCost, 2) }} {{ number_format($totalProfit, 2) }}