@include('microfin/miscellaneous/monthEndPendingAlert') @php function num($number,$filRoundUup){ if ($filRoundUup==1) { return number_format($number); } else{ return number_format($number,2); } } if ($filServiceCharge==1) { $serviceChargeText = '(With Service Charge)'; } else{ $serviceChargeText = '(Without Service Charge)'; } @endphp
@include('microfin.reports.pksfPomisReport.pksfPomis5ReportNew.header') @include('microfin.reports.pksfPomisReport.pksfPomis5ReportNew.noteOne') @include('microfin.reports.pksfPomisReport.pksfPomis5ReportNew.loanRegister') {{-- Third Table --}} @php $savingsProductSegmentArray = [ 'gen' => 'General', 'vol' => 'Voluntary', 'others' => 'Others', ]; @endphp
@foreach($savingsProductSegmentArray as $savingsProductSegment) @endforeach @foreach($savingsProductSegmentArray as $savingsProductSegment) @endforeach @php foreach($savingsProductSegmentArray as $i => $savingsProductSegment){ ${'grand_'.$i.'BalanceMale'} = 0; ${'grand_'.$i.'BalanceFemale'} = 0; } $grand_balanceMale = 0; $grand_balanceFemale = 0; @endphp @php $curSavingsData = $savingsData->whereIn('fundingOrganizationId', $pksfOthersFundingOrgs); $curSavingsMaleData = $curSavingsData->where('genderTypeId', 1); $curSavingsFemaleData = $curSavingsData->where('genderTypeId', 2); $genSavingsMaleData = $curSavingsMaleData->whereIn('savingProductIdFk', $savingsType->where('savingsType', 1)->pluck('productIds')->toArray()); $genSavingsFemaleData = $curSavingsFemaleData->whereIn('savingProductIdFk', $savingsType->where('savingsType', 1)->pluck('productIds')->toArray()); $volSavingsMaleData = $curSavingsMaleData->whereIn('savingProductIdFk', $savingsType->where('savingsType', 2)->pluck('productIds')->toArray()); $volSavingsFemaleData = $curSavingsFemaleData->whereIn('savingProductIdFk', $savingsType->where('savingsType', 2)->pluck('productIds')->toArray()); $othersSavingsMaleData = $curSavingsMaleData->whereIn('savingProductIdFk', $savingsType->where('savingsType', 3)->pluck('productIds')->toArray()); $othersSavingsFemaleData = $curSavingsFemaleData->whereIn('savingProductIdFk', $savingsType->where('savingsType', 3)->pluck('productIds')->toArray()); foreach($savingsProductSegmentArray as $i => $savingsProductSegment){ ${$i.'ProvisionMale'} = ${$i.'SavingsMaleData'}->sum('cumInterestProvision'); ${$i.'ProvisionFemale'} = ${$i.'SavingsFemaleData'}->sum('cumInterestProvision'); ${$i.'CollectionMale'} = ${$i.'SavingsMaleData'}->sum('cumCollection')-(${$i.'ProvisionMale'}); ${$i.'CollectionFemale'} = ${$i.'SavingsFemaleData'}->sum('cumCollection')-(${$i.'ProvisionFemale'}); ${$i.'SavingsMale'} = ${$i.'CollectionMale'}+${$i.'ProvisionMale'}; ${$i.'SavingsFemale'} = ${$i.'CollectionFemale'}+${$i.'ProvisionFemale'}; ${$i.'WithdrawMale'} = ${$i.'SavingsMaleData'}->sum('cumWithdraw')-(${$i.'ProvisionMale'}); ${$i.'WithdrawFemale'} = ${$i.'SavingsFemaleData'}->sum('cumWithdraw')-(${$i.'ProvisionFemale'}); ${$i.'BalanceMale'} = ${$i.'SavingsMale'}-${$i.'WithdrawMale'}; ${$i.'BalanceFemale'} = ${$i.'SavingsFemale'}-${$i.'WithdrawFemale'}; ${'grand_'.$i.'BalanceMale'} += ${$i.'BalanceMale'}; ${'grand_'.$i.'BalanceFemale'} += ${$i.'BalanceFemale'}; } $totalCollectionMale = $genCollectionMale+$volCollectionMale+$othersCollectionMale; $totalCollectionFemale = $genCollectionFemale+$volCollectionFemale+$othersCollectionFemale; $totalProvisionMale = $genProvisionMale+$volProvisionMale+$othersProvisionMale; $totalProvisionFemale = $genProvisionFemale+$volProvisionFemale+$othersProvisionFemale; $totalSavingsMale = $genSavingsMale+$volSavingsMale+$othersSavingsMale; $totalSavingsFemale = $genSavingsFemale+$volSavingsFemale+$othersSavingsFemale; $totalWithdrawMale = $genWithdrawMale+$volWithdrawMale+$othersWithdrawMale; $totalWithdrawFemale = $genWithdrawFemale+$volWithdrawFemale+$othersWithdrawFemale; $balanceMale = $genBalanceMale+$volBalanceMale+$othersBalanceMale; $balanceFemale = $genBalanceFemale+$volBalanceFemale+$othersBalanceFemale; $grand_balanceMale += $balanceMale; $grand_balanceFemale += $balanceFemale; @endphp @foreach($savingsProductSegmentArray as $i => $savingsProductSegment) @endforeach @foreach($savingsProductSegmentArray as $i => $savingsProductSegment) @endforeach @foreach($savingsProductSegmentArray as $i => $savingsProductSegment) @endforeach @foreach($savingsProductSegmentArray as $i => $savingsProductSegment) @endforeach @foreach($savingsProductSegmentArray as $i => $savingsProductSegment) @endforeach @foreach($savingsProductSegmentArray as $i => $savingsProductSegment) @endforeach
Savings Fund{{ $savingsProductSegment }} SavingsTotal Savings
M F TotalM F Total
Note-3 ({{ $filFundingOrgName }})
Cumulative Savings Collection (A) {{ num(${$i.'CollectionMale'},$filRoundUup) }} {{ num(${$i.'CollectionFemale'},$filRoundUup) }} {{ num(${$i.'CollectionMale'}+${$i.'CollectionFemale'},$filRoundUup) }}{{ num($totalCollectionMale,$filRoundUup) }} {{ num($totalCollectionFemale,$filRoundUup) }} {{ num($totalCollectionMale+$totalCollectionFemale,$filRoundUup) }}
Cumulative Interest Provission (B) {{ num(${$i.'ProvisionMale'},$filRoundUup) }} {{ num(${$i.'ProvisionFemale'},$filRoundUup) }} {{ num(${$i.'ProvisionMale'}+${$i.'ProvisionFemale'},$filRoundUup) }}{{ num($totalProvisionMale,$filRoundUup) }} {{ num($totalProvisionFemale,$filRoundUup) }} {{ num($totalProvisionMale+$totalProvisionFemale,$filRoundUup) }}
Total Savings (C) = (A) + (B){{ num(${$i.'SavingsMale'},$filRoundUup) }} {{ num(${$i.'SavingsFemale'},$filRoundUup) }} {{ num(${$i.'SavingsMale'}+${$i.'SavingsFemale'},$filRoundUup) }}{{ num($totalSavingsMale,$filRoundUup) }} {{ num($totalSavingsFemale,$filRoundUup) }} {{ num($totalSavingsMale+$totalSavingsFemale,$filRoundUup) }}
Cumulative Savings Return/Withdrwal (D){{ num(${$i.'WithdrawMale'},$filRoundUup) }} {{ num(${$i.'WithdrawFemale'},$filRoundUup) }} {{ num(${$i.'WithdrawMale'}+${$i.'WithdrawFemale'},$filRoundUup) }}{{ num($totalWithdrawMale,$filRoundUup) }} {{ num($totalWithdrawFemale,$filRoundUup) }} {{ num($totalWithdrawMale+$totalWithdrawFemale,$filRoundUup) }}
Current Savings Balance (E) = (C) - (D){{ num(${$i.'BalanceMale'},$filRoundUup) }} {{ num(${$i.'BalanceFemale'},$filRoundUup) }} {{ num(${$i.'BalanceMale'}+${$i.'BalanceFemale'},$filRoundUup) }}{{ num($balanceMale,$filRoundUup) }} {{ num($balanceFemale,$filRoundUup) }} {{ num($balanceMale+$balanceFemale,$filRoundUup) }}
Grnad Total{{ num(${'grand_'.$i.'BalanceMale'},$filRoundUup) }} {{ num(${'grand_'.$i.'BalanceFemale'},$filRoundUup) }} {{ num(${'grand_'.$i.'BalanceMale'} + ${'grand_'.$i.'BalanceFemale'},$filRoundUup) }}{{ num($grand_balanceMale,$filRoundUup) }} {{ num($grand_balanceFemale,$filRoundUup) }} {{ num($grand_balanceMale+$grand_balanceFemale,$filRoundUup) }}
{{-- End Table Note-3 --}} {{-- note 4 table--}} @include('microfin.reports.pksfPomisReport.pksfPomis5ReportNew.noteFour') {{-- note 4 table end--}} {{-- writeoff table --}} @include('microfin.reports.pksfPomisReport.pksfPomis5ReportNew.writeOffPksfAndOthers') {{-- writeoff table end --}}
{{-- printDiv DIV --}}