Skip to content

Commit 25aa2f7

Browse files
committed
WEB-246: add deferred income liability account handling for buy-down fee in loan product accounting form
1 parent cfea98c commit 25aa2f7

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,10 @@ <h4 class="mat-h4 flex-98">{{ 'labels.heading.Liabilities' | translate }}</h4>
264264
</mifosx-gl-account-selector>
265265

266266
<mifosx-gl-account-selector
267-
*ngIf="deferredIncomeRecognition?.capitalizedIncome?.enableIncomeCapitalization"
267+
*ngIf="
268+
deferredIncomeRecognition?.capitalizedIncome?.enableIncomeCapitalization ||
269+
deferredIncomeRecognition?.buyDownFee?.enableBuyDownFee
270+
"
268271
class="flex-48"
269272
[inputFormControl]="loanProductAccountingForm.controls.deferredIncomeLiabilityAccountId"
270273
[glAccountList]="liabilityAccountData"

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
157157
}
158158
if (this.deferredIncomeRecognition.buyDownFee.enableBuyDownFee) {
159159
this.loanProductAccountingForm.patchValue({
160+
deferredIncomeLiabilityAccountId: accountingMappings.deferredIncomeLiabilityAccount.id,
160161
buyDownExpenseAccountId: accountingMappings.buyDownExpenseAccount.id,
161162
incomeFromBuyDownAccountId: accountingMappings.incomeFromBuyDownAccount.id
162163
});
@@ -600,17 +601,23 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
600601
setDeferredIncomeRecognitionControls() {
601602
if (this.isAccountingAccrualBased) {
602603
if (this.deferredIncomeRecognition) {
603-
if (this.deferredIncomeRecognition.capitalizedIncome.enableIncomeCapitalization) {
604+
if (
605+
this.deferredIncomeRecognition.capitalizedIncome.enableIncomeCapitalization ||
606+
this.deferredIncomeRecognition.buyDownFee.enableBuyDownFee
607+
) {
604608
this.loanProductAccountingForm.addControl(
605609
'deferredIncomeLiabilityAccountId',
606610
new UntypedFormControl('', Validators.required)
607611
);
612+
} else {
613+
this.loanProductAccountingForm.removeControl('deferredIncomeLiabilityAccountId');
614+
}
615+
if (this.deferredIncomeRecognition.capitalizedIncome.enableIncomeCapitalization) {
608616
this.loanProductAccountingForm.addControl(
609617
'incomeFromCapitalizationAccountId',
610618
new UntypedFormControl('', Validators.required)
611619
);
612620
} else {
613-
this.loanProductAccountingForm.removeControl('deferredIncomeLiabilityAccountId');
614621
this.loanProductAccountingForm.removeControl('incomeFromCapitalizationAccountId');
615622
}
616623
if (this.deferredIncomeRecognition.buyDownFee.enableBuyDownFee) {

0 commit comments

Comments
 (0)