@foreach($billData as $billItem) @php $bill = $billItem['bill']; $customer = $billItem['customer']; $billLines = $billItem['billLines']; $totalBillAmount = $billItem['totalBillAmount']; $totalAmount = $billItem['totalAmount']; @endphp @php // Format the company address $companyAddress = []; if (!empty($company->Address1)) $companyAddress[] = $company->Address1; if (!empty($company->Address2)) $companyAddress[] = $company->Address2; @endphp

C/o

{{ $company->CompanyName ?? 'HassConsult Limited' }}

@if(!empty($companyAddress)) {{ implode(', ', $companyAddress) }} @else P.O. Box 14090-00800 Nairobi @endif

@if(!empty($company->TelNo))

Tel: {{ $company->TelNo }}

@endif @if(!empty($company->Email))

Email: {{ $company->Email }}

@endif
Recovery of Electricity Charges
To
{{ $customer->TenantName ?? $customer->customer_name ?? 'N/A' }}
@if(!empty($customer->TenantName) && !empty($customer->customer_name)) C/O {{ $customer->customer_name }}
@endif @if(!empty($customer->TelNo)) Tel: {{ $customer->TelNo }}
@endif {{ $customer->AddressLine ?? ($customer->Address1 ?? '') }} @if(!empty($customer->Address2))
{{ $customer->Address2 }} @endif
BILL No. {{ $bill->BillNo ?? 'N/A' }}
Account No. {{ $bill->AccountNo ?? ($customer->AccountNo ?? 'N/A') }}
Meter No {{ $bill->EMeterNo ?? ($customer->EMeterNo ?? 'N/A') }}
Billing Date {{ $bill->BillingDate ? \Carbon\Carbon::parse($bill->BillingDate)->format('d/m/Y') : 'N/A' }}
Billing Period {{ $bill->BillingPeriod ? \Carbon\Carbon::createFromFormat('Ym', $bill->BillingPeriod)->format('M Y') : 'N/A' }}
CONSUMPTION DATA BILLING DETAILS
@if(isset($billLines) && count($billLines) > 0) @foreach($billLines as $billLine) @endforeach @else @endif
Previous
Reading
Previous
Reading Date
Current
Reading
Current
Reading Date
Consumption
(kWh)
Billing
Concept
Amount
Kshs.

{{ $bill->PrvReading ?? 'N/A' }} {{ $bill->PrvReadingDate ?? 'N/A' }} {{ $bill->CurReading ?? 'N/A' }} {{ $bill->CurReadingDate ?? 'N/A' }} {{ $bill->ConsumptionBilled ?? 'N/A' }}
{{ $billLine->BLineDesc ?? 'N/A' }} {{ number_format($billLine->BLineAmount ?? 0, 2) }}
No billing details available

TOTAL CURRENT BILL {{ number_format($totalBillAmount, 2) }}

TOTAL AMOUNT PAYABLE : {{ number_format($totalBillAmount, 2) }}

The net account balance as at {{ $bill->BillingDate ?? 'N/A' }} is Kshs {{ number_format($totalBillAmount, 2) }} .

Please pay this amount on or before {{ $bill->DueDate ?? 'N/A' }} to avoid disconnection.


Cheques to be made payable to : HassConsult Real Estate Ltd - Watermark

To be attached to payment THE WATERMARK BUSINESS PARK

{{$customer->TenantName ?? $customer->customer_name ?? 'N/A'}}
@if(!empty($customer->TenantName) && !empty($customer->customer_name)) {{ $customer->customer_name }}
@endif @if(!empty($customer->TelNo)) Tel: {{ $customer->TelNo }}
@endif {{ $customer->AddressLine ?? ($customer->Address1 ?? '') }} @if(!empty($customer->Address2))
{{ $customer->Address2 }} @endif
BILL No. {{ $bill->BillNo ?? 'N/A' }}
Account No. {{ $bill->AccountNo ?? ($customer->AccountNo ?? 'N/A') }}
Meter No {{ $bill->EMeterNo ?? ($customer->EMeterNo ?? 'N/A') }}
Amount Due Kshs {{ number_format($totalAmount, 2) }}
Due Date {{ $bill->DueDate ? \Carbon\Carbon::parse($bill->DueDate)->format('d/m/Y') : 'N/A' }}
@endforeach