diff --git a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.html b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.html index 3176e7be7..352f5daad 100644 --- a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.html +++ b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.html @@ -336,7 +336,8 @@ + [paymentAllocation]="paymentAllocation" + [advancePaymentAllocationData]="advancePaymentAllocationData"> diff --git a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.ts b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.ts index 0f543e050..1f9987ae9 100644 --- a/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.ts +++ b/src/app/products/loan-products/view-loan-product/general-tab/general-tab.component.ts @@ -1,5 +1,6 @@ import { Component, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { AdvancePaymentAllocationData } from '../../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model'; @Component({ selector: 'mifosx-general-tab', @@ -15,6 +16,8 @@ export class GeneralTabComponent implements OnInit { paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId']; feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId']; + advancePaymentAllocationData: AdvancePaymentAllocationData | null = null; + constructor(private route: ActivatedRoute) { this.route.data.subscribe((data: { loanProduct: any }) => { this.loanProduct = data.loanProduct; diff --git a/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.ts b/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.ts index 71ef5bbd5..2518c00c0 100644 --- a/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.ts +++ b/src/app/products/loan-products/view-loan-product/shared/view-advance-paymeny-allocation/view-advance-paymeny-allocation.component.ts @@ -17,16 +17,25 @@ export class ViewAdvancePaymenyAllocationComponent implements OnInit { } transactionTypeValue(code: string): string { + if (this.advancePaymentAllocationData == null) { + return code; + } const transactionType = this.advancePaymentAllocationData.transactionTypes.find(t => t.code === code); return transactionType.value; } allocationRuleValue(code: string): string { + if (this.advancePaymentAllocationData == null) { + return code; + } const allocationType = this.advancePaymentAllocationData.allocationTypes.find(t => t.code === code); return allocationType.value; } futureInstallmentRuleValue(code: string): string { + if (this.advancePaymentAllocationData == null) { + return code; + } const futureInstallmentAllocationRule = this.advancePaymentAllocationData.futureInstallmentAllocationRules.find(t => t.code === code); return futureInstallmentAllocationRule.value; }