Skip to content

Commit 5298cbe

Browse files
authored
Merge pull request #2632 from alberto-art3ch/WEB-304/loan-product-edition-breaked
WEB-304: Accounting settings gets lost on Loan product edit screen
2 parents 7e5ed86 + 18b20ec commit 5298cbe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/app/products/loan-products/loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,18 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
142142
enableAccrualActivityPosting: this.loanProductsTemplate.enableAccrualActivityPosting
143143
});
144144
if (this.deferredIncomeRecognition) {
145-
if (this.deferredIncomeRecognition.capitalizedIncome.enableIncomeCapitalization) {
145+
if (this.deferredIncomeRecognition.capitalizedIncome?.enableIncomeCapitalization) {
146146
this.loanProductAccountingForm.patchValue({
147147
deferredIncomeLiabilityAccountId: accountingMappings.deferredIncomeLiabilityAccount.id,
148148
incomeFromCapitalizationAccountId: accountingMappings.incomeFromCapitalizationAccount.id
149149
});
150150
}
151-
if (this.deferredIncomeRecognition.buyDownFee.enableBuyDownFee) {
151+
if (this.deferredIncomeRecognition.buyDownFee?.enableBuyDownFee) {
152152
this.loanProductAccountingForm.patchValue({
153153
deferredIncomeLiabilityAccountId: accountingMappings.deferredIncomeLiabilityAccount.id,
154154
incomeFromBuyDownAccountId: accountingMappings.incomeFromBuyDownAccount.id
155155
});
156-
if (this.deferredIncomeRecognition.buyDownFee.merchantBuyDownFee) {
156+
if (this.deferredIncomeRecognition.buyDownFee?.merchantBuyDownFee) {
157157
this.loanProductAccountingForm.patchValue({
158158
buyDownExpenseAccountId: accountingMappings.buyDownExpenseAccount?.id
159159
});
@@ -599,8 +599,8 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
599599
if (this.isAccountingAccrualBased) {
600600
if (this.deferredIncomeRecognition) {
601601
if (
602-
this.deferredIncomeRecognition.capitalizedIncome.enableIncomeCapitalization ||
603-
this.deferredIncomeRecognition.buyDownFee.enableBuyDownFee
602+
this.deferredIncomeRecognition.capitalizedIncome?.enableIncomeCapitalization ||
603+
this.deferredIncomeRecognition.buyDownFee?.enableBuyDownFee
604604
) {
605605
this.loanProductAccountingForm.addControl(
606606
'deferredIncomeLiabilityAccountId',
@@ -609,16 +609,16 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
609609
} else {
610610
this.loanProductAccountingForm.removeControl('deferredIncomeLiabilityAccountId');
611611
}
612-
if (this.deferredIncomeRecognition.capitalizedIncome.enableIncomeCapitalization) {
612+
if (this.deferredIncomeRecognition.capitalizedIncome?.enableIncomeCapitalization) {
613613
this.loanProductAccountingForm.addControl(
614614
'incomeFromCapitalizationAccountId',
615615
new UntypedFormControl('', Validators.required)
616616
);
617617
} else {
618618
this.loanProductAccountingForm.removeControl('incomeFromCapitalizationAccountId');
619619
}
620-
if (this.deferredIncomeRecognition.buyDownFee.enableBuyDownFee) {
621-
if (this.deferredIncomeRecognition.buyDownFee.merchantBuyDownFee) {
620+
if (this.deferredIncomeRecognition.buyDownFee?.enableBuyDownFee) {
621+
if (this.deferredIncomeRecognition.buyDownFee?.merchantBuyDownFee) {
622622
this.loanProductAccountingForm.addControl(
623623
'buyDownExpenseAccountId',
624624
new UntypedFormControl('', Validators.required)

0 commit comments

Comments
 (0)