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:
Ralph Hopman
2025-01-29 10:36:13 +01:00
committed by Adam Saghy
parent c2777170be
commit 06693a65f0
23 changed files with 155 additions and 138 deletions
@@ -63,7 +63,7 @@
fxFlex="96%"
labelPosition="before"
matTooltip="{{ 'tooltips.To be used with SAME AS REPAYMENT PERIOD' | translate }}"
formControlName="allowPartialPeriodInterestCalcualtion"
formControlName="allowPartialPeriodInterestCalculation"
>
{{ 'labels.inputs.Calculate interest for exact days in partial period' | translate }}
</mat-checkbox>
@@ -62,7 +62,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
this.isLinkedToFloatingInterestRates.valueChanges.subscribe((isLinkedToFloatingInterestRates: any) => {
if (isLinkedToFloatingInterestRates) {
this.loanProductSettingsForm.get('isInterestRecalculationEnabled').setValue(true);
this.loanProductSettingsForm.get('allowPartialPeriodInterestCalcualtion').setValue(true);
this.loanProductSettingsForm.get('allowPartialPeriodInterestCalculation').setValue(true);
}
});
@@ -98,7 +98,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
interestType: this.loanProductsTemplate.interestType.id,
isEqualAmortization: this.loanProductsTemplate.isEqualAmortization,
interestCalculationPeriodType: this.loanProductsTemplate.interestCalculationPeriodType.id,
allowPartialPeriodInterestCalcualtion: this.loanProductsTemplate.allowPartialPeriodInterestCalcualtion,
allowPartialPeriodInterestCalculation: this.loanProductsTemplate.allowPartialPeriodInterestCalculation,
transactionProcessingStrategyCode: transactionProcessingStrategyCode,
graceOnPrincipalPayment: this.loanProductsTemplate.graceOnPrincipalPayment,
graceOnInterestPayment: this.loanProductsTemplate.graceOnInterestPayment,
@@ -291,7 +291,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
holdGuaranteeFunds: [false],
multiDisburseLoan: [false],
allowAttributeConfiguration: [true],
allowPartialPeriodInterestCalcualtion: [false],
allowPartialPeriodInterestCalculation: [false],
allowAttributeOverrides: this.formBuilder.group({
amortizationType: [true],
interestType: [true],
@@ -323,7 +323,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
.get('interestCalculationPeriodType')
.valueChanges.subscribe((interestCalculationPeriodType: any) => {
if (interestCalculationPeriodType === 0) {
this.loanProductSettingsForm.patchValue({ allowPartialPeriodInterestCalcualtion: false });
this.loanProductSettingsForm.patchValue({ allowPartialPeriodInterestCalculation: false });
}
});
@@ -73,6 +73,11 @@ export class LoanProducts {
delete loanProduct.allowAttributeConfiguration;
delete loanProduct.advancedAccountingRules;
// In Fineract, the POST and PUT endpoints for /v1/loanproducts have a typo in the field
// allowPartialPeriodInterestCalculation. Until that is fixed, we need to replace the field name in the payload.
loanProduct.allowPartialPeriodInterestCalcualtion = loanProduct.allowPartialPeriodInterestCalculation;
delete loanProduct.allowPartialPeriodInterestCalculation;
// Set Default values If they were not set
itemsByDefault.forEach((config: GlobalConfiguration) => {
const propertyName = this.resolvePropertyName(config.name);
@@ -90,7 +90,7 @@ export class GeneralTabComponent implements OnInit {
productCopy['currencyCode'] = productCopy['currency'] ? productCopy['currency']['code'] : null;
productCopy['interestRatePerPeriod'] = productCopy['annualInterestRate'];
productCopy['transactionProcessingStrategyCode'] = productCopy['transactionProcessingStrategyName'];
productCopy['allowPartialPeriodInterestCalcualtion'] = productCopy['allowPartialPeriodInterestCalculation'];
productCopy['allowPartialPeriodInterestCalculation'] = productCopy['allowPartialPeriodInterestCalculation'];
productCopy['locale'] = this.settingsService.language.code;
let valueTmp: any = productCopy['daysInMonthType']['value'];