@@ -76,86 +76,89 @@
-
-
-
-
{{ 'labels.inputs.Overdue Charges' | translate }}
-
-
-
- {{ 'labels.inputs.Overdue Charge' | translate }}
-
- @for (
- overdueCharge of overdueChargeData | chargesFilter: chargesDataSource : currencyCode.value;
- track overdueCharge
- ) {
-
- {{ overdueCharge.name }}
-
- }
-
-
-
-
-
diff --git a/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.ts b/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.ts
index dd21938e5c..6ca1aa14a1 100644
--- a/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.ts
+++ b/src/app/products/loan-products/loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component.ts
@@ -88,7 +88,7 @@ export class LoanProductChargesStepComponent extends LoanProductBaseComponent im
pristine = true;
ngOnInit() {
- this.chargeData = this.loanProductsTemplate.chargeOptions;
+ this.chargeData = this.loanProductsTemplate.chargeOptions || [];
this.overdueChargeData = this.loanProductsTemplate.penaltyOptions
? this.loanProductsTemplate.penaltyOptions.filter(
(penalty: any) => penalty.chargeTimeType.code === 'chargeTimeType.overdueInstallment'
diff --git a/src/app/products/loan-products/loan-products.ts b/src/app/products/loan-products/loan-products.ts
index d64e5bc0a5..f6ee634e10 100644
--- a/src/app/products/loan-products/loan-products.ts
+++ b/src/app/products/loan-products/loan-products.ts
@@ -73,18 +73,14 @@ export class LoanProducts {
const dateFormat: string = this.settingsService.dateFormat;
const locale: string = this.settingsService.language.code;
- const loanProduct = this.loanProductService.isLoanProduct
- ? {
- ...loanProductData,
- charges: (loanProductData.charges || []).map((charge: any) => ({ id: charge.id })),
- dateFormat,
- locale
- }
- : {
- ...loanProductData,
- dateFormat,
- locale
- };
+ // Both product types accept the optional `charges` parameter as a list of `{ id }` references, and
+ // both replace the whole association list on update, so the mapping is shared.
+ const loanProduct = {
+ ...loanProductData,
+ charges: (loanProductData.charges || []).map((charge: any) => ({ id: charge.id })),
+ dateFormat,
+ locale
+ };
// Remove unnecessary properties
delete loanProduct.allowAttributeConfiguration;
delete loanProduct.advancedAccountingRules;