Product Wise Sale Report

@if($product)

Product: {{ $product->barcode }} - {{ $product->name }}

@endif
Run time: {{ $runAt->format('Y-m-d h:i A') }}
User: {{ auth()->user()->name ?? 'System' }}
Duration: {{ $startDate }} to {{ $endDate }}
@foreach($rows as $idx => $row) @php $profit = (float)$row->income - (float)$row->cost; @endphp @endforeach @php $totalProfit = $totals['income'] - $totals['cost']; @endphp
No. Date Total Product Cost Income Profit
{{ $idx + 1 }} {{ $row->date }} {{ number_format($row->qty, 2) }} {{ number_format($row->cost, 2) }} {{ number_format($row->income, 2) }} {{ number_format($profit, 2) }}
Total Amount {{ number_format($totals['qty'], 2) }} {{ number_format($totals['cost'], 2) }} {{ number_format($totals['income'], 2) }} {{ number_format($totalProfit, 2) }}