{{-- div for Company --}} @php $company = DB::table('gnr_company') ->where('id', Auth::user()->company_id_fk) ->select('name', 'address') ->first(); @endphp {{ $company->name }}
{{ $company->address }}
PERIODIC COLLECTION REPORT COMPONENT WISE
@foreach ($savingsProducts as $savingsProduct) @endforeach @foreach ($savingsProducts as $savingsProduct) @endforeach @foreach ($savingsProducts as $savingsProduct) @endforeach {{-- Loop through each officer --}} @php //INITIALIZE GRAND TOTAL VALUE $grndtotalAdditionalFee = 0; $grndtotalLoanAmount = 0; $grndtotalprocessingFee = 0; $grndtotalInsuranceAmount = 0; $grndrecoverableLoanAmount = 0; $grndprincipleLoanCollection = 0; $grndinterestAmountOfLoanCollection = 0; $grndinstallmentClaimed = 0; $grndscheduleAmountAtStartDate = 0; $grndcollectionAmountAtStartDate = 0; $grndscheduleAmountAtEndDate = 0; $grndcollectionAmountAtEndDate = 0; $grndloanCollection = 0; $grndregularLoanCollection = 0; $grnddueAmount = 0; $grndadvanceAmount = 0; $grndrebateAmount = 0; $grndtotal_passbookFee = 0; $grndtotal_admissionFee = 0; $totalSavingsData = []; foreach ($savingsProducts as $key => $savingItem) { $totalSavingsData[$savingItem->id]['total_deposit_amount'] = 0; $totalSavingsData[$savingItem->id]['total_interest_amount'] = 0; $totalSavingsData[$savingItem->id]['total_withdraw_amount'] = 0; } @endphp @foreach ($OfficerSamityProductWisefilteredData as $officerId => $samities) @php $offc = 0; $officersRawSpan = 0; foreach ($samities as $key => $products) { $officersRawSpan += $products['PrimaryProductIds']->count(); } //INITIALIZE OFFICER TOTAL VALUE $officerTotalAdditionalFee = 0; $officerTotalLoanAmount = 0; $officerTotalProcessingFee = 0; $officerTotalInsuranceAmount = 0; $officerRecoverableLoanAmount = 0; $officerPrincipleLoanCollection = 0; $officerInterestAmountOfLoanCollection = 0; $officerInstallmentClaimed = 0; $officerScheduleAmountAtStartDate = 0; $officerCollectionAmountAtStartDate = 0; $officerScheduleAmountAtEndDate = 0; $officerCollectionAmountAtEndDate = 0; $officerLoanCollection = 0; $officerRegularLoanCollection = 0; $officerDueAmount = 0; $officerAdvanceAmount = 0; $officerRebateAmount = 0; $officerTotalPassbookFee = 0; $officerTotalAdmissionFee = 0; $officerTotalSavingsData = []; foreach ($savingsProducts as $key => $savingItem) { $officerTotalSavingsData[$savingItem->id]['total_deposit_amount'] = 0; $officerTotalSavingsData[$savingItem->id]['total_interest_amount'] = 0; $officerTotalSavingsData[$savingItem->id]['total_withdraw_amount'] = 0; } @endphp @foreach ($samities as $samity => $products) @if (isset($products['PrimaryProductIds'])) @php $samt = 0; @endphp @foreach ($products['PrimaryProductIds'] as $product => $item) @php $offc++; $samt++; $fieldOfficersInfos = DB::table('hr_emp_general_info') ->where('id', $officerId) ->select('id', 'emp_id', 'emp_name_english') ->first(); $samityInfos = DB::table('mfn_samity') ->where([['id', $samity], ['branchId', $branchId]]) ->select('id', 'name', 'code') ->first(); $productName = DB::table('mfn_loans_product') ->select('shortName') ->where('id', $product) ->first(); @endphp @if ($offc == 1) @endif @if ($samt == 1) @endif @php $savingsData = $item['savingsAccountsData']; @endphp {{-- deposit --}} @foreach ($savingsProducts as $savingsProduct) @php $savingsId = $savingsProduct->id; if (isset($savingsData[$savingsId])) { $savingsItem = isset($savingsData[$savingsProduct->id]['total_deposit_amount']) ? $savingsData[$savingsProduct->id]['total_deposit_amount']: 0; }else{ $savingsItem = 0.00; } //OFFICER TOTAL SAVINGS CALCUALTION $officerTotalSavingsData[$savingsId]['total_deposit_amount'] += $savingsItem; //GRAND TOTAL SAVINGS CALCUALTION $totalSavingsData[$savingsId]['total_deposit_amount'] += $savingsItem; @endphp @endforeach {{-- interest --}} @foreach ($savingsProducts as $savingsProduct) @php $savingsId = $savingsProduct->id; if (isset($savingsData[$savingsId])) { $savingsItem = isset($savingsData[$savingsProduct->id]['total_interest_amount']) ? $savingsData[$savingsProduct->id]['total_interest_amount']: 0; }else{ $savingsItem = 0.00; } //OFFICER TOTAL SAVINGS CALCUALTION $officerTotalSavingsData[$savingsId]['total_interest_amount'] += $savingsItem; //GRAND TOTAL SAVINGS CALCUALTION $totalSavingsData[$savingsId]['total_interest_amount'] += $savingsItem; @endphp @endforeach {{-- withdraw --}} @foreach ($savingsProducts as $savingsProduct) @php $savingsId = $savingsProduct->id; if (isset($savingsData[$savingsId])) { $savingsItem = isset($savingsData[$savingsProduct->id]['total_withdraw_amount']) ? $savingsData[$savingsProduct->id]['total_withdraw_amount']: 0; }else{ $savingsItem = 0.00; } //OFFICER TOTAL SAVINGS CALCUALTION $officerTotalSavingsData[$savingsId]['total_withdraw_amount'] += $savingsItem; //GRAND TOTAL SAVINGS CALCUALTION $totalSavingsData[$savingsId]['total_withdraw_amount'] += $savingsItem; @endphp @endforeach {{-- calcualte grand total --}} @php //CALCUALTE OFFICER TOTAL $officerTotalAdditionalFee += $item['additionalFee']; $officerTotalLoanAmount += $item['loanAmount']; $officerTotalProcessingFee += $item['processingFee']; $officerTotalInsuranceAmount += $item['insuranceAmount']; $officerRecoverableLoanAmount += $item['recoverableInstallmentAmount']; $officerPrincipleLoanCollection += $item['principleLoanCollection']; $officerInterestAmountOfLoanCollection += $item['interestAmountOfLoanCollection']; $officerLoanCollection += ($item['principleLoanCollection'] + $item['interestAmountOfLoanCollection']); $officerRegularLoanCollection += $item['regularCollection']; $officerDueAmount += $item['dueCollection']; $officerAdvanceAmount += $item['advanceCollection']; $officerRebateAmount += $item['rebateAmount']; $officerTotalPassbookFee += $item['passbookFee']; $officerTotalAdmissionFee += $item['admissionFee']; //CALCULATE GRAND TOTAL $grndtotalAdditionalFee += $item['additionalFee']; $grndtotalLoanAmount += $item['loanAmount']; $grndtotalprocessingFee += $item['processingFee']; $grndtotalInsuranceAmount += $item['insuranceAmount']; $grndrecoverableLoanAmount += $item['recoverableInstallmentAmount']; $grndprincipleLoanCollection += $item['principleLoanCollection']; $grndinterestAmountOfLoanCollection += $item['interestAmountOfLoanCollection']; $grndloanCollection += ($item['principleLoanCollection'] + $item['interestAmountOfLoanCollection']); $grndregularLoanCollection += $item['regularCollection']; $grnddueAmount += $item['dueCollection']; $grndadvanceAmount += $item['advanceCollection']; $grndrebateAmount += $item['rebateAmount']; $grndtotal_passbookFee += $item['passbookFee']; $grndtotal_admissionFee += $item['admissionFee']; @endphp @endforeach @endif @endforeach @foreach ($officerTotalSavingsData as $totalSvingsItem) @endforeach @foreach ($officerTotalSavingsData as $totalSvingsItem) @endforeach @foreach ($officerTotalSavingsData as $totalSvingsItem) @endforeach @endforeach @foreach ($totalSavingsData as $totalSvingsItem) @endforeach @foreach ($totalSavingsData as $totalSvingsItem) @endforeach @foreach ($totalSavingsData as $totalSvingsItem) @endforeach @php $savings_total_deposit_amount = 0; $savings_total_interest_amount = 0; $savings_total_withdraw_amount = 0; foreach ($totalSavingsData as $key => $totalSvingsItem) { $savings_total_deposit_amount += $totalSvingsItem['total_deposit_amount']; $savings_total_interest_amount += $totalSvingsItem['total_interest_amount']; $savings_total_withdraw_amount += $totalSvingsItem['total_withdraw_amount']; } @endphp
Field Worker Samity Component Savings Collection Interest On Savings Savings Refund Additional
Fee
Collection
Disbursement
Amount
Regular
Recoverable
Loan Collection Ins.
Claim
Processing
Fee
Passbook
Fee
Admission
Fee
ID Name ID Name{{ $savingsProduct->shortName }}{{ $savingsProduct->shortName }}{{ $savingsProduct->shortName }}Regular Due Advance Rebate Total Collection
Loan Received
(Principle)
Loan Received
(Service Charge)
Total
{{ $fieldOfficersInfos->emp_id }} {{ $fieldOfficersInfos->emp_name_english }} {{ $samityInfos->code }} {{ $samityInfos->name }}{{$productName->shortName ?? $product}}{{$savingsItem}}{{$savingsItem}}{{$savingsItem}}{{ number_format($item['additionalFee'],2) }} {{ number_format($item['loanAmount'],2) }} {{ number_format($item['recoverableInstallmentAmount'],2) }} {{ number_format($item['regularCollection'],2) }} {{ number_format($item['dueCollection'],2) }} {{ number_format($item['advanceCollection'],2) }} {{ number_format($item['rebateAmount'],2) }} {{ number_format($item['principleLoanCollection'],2) }} {{ number_format($item['interestAmountOfLoanCollection'],2) }} {{ number_format(($item['principleLoanCollection'] + $item['interestAmountOfLoanCollection']),2)}} {{ number_format($item['insuranceAmount'],2) }} {{ number_format($item['processingFee'],2) }} {{ number_format($item['passbookFee'],2) }} {{ number_format($item['admissionFee'],2) }}
Officer Total{{ number_format($totalSvingsItem['total_deposit_amount'], 2) }}{{ number_format($totalSvingsItem['total_interest_amount'], 2) }}{{ number_format($totalSvingsItem['total_withdraw_amount'], 2) }}{{ number_format($officerTotalAdditionalFee, 2) }} {{ number_format($officerTotalLoanAmount, 2) }} {{ number_format($officerRecoverableLoanAmount, 2) }} {{ number_format($officerRegularLoanCollection, 2) }} {{ number_format($officerDueAmount, 2) }} {{ number_format($officerAdvanceAmount, 2) }} {{ number_format($officerRebateAmount, 2) }} {{ number_format($officerPrincipleLoanCollection, 2) }} {{ number_format($officerInterestAmountOfLoanCollection, 2) }} {{ number_format($officerLoanCollection, 2) }} {{ number_format($officerTotalInsuranceAmount, 2) }} {{ number_format($officerTotalProcessingFee, 2) }} {{ number_format($officerTotalPassbookFee, 2) }} {{ number_format($officerTotalAdmissionFee, 2) }}
Grand Total{{ number_format($totalSvingsItem['total_deposit_amount'], 2) }}{{ number_format($totalSvingsItem['total_interest_amount'], 2) }}{{ number_format($totalSvingsItem['total_withdraw_amount'], 2) }}{{ number_format($grndtotalAdditionalFee, 2) }} {{ number_format($grndtotalLoanAmount, 2) }} {{ number_format($grndrecoverableLoanAmount, 2) }} {{ number_format($grndregularLoanCollection, 2) }} {{ number_format($grnddueAmount, 2) }} {{ number_format($grndadvanceAmount, 2) }} {{ number_format($grndrebateAmount, 2) }} {{ number_format($grndprincipleLoanCollection, 2) }} {{ number_format($grndinterestAmountOfLoanCollection, 2) }} {{ number_format($grndloanCollection, 2) }} {{ number_format($grndtotalInsuranceAmount, 2) }} {{ number_format($grndtotalprocessingFee, 2) }} {{ number_format($grndtotal_passbookFee, 2) }} {{ number_format($grndtotal_admissionFee, 2) }}
Savings Grand Total{{ number_format($savings_total_deposit_amount, 2) }} {{ number_format($savings_total_interest_amount, 2) }} {{ number_format($savings_total_withdraw_amount, 2) }}