Undo Loan Charge-off transaction

This commit is contained in:
Jose Alberto Hernandez
2025-01-02 01:40:30 -05:00
committed by Jose Alberto Hernandez
parent 54ac7b4612
commit 5e5c7ed47d
15 changed files with 33 additions and 6 deletions
@@ -54,7 +54,6 @@
<mifosx-add-loan-charge *ngIf="actions['Add Loan Charge']"></mifosx-add-loan-charge> <mifosx-add-loan-charge *ngIf="actions['Add Loan Charge']"></mifosx-add-loan-charge>
<mifosx-edit-repayment-schedule *ngIf="actions['Edit Repayment Schedule']"></mifosx-edit-repayment-schedule> <mifosx-edit-repayment-schedule *ngIf="actions['Edit Repayment Schedule']"></mifosx-edit-repayment-schedule>
<mifosx-charge-off [dataObject]="actionButtonData" *ngIf="actions['Charge-Off']"></mifosx-charge-off> <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-asset-transfer-loan *ngIf="actions['Sell Loan'] || actions['Buy Back Loan']"></mifosx-asset-transfer-loan>
<mifosx-loan-reaging [dataObject]="actionButtonData" *ngIf="actions['Re-Age']"></mifosx-loan-reaging> <mifosx-loan-reaging [dataObject]="actionButtonData" *ngIf="actions['Re-Age']"></mifosx-loan-reaging>
<mifosx-loan-reamortize [dataObject]="actionButtonData" *ngIf="actions['Re-Amortize']"></mifosx-loan-reamortize> <mifosx-loan-reamortize [dataObject]="actionButtonData" *ngIf="actions['Re-Amortize']"></mifosx-loan-reamortize>
@@ -42,7 +42,6 @@ export class LoanAccountActionsComponent {
'Credit Balance Refund': boolean, 'Credit Balance Refund': boolean,
'Edit Repayment Schedule': boolean, 'Edit Repayment Schedule': boolean,
'Charge-Off': boolean, 'Charge-Off': boolean,
'Undo Charge-Off': boolean,
'Sell Loan': boolean, 'Sell Loan': boolean,
'Buy Back Loan': boolean, 'Buy Back Loan': boolean,
'Re-Age': boolean 'Re-Age': boolean
@@ -76,7 +75,6 @@ export class LoanAccountActionsComponent {
'Credit Balance Refund': false, 'Credit Balance Refund': false,
'Edit Repayment Schedule': false, 'Edit Repayment Schedule': false,
'Charge-Off': false, 'Charge-Off': false,
'Undo Charge-Off': false,
'Sell Loan': false, 'Sell Loan': false,
'Buy Back Loan': false, 'Buy Back Loan': false,
'Re-Age': false 'Re-Age': false
@@ -176,6 +176,12 @@ export class LoansViewComponent implements OnInit {
icon: 'coins', icon: 'coins',
taskPermissionName: 'CHARGEOFF_LOAN' taskPermissionName: 'CHARGEOFF_LOAN'
}); });
} else {
this.buttonConfig.addButton({
name: 'Undo Charge-Off',
icon: 'undo',
taskPermissionName: 'UNDOCHARGEOFF_LOAN'
});
} }
// Allow Re-Ageing only when there is not any Re-Age transaction // Allow Re-Ageing only when there is not any Re-Age transaction
@@ -226,7 +232,8 @@ export class LoansViewComponent implements OnInit {
break; break;
case 'Undo Re-Age': case 'Undo Re-Age':
case 'Undo Re-Amortize': case 'Undo Re-Amortize':
this.undoReAgeOrReAmortize(actionName); case 'Undo Charge-Off':
this.undoLoanAction(actionName);
break; break;
default: default:
this.router.navigate(['actions', actionName], { relativeTo: this.route }); this.router.navigate(['actions', actionName], { relativeTo: this.route });
@@ -261,7 +268,7 @@ export class LoansViewComponent implements OnInit {
} }
} }
undoReAgeOrReAmortize(actionName: string): void { undoLoanAction(actionName: string): void {
actionName = actionName.replace('Undo ', ''); actionName = actionName.replace('Undo ', '');
const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, { const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { data: {
@@ -271,7 +278,18 @@ export class LoansViewComponent implements OnInit {
}); });
undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => { undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) { if (response.confirm) {
const undoCommand = actionName === 'Re-Age' ? 'undoReAge' : 'undoReAmortize'; let undoCommand: string = '';
switch (actionName) {
case 'Re-Age':
undoCommand = 'undoReAge';
break;
case 'Re-Amortize':
undoCommand = 'undoReAmortize';
break;
case 'Charge-Off':
undoCommand = 'undo-charge-off';
break;
}
this.loansService.executeLoansAccountTransactionsCommand(String(this.loanId), undoCommand, {}).subscribe(() => { this.loansService.executeLoansAccountTransactionsCommand(String(this.loanId), undoCommand, {}).subscribe(() => {
this.reload(); this.reload();
}); });
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Znovu aktivace", "Undo Activation": "Znovu aktivace",
"Undo Approval": "Zrušit schválení", "Undo Approval": "Zrušit schválení",
"Undo Disbursal": "Zrušit výplatu", "Undo Disbursal": "Zrušit výplatu",
"Undo Charge-Off": "Zrušit Charge-Off",
"Undo Last Disbursal": "Zrušit poslední výplatu", "Undo Last Disbursal": "Zrušit poslední výplatu",
"Undo Re-Age": "Zrušit Stárnutí", "Undo Re-Age": "Zrušit Stárnutí",
"Undo Re-Amortize": "Zrušit Amortizovat", "Undo Re-Amortize": "Zrušit Amortizovat",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Aktivierung rückgängig", "Undo Activation": "Aktivierung rückgängig",
"Undo Approval": "Genehmigung rückgängig machen", "Undo Approval": "Genehmigung rückgängig machen",
"Undo Disbursal": "Auszahlung rückgängig machen", "Undo Disbursal": "Auszahlung rückgängig machen",
"Undo Charge-Off": "Abladen rückgängig machen",
"Undo Last Disbursal": "Letzte Auszahlung rückgängig machen", "Undo Last Disbursal": "Letzte Auszahlung rückgängig machen",
"Undo Re-Age": "Altern rückgängig machen", "Undo Re-Age": "Altern rückgängig machen",
"Undo Re-Amortize": "Amortisieren rückgängig machen", "Undo Re-Amortize": "Amortisieren rückgängig machen",
+1
View File
@@ -2539,6 +2539,7 @@
"Undo Activation": "Undo Activation", "Undo Activation": "Undo Activation",
"Undo Approval": "Undo Approval", "Undo Approval": "Undo Approval",
"Undo Disbursal": "Undo Disbursal", "Undo Disbursal": "Undo Disbursal",
"Undo Charge-Off": "Undo Charge-Off",
"Undo Last Disbursal": "Undo Last Disbursal", "Undo Last Disbursal": "Undo Last Disbursal",
"Undo Re-Age": "Undo Re-Age", "Undo Re-Age": "Undo Re-Age",
"Undo Re-Amortize": "Undo Re-Amortize", "Undo Re-Amortize": "Undo Re-Amortize",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Deshacer la activación", "Undo Activation": "Deshacer la activación",
"Undo Approval": "Deshacer aprobación", "Undo Approval": "Deshacer aprobación",
"Undo Disbursal": "Deshacer desembolso", "Undo Disbursal": "Deshacer desembolso",
"Undo Charge-Off": "Deshacer Cancelación",
"Undo Last Disbursal": "Deshacer el último desembolso", "Undo Last Disbursal": "Deshacer el último desembolso",
"Undo Re-Age": "Deshacer Envejecimiento", "Undo Re-Age": "Deshacer Envejecimiento",
"Undo Re-Amortize": "Deshacer Amortizar", "Undo Re-Amortize": "Deshacer Amortizar",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Annuler l'activation", "Undo Activation": "Annuler l'activation",
"Undo Approval": "Annuler l'approbation", "Undo Approval": "Annuler l'approbation",
"Undo Disbursal": "Annuler le décaissement", "Undo Disbursal": "Annuler le décaissement",
"Undo Charge-Off": "Annuler le Amortir",
"Undo Last Disbursal": "Annuler le dernier décaissement", "Undo Last Disbursal": "Annuler le dernier décaissement",
"Undo Re-Age": "Annuler le Vieillissement", "Undo Re-Age": "Annuler le Vieillissement",
"Undo Re-Amortize": "Annuler le Amortir", "Undo Re-Amortize": "Annuler le Amortir",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Annullare l'attivazione", "Undo Activation": "Annullare l'attivazione",
"Undo Approval": "Annulla l'approvazione", "Undo Approval": "Annulla l'approvazione",
"Undo Disbursal": "Annullare l'esborso", "Undo Disbursal": "Annullare l'esborso",
"Undo Charge-Off": "Annullare l'addebito",
"Undo Last Disbursal": "Annulla l'ultimo esborso", "Undo Last Disbursal": "Annulla l'ultimo esborso",
"Undo Re-Age": "Annullare l'invecchiamento", "Undo Re-Age": "Annullare l'invecchiamento",
"Undo Re-Amortize": "Annullare l'ammortizzare", "Undo Re-Amortize": "Annullare l'ammortizzare",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "실행 취소 활성화", "Undo Activation": "실행 취소 활성화",
"Undo Approval": "승인 취소", "Undo Approval": "승인 취소",
"Undo Disbursal": "지급 취소", "Undo Disbursal": "지급 취소",
"Undo Charge-Off": "상각 취소",
"Undo Last Disbursal": "마지막 지불 취소", "Undo Last Disbursal": "마지막 지불 취소",
"Undo Re-Age": "노화 취소", "Undo Re-Age": "노화 취소",
"Undo Re-Amortize": "상각합니다 취소", "Undo Re-Amortize": "상각합니다 취소",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Anuliuoti aktyvaciją", "Undo Activation": "Anuliuoti aktyvaciją",
"Undo Approval": "Anuliuoti patvirtinimą", "Undo Approval": "Anuliuoti patvirtinimą",
"Undo Disbursal": "Anuliuoti išmokėjimą", "Undo Disbursal": "Anuliuoti išmokėjimą",
"Undo Charge-Off": "Anuliuoti Atsakingas už",
"Undo Last Disbursal": "Anuliuoti paskutinę išmokėjimą", "Undo Last Disbursal": "Anuliuoti paskutinę išmokėjimą",
"Undo Re-Age": "Anuliuoti senėjimas", "Undo Re-Age": "Anuliuoti senėjimas",
"Undo Re-Amortize": "Anuliuoti amortize", "Undo Re-Amortize": "Anuliuoti amortize",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Atsaukt aktivizēšanu", "Undo Activation": "Atsaukt aktivizēšanu",
"Undo Approval": "Atsaukt apstiprinājumu", "Undo Approval": "Atsaukt apstiprinājumu",
"Undo Disbursal": "Atsaukt izmaksu", "Undo Disbursal": "Atsaukt izmaksu",
"Undo Charge-Off": "Atsaukt Charge-Off",
"Undo Last Disbursal": "Atsaukt pēdējo izmaksu", "Undo Last Disbursal": "Atsaukt pēdējo izmaksu",
"Undo Re-Age": "Atsaukt novecošanās", "Undo Re-Age": "Atsaukt novecošanās",
"Undo Re-Amortize": "Atsaukt amortizēt", "Undo Re-Amortize": "Atsaukt amortizēt",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "अन्डु सक्रियता", "Undo Activation": "अन्डु सक्रियता",
"Undo Approval": "अनुमोदन अनडू गर्नुहोस्", "Undo Approval": "अनुमोदन अनडू गर्नुहोस्",
"Undo Disbursal": "वितरण पूर्ववत गर्नुहोस्", "Undo Disbursal": "वितरण पूर्ववत गर्नुहोस्",
"Undo Charge-Off": "चार्ज-अफ गर्नुहोस्",
"Undo Last Disbursal": "पछिल्लो वितरण पूर्ववत गर्नुहोस्", "Undo Last Disbursal": "पछिल्लो वितरण पूर्ववत गर्नुहोस्",
"Undo Re-Age": "बुढ्यौडो अनडू", "Undo Re-Age": "बुढ्यौडो अनडू",
"Undo Re-Amortize": "परिणत गर्नुहोस् अनडू", "Undo Re-Amortize": "परिणत गर्नुहोस् अनडू",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Desfazer ativação", "Undo Activation": "Desfazer ativação",
"Undo Approval": "Desfazer aprovação", "Undo Approval": "Desfazer aprovação",
"Undo Disbursal": "Desfazer desembolso", "Undo Disbursal": "Desfazer desembolso",
"Undo Charge-Off": "Desfazer Cobrança",
"Undo Last Disbursal": "Desfazer último desembolso", "Undo Last Disbursal": "Desfazer último desembolso",
"Undo Re-Age": "Desfazer envelhecimento", "Undo Re-Age": "Desfazer envelhecimento",
"Undo Re-Amortize": "Desfazer amortizar", "Undo Re-Amortize": "Desfazer amortizar",
+1
View File
@@ -2538,6 +2538,7 @@
"Undo Activation": "Uanzishaji", "Undo Activation": "Uanzishaji",
"Undo Approval": "Tendua Uidhinishaji", "Undo Approval": "Tendua Uidhinishaji",
"Undo Disbursal": "Tendua Utoaji", "Undo Disbursal": "Tendua Utoaji",
"Undo Charge-Off": "Tendua Chaji-Zima",
"Undo Last Disbursal": "Tendua Utoaji wa Mwisho", "Undo Last Disbursal": "Tendua Utoaji wa Mwisho",
"Undo Re-Age": "Tendua Kuzeeka", "Undo Re-Age": "Tendua Kuzeeka",
"Undo Re-Amortize": "Tendua Adize", "Undo Re-Amortize": "Tendua Adize",