Allow Undo Loan re-aging transaction

This commit is contained in:
Jose Alberto Hernandez
2024-03-05 08:54:45 -06:00
parent b76b61bae5
commit 2ac05d26d8
16 changed files with 81 additions and 43 deletions
@@ -28,4 +28,4 @@
<mifosx-charge-off [dataObject]="actionButtonData" *ngIf="actions['Charge-Off']"></mifosx-charge-off>
<mifosx-undo-command [actionName]="actionName" *ngIf="actions['Undo Charge-Off']"></mifosx-undo-command>
<mifosx-asset-transfer-loan *ngIf="actions['Sell Loan'] || actions['Buy Back Loan']"></mifosx-asset-transfer-loan>
<mifosx-loan-reaging [dataObject]="actionButtonData" *ngIf="actions['Re-Ageing']"></mifosx-loan-reaging>
<mifosx-loan-reaging [dataObject]="actionButtonData" *ngIf="actions['Re-Age']"></mifosx-loan-reaging>
@@ -45,7 +45,7 @@ export class LoanAccountActionsComponent {
'Undo Charge-Off': boolean,
'Sell Loan': boolean,
'Buy Back Loan': boolean,
'Re-Ageing': boolean
'Re-Age': boolean
} = {
'Close': false,
'Undo Approval': false,
@@ -79,7 +79,7 @@ export class LoanAccountActionsComponent {
'Undo Charge-Off': false,
'Sell Loan': false,
'Buy Back Loan': false,
'Re-Ageing': false
'Re-Age': false
};
actionButtonData: any;
@@ -174,10 +174,16 @@ export class LoansViewComponent implements OnInit {
// Allow Re-Ageing only when there is not any Re-Age transaction
if (!this.loanReAged) {
this.buttonConfig.addButton({
name: 'Re-Ageing',
name: 'Re-Age',
icon: 'calendar',
taskPermissionName: 'REAGE_LOAN',
});
} else {
this.buttonConfig.addButton({
name: 'Undo Re-Age',
icon: 'undo',
taskPermissionName: 'UNDO_REAGE_LOAN',
});
}
}
}
@@ -197,6 +203,9 @@ export class LoansViewComponent implements OnInit {
const queryParams: any = { loanId: this.loanId, accountType: 'fromloans' };
this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams });
break;
case 'Undo Re-Age':
this.undoReAge();
break;
default:
this.router.navigate(['actions', button], { relativeTo: this.route });
break;
@@ -230,6 +239,21 @@ export class LoansViewComponent implements OnInit {
}
}
undoReAge(): void {
const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Undo Transaction'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + ' ReAge'
}
});
undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.loansService.executeLoansAccountTransactionsCommand(String(this.loanId), 'undoReAge', {}).subscribe(() => {
this.reload();
});
}
});
}
iconLoanStatusColor() {
if (this.loanDetailsData.chargedOff) {
return 'loanStatusType.chargeoff';
@@ -1,31 +1,33 @@
export interface LoanTransactionType {
id: number;
code: string;
value: string;
id: number;
code: string;
value: string;
accrual: boolean;
approveTransfer: boolean;
chargeAdjustment: boolean;
chargePayment: boolean;
chargeRefund: boolean;
chargeback: boolean;
chargeoff: boolean;
contra: boolean;
creditBalanceRefund: boolean;
disbursement: boolean;
downPayment: boolean;
goodwillCredit: boolean;
initiateTransfer: boolean;
merchantIssuedRefund: boolean;
payoutRefund: boolean;
recoveryRepayment: boolean;
refund: boolean;
refundForActiveLoans: boolean;
rejectTransfer: boolean;
repayment: boolean;
disbursement: boolean;
repaymentAtDisbursement: boolean;
waiveCharges: boolean;
waiveInterest: boolean;
withdrawTransfer: boolean;
writeOff: boolean;
repayment: boolean;
merchantIssuedRefund: boolean;
payoutRefund: boolean;
goodwillCredit: boolean;
chargeRefund: boolean;
contra: boolean;
waiveInterest: boolean;
waiveCharges: boolean;
accrual: boolean;
writeOff: boolean;
recoveryRepayment: boolean;
initiateTransfer: boolean;
approveTransfer: boolean;
withdrawTransfer: boolean;
rejectTransfer: boolean;
chargePayment: boolean;
refund: boolean;
refundForActiveLoans: boolean;
creditBalanceRefund: boolean;
chargeAdjustment: boolean;
chargeback: boolean;
chargeoff: boolean;
downPayment: boolean;
reAge: boolean;
reAmortize: boolean;
}