{{ __('Customer Summary') }}

{{ __('Search Customer') }} @include('livewire.partials.customer-search')
@if (!empty($info_data)) {{ __('Customer Information') }}
@php $badge = match ($info_data->status) { 'active' => 'bg-success', 'pending' => 'bg-warning text-dark', 'free' => 'bg-info text-dark', default => 'bg-danger', }; @endphp
{{ __('Customer ID') }} {{ $info_data->customer_unique_id }} {{ __('Name') }} {{ $info_data->customer_name }}
{{ __('Billing Type') }} {{ __(ucfirst($info_data->billing->billing_type)) }} {{ __('PPPoE Username') }} {{ $info_data->pppUser->username ?? 'N/A' }}
{{ __('Address') }} @foreach ($info_data->customerAddress as $address) {{ $address->input_type_dropdown }}, {{ $address->input_type_test }} @if ($address->input_type_textarea) | {{ $address->input_type_textarea }} @endif @endforeach
{{ __('Status') }} {{ __(ucfirst($info_data->status)) }} {{ __('Expire Date') }} {{ \Carbon\Carbon::parse($this->info_data->billing->auto_disable_date)->format('d-M-Y') }}
@endif
@if (!empty($info_data))
{{ __('Customer Payment Ledger') }}
@foreach ($info_data->paymentSummary->sortByDesc('summary_date') as $paymentSummary) @php $collectionStartDate = \Carbon\Carbon::parse( $paymentSummary->summary_date, )->startOfMonth(); $collectionEndDate = \Carbon\Carbon::parse( $paymentSummary->summary_date, )->endOfMonth(); $collections = $info_data->collectionSummary ->whereBetween('collection_date', [ $collectionStartDate, $collectionEndDate, ]) ->values() ->toArray(); $bill_amount = $paymentSummary->monthly_rent + $paymentSummary->additional_charge + $paymentSummary->previous_due - ($paymentSummary->discount + $paymentSummary->advance); @endphp @if ($collections) @foreach ($collections as $collection) @endforeach @else @endif @endforeach
{{ __('Date') }} {{ __('Monthly Rent') }} {{ __('Discount') }} {{ __('Advance') }} {{ __('Add. Charge') }} {{ __('Vat (%)') }} {{ __('Previous Due') }} {{ __('Bill Amount') }} {{ __('Collection Amount') }} {{ __('Total Due') }}
{{ \Carbon\Carbon::parse($paymentSummary->summary_date)->format('d-M-Y') }} {{ $paymentSummary->monthly_rent }} {{ $paymentSummary->discount }} {{ $paymentSummary->advance }} {{ $paymentSummary->additional_charge }} {{ $paymentSummary->vat }}% {{ $paymentSummary->previous_due }} {{ $bill_amount }} - -
{{ date('d-M-Y', strtotime($collection['collection_date'])) }} {{ __('Collected By:') }} {{ $collection['collected_by'] }} {{ $collection['collection_amount'] }} {{ $bill_amount - $collection['collection_amount'] }}
{{ __('No Collection') }} 0 {{ $bill_amount }}
@endif
@push('styles') @endpush @push('scripts') @endpush