Merge pull request #2528 from alberto-art3ch/enhancement/loan_buy_down_fee_transaction

WEB-218: Add Buy down fee transaction to Loan
This commit is contained in:
Felix van Hove
2025-06-21 22:07:44 +02:00
committed by GitHub
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']"
@@ -115,6 +115,7 @@ export class LoanAccountActionsComponent {
'Add Interest Pause': boolean;
'Capitalized Income': boolean;
'Contract Termination': boolean;
'Buy Down Fee': boolean;
} = {
Close: false,
'Undo Approval': false,
@@ -152,7 +153,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;
@@ -145,7 +145,7 @@ export class MakeRepaymentComponent implements OnInit {
}
showDetails(): boolean {
return !this.isCapitalizedIncome();
return !this.isCapitalizedIncome() && !this.isBuyDownFee();
}
isCapitalizedIncome(): boolean {
@@ -155,6 +155,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;
@@ -183,6 +183,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',