Sale Report (Product Wise)

Run time: {{ $runAt->format('Y-m-d h:i A') }}
User: {{ auth()->user()->name ?? 'System' }}
Duration: {{ $startDate }} to {{ $endDate }}
@foreach($products as $product) @php $profit = (float)$product->income - (float)$product->cost; @endphp @endforeach @php $netProfit = $totals['income'] - $totals['cost']; @endphp
Barcode Product QTY Income Cost Profit
{{ $product->barcode }} {{ $product->name }} {{ number_format($product->qty, 2) }} {{ number_format($product->income, 2) }} {{ number_format($product->cost, 2) }} {{ number_format($profit, 2) }}
Net Amount {{ number_format($totals['income'], 2) }} {{ number_format($totals['cost'], 2) }} {{ number_format($netProfit, 2) }}