Loan Account Term calculation (#1871)
Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
co-authored by
Jose Alberto Hernandez
parent
ab55521a5a
commit
adef15df35
+2
-2
@@ -65,8 +65,8 @@
|
||||
|
||||
<mifosx-loan-product-payment-strategy-step
|
||||
[advancedPaymentAllocations]="advancedPaymentAllocations"
|
||||
[advancedPaymentAllocationTransactionTypes]="loanProductAndTemplate.advancedPaymentAllocationTransactionTypes"
|
||||
[paymentAllocationOrderDefault]="loanProductAndTemplate.advancedPaymentAllocationTypes"
|
||||
[advancedPaymentAllocationTransactionTypes]="loanProductsTemplate.advancedPaymentAllocationTransactionTypes"
|
||||
[paymentAllocationOrderDefault]="loanProductsTemplate.advancedPaymentAllocationTypes"
|
||||
(setPaymentAllocation)="setPaymentAllocation($event)"
|
||||
>
|
||||
</mifosx-loan-product-payment-strategy-step>
|
||||
|
||||
@@ -60,7 +60,9 @@ export class CreateLoanProductComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() { }
|
||||
ngOnInit() {
|
||||
this.buildAdvancedPaymentAllocation();
|
||||
}
|
||||
|
||||
get loanProductDetailsForm() {
|
||||
return this.loanProductDetailsStep.loanProductDetailsForm;
|
||||
@@ -85,7 +87,6 @@ export class CreateLoanProductComponent implements OnInit {
|
||||
}
|
||||
|
||||
setPaymentAllocation(paymentAllocation: PaymentAllocation[]): void {
|
||||
console.log(paymentAllocation);
|
||||
this.paymentAllocation = paymentAllocation;
|
||||
}
|
||||
|
||||
|
||||
+11
-9
@@ -53,16 +53,18 @@ export class AdvancedPaymentStrategy {
|
||||
const advancedPaymentAllocationTypes: PaymentAllocationOrder[] = loanProduct.advancedPaymentAllocationTypes;
|
||||
const advancedPaymentAllocationFutureInstallmentAllocationRules: FutureInstallmentAllocationRule[] =
|
||||
loanProduct.advancedPaymentAllocationFutureInstallmentAllocationRules;
|
||||
loanProduct.paymentAllocation.forEach((item: PaymentAllocation) => {
|
||||
advancedPaymentAllocation.push({
|
||||
transaction: this.getItemByCode(item.transactionType, advancedPaymentAllocationTransactionTypes),
|
||||
paymentAllocationOrder: this.buildCurrentPaymentAllocationOrder(item.paymentAllocationOrder,
|
||||
advancedPaymentAllocationTypes),
|
||||
futureInstallmentAllocationRule: this.getItemByCode(item.futureInstallmentAllocationRule,
|
||||
advancedPaymentAllocationFutureInstallmentAllocationRules),
|
||||
futureInstallmentAllocationRules: advancedPaymentAllocationFutureInstallmentAllocationRules,
|
||||
if (loanProduct.paymentAllocation) {
|
||||
loanProduct.paymentAllocation.forEach((item: PaymentAllocation) => {
|
||||
advancedPaymentAllocation.push({
|
||||
transaction: this.getItemByCode(item.transactionType, advancedPaymentAllocationTransactionTypes),
|
||||
paymentAllocationOrder: this.buildCurrentPaymentAllocationOrder(item.paymentAllocationOrder,
|
||||
advancedPaymentAllocationTypes),
|
||||
futureInstallmentAllocationRule: this.getItemByCode(item.futureInstallmentAllocationRule,
|
||||
advancedPaymentAllocationFutureInstallmentAllocationRules),
|
||||
futureInstallmentAllocationRules: advancedPaymentAllocationFutureInstallmentAllocationRules,
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
// If this is Empty, add the Default
|
||||
if (advancedPaymentAllocation.length === 0) {
|
||||
advancedPaymentAllocation.push({
|
||||
|
||||
Reference in New Issue
Block a user