Fix to display the Advance Payment Allocation data in Loan Product general tab (#1875)
Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
0bcf780a9f
commit
61f3ec24e9
+2
-1
@@ -336,7 +336,8 @@
|
|||||||
<span fxFlex="60%">
|
<span fxFlex="60%">
|
||||||
<mat-accordion>
|
<mat-accordion>
|
||||||
<mifosx-view-advance-paymeny-allocation *ngFor="let paymentAllocation of loanProduct.paymentAllocation"
|
<mifosx-view-advance-paymeny-allocation *ngFor="let paymentAllocation of loanProduct.paymentAllocation"
|
||||||
[paymentAllocation]="paymentAllocation">
|
[paymentAllocation]="paymentAllocation"
|
||||||
|
[advancePaymentAllocationData]="advancePaymentAllocationData">
|
||||||
</mifosx-view-advance-paymeny-allocation>
|
</mifosx-view-advance-paymeny-allocation>
|
||||||
</mat-accordion>
|
</mat-accordion>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute } from '@angular/router';
|
import { ActivatedRoute } from '@angular/router';
|
||||||
|
import { AdvancePaymentAllocationData } from '../../loan-product-stepper/loan-product-payment-strategy-step/payment-allocation-model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-general-tab',
|
selector: 'mifosx-general-tab',
|
||||||
@@ -15,6 +16,8 @@ export class GeneralTabComponent implements OnInit {
|
|||||||
paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId'];
|
paymentFundSourceDisplayedColumns: string[] = ['paymentTypeId', 'fundSourceAccountId'];
|
||||||
feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId'];
|
feesPenaltyIncomeDisplayedColumns: string[] = ['chargeId', 'incomeAccountId'];
|
||||||
|
|
||||||
|
advancePaymentAllocationData: AdvancePaymentAllocationData | null = null;
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute) {
|
constructor(private route: ActivatedRoute) {
|
||||||
this.route.data.subscribe((data: { loanProduct: any }) => {
|
this.route.data.subscribe((data: { loanProduct: any }) => {
|
||||||
this.loanProduct = data.loanProduct;
|
this.loanProduct = data.loanProduct;
|
||||||
|
|||||||
+9
@@ -17,16 +17,25 @@ export class ViewAdvancePaymenyAllocationComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
transactionTypeValue(code: string): string {
|
transactionTypeValue(code: string): string {
|
||||||
|
if (this.advancePaymentAllocationData == null) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
const transactionType = this.advancePaymentAllocationData.transactionTypes.find(t => t.code === code);
|
const transactionType = this.advancePaymentAllocationData.transactionTypes.find(t => t.code === code);
|
||||||
return transactionType.value;
|
return transactionType.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
allocationRuleValue(code: string): string {
|
allocationRuleValue(code: string): string {
|
||||||
|
if (this.advancePaymentAllocationData == null) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
const allocationType = this.advancePaymentAllocationData.allocationTypes.find(t => t.code === code);
|
const allocationType = this.advancePaymentAllocationData.allocationTypes.find(t => t.code === code);
|
||||||
return allocationType.value;
|
return allocationType.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
futureInstallmentRuleValue(code: string): string {
|
futureInstallmentRuleValue(code: string): string {
|
||||||
|
if (this.advancePaymentAllocationData == null) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
const futureInstallmentAllocationRule = this.advancePaymentAllocationData.futureInstallmentAllocationRules.find(t => t.code === code);
|
const futureInstallmentAllocationRule = this.advancePaymentAllocationData.futureInstallmentAllocationRules.find(t => t.code === code);
|
||||||
return futureInstallmentAllocationRule.value;
|
return futureInstallmentAllocationRule.value;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user