@can('dashboard-billing-info')

Report Manager wise (only own) of Monthly Generated Bill Collection {{ date('M') }} {{ date('Y') }}

@php $dueClients = 0; $dueAmounts = 0; $clientscount = 0; $totalBill = 0; // $totalAdjustment = 0; $totalPaid = 0; $totalDiscount = 0; @endphp {{-- {{ dd($resellers)}} --}} @foreach ($resellers->where('reseller_type', 'own') as $reseller) @php $rTotalClient = 0; $rTotalBill = 0; $rTotalPaid = 0; $rTotalDueAmount = 0; $rTotaldueClient = 0; $rTotalDiscount = 0; @endphp @foreach ($popWiseBillReport->where('reseller_id', $reseller->id) as $item) @php $totalBill += $item->total_bill; $clientscount += $item->total_row; $dueClients += $item->not_paid; $dueAmounts += $item->total_bill - $item->total_paid; $totalPaid += $item->total_paid; $totalDiscount += $item->total_discount; $rTotalClient += $item->total_row; $rTotalBill += $item->total_bill; $rTotalPaid += $item->total_paid; $rTotalDueAmount += $item->total_bill - $item->total_paid; $rTotaldueClient += $item->not_paid; $rTotalDiscount += $item->total_discount; @endphp @endforeach @endforeach
Manager Bill Client Bill Amount Received Client Received Amount Discount Amount Collection(%) Dues Clients Dues Amount
{{ $reseller->name }} {{ $rTotalClient }} {{ $rTotalBill }} {{ $rTotalClient - $rTotaldueClient }} {{ $rTotalPaid - $rTotalDiscount }} {{ $rTotalDiscount }} @if ($rTotalPaid != 0 && $rTotalBill != 0) {{ round(($rTotalPaid * 100) / $rTotalBill, 2) }}% @else 0% @endif {{ $rTotaldueClient ?? 0 }} {{ $rTotalBill - $rTotalPaid }}
Total {{ $clientscount }} {{ $totalBill }} {{ $clientscount - $dueClients }} {{ round($totalPaid) - round($totalDiscount) }} {{ round($totalDiscount) }} @if ($totalBill != 0) {{ number_format(($totalPaid * 100) / $totalBill, 2) }} % @else 0% @endif {{ $dueClients }} {{ round($dueAmounts) }}
@endcan