@extends('layout.app') @section('content')

Note: Those customers who already paid this month are not on this list.

@php $totalRunningMonthDue = 0; $totalPreviousDue = 0; @endphp @foreach ($clients as $client) @php $totalRunningMonthDue += $client->thisMonthBill->sum('bill_amount'); $totalPreviousDue += $client->customerAccount->dueAmount - $client->thisMonthBill->sum('bill_amount'); @endphp @endforeach

Total Row: {{ $clients->count() }}

Total Runnign Month Due {{$totalRunningMonthDue}}

Total Previous Due: {{$totalPreviousDue}}

Total Due: {{$totalPreviousDue + $totalRunningMonthDue}}

{{-- @dd($clients) --}} @foreach ($clients as $client) @endforeach
Id User Id Status Expire Date Clietn Name Mobile Runnign Month Due Previous Due
{{$client->id}} {{$client->userid}} {{$client->clients_status }} {{$client->expire_date}} {{$client->clientsinfo->clients_name }} {{$client->clientsinfo->contact_no }} {{$client->thisMonthBill->sum('bill_amount') }} {{ $client->customerAccount->dueAmount - $client->thisMonthBill->sum('bill_amount') }}
Total {{$totalRunningMonthDue}} {{$totalPreviousDue}}
@endsection @section('ajax') @endsection