@include('microfin/miscellaneous/monthEndPendingAlert') @php function num($number,$filRoundUup){ if ($filRoundUup==1) { // return number_format(round($number),2); return number_format($number); } else{ return number_format($number,2); } } if ($filServiceCharge==1) { $serviceChargeText = '(With Service Charge)'; } else{ $serviceChargeText = '(Without Service Charge)'; } @endphp
{{-- div for Company --}} @php $company = DB::table('gnr_company')->where('id', Auth::user()->company_id_fk)->select('name','address')->first(); if($filBranch==null){ $branchName = 'All'; } else{ $branchName = DB::table('gnr_branch')->where('id',$filBranch)->value('name'); } @endphp {{$company->name}}
{{$company->address}}
{{'Reporting Branch: '.$branchName}}
Notes to Balance Sheet - POMIS-5(A) {{$serviceChargeText}}
{{-- report info div --}} @php use Carbon\Carbon; $reportDate = Carbon::parse($filDate)->format('d-m-Y'); $printDate = Carbon::now()->format('d-m-Y'); @endphp
Report Date : {{$reportDate}} Print Date : {{$printDate}}
{{-- end report info div --}} {{-- First Table --}}
Note-1
(A) Dissaster Management Fund(DMF) DMF Received from PKSF PKSF DMF USED NON-PKSF DMF USED
- - -
(B) Fund Account   PKSF NON-PKSF PKSF & NON-PKSF
Cumulative Service Charge Collection {{num($cumSerChargeCollectionPKSF,$filRoundUup)}} - {{num($cumSerChargeCollectionPKSF,$filRoundUup)}}
Total Others Income {{num($totalOthersIncomePKSF,$filRoundUup)}} - {{num($totalOthersIncomePKSF,$filRoundUup)}}
Cumulative Total Income {{num($cumSerChargeCollectionPKSF + $totalOthersIncomePKSF,$filRoundUup)}} - {{num($cumSerChargeCollectionPKSF + $totalOthersIncomePKSF,$filRoundUup)}}
Cumulative Total Expenditure {{num($cumTotalExpenditurePKSF,$filRoundUup)}} - {{num($cumTotalExpenditurePKSF,$filRoundUup)}}
Fund Account (Surplus) {{num($surplusPKSF,$filRoundUup)}} - {{num($surplusPKSF,$filRoundUup)}}
Reserve Fund {{num($reserveFundPKSF,$filRoundUup)}} - {{num($reserveFundPKSF,$filRoundUup)}}
Cumulative Total Salary Paid {{num($staffSalaryPKSF,$filRoundUup)}} - {{num($staffSalaryPKSF,$filRoundUup)}}
{{-- End First Table --}} {{-- Second Table --}} @if(in_array(1,$filBranchIds)) @if(count($pksfFundLoanProducts)>0)
@foreach($pksfFundLoanProducts as $pksfLoanProduct) @php $cumulativeReceive = $pksfFundAccounts->where('loanProductId_fk',$pksfLoanProduct->id)->sum('loanAmount'); $accountIds = $pksfFundAccounts->where('loanProductId_fk',$pksfLoanProduct->id)->pluck('id')->toArray(); $paymentPrincipal = $payments->whereIn('accId_fk',$accountIds)->sum('principalAmount'); $paymentInterest = $payments->whereIn('accId_fk',$accountIds)->sum('interestAmount'); $outstanding = $pksfFundAccounts->whereIn('id',$accountIds)->sum('repayAmount') - $payments->whereIn('accId_fk',$accountIds)->sum('totalAmount'); $duePrincipal = $paymentSchedules->whereIn('accId_fk',$accountIds)->sum('principalAmount') - $payments->whereIn('accId_fk',$accountIds)->sum('principalAmount'); $dueInterest = $paymentSchedules->whereIn('accId_fk',$accountIds)->sum('interestAmount') - $payments->whereIn('accId_fk',$accountIds)->sum('interestAmount'); $nextPayable = $nextPaymentSchedules->whereIn('accId_fk',$accountIds)->sum('totalAmount'); @endphp @endforeach @php $cumulativeReceive = $pksfFundAccounts->sum('loanAmount'); $accountIds = $pksfFundAccounts->pluck('id')->toArray(); $paymentPrincipal = $payments->whereIn('accId_fk',$accountIds)->sum('principalAmount'); $paymentInterest = $payments->whereIn('accId_fk',$accountIds)->sum('interestAmount'); $outstanding = $pksfFundAccounts->whereIn('id',$accountIds)->sum('repayAmount') - $payments->whereIn('accId_fk',$accountIds)->sum('totalAmount'); $duePrincipal = $paymentSchedules->whereIn('accId_fk',$accountIds)->sum('principalAmount') - $payments->whereIn('accId_fk',$accountIds)->sum('principalAmount'); $dueInterest = $paymentSchedules->whereIn('accId_fk',$accountIds)->sum('interestAmount') - $payments->whereIn('accId_fk',$accountIds)->sum('interestAmount'); $nextPayable = $nextPaymentSchedules->whereIn('accId_fk',$accountIds)->sum('totalAmount'); @endphp
Note-2 (PKSF)
PKSF Fund Account: Cumulative Receive Cumulative Payment Current Outstanding End of the Month Due Next 12 month Payable Amount
Principle Service Charge Principle Service Charge
{{$pksfLoanProduct->name}} {{num($cumulativeReceive,$filRoundUup)}} {{num($paymentPrincipal,$filRoundUup)}} {{num($paymentInterest,$filRoundUup)}} {{num($outstanding,$filRoundUup)}} {{num($duePrincipal,$filRoundUup)}} {{num($dueInterest,$filRoundUup)}} {{num($nextPayable,$filRoundUup)}}
Total {{num($cumulativeReceive,$filRoundUup)}} {{num($paymentPrincipal,$filRoundUup)}} {{num($paymentInterest,$filRoundUup)}} {{num($outstanding,$filRoundUup)}} {{num($duePrincipal,$filRoundUup)}} {{num($dueInterest,$filRoundUup)}} {{num($nextPayable,$filRoundUup)}}
@endif @endif {{-- End Second Table --}} {{-- Forth Table Note-3 --}} @if (count($pksfMaleMemberIds)>0 || count($pksfFemaleMemberIds)>0)
@php $totalMaleSavCollection = $cumGenSavCollMale + $cumVOlSavCollMale + $cumOthSavCollMale; $totalFemaleSavCollection = $cumGenSavCollFemale + $cumVOlSavCollFemale + $cumOthSavCollFemale; @endphp {{-- Interest Will be added later --}} @php $totalMaleSavCollection = $cumGenSavCollMale + $cumVOlSavCollMale + $cumOthSavCollMale; $totalFemaleSavCollection = $cumGenSavCollFemale + $cumVOlSavCollFemale + $cumOthSavCollFemale; @endphp @php $totalMaleWithdraw = $cumGenSavWithdrawMale + $cumVOlSavWithdrawMale + $cumOthSavWithdrawMale; $totalFemaleWithdraw = $cumGenSavWithdrawFemale + $cumVOlSavWithdrawFemale + $cumOthSavWithdrawFemale; @endphp @php $totalSavBalMale = $cumGenSavBalMale + $cumVOlSavBalMale + $cumOthSavBalMale; $totalSavBalFemale = $cumGenSavBalFemale + $cumVOlSavBalFemale + $cumOthSavBalFemale; @endphp
Savings Fund General Savings Voluntary Savings Other Savings Total Savings
Note-3 (PKSF)
  M F Total M F Total M F Total M F Total
Cumulative Savings Collection (A) {{num($cumGenSavCollMale,$filRoundUup)}} {{num($cumGenSavCollFemale,$filRoundUup)}} {{num($cumGenSavCollMale + $cumGenSavCollFemale,$filRoundUup)}} {{num($cumVOlSavCollMale,$filRoundUup)}} {{num($cumVOlSavCollFemale,$filRoundUup)}} {{num($cumVOlSavCollMale + $cumVOlSavCollFemale,$filRoundUup)}} {{num($cumOthSavCollMale,$filRoundUup)}} {{num($cumOthSavCollFemale,$filRoundUup)}} {{num($cumOthSavCollMale + $cumOthSavCollFemale,$filRoundUup)}} {{num($totalMaleSavCollection,$filRoundUup)}} {{num($totalFemaleSavCollection,$filRoundUup)}} {{num($totalMaleSavCollection + $totalFemaleSavCollection,$filRoundUup)}}
Cumulative Interest Provission (B) {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}} {{num(0,$filRoundUup)}}
Total Savings (C) = (A) + (B) {{num($cumGenSavCollMale,$filRoundUup)}} {{num($cumGenSavCollFemale,$filRoundUup)}} {{num($cumGenSavCollMale + $cumGenSavCollFemale,$filRoundUup)}} {{num($cumVOlSavCollMale,$filRoundUup)}} {{num($cumVOlSavCollFemale,$filRoundUup)}} {{num($cumVOlSavCollMale + $cumVOlSavCollFemale,$filRoundUup)}} {{num($cumOthSavCollMale,$filRoundUup)}} {{num($cumOthSavCollFemale,$filRoundUup)}} {{num($cumOthSavCollMale + $cumOthSavCollFemale,$filRoundUup)}} {{num($totalMaleSavCollection,$filRoundUup)}} {{num($totalFemaleSavCollection,$filRoundUup)}} {{num($totalMaleSavCollection + $totalFemaleSavCollection,$filRoundUup)}}
Cumulative Savings Return/withdrwal (D) {{num($cumGenSavWithdrawMale,$filRoundUup)}} {{num($cumGenSavWithdrawFemale,$filRoundUup)}} {{num($cumGenSavWithdrawMale + $cumGenSavWithdrawFemale,$filRoundUup)}} {{num($cumVOlSavWithdrawMale,$filRoundUup)}} {{num($cumVOlSavWithdrawFemale,$filRoundUup)}} {{num($cumVOlSavWithdrawMale + $cumVOlSavWithdrawFemale,$filRoundUup)}} {{num($cumOthSavWithdrawMale,$filRoundUup)}} {{num($cumOthSavWithdrawFemale,$filRoundUup)}} {{num($cumOthSavWithdrawMale + $cumOthSavWithdrawFemale,$filRoundUup)}} {{num($totalMaleWithdraw,$filRoundUup)}} {{num($totalFemaleWithdraw,$filRoundUup)}} {{num($totalMaleWithdraw + $totalFemaleWithdraw,$filRoundUup)}}
Current Savings Balance (E) = (C) - (D) {{num($cumGenSavBalMale,$filRoundUup)}} {{num($cumGenSavBalFemale,$filRoundUup)}} {{num($cumGenSavBalMale + $cumGenSavBalFemale,$filRoundUup)}} {{num($cumVOlSavBalMale,$filRoundUup)}} {{num($cumVOlSavBalFemale,$filRoundUup)}} {{num($cumVOlSavBalMale + $cumVOlSavBalFemale,$filRoundUup)}} {{num($cumOthSavBalMale,$filRoundUup)}} {{num($cumOthSavBalFemale,$filRoundUup)}} {{num($cumOthSavBalMale + $cumOthSavBalFemale,$filRoundUup)}} {{num($totalSavBalMale,$filRoundUup)}} {{num($totalSavBalFemale,$filRoundUup)}} {{num($totalSavBalMale + $totalSavBalFemale,$filRoundUup)}}
@endif {{-- End Forth Table Note-3 --}} {{-- Sixth Table Note-4 --}} @if(count($pksfLoanCategories)>0)
@foreach ($pksfLoanCategories as $key => $loanCategory) @php $loanProductIds = $pksfLoanProducts->where('productCategoryId',$loanCategory->id)->pluck('id')->toArray(); $pksfLoanDisbursementMale = $pksfLoanDisbursements->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfMaleMemberIds)->sum('loanAmount') + $branchOpeningLoanInfo->whereIn('productIdFk',$loanProductIds)->where('genderTypeId',1)->sum('disbursedAmount'); $pksfLoanDisbursementFemale = $pksfLoanDisbursements->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfFemaleMemberIds)->sum('loanAmount') + $branchOpeningLoanInfo->whereIn('productIdFk',$loanProductIds)->where('genderTypeId',2)->sum('disbursedAmount'); if ($filServiceCharge==1) { $pksfLoanCollectionMale = $pksfLoanCollections->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfMaleMemberIds)->sum('amount'); $pksfLoanCollectionFemale = $pksfLoanCollections->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfFemaleMemberIds)->sum('amount'); $pksfLoanRepayAmountMale = $pksfLoanDisbursements->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfMaleMemberIds)->sum('totalRepayAmount'); $pksfLoanRepayAmountFemale = $pksfLoanDisbursements->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfFemaleMemberIds)->sum('totalRepayAmount'); } else{ $pksfLoanCollectionMale = $pksfLoanCollections->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfMaleMemberIds)->sum('principalAmount') + $branchOpeningLoanInfo->whereIn('productIdFk',$loanProductIds)->where('genderTypeId',1)->sum('principalRecoveryAmount'); $pksfLoanCollectionFemale = $pksfLoanCollections->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfFemaleMemberIds)->sum('principalAmount') + $branchOpeningLoanInfo->whereIn('productIdFk',$loanProductIds)->where('genderTypeId',2)->sum('principalRecoveryAmount'); $pksfLoanRepayAmountMale = $pksfLoanDisbursementMale; $pksfLoanRepayAmountFemale = $pksfLoanDisbursementFemale; } $pksfOutstandingMale = $pksfLoanRepayAmountMale - $pksfLoanCollectionMale; $pksfOutstandingFemale = $pksfLoanRepayAmountFemale - $pksfLoanCollectionFemale; @endphp @endforeach @php $loanProductIds = $pksfLoanProducts->pluck('id')->toArray(); $pksfLoanDisbursementMale = $pksfLoanDisbursements->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfMaleMemberIds)->sum('loanAmount') + $branchOpeningLoanInfo->whereIn('productIdFk',$loanProductIds)->where('genderTypeId',1)->sum('disbursedAmount'); $pksfLoanDisbursementFemale = $pksfLoanDisbursements->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfFemaleMemberIds)->sum('loanAmount') + $branchOpeningLoanInfo->whereIn('productIdFk',$loanProductIds)->where('genderTypeId',2)->sum('disbursedAmount'); if ($filServiceCharge==1) { $pksfLoanCollectionMale = $pksfLoanCollections->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfMaleMemberIds)->sum('amount'); $pksfLoanCollectionFemale = $pksfLoanCollections->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfFemaleMemberIds)->sum('amount'); $pksfLoanRepayAmountMale = $pksfLoanDisbursements->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfMaleMemberIds)->sum('totalRepayAmount'); $pksfLoanRepayAmountFemale = $pksfLoanDisbursements->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfFemaleMemberIds)->sum('totalRepayAmount'); } else{ $pksfLoanCollectionMale = $pksfLoanCollections->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfMaleMemberIds)->sum('principalAmount') + $branchOpeningLoanInfo->whereIn('productIdFk',$loanProductIds)->where('genderTypeId',1)->sum('principalRecoveryAmount'); $pksfLoanCollectionFemale = $pksfLoanCollections->whereIn('productIdFk',$loanProductIds)->whereIn('memberIdFk',$pksfFemaleMemberIds)->sum('principalAmount') + $branchOpeningLoanInfo->whereIn('productIdFk',$loanProductIds)->where('genderTypeId',2)->sum('principalRecoveryAmount'); $pksfLoanRepayAmountMale = $pksfLoanDisbursementMale; $pksfLoanRepayAmountFemale = $pksfLoanDisbursementFemale; } $pksfOutstandingMale = $pksfLoanRepayAmountMale - $pksfLoanCollectionMale; $pksfOutstandingFemale = $pksfLoanRepayAmountFemale - $pksfLoanCollectionFemale; @endphp
Note-4 (PKSF)
Outstanding Account (Outstanding in the Field)
Male Female Total
{{$loanCategory->name}} Cumulative Loan Disbursement {{num($pksfLoanDisbursementMale,$filRoundUup)}} {{num($pksfLoanDisbursementFemale,$filRoundUup)}} {{num($pksfLoanDisbursementMale + $pksfLoanDisbursementFemale,$filRoundUup)}}
Cumulative Loan Collection {{num($pksfLoanCollectionMale,$filRoundUup)}} {{num($pksfLoanCollectionFemale,$filRoundUup)}} {{num($pksfLoanCollectionMale + $pksfLoanCollectionFemale,$filRoundUup)}}
Current Outstanding {{num($pksfOutstandingMale,$filRoundUup)}} {{num($pksfOutstandingFemale,$filRoundUup)}} {{num($pksfOutstandingMale + $pksfOutstandingFemale,$filRoundUup)}}
Total PKSF Cumulative Loan Disbursement {{num($pksfLoanDisbursementMale,$filRoundUup)}} {{num($pksfLoanDisbursementFemale,$filRoundUup)}} {{num($pksfLoanDisbursementMale + $pksfLoanDisbursementFemale,$filRoundUup)}}
Cumulative Loan Collection {{num($pksfLoanCollectionMale,$filRoundUup)}} {{num($pksfLoanCollectionFemale,$filRoundUup)}} {{num($pksfLoanCollectionMale + $pksfLoanCollectionFemale,$filRoundUup)}}
Current Outstanding {{num($pksfOutstandingMale,$filRoundUup)}} {{num($pksfOutstandingFemale,$filRoundUup)}} {{num($pksfOutstandingMale + $pksfOutstandingFemale,$filRoundUup)}}
@endif {{-- End Sixth Table Note-4 --}} {{-- writeoff Table --}} @if (count($pksfCatgCumServiceCharges)>0)
@foreach ($pksfLoanCategories as $key => $pksfLoanCategory) @php $cumServiceChargeAmount = $pksfCatgCumServiceCharges->where('categoryId',$pksfLoanCategory->id)->sum('cumSerCharge'); $maleWriteOffNo = $pksfCatgCumServiceCharges->where('categoryId',$pksfLoanCategory->id)->sum('maleWriteOffNo'); $maleWriteOffAmount = $pksfCatgCumServiceCharges->where('categoryId',$pksfLoanCategory->id)->sum('maleWriteOffAmount'); $femaleWriteOffNo = $pksfCatgCumServiceCharges->where('categoryId',$pksfLoanCategory->id)->sum('femaleWriteOffNo'); $femaleWriteOffAmount = $pksfCatgCumServiceCharges->where('categoryId',$pksfLoanCategory->id)->sum('femaleWriteOffAmount'); $bothWtiteOffNo = $maleWriteOffNo + $femaleWriteOffNo; $bothWriteOffAmount = $maleWriteOffAmount + $femaleWriteOffAmount; @endphp @if ($key==0) @endif @endforeach @if (count($pksfLoanCategories)>0) @php $cumServiceChargeAmount = $pksfCatgCumServiceCharges->sum('cumSerCharge'); $maleWriteOffNo = $pksfCatgCumServiceCharges->sum('maleWriteOffNo'); $maleWriteOffAmount = $pksfCatgCumServiceCharges->sum('maleWriteOffAmount'); $femaleWriteOffNo = $pksfCatgCumServiceCharges->sum('femaleWriteOffNo'); $femaleWriteOffAmount = $pksfCatgCumServiceCharges->sum('femaleWriteOffAmount'); $bothWtiteOffNo = $maleWriteOffNo + $femaleWriteOffNo; $bothWriteOffAmount = $maleWriteOffAmount + $femaleWriteOffAmount; @endphp @endif
Component Cumulative Write Off Information Cumulative Service Charge Collection
Funding Organization Name Loan Product Category Name Male Female Total
No. of Member Amount No. of Member Amount No. of Member Amount
PKSF {{$pksfLoanCategory->name}} {{$maleWriteOffNo}} {{num($maleWriteOffAmount,$filRoundUup)}} {{$femaleWriteOffNo}} {{num($femaleWriteOffAmount,$filRoundUup)}} {{$bothWtiteOffNo}} {{num($bothWriteOffAmount,$filRoundUup)}} {{num($cumServiceChargeAmount,$filRoundUup)}}
Total PKSF {{$maleWriteOffNo}} {{num($maleWriteOffAmount,$filRoundUup)}} {{$femaleWriteOffNo}} {{num($femaleWriteOffAmount,$filRoundUup)}} {{$bothWtiteOffNo}} {{num($bothWriteOffAmount,$filRoundUup)}} {{num($cumServiceChargeAmount,$filRoundUup)}}
@endif {{-- End writeoff Table --}}
{{-- printDiv DIV --}}