diff --git a/src/app/products/loan-products/create-loan-product/create-loan-product.component.ts b/src/app/products/loan-products/create-loan-product/create-loan-product.component.ts index e85902f633..b3a11e3536 100644 --- a/src/app/products/loan-products/create-loan-product/create-loan-product.component.ts +++ b/src/app/products/loan-products/create-loan-product/create-loan-product.component.ts @@ -154,7 +154,11 @@ export class CreateLoanProductComponent implements OnInit { loanProduct['dueDaysForRepaymentEvent'] = null; loanProduct['overDueDaysForRepaymentEvent'] = null; } - loanProduct['supportedInterestRefundTypes'] = this.mapStringEnumOptionToIdList(loanProduct['supportedInterestRefundTypes']); + if (this.isAdvancedPaymentStrategy) { + loanProduct['supportedInterestRefundTypes'] = this.mapStringEnumOptionToIdList(loanProduct['supportedInterestRefundTypes']); + } else { + delete loanProduct['supportedInterestRefundTypes']; + } delete loanProduct['useDueForRepaymentsConfigurations']; this.productsService.createLoanProduct(loanProduct) diff --git a/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts b/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts index d485bd40e8..c3dfae91f5 100644 --- a/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts +++ b/src/app/products/loan-products/edit-loan-product/edit-loan-product.component.ts @@ -184,7 +184,11 @@ export class EditLoanProductComponent implements OnInit { loanProduct['dueDaysForRepaymentEvent'] = null; loanProduct['overDueDaysForRepaymentEvent'] = null; } - loanProduct['supportedInterestRefundTypes'] = this.mapStringEnumOptionToIdList(loanProduct['supportedInterestRefundTypes']); + if (this.isAdvancedPaymentStrategy) { + loanProduct['supportedInterestRefundTypes'] = this.mapStringEnumOptionToIdList(loanProduct['supportedInterestRefundTypes']); + } else { + delete loanProduct['supportedInterestRefundTypes']; + } delete loanProduct['useDueForRepaymentsConfigurations']; this.productsService.updateLoanProduct(this.loanProductAndTemplate.id, loanProduct)