{{-- @include('microfin/miscellaneous/dayEndPendingAlert') --}} @php use Carbon\Carbon; @endphp
{{-- div for Company --}} @php $company = DB::table('gnr_company')->where('id', Auth::user()->company_id_fk)->select('name','address')->first(); $filReportLevel = $filReportLevel ??'Branch'; $filXyzTable = 'gnr_'.strtolower($filReportLevel); $filXyz = ${'fil'.$filReportLevel}; if($filXyz == NULL || $filXyz == '' || $filXyz == 0){ $xyzName = "All"; }else{ $xyzQuery = DB::table($filXyzTable)->where('id', $filXyz)->first(); if($filReportLevel == 'Branch') $xyzCode = $xyzQuery->branchCode; else $xyzCode = $xyzQuery->code; $xyzName = $xyzQuery->name.' & ('.str_pad($xyzCode,3,0,STR_PAD_LEFT).')'; } @endphp {{$company->name}}
{{$company->address}}
MFP Branch Wise Program Report
{{'Date: '.Carbon::parse($dateTo)->format("dS F Y")}}
@if($lastUpdateTime) {{'Last Update: '.$lastUpdateTime}}
@endif @include('microfin/miscellaneous/draftReport', ['filDate' => Carbon::parse($dateTo)->endOfMonth()->format('Y-m-d')])


