Add Buy down fee transaction to Loan

This commit is contained in:
Jose Alberto Hernandez
2025-06-19 21:52:18 -05:00
parent 11d0d4270e
commit e1f08ff355
18 changed files with 31 additions and 2 deletions
@@ -77,6 +77,8 @@ export class LoanActionButtonResolver {
return this.loansService.getLoanActionTemplate(loanId, 'capitalizedIncome');
} else if (loanActionButton === 'Contract Termination') {
return this.loansService.getLoanActionTemplate(loanId, 'contractTermination');
} else if (loanActionButton === 'Buy Down Fee') {
return this.loansService.getLoanActionTemplate(loanId, 'buyDownFee');
} else {
return undefined;
}
@@ -12,6 +12,7 @@
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Make Repayment']"></mifosx-make-repayment>
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Capitalized Income']"></mifosx-make-repayment>
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Goodwill Credit']"></mifosx-make-repayment>
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Buy Down Fee']"></mifosx-make-repayment>
<mifosx-make-repayment
[dataObject]="actionButtonData"
*ngIf="actions['Interest Payment Waiver']"
@@ -53,6 +53,7 @@ export class LoanAccountActionsComponent {
'Add Interest Pause': boolean;
'Capitalized Income': boolean;
'Contract Termination': boolean;
'Buy Down Fee': boolean;
} = {
Close: false,
'Undo Approval': false,
@@ -90,7 +91,8 @@ export class LoanAccountActionsComponent {
'Interest Payment Waiver': false,
'Add Interest Pause': false,
'Capitalized Income': false,
'Contract Termination': false
'Contract Termination': false,
'Buy Down Fee': false
};
actionButtonData: any;
@@ -127,7 +127,7 @@ export class MakeRepaymentComponent implements OnInit {
}
showDetails(): boolean {
return !this.isCapitalizedIncome();
return !this.isCapitalizedIncome() && !this.isBuyDownFee();
}
isCapitalizedIncome(): boolean {
@@ -137,6 +137,12 @@ export class MakeRepaymentComponent implements OnInit {
].includes(this.command);
}
isBuyDownFee(): boolean {
return [
'buyDownFee'
].includes(this.command);
}
/** Submits the repayment form */
submit() {
const repaymentLoanFormData = this.repaymentLoanForm.value;
@@ -142,6 +142,11 @@ export class LoansViewComponent implements OnInit {
taskPermissionName: 'DISBURSE_LOAN'
});
} else if (this.status === 'Active') {
this.buttonConfig.addButton({
name: 'Buy Down Fee',
icon: 'plus',
taskPermissionName: 'BUY_DOWN_FEE_LOAN'
});
if (this.loanDetailsData.enableIncomeCapitalization) {
this.buttonConfig.addButton({
name: 'Capitalized Income',