fix: allowPartialPeriodInterestCalculation
Due to a typo, the allowPartialPeriodInterestCalculation field was not processed correctly. Since the typo also occurs in some places in the Fineract API, the typo is re-introduced where needed.
This commit is contained in:
@@ -150,7 +150,7 @@ export class EditLoansAccountComponent {
|
||||
}
|
||||
|
||||
if (loansAccountData.interestCalculationPeriodType === 0) {
|
||||
loansAccountData.allowPartialPeriodInterestCalcualtion = false;
|
||||
loansAccountData.allowPartialPeriodInterestCalculation = false;
|
||||
}
|
||||
if (
|
||||
!loansAccountData.isLoanProductLinkedToFloatingRate ||
|
||||
@@ -161,6 +161,12 @@ export class EditLoansAccountComponent {
|
||||
loansAccountData.principal = loansAccountData.principalAmount;
|
||||
delete loansAccountData.principalAmount;
|
||||
delete loansAccountData.multiDisburseLoan;
|
||||
|
||||
// In Fineract, the POST and PUT endpoints for /v1/loans have a typo in the field
|
||||
// allowPartialPeriodInterestCalculation. Until that is fixed, we need to replace the field name in the payload.
|
||||
loansAccountData.allowPartialPeriodInterestCalcualtion = loansAccountData.allowPartialPeriodInterestCalculation;
|
||||
delete loansAccountData.allowPartialPeriodInterestCalculation;
|
||||
|
||||
this.loansService.updateLoansAccount(this.loanId, loansAccountData).subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
|
||||
+2
-2
@@ -130,9 +130,9 @@
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill *ngIf="loansAccount.allowPartialPeriodInterestCalcualtion">
|
||||
<div fxFlexFill *ngIf="loansAccount.allowPartialPeriodInterestCalculation">
|
||||
<span fxFlex="40%">{{ 'labels.inputs.Calculate interest for exact days in partial period' | translate }}:</span>
|
||||
<span fxFlex="60%">{{ loansAccount.allowPartialPeriodInterestCalcualtion }}</span>
|
||||
<span fxFlex="60%">{{ loansAccount.allowPartialPeriodInterestCalculation }}</span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill *ngIf="loansAccount.inArrearsTolerance">
|
||||
|
||||
+2
-2
@@ -138,9 +138,9 @@
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill *ngIf="loansAccount.allowPartialPeriodInterestCalcualtion">
|
||||
<div fxFlexFill *ngIf="loansAccount.allowPartialPeriodInterestCalculation">
|
||||
<span fxFlex="40%">{{ 'labels.inputs.Calculate interest for exact days in partial period' | translate }}:</span>
|
||||
<span fxFlex="60%">{{ loansAccount.allowPartialPeriodInterestCalcualtion }}</span>
|
||||
<span fxFlex="60%">{{ loansAccount.allowPartialPeriodInterestCalculation }}</span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill *ngIf="loansAccount.inArrearsTolerance">
|
||||
|
||||
+1
-1
@@ -320,7 +320,7 @@
|
||||
|
||||
<mat-checkbox
|
||||
fxFlex="48%"
|
||||
formControlName="allowPartialPeriodInterestCalcualtion"
|
||||
formControlName="allowPartialPeriodInterestCalculation"
|
||||
matTooltip="{{ 'tooltips.To be used with SAME AS REPAYMENT PERIOD' | translate }}"
|
||||
>
|
||||
<p>{{ 'labels.inputs.Calculate interest for exact days in partial period' | translate }}</p>
|
||||
|
||||
+4
-4
@@ -146,7 +146,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
interestType: this.loansAccountTermsData.interestType.id,
|
||||
isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '',
|
||||
interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id,
|
||||
allowPartialPeriodInterestCalcualtion: this.loansAccountTermsData.allowPartialPeriodInterestCalcualtion,
|
||||
allowPartialPeriodInterestCalculation: this.loansAccountTermsData.allowPartialPeriodInterestCalculation,
|
||||
inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance,
|
||||
graceOnPrincipalPayment: this.loansAccountTermsData.graceOnPrincipalPayment,
|
||||
graceOnInterestPayment: this.loansAccountTermsData.graceOnInterestPayment,
|
||||
@@ -203,7 +203,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
}
|
||||
if (!allowAttributeOverrides.interestCalculationPeriodType) {
|
||||
this.loansAccountTermsForm.controls.interestCalculationPeriodType.disable();
|
||||
this.loansAccountTermsForm.controls.allowPartialPeriodInterestCalcualtion.disable();
|
||||
this.loansAccountTermsForm.controls.allowPartialPeriodInterestCalculation.disable();
|
||||
}
|
||||
if (!allowAttributeOverrides.inArrearsTolerance) {
|
||||
this.loansAccountTermsForm.controls.inArrearsTolerance.disable();
|
||||
@@ -251,7 +251,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
interestType: this.loansAccountTermsData.interestType.id,
|
||||
isFloatingInterestRate: this.loansAccountTermsData.isLoanProductLinkedToFloatingRate ? false : '',
|
||||
interestCalculationPeriodType: this.loansAccountTermsData.interestCalculationPeriodType.id,
|
||||
allowPartialPeriodInterestCalcualtion: this.loansAccountTermsData.allowPartialPeriodInterestCalcualtion,
|
||||
allowPartialPeriodInterestCalculation: this.loansAccountTermsData.allowPartialPeriodInterestCalculation,
|
||||
inArrearsTolerance: this.loansAccountTermsData.inArrearsTolerance,
|
||||
graceOnPrincipalPayment: this.loansAccountTermsData.graceOnPrincipalPayment,
|
||||
graceOnInterestPayment: this.loansAccountTermsData.graceOnInterestPayment,
|
||||
@@ -396,7 +396,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
Validators.required
|
||||
],
|
||||
interestCalculationPeriodType: [''],
|
||||
allowPartialPeriodInterestCalcualtion: [''],
|
||||
allowPartialPeriodInterestCalculation: [''],
|
||||
inArrearsTolerance: [''],
|
||||
graceOnInterestCharged: [''],
|
||||
graceOnPrincipalPayment: [''],
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
<span fxFlex="50%">
|
||||
{{ 'labels.inputs.Allow Partial Interest Calculation with same as repayment' | translate }}</span
|
||||
>
|
||||
<span fxFlex="50%"> {{ loanDetails.allowPartialPeriodInterestCalcualtion | yesNo }} </span>
|
||||
<span fxFlex="50%"> {{ loanDetails.allowPartialPeriodInterestCalculation | yesNo }} </span>
|
||||
</div>
|
||||
|
||||
<div fxFlexFill>
|
||||
|
||||
@@ -634,7 +634,7 @@ export class LoansService {
|
||||
}
|
||||
|
||||
if (loansAccountData.interestCalculationPeriodType === 0) {
|
||||
loansAccountData.allowPartialPeriodInterestCalcualtion = false;
|
||||
loansAccountData.allowPartialPeriodInterestCalculation = false;
|
||||
}
|
||||
if (!(loansAccountData.isFloatingInterestRate === false)) {
|
||||
delete loansAccountData.isFloatingInterestRate;
|
||||
@@ -646,6 +646,12 @@ export class LoansService {
|
||||
loansAccountData.principal = loansAccountData.principalAmount;
|
||||
delete loansAccountData.principalAmount;
|
||||
delete loansAccountData.multiDisburseLoan; // this was just added so that disbursement data can be send in the backend
|
||||
|
||||
// In Fineract, the POST and PUT endpoints for /v1/loans have a typo in the field
|
||||
// allowPartialPeriodInterestCalculation. Until that is fixed, we need to replace the field name in the payload.
|
||||
loansAccountData.allowPartialPeriodInterestCalcualtion = loansAccountData.allowPartialPeriodInterestCalculation;
|
||||
delete loansAccountData.allowPartialPeriodInterestCalculation;
|
||||
|
||||
return loansAccountData;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user