Skip to content

Commit 0fff471

Browse files
committed
WEB-213: Loan product config - buy down fees accounting
1 parent 6dc4283 commit 0fff471

File tree

18 files changed

+101
-13
lines changed

18 files changed

+101
-13
lines changed

src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.html

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,14 @@ <h4 class="mat-h4 flex-100">{{ 'labels.heading.Income' | translate }}</h4>
10421042
[withTitle]="'47%'"
10431043
>
10441044
</mifosx-gl-account-display>
1045+
<mifosx-gl-account-display
1046+
class="flex-100"
1047+
*ngIf="accountingMappings.incomeFromBuyDownAccount"
1048+
[accountTitle]="'Income from Buy down fees'"
1049+
[glAccount]="accountingMappings.incomeFromBuyDownAccount"
1050+
[withTitle]="'47%'"
1051+
>
1052+
</mifosx-gl-account-display>
10451053

10461054
<h4 class="mat-h4 flex-100">{{ 'labels.heading.Expenses' | translate }}</h4>
10471055

@@ -1076,6 +1084,14 @@ <h4 class="mat-h4 flex-100">{{ 'labels.heading.Expenses' | translate }}</h4>
10761084
[withTitle]="'47%'"
10771085
>
10781086
</mifosx-gl-account-display>
1087+
<mifosx-gl-account-display
1088+
class="flex-100"
1089+
*ngIf="accountingMappings.buyDownExpenseAccount"
1090+
[accountTitle]="'Buy down fee Expense'"
1091+
[glAccount]="accountingMappings.buyDownExpenseAccount"
1092+
[withTitle]="'47%'"
1093+
>
1094+
</mifosx-gl-account-display>
10791095

10801096
<h4 class="mat-h4 flex-fill">{{ 'labels.heading.Liabilities' | translate }}</h4>
10811097
<mifosx-gl-account-display

src/app/products/loan-products/common/loan-product-summary/loan-product-summary.component.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,16 @@ export class LoanProductSummaryComponent implements OnInit, OnChanges {
202202
this.loanProduct.incomeFromCapitalizationAccountId,
203203
incomeAccountData
204204
),
205+
incomeFromBuyDownAccount: this.glAccountLookUp(
206+
this.loanProduct.incomeFromBuyDownAccountId,
207+
incomeAccountData
208+
),
205209

206210
writeOffAccount: this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
207211
goodwillCreditAccount: this.glAccountLookUp(this.loanProduct.goodwillCreditAccountId, expenseAccountData),
208212
chargeOffExpenseAccount: this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
209213
chargeOffFraudExpenseAccount: this.glAccountLookUp(this.loanProduct.writeOffAccountId, expenseAccountData),
214+
buyDownExpenseAccount: this.glAccountLookUp(this.loanProduct.buyDownExpenseAccountId, expenseAccountData),
210215

211216
overpaymentLiabilityAccount: this.glAccountLookUp(
212217
this.loanProduct.overpaymentLiabilityAccountId,

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,16 @@ <h4 class="mat-h4 flex-98">{{ 'labels.heading.Income' | translate }}</h4>
190190
>
191191
</mifosx-gl-account-selector>
192192

193+
<mifosx-gl-account-selector
194+
class="flex-48"
195+
*ngIf="deferredIncomeRecognition?.buyDownFee?.enableBuyDownFee"
196+
[inputFormControl]="loanProductAccountingForm.controls.incomeFromBuyDownAccountId"
197+
[glAccountList]="incomeAccountData"
198+
[required]="true"
199+
[inputLabel]="'Income from Buy down fees'"
200+
>
201+
</mifosx-gl-account-selector>
202+
193203
<mat-divider class="flex-98"></mat-divider>
194204

195205
<h4 class="mat-h4 flex-98">{{ 'labels.heading.Expenses' | translate }}</h4>
@@ -230,6 +240,16 @@ <h4 class="mat-h4 flex-98">{{ 'labels.heading.Expenses' | translate }}</h4>
230240
>
231241
</mifosx-gl-account-selector>
232242

243+
<mifosx-gl-account-selector
244+
class="flex-48"
245+
*ngIf="deferredIncomeRecognition?.buyDownFee?.enableBuyDownFee"
246+
[inputFormControl]="loanProductAccountingForm.controls.buyDownExpenseAccountId"
247+
[glAccountList]="expenseAccountData"
248+
[required]="true"
249+
[inputLabel]="'Buy down fee Expense'"
250+
>
251+
</mifosx-gl-account-selector>
252+
233253
<mat-divider class="flex-98"></mat-divider>
234254

235255
<h4 class="mat-h4 flex-98">{{ 'labels.heading.Liabilities' | translate }}</h4>

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
155155
incomeFromCapitalizationAccountId: accountingMappings.incomeFromCapitalizationAccount.id
156156
});
157157
}
158+
if (this.deferredIncomeRecognition.buyDownFee.enableBuyDownFee) {
159+
this.loanProductAccountingForm.patchValue({
160+
buyDownExpenseAccountId: accountingMappings.buyDownExpenseAccount.id,
161+
incomeFromBuyDownAccountId: accountingMappings.incomeFromBuyDownAccount.id
162+
});
163+
}
158164
}
159165
/* falls through */
160166
case 2:
@@ -607,6 +613,19 @@ export class LoanProductAccountingStepComponent implements OnInit, OnChanges {
607613
this.loanProductAccountingForm.removeControl('deferredIncomeLiabilityAccountId');
608614
this.loanProductAccountingForm.removeControl('incomeFromCapitalizationAccountId');
609615
}
616+
if (this.deferredIncomeRecognition.buyDownFee.enableBuyDownFee) {
617+
this.loanProductAccountingForm.addControl(
618+
'buyDownExpenseAccountId',
619+
new UntypedFormControl('', Validators.required)
620+
);
621+
this.loanProductAccountingForm.addControl(
622+
'incomeFromBuyDownAccountId',
623+
new UntypedFormControl('', Validators.required)
624+
);
625+
} else {
626+
this.loanProductAccountingForm.removeControl('buyDownExpenseAccountId');
627+
this.loanProductAccountingForm.removeControl('incomeFromBuyDownAccountId');
628+
}
610629
}
611630
}
612631
}

