Total Sales{{ \App\Models\SystemSetting::formatMoney($sales->sum('total')) }}
Gross Profit{{ \App\Models\SystemSetting::formatMoney($sales->sum('total')-$sales->sum('cost')) }}
Expenses{{ \App\Models\SystemSetting::formatMoney($expenses->sum('amount')) }}
Net Profit{{ \App\Models\SystemSetting::formatMoney($sales->sum('total')-$sales->sum('cost')-$moves->sum('loss')-$expenses->sum('amount')) }}
@else
{{ auth()->user()->branch?->name }}
{{ ['restocking'=>'Supplier Restocking Report','stock_movement'=>'Stock Movement by Product','sales_product'=>'Sales by Product'][request('report')] }}
{{ $from }} to {{ $to }}@if($gasReport['selected']) · {{ $gasReport['selected']->name }}@endif
@if(request('report')==='sales_product')
Total Sales{{ \App\Models\SystemSetting::formatMoney($gasReport['productSales']->sum('total')) }}
Total Profit{{ \App\Models\SystemSetting::formatMoney($gasReport['productSales']->sum('profit')) }}
| Product | Sale Type | Quantity Sold | Total Cost | Total Sales | Profit |
@forelse($gasReport['productSales'] as $row)| {{ $row->name }} | {{ $row->action==='exchange'?'Refill':($row->action==='full'?'Outright sale':'Accessory') }} | {{ $row->qty }} | {{ \App\Models\SystemSetting::formatMoney($row->cost) }} | {{ \App\Models\SystemSetting::formatMoney($row->total) }} | {{ \App\Models\SystemSetting::formatMoney($row->profit) }} |
@empty| No sales for these dates. |
@endforelse
| Totals | {{ $gasReport['productSales']->sum('qty') }} | {{ \App\Models\SystemSetting::formatMoney($gasReport['productSales']->sum('cost')) }} | {{ \App\Models\SystemSetting::formatMoney($gasReport['productSales']->sum('total')) }} | {{ \App\Models\SystemSetting::formatMoney($gasReport['productSales']->sum('profit')) }} |
|---|
@elseif(request('report')==='restocking')
| Ref. | Date | Product | Received | Empties Issued | Total Cost | Supplier / Reference | Received By |
@forelse($gasReport['restocks'] as $row)| ST{{ str_pad($row->id,6,'0',STR_PAD_LEFT) }} | {{ $row->created_at }} | {{ $row->name }} | {{ max(0,$row->full_change)+max(0,$row->empty_change)+max(0,$row->quantity_change) }} | {{ max(0,-$row->empty_change) }} | {{ \App\Models\SystemSetting::formatMoney($row->cost) }} | {{ $row->note }} | {{ $row->user_name }} |
@empty| No supplier restocking for these dates. |
@endforelse
| Total Cost | {{ \App\Models\SystemSetting::formatMoney($gasReport['restocks']->sum('cost')) }} | |
|---|
@elseif(request('report')==='stock_movement')
@if(!$gasReport['selected'])
Select a product above to view its movements.
@else
| Date | Ref. | Activity | Full Change | Empty Change | Accessory Change | Full Balance | Empty Balance | Accessory Balance | Reference / Customer |
| {{ $from }} | | Opening Stock | | | | {{ $gasReport['opening'][0] }} | {{ $gasReport['opening'][1] }} | {{ $gasReport['opening'][2] }} | |
@foreach($gasReport['movement'] as $row)| {{ $row['time'] }} | {{ $row['reference'] }} | {{ $row['activity'] }} | {{ $row['delta'][0] }} | {{ $row['delta'][1] }} | {{ $row['delta'][2] }} | {{ $row['balance'][0] }} | {{ $row['balance'][1] }} | {{ $row['balance'][2] }} | {{ $row['note'] }} |
@endforeach
| Closing Stock | {{ $gasReport['closing'][0]-$gasReport['opening'][0] }} | {{ $gasReport['closing'][1]-$gasReport['opening'][1] }} | {{ $gasReport['closing'][2]-$gasReport['opening'][2] }} | {{ $gasReport['closing'][0] }} | {{ $gasReport['closing'][1] }} | {{ $gasReport['closing'][2] }} | |
|---|
@endif
@endif
@endif
@endif