{{'Reporting '.$filReportLevel.' & Code: '.$xyzName}}
Print Date: {{Carbon::now()->format('d-m-Y')}}
{{--
--}} @php $grossTotalMember = 0; $grossTotalBorrower = 0; $grossTotalSavingsBalance = 0; $grossTotalOtsSavingsBalance = 0; $grossTotalLoanOutstansing = 0; $grossTotalLoanDisbursement = 0; $grossTotalLoanRecovery = 0; $grossTotalRegularRecoverable = 0; $grossTotalRegularRecovery = 0; $grossTotalCurrentMonthDue = 0; $grossTotalCurrentMonthDueLoanee = 0; $grossTotalDue = 0; $grossTotalDueLoanee = 0; $grossTotalBadLoan = 0; $grossTotalBadLoanee = 0; $grossTotalOverdueLoanOutstanding = 0; $grossTotalBCR = 0; $grossTotalPAR = 0; $grossTotalOTR = 0; @endphp @foreach($branchMapingDataWithType['data'] as $key => $data ) @php $totalMember = 0; $totalBorrower = 0; $totalSavingsBalance = 0; $totalOtsSavingsBalance = 0; $totalLoanOutstansing = 0; $totalLoanDisbursement = 0; $totalLoanRecovery = 0; $totalRegularRecoverable = 0; $totalRegularRecovery = 0; $totalCurrentMonthDue = 0; $totalCurrentMonthDueLoanee = 0; $totalDue = 0; $totalDueLoanee = 0; $totalBadLoan = 0; $totalBadLoanee = 0; $totalOverdueLoanOutstanding = 0; $totalBCR = 0; $totalPAR = 0; $totalOTR = 0; $count = 0; @endphp @foreach($data['child'] as $key1 => $childData ) @php $count++; @endphp @if($branchMapingDataWithType['type']== 'area' && isset($data_collect['branchData'][$childData])) @php $totalMember += $data_collect['branchData'][$childData]['member']['current']; $totalBorrower += $data_collect['branchData'][$childData]['borrower']['current']; $totalSavingsBalance += $data_collect['branchData'][$childData]['savingsBalance']['current']; $totalOtsSavingsBalance += $data_collect['branchData'][$childData]['savingsCollection']['current']; $totalLoanOutstansing += $data_collect['branchData'][$childData]['outstanding']['current']; $totalLoanDisbursement += $data_collect['branchData'][$childData]['disbursement']['current']; $totalLoanRecovery += $data_collect['branchData'][$childData]['recovery']['current']; $totalRegularRecoverable += $data_collect['branchData'][$childData]['regularRecoverable']['current']; $totalRegularRecovery += $data_collect['branchData'][$childData]['regularRecovery']['current']; $totalCurrentMonthDue += $data_collect['branchData'][$childData]['currentMonthDue']['current']; $totalCurrentMonthDueLoanee += $data_collect['branchData'][$childData]['currentMonthDue']['loanee']; $totalDue += $data_collect['branchData'][$childData]['totalDue']['current']; $totalDueLoanee += $data_collect['branchData'][$childData]['totalDue']['loanee']; $totalBadLoan += $data_collect['branchData'][$childData]['badLoan']['current']; $totalBadLoanee += $data_collect['branchData'][$childData]['badLoan']['loanee']; $totalOverdueLoanOutstanding += $data_collect['branchData'][$childData]['overduePresentLoan']['current']; @endphp @endif @if($branchMapingDataWithType['type']== 'zone' ) @if(isset($data['data']['area'][$childData])) @php $zoneMember = 0; $zoneBorrower = 0; $zoneSavingsBalance = 0; $zoneOtsSavingsBalance = 0; $zoneLoanOutstansing = 0; $zoneLoanDisbursement = 0; $zoneLoanRecovery = 0; $zoneRegularRecoverable = 0; $zoneRegularRecovery = 0; $zoneCurrentMonthDue = 0; $zoneCurrentMonthDueLoanee = 0; $zonelDue = 0; $zonelDueLoanee = 0; $zoneBadLoan = 0; $zoneBadLoanee = 0; $zoneOverdueLoanOutstanding = 0; @endphp @foreach($data['data']['area'][$childData]['child'] as $branchkey => $branchChildData ) @if(isset($data_collect['branchData'][$branchChildData])) @php $zoneMember += $data_collect['branchData'][$branchChildData]['member']['current']; $zoneBorrower += $data_collect['branchData'][$branchChildData]['borrower']['current']; $zoneSavingsBalance += $data_collect['branchData'][$branchChildData]['savingsBalance']['current']; $zoneOtsSavingsBalance += $data_collect['branchData'][$branchChildData]['savingsCollection']['current']; $zoneLoanOutstansing += $data_collect['branchData'][$branchChildData]['outstanding']['current']; $zoneLoanDisbursement += $data_collect['branchData'][$branchChildData]['disbursement']['current']; $zoneLoanRecovery += $data_collect['branchData'][$branchChildData]['recovery']['current']; $zoneRegularRecoverable += $data_collect['branchData'][$branchChildData]['regularRecoverable']['current']; $zoneRegularRecovery += $data_collect['branchData'][$branchChildData]['regularRecovery']['current']; $zoneCurrentMonthDue += $data_collect['branchData'][$branchChildData]['currentMonthDue']['current']; $zoneCurrentMonthDueLoanee += $data_collect['branchData'][$branchChildData]['currentMonthDue']['loanee']; $zonelDue += $data_collect['branchData'][$branchChildData]['totalDue']['current']; $zonelDueLoanee += $data_collect['branchData'][$branchChildData]['totalDue']['loanee']; $zoneBadLoan += $data_collect['branchData'][$branchChildData]['badLoan']['current']; $zoneBadLoanee += $data_collect['branchData'][$branchChildData]['badLoan']['loanee']; $zoneOverdueLoanOutstanding += $data_collect['branchData'][$branchChildData]['overduePresentLoan']['current']; @endphp @endif @endforeach @php $totalMember += $zoneMember; $totalBorrower += $zoneBorrower; $totalSavingsBalance += $zoneSavingsBalance; $totalOtsSavingsBalance += $zoneOtsSavingsBalance; $totalLoanOutstansing += $zoneLoanOutstansing; $totalLoanDisbursement += $zoneLoanDisbursement; $totalLoanRecovery += $zoneLoanRecovery; $totalRegularRecoverable += $zoneRegularRecoverable; $totalRegularRecovery += $zoneRegularRecovery; $totalCurrentMonthDue += $zoneCurrentMonthDue; $totalCurrentMonthDueLoanee += $zoneCurrentMonthDueLoanee; $totalDue += $zonelDue; $totalDueLoanee += $zonelDueLoanee; $totalBadLoan += $zoneBadLoan; $totalBadLoanee += $zoneBadLoanee; $totalOverdueLoanOutstanding += $zoneOverdueLoanOutstanding; @endphp @endif @endif @if($branchMapingDataWithType['type']== 'region' ) @if(isset($data['data']['zone'][$childData])) @php $regionMember = 0; $regionBorrower = 0; $regionSavingsBalance = 0; $regionOtsSavingsBalance = 0; $regionLoanOutstansing = 0; $regionLoanDisbursement = 0; $regionLoanRecovery = 0; $regionRegularRecoverable = 0; $regionRegularRecovery = 0; $regionCurrentMonthDue = 0; $regionCurrentMonthDueLoanee = 0; $regionlDue = 0; $regionlDueLoanee = 0; $regionBadLoan = 0; $regionBadLoanee = 0; $regionOverdueLoanOutstanding = 0; @endphp @foreach($data['data']['zone'][$childData]['child'] as $areakey => $areaChildData ) @if(isset($data['data']['zone'][$childData]['data']['area'][$areaChildData]['child'])) @foreach($data['data']['zone'][$childData]['data']['area'][$areaChildData]['child'] as $branchkey => $branchChildData ) @if(isset($data_collect['branchData'][$branchChildData])) @php $regionMember += $data_collect['branchData'][$branchChildData]['member']['current']; $regionBorrower += $data_collect['branchData'][$branchChildData]['borrower']['current']; $regionSavingsBalance += $data_collect['branchData'][$branchChildData]['savingsBalance']['current']; $regionOtsSavingsBalance += $data_collect['branchData'][$branchChildData]['savingsCollection']['current']; $regionLoanOutstansing += $data_collect['branchData'][$branchChildData]['outstanding']['current']; $regionLoanDisbursement += $data_collect['branchData'][$branchChildData]['disbursement']['current']; $regionLoanRecovery += $data_collect['branchData'][$branchChildData]['recovery']['current']; $regionRegularRecoverable += $data_collect['branchData'][$branchChildData]['regularRecoverable']['current']; $regionRegularRecovery += $data_collect['branchData'][$branchChildData]['regularRecovery']['current']; $regionCurrentMonthDue += $data_collect['branchData'][$branchChildData]['currentMonthDue']['current']; $regionCurrentMonthDueLoanee += $data_collect['branchData'][$branchChildData]['currentMonthDue']['loanee']; $regionlDue += $data_collect['branchData'][$branchChildData]['totalDue']['current']; $regionlDueLoanee += $data_collect['branchData'][$branchChildData]['totalDue']['loanee']; $regionBadLoan += $data_collect['branchData'][$branchChildData]['badLoan']['current']; $regionBadLoanee += $data_collect['branchData'][$branchChildData]['badLoan']['loanee']; $regionOverdueLoanOutstanding += $data_collect['branchData'][$branchChildData]['overduePresentLoan']['current']; @endphp @endif @endforeach @endif @endforeach @php $totalMember += $regionMember; $totalBorrower += $regionBorrower; $totalSavingsBalance += $regionSavingsBalance; $totalOtsSavingsBalance += $regionOtsSavingsBalance; $totalLoanOutstansing += $regionLoanOutstansing; $totalLoanDisbursement += $regionLoanDisbursement; $totalLoanRecovery += $regionLoanRecovery; $totalRegularRecoverable += $regionRegularRecoverable; $totalRegularRecovery += $regionRegularRecovery; $totalCurrentMonthDue += $regionCurrentMonthDue; $totalCurrentMonthDueLoanee += $regionCurrentMonthDueLoanee; $totalDue += $regionlDue; $totalDueLoanee += $regionlDueLoanee; $totalBadLoan += $regionBadLoan; $totalBadLoanee += $regionBadLoanee; $totalOverdueLoanOutstanding += $regionOverdueLoanOutstanding; @endphp @endif @endif @endforeach @php $grossTotalMember += $totalMember; $grossTotalBorrower += $totalBorrower; $grossTotalSavingsBalance += $totalSavingsBalance; $grossTotalOtsSavingsBalance += $totalOtsSavingsBalance; $grossTotalLoanOutstansing += $totalLoanOutstansing; $grossTotalLoanDisbursement += $totalLoanDisbursement; $grossTotalLoanRecovery += $totalLoanRecovery; $grossTotalRegularRecoverable += $totalRegularRecoverable; $grossTotalRegularRecovery += $totalRegularRecovery; $grossTotalCurrentMonthDue += $totalCurrentMonthDue; $grossTotalCurrentMonthDueLoanee += $totalCurrentMonthDueLoanee; $grossTotalDue += $totalDue; $grossTotalDueLoanee += $totalDueLoanee; $grossTotalBadLoan += $totalBadLoan; $grossTotalBadLoanee += $totalBadLoanee; $grossTotalOverdueLoanOutstanding += $totalOverdueLoanOutstanding; @endphp @endforeach
SL No. @if($branchMapingDataWithType['type']=="area") Branch @elseif($branchMapingDataWithType['type']=="zone") Area @elseif($branchMapingDataWithType['type']=="region") Zone @else Branch @endif Member Borrower Savings Balance Savings Collection Loan Outstanding Loan Disbursement Loan Recovery Regular Recoverable Regular Recovery Current Month Due (New) Current Month Due loanee (New) Total Due (End Of Month) Total Due Loanee (End Of Month) Bad Loan Bad Loanee Overdue Loan Outstanding Borrower Coverage Ratio (%) OTR (%) PAR (%)
{{$data['name']}}
{{$count}} {{ $data_collect['branchData'][$childData]['branchName']['current'] }} {{ $data_collect['branchData'][$childData]['member']['current'] }} {{ $data_collect['branchData'][$childData]['borrower']['current'] }} {{ $data_collect['branchData'][$childData]['savingsBalance']['current'] }} {{ $data_collect['branchData'][$childData]['savingsCollection']['current'] }} {{ $data_collect['branchData'][$childData]['outstanding']['current'] }} {{ $data_collect['branchData'][$childData]['disbursement']['current'] }} {{ $data_collect['branchData'][$childData]['recovery']['current'] }} {{ $data_collect['branchData'][$childData]['regularRecoverable']['current'] }} {{ $data_collect['branchData'][$childData]['regularRecovery']['current'] }} {{ $data_collect['branchData'][$childData]['currentMonthDue']['current'] }} {{ $data_collect['branchData'][$childData]['currentMonthDue']['loanee'] }} {{ $data_collect['branchData'][$childData]['totalDue']['current'] }} {{ $data_collect['branchData'][$childData]['totalDue']['loanee'] }} {{ $data_collect['branchData'][$childData]['badLoan']['current'] }} {{ $data_collect['branchData'][$childData]['badLoan']['loanee'] }} {{ $data_collect['branchData'][$childData]['overduePresentLoan']['current'] }} @if($data_collect['branchData'][$childData]['member']['current'] > 0) {{(round($data_collect['branchData'][$childData]['borrower']['current']/$data_collect['branchData'][$childData]['member']['current']*100,2)).'%'}} @else {{'0%'}} @endif @if($data_collect['branchData'][$childData]['regularRecoverable']['current'] > 0) {{(round($data_collect['branchData'][$childData]['regularRecovery']['current']/$data_collect['branchData'][$childData]['regularRecoverable']['current']*100,2)).'%'}} @else @if($data_collect['branchData'][$childData]['regularRecovery']['current'] == $data_collect['branchData'][$childData]['regularRecoverable']['current']) {{'100%'}} @else {{'0%'}} @endif @endif @if($data_collect['branchData'][$childData]['outstanding']['current'] > 0) @if(round($data_collect['branchData'][$childData]['overduePresentLoan']['current']/$data_collect['branchData'][$childData]['outstanding']['current']*100,2) > 100) {{'100%'}} @else {{(round($data_collect['branchData'][$childData]['overduePresentLoan']['current']/$data_collect['branchData'][$childData]['outstanding']['current']*100,2)).'%'}} @endif @else {{'0%'}} @endif
{{$count}} {{ $data['data']['area'][$childData]['name'] }} {{$zoneMember}} {{$zoneBorrower}} {{$zoneSavingsBalance}} {{$zoneOtsSavingsBalance}} {{$zoneLoanOutstansing}} {{$zoneLoanDisbursement}} {{$zoneLoanRecovery}} {{$zoneRegularRecoverable}} {{$zoneRegularRecovery}} {{$zoneCurrentMonthDue}} {{$zoneCurrentMonthDueLoanee}} {{$zonelDue}} {{$zonelDueLoanee}} {{$zoneBadLoan}} {{$zoneBadLoanee}} {{$zoneOverdueLoanOutstanding}} @if($zoneMember > 0) {{(round($zoneBorrower/$zoneMember*100,2)).'%'}} @else {{'0%'}} @endif @if($zoneRegularRecoverable > 0) {{(round($zoneRegularRecovery/$zoneRegularRecoverable*100,2)).'%'}} @else @if($zoneRegularRecovery == $zoneRegularRecoverable) {{'100%'}} @else {{'0%'}} @endif @endif @if($zoneLoanOutstansing > 0) @if(round($zoneOverdueLoanOutstanding/$zoneLoanOutstansing*100,2) > 100) {{'100%'}} @else {{(round($zoneOverdueLoanOutstanding/$zoneLoanOutstansing*100,2)).'%'}} @endif @else {{'0%'}} @endif
{{$count}} {{ $data['data']['zone'][$childData]['name'] }} {{$regionMember}} {{$regionBorrower}} {{$regionSavingsBalance}} {{$regionOtsSavingsBalance}} {{$regionLoanOutstansing}} {{$regionLoanDisbursement}} {{$regionLoanRecovery}} {{$regionRegularRecoverable}} {{$regionRegularRecovery}} {{$regionCurrentMonthDue}} {{$regionCurrentMonthDueLoanee}} {{$regionlDue}} {{$regionlDueLoanee}} {{$regionBadLoan}} {{$regionBadLoanee}} {{$regionOverdueLoanOutstanding}} @if($regionMember > 0) {{(round($regionBorrower/$regionMember*100,2)).'%'}} @else {{'0%'}} @endif @if($regionRegularRecoverable > 0) {{(round($regionRegularRecovery/$regionRegularRecoverable*100,2)).'%'}} @else @if($regionRegularRecovery == $regionRegularRecoverable) {{'100%'}} @else {{'0%'}} @endif @endif @if($regionLoanOutstansing > 0) @if(round($regionOverdueLoanOutstanding/$regionLoanOutstansing*100,2) > 100) {{'100%'}} @else {{(round($regionOverdueLoanOutstanding/$regionLoanOutstansing*100,2)).'%'}} @endif @else {{'0%'}} @endif
Subtotal {{ $totalMember }} {{ $totalBorrower }} {{ $totalSavingsBalance }} {{ $totalOtsSavingsBalance }} {{ $totalLoanOutstansing }} {{ $totalLoanDisbursement }} {{ $totalLoanRecovery }} {{ $totalRegularRecoverable }} {{ $totalRegularRecovery }} {{ $totalCurrentMonthDue }} {{ $totalCurrentMonthDueLoanee }} {{ $totalDue }} {{ $totalDueLoanee }} {{ $totalBadLoan }} {{ $totalBadLoanee }} {{ $totalOverdueLoanOutstanding }} @if($totalMember > 0) {{(round($totalBorrower/$totalMember*100,2)).'%'}} @else {{'0%'}} @endif @if($totalRegularRecoverable > 0) {{(round(($totalRegularRecovery)/($totalRegularRecoverable)*100,2)).'%'}} @else {{'0%'}} @endif @if($totalLoanOutstansing > 0) @if(round($totalOverdueLoanOutstanding/$totalLoanOutstansing*100,2) > 100) {{'100%'}} @else {{(round($totalOverdueLoanOutstanding/$totalLoanOutstansing*100,2)).'%'}} @endif @else {{'0%'}} @endif
Gross Total {{ $grossTotalMember }} {{ $grossTotalBorrower }} {{ $grossTotalSavingsBalance }} {{ $grossTotalOtsSavingsBalance }} {{ $grossTotalLoanOutstansing }} {{ $grossTotalLoanDisbursement }} {{ $grossTotalLoanRecovery }} {{ $grossTotalRegularRecoverable }} {{ $grossTotalRegularRecovery }} {{ $grossTotalCurrentMonthDue }} {{ $grossTotalCurrentMonthDueLoanee }} {{ $grossTotalDue }} {{ $grossTotalDueLoanee }} {{ $grossTotalBadLoan }} {{ $grossTotalBadLoanee }} {{ $grossTotalOverdueLoanOutstanding }} @if($grossTotalMember > 0) {{(round($grossTotalBorrower/$grossTotalMember*100,2)).'%'}} @else {{'0%'}} @endif @if($grossTotalRegularRecoverable > 0) {{(round(($grossTotalRegularRecovery)/($grossTotalRegularRecoverable)*100,2)).'%'}} @else {{'0%'}} @endif @if($grossTotalLoanOutstansing > 0) @if(round($grossTotalOverdueLoanOutstanding/$grossTotalLoanOutstansing*100,2) > 100) {{'100%'}} @else {{(round($grossTotalOverdueLoanOutstanding/$grossTotalLoanOutstansing*100,2)).'%'}} @endif @else {{'0%'}} @endif
{{--
--}}
{{-- REPORT FOOTER --}}