src/app/products/loan-products/models/loan-product.model.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,10 @@ export interface LoanProduct {
121121
// Accounting
122122
accountingRule: any;
123123
accountingMappings?: { [key: string]: AccountingMapping };
124+
buyDownExpenseAccountId?: number;
124125
fundSourceAccountId?: number;
125126
goodwillCreditAccountId?: number;
127+
incomeFromBuyDownAccountId?: number;
126128
incomeFromCapitalizationAccountId?: number;
127129
incomeFromChargeOffFeesAccountId?: number;
128130
incomeFromChargeOffInterestAccountId?: number;

src/assets/translations/cs-CS.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,9 @@
24772477
"Buy down fee calculation type": "Typ výpočtu poplatku za odkup",
24782478
"Buy down fee strategy": "Strategie poplatku za odkup",
24792479
"Buy down fee income type": "Typ příjmu z poplatku za odkup",
2480-
"Buy down fees": "Poplatky za odkup"
2480+
"Buy down fees": "Poplatky za odkup",
2481+
"Income from Buy down fees": "Příjmy z poplatků za odkup",
2482+
"Buy down fee Expense": "Náklady na poplatek za odkup"
24812483
},
24822484
"links": {
24832485
"Community": "Společenství",

src/assets/translations/de-DE.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,9 @@
24772477
"Buy down fee calculation type": "Berechnungsart der Buy-Down-Gebühr",
24782478
"Buy down fee strategy": "Strategie für Buy-Down-Gebühr",
24792479
"Buy down fee income type": "Einnahmeart der Buy-Down-Gebühr",
2480-
"Buy down fees": "Buy-Down-Gebühren"
2480+
"Buy down fees": "Buy-Down-Gebühren",
2481+
"Income from Buy down fees": "Einnahmen aus Buy-Down-Gebühren",
2482+
"Buy down fee Expense": "Aufwendungen aus Buy-Down-Gebühren"
24812483
},
24822484
"links": {
24832485
"Community": "Gemeinschaft",

src/assets/translations/en-US.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2484,7 +2484,9 @@
24842484
"Buy down fee calculation type": "Buy down fee calculation type",
24852485
"Buy down fee strategy": "Buy down fee strategy",
24862486
"Buy down fee income type": "Buy down fee income type",
2487-
"Buy down fees": "Buy down fees"
2487+
"Buy down fees": "Buy down fees",
2488+
"Income from Buy down fees": "Income from Buy down fees",
2489+
"Buy down fee Expense": "Buy down fee Expense"
24882490
},
24892491
"links": {
24902492
"Community": "Community",

src/assets/translations/es-CL.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,9 @@
24772477
"Buy down fee calculation type": "Tipo de cálculo de comisión de compra anticipada",
24782478
"Buy down fee strategy": "Estrategia de comisión de compra anticipada",
24792479
"Buy down fee income type": "Tipo de ingreso de comisión de compra anticipada",
2480-
"Buy down fees": "Tarifas de compra anticipada"
2480+
"Buy down fees": "Tarifas de compra anticipada",
2481+
"Income from Buy down fees": "Ingresos por comisiones de compra inicial",
2482+
"Buy down fee Expense": "Gastos por comisiones de compra inicial"
24812483
},
24822484
"links": {
24832485
"Community": "Comunidad",

src/assets/translations/es-MX.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,9 @@
24772477
"Buy down fee calculation type": "Tipo de cálculo de comisión de compra anticipada",
24782478
"Buy down fee strategy": "Estrategia de comisión de compra anticipada",
24792479
"Buy down fee income type": "Tipo de ingreso de comisión de compra anticipada",
2480-
"Buy down fees": "Tarifas de compra anticipada"
2480+
"Buy down fees": "Tarifas de compra anticipada",
2481+
"Income from Buy down fees": "Ingresos por comisiones de compra inicial",
2482+
"Buy down fee Expense": "Gastos por comisiones de compra inicial"
24812483
},
24822484
"links": {
24832485
"Community": "Comunidad",

0 commit comments

Comments
 (0)