{{-- PAGE HEAD --}}
Utilities & Detergents
{{ $start->format('d M Y') }} – {{ $end->format('d M Y') }}
โ Reports
{{-- FILTER --}}
{{-- KPI STRIP --}}
Grand Total
KSh {{ number_format($grandTotal, 0) }}
Utilities + Detergents
โก Electricity
KSh {{ number_format($electricityTotal, 0) }}
{{ $electricityTokens > 0 ? number_format($electricityTokens, 1).' kWh' : $electricity->count().' entries' }}
๐ง Water
KSh {{ number_format($waterTotal, 0) }}
{{ $waterUnits > 0 ? number_format($waterUnits, 1).' mยณ' : $water->count().' entries' }}
๐งด Detergents
KSh {{ number_format($totalDetergents, 0) }}
{{ $detergents->count() }} purchases
@if($otherUtilities->isNotEmpty())
๐ Other Utilities
KSh {{ number_format($otherUtilities->sum('amount'), 0) }}
{{ $otherUtilities->count() }} entries
@endif
{{-- CHARTS ROW --}}
6-Month Spend Trend utilities vs detergents
Spend Breakdown this period
{{-- ELECTRICITY --}}
โก Electricity
@if($electricityTokens > 0)
{{ number_format($electricityTokens,1) }} kWh total
@endif
KSh {{ number_format($electricityTotal, 2) }}
@if($electricity->isEmpty())
No electricity records in this period.
@else
| Date | Token / Ref | Provider |
kWh | Amount |
Bal. Remaining | Status |
@foreach($electricity as $e)
@php $m = $e->meta ?? []; $st = $e->status; @endphp
| {{ $e->expense_date->format('d M Y') }} |
{{ $m['tokens'] ?? ($e->description ?? 'โ') }} |
{{ $m['provider'] ?? 'โ' }} |
{{ isset($m['units']) ? number_format($m['units'],1) : 'โ' }} |
KSh {{ number_format($e->amount, 2) }} |
@if(isset($m['remaining_balance']))
KSh {{ number_format($m['remaining_balance'],2) }}
@else โ @endif
|
{{ $st }} |
@endforeach
| Total |
KSh {{ number_format($electricityTotal,2) }} |
|
@endif
{{-- WATER --}}
๐ง Water
@if($waterUnits > 0)
{{ number_format($waterUnits,1) }} mยณ total
@endif
KSh {{ number_format($waterTotal, 2) }}
@if($water->isEmpty())
No water records in this period.
@else
| Date | Description |
mยณ | Amount |
Bal. Remaining | Status |
@foreach($water as $e)
@php $m = $e->meta ?? []; $st = $e->status; @endphp
| {{ $e->expense_date->format('d M Y') }} |
{{ Str::limit($e->description ?? 'โ', 40) }} |
{{ isset($m['units']) ? number_format($m['units'],1) : 'โ' }} |
KSh {{ number_format($e->amount, 2) }} |
@if(isset($m['remaining_balance']))
KSh {{ number_format($m['remaining_balance'],2) }}
@else โ @endif
|
{{ $st }} |
@endforeach
| Total |
KSh {{ number_format($waterTotal,2) }} |
|
@endif
{{-- OTHER UTILITIES --}}
@if($otherUtilities->isNotEmpty())
๐ Other Utilities
KSh {{ number_format($otherUtilities->sum('amount'), 2) }}
| Date | Type | Description |
Amount | Status |
@foreach($otherUtilities as $e)
@php $st = $e->status; @endphp
| {{ $e->expense_date->format('d M Y') }} |
{{ $e->sub_category ?? 'โ' }} |
{{ Str::limit($e->description ?? 'โ', 50) }} |
KSh {{ number_format($e->amount, 2) }} |
{{ $st }} |
@endforeach
| Total |
KSh {{ number_format($otherUtilities->sum('amount'),2) }} |
|
@endif
{{-- DETERGENTS --}}
๐งด Detergents & Chemicals
KSh {{ number_format($totalDetergents, 2) }}
{{-- Type pills --}}
@if($detergentByType->isNotEmpty())
@foreach($detergentByType as $type => $data)
{{ $type }}
{{ $data['count'] }}
KSh {{ number_format($data['amount'],0) }}
@endforeach
{{-- Detergent bar chart --}}
@endif
@if($detergents->isEmpty())
No detergent records in this period.
@else
| Date | Product | Type |
Qty | Unit Price |
Total | Supplier | Status |
@foreach($detergents as $e)
@php $m = $e->meta ?? []; $st = $e->status; @endphp
| {{ $e->expense_date->format('d M Y') }} |
{{ $m['product_name'] ?? ($e->description ?? 'โ') }} |
{{ $m['detergent_type'] ?? ($e->sub_category ?? 'โ') }} |
{{ isset($m['quantity']) ? $m['quantity'].' '.($m['unit'] ?? '') : 'โ' }} |
{{ isset($m['unit_price']) ? 'KSh '.number_format($m['unit_price'],2) : 'โ' }} |
KSh {{ number_format($e->amount, 2) }} |
{{ $m['supplier'] ?? 'โ' }} |
{{ $st }} |
@endforeach
| Total |
KSh {{ number_format($totalDetergents,2) }} |
|
@endif