@if(($filters['display']??'grouped')==='detailed')@endif@forelse($products as $p)@if(($filters['display']??'grouped')==='detailed')@endif@empty@endforelse@foreach(['USD','SSP'] as $c)@php($rows=$products->where('currency',$c))@if($rows->isNotEmpty())@endif @endforeach
DateInvoiceCodeProductQty SoldCurrencyAverage S.PriceTotal SalesTotal CostGross Profit
{{ $p->sold_at }}{{ $p->reference }}{{ $p->barcode }}{{ $p->name }}{{ number_format($p->quantity,2) }}{{ $p->currency }}{{ number_format($p->quantity>0?$p->total/$p->quantity:0,2) }}{{ number_format($p->total,2) }}{{ $p->cost===null?'Not recorded':number_format($p->cost,2) }}{{ $p->profit===null?'Not available':number_format($p->profit,2) }}
No product sales in this period.
Totals{{ number_format($rows->sum('quantity'),2) }}{{ $c }}{{ number_format($rows->sum('total'),2) }}{{ $rows->contains(fn($x)=>$x->cost===null)?'Incomplete history':number_format($rows->sum('cost'),2) }}{{ $rows->contains(fn($x)=>$x->profit===null)?'Incomplete history':number_format($rows->sum('profit'),2) }}
@if($products->contains(fn($x)=>$x->cost===null))
Some older sales have no recorded cost per product. Their historical profit is left unavailable rather than calculated using today’s buying prices.
@endif