Utilities & Detergents Report

{{-- PAGE HEAD --}}

Utilities & Detergents

{{ $start->format('d M Y') }} – {{ $end->format('d M Y') }}

โ† Reports
{{-- FILTER --}}
Reset @foreach([ ['This Month', now()->startOfMonth()->format('Y-m-d'), now()->format('Y-m-d')], ['Last Month', now()->subMonth()->startOfMonth()->format('Y-m-d'), now()->subMonth()->endOfMonth()->format('Y-m-d')], ['This Year', now()->startOfYear()->format('Y-m-d'), now()->format('Y-m-d')], ] as [$lbl, $f, $t]) {{ $lbl }} @endforeach
{{-- 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
@foreach($electricity as $e) @php $m = $e->meta ?? []; $st = $e->status; @endphp @endforeach
DateToken / RefProvider kWhAmount Bal. RemainingStatus
{{ $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 }}
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
@foreach($water as $e) @php $m = $e->meta ?? []; $st = $e->status; @endphp @endforeach
DateDescription mยณAmount Bal. RemainingStatus
{{ $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 }}
Total KSh {{ number_format($waterTotal,2) }}
@endif
{{-- OTHER UTILITIES --}} @if($otherUtilities->isNotEmpty())
๐Ÿ”Œ Other Utilities KSh {{ number_format($otherUtilities->sum('amount'), 2) }}
@foreach($otherUtilities as $e) @php $st = $e->status; @endphp @endforeach
DateTypeDescription AmountStatus
{{ $e->expense_date->format('d M Y') }} {{ $e->sub_category ?? 'โ€”' }} {{ Str::limit($e->description ?? 'โ€”', 50) }} KSh {{ number_format($e->amount, 2) }} {{ $st }}
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
@foreach($detergents as $e) @php $m = $e->meta ?? []; $st = $e->status; @endphp @endforeach
DateProductType QtyUnit Price TotalSupplierStatus
{{ $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 }}
Total KSh {{ number_format($totalDetergents,2) }}
@endif
{{-- end ur-container --}}
{{-- end ur-wrap --}} @push('scripts') @endpush