Merge pull request #2014 from alberto-art3ch/enhacement/undo_loan_reaging_transaction

Allow Undo Loan re-aging transaction
This commit is contained in:
Jose Alberto Hernandez
2024-03-05 11:53:39 -06:00
committed by GitHub
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-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-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-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, 'Undo Charge-Off': boolean,
'Sell Loan': boolean, 'Sell Loan': boolean,
'Buy Back Loan': boolean, 'Buy Back Loan': boolean,
'Re-Ageing': boolean 'Re-Age': boolean
} = { } = {
'Close': false, 'Close': false,
'Undo Approval': false, 'Undo Approval': false,
@@ -79,7 +79,7 @@ export class LoanAccountActionsComponent {
'Undo Charge-Off': false, 'Undo Charge-Off': false,
'Sell Loan': false, 'Sell Loan': false,
'Buy Back Loan': false, 'Buy Back Loan': false,
'Re-Ageing': false 'Re-Age': false
}; };
actionButtonData: any; actionButtonData: any;
@@ -174,10 +174,16 @@ export class LoansViewComponent implements OnInit {
// Allow Re-Ageing only when there is not any Re-Age transaction // Allow Re-Ageing only when there is not any Re-Age transaction
if (!this.loanReAged) { if (!this.loanReAged) {
this.buttonConfig.addButton({ this.buttonConfig.addButton({
name: 'Re-Ageing', name: 'Re-Age',
icon: 'calendar', icon: 'calendar',
taskPermissionName: 'REAGE_LOAN', 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' }; const queryParams: any = { loanId: this.loanId, accountType: 'fromloans' };
this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams }); this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams });
break; break;
case 'Undo Re-Age':
this.undoReAge();
break;
default: default:
this.router.navigate(['actions', button], { relativeTo: this.route }); this.router.navigate(['actions', button], { relativeTo: this.route });
break; 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() { iconLoanStatusColor() {
if (this.loanDetailsData.chargedOff) { if (this.loanDetailsData.chargedOff) {
return 'loanStatusType.chargeoff'; return 'loanStatusType.chargeoff';
@@ -1,31 +1,33 @@
export interface LoanTransactionType { export interface LoanTransactionType {
id: number; id: number;
code: string; code: string;
value: string; value: string;
accrual: boolean; disbursement: 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;
repaymentAtDisbursement: boolean; repaymentAtDisbursement: boolean;
waiveCharges: boolean; repayment: boolean;
waiveInterest: boolean; merchantIssuedRefund: boolean;
withdrawTransfer: boolean; payoutRefund: boolean;
writeOff: 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;
} }
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Půjčka před výplatou", "Prepay Loan": "Půjčka před výplatou",
"Products": "produkty", "Products": "produkty",
"Profile": "Profil", "Profile": "Profil",
"Re-Ageing": "Stárnutí", "Re-Age": "Stárnutí",
"Recover From Guarantor": "Vymáhání od ručitele", "Recover From Guarantor": "Vymáhání od ručitele",
"Recovery Payment": "Platba obnovy", "Recovery Payment": "Platba obnovy",
"Reject": "Odmítnout", "Reject": "Odmítnout",
@@ -2167,6 +2167,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 Re-Age": "Zrušit Stárnutí",
"User Management": "správa uživatelů", "User Management": "správa uživatelů",
"User Panel": "Uživatelský panel", "User Panel": "Uživatelský panel",
"Users": "Uživatelé", "Users": "Uživatelé",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Darlehen mit Vorauszahlung", "Prepay Loan": "Darlehen mit Vorauszahlung",
"Products": "Produkte", "Products": "Produkte",
"Profile": "Profil", "Profile": "Profil",
"Re-Ageing": "Altern", "Re-Age": "Altern",
"Recover From Guarantor": "Rückforderung vom Bürgen", "Recover From Guarantor": "Rückforderung vom Bürgen",
"Recovery Payment": "Wiederherstellungszahlung", "Recovery Payment": "Wiederherstellungszahlung",
"Reject": "Ablehnen", "Reject": "Ablehnen",
@@ -2167,6 +2167,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 Re-Age": "Altern rückgängig machen",
"User Management": "Benutzerverwaltung", "User Management": "Benutzerverwaltung",
"User Panel": "Benutzerbereich", "User Panel": "Benutzerbereich",
"Users": "Benutzer", "Users": "Benutzer",
+2 -1
View File
@@ -2144,7 +2144,7 @@
"Prepay Loan": "Prepay Loan", "Prepay Loan": "Prepay Loan",
"Products": "Products", "Products": "Products",
"Profile": "Profile", "Profile": "Profile",
"Re-Ageing": "Re-Ageing", "Re-Age": "Re-Age",
"Recover From Guarantor": "Recover From Guarantor", "Recover From Guarantor": "Recover From Guarantor",
"Recovery Payment": "Recovery Payment", "Recovery Payment": "Recovery Payment",
"Reject": "Reject", "Reject": "Reject",
@@ -2166,6 +2166,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 Re-Age": "Undo Re-Age",
"User Management": "User Management", "User Management": "User Management",
"User Panel": "User Panel", "User Panel": "User Panel",
"Users": "Users", "Users": "Users",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Prepagar crédito", "Prepay Loan": "Prepagar crédito",
"Products": "Productos", "Products": "Productos",
"Profile": "Perfil", "Profile": "Perfil",
"Re-Ageing": "Envejecimiento", "Re-Age": "Envejecimiento",
"Recover From Guarantor": "Recuperar del Garante", "Recover From Guarantor": "Recuperar del Garante",
"Recovery Payment": "Pago de recuperación", "Recovery Payment": "Pago de recuperación",
"Reject": "Rechazar", "Reject": "Rechazar",
@@ -2167,6 +2167,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 Re-Age": "Deshacer Envejecimiento",
"User Management": "Gestión de usuarios", "User Management": "Gestión de usuarios",
"User Panel": "Panel de usuario", "User Panel": "Panel de usuario",
"Users": "Usuarios", "Users": "Usuarios",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Prêt à remboursement anticipé", "Prepay Loan": "Prêt à remboursement anticipé",
"Products": "Des produits", "Products": "Des produits",
"Profile": "Profil", "Profile": "Profil",
"Re-Ageing": "Vieillissement", "Re-Age": "Vieillissement",
"Recover From Guarantor": "Récupération auprès du garant", "Recover From Guarantor": "Récupération auprès du garant",
"Recovery Payment": "Paiement de récupération", "Recovery Payment": "Paiement de récupération",
"Reject": "Rejeter", "Reject": "Rejeter",
@@ -2167,6 +2167,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 Re-Age": "Annuler le Vieillissement",
"User Management": "Gestion des utilisateurs", "User Management": "Gestion des utilisateurs",
"User Panel": "Panneau utilisateur", "User Panel": "Panneau utilisateur",
"Users": "Utilisateurs", "Users": "Utilisateurs",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Prestito con pagamento anticipato", "Prepay Loan": "Prestito con pagamento anticipato",
"Products": "Prodotti", "Products": "Prodotti",
"Profile": "Profilo", "Profile": "Profilo",
"Re-Ageing": "Invecchiamento", "Re-Age": "Invecchiamento",
"Recover From Guarantor": "Recupero dal garante", "Recover From Guarantor": "Recupero dal garante",
"Recovery Payment": "Pagamento di recupero", "Recovery Payment": "Pagamento di recupero",
"Reject": "Rifiutare", "Reject": "Rifiutare",
@@ -2167,6 +2167,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 Re-Age": "Annullare l'invecchiamento",
"User Management": "Gestione utenti", "User Management": "Gestione utenti",
"User Panel": "Pannello Utente", "User Panel": "Pannello Utente",
"Users": "Utenti", "Users": "Utenti",
+2 -1
View File
@@ -2146,7 +2146,7 @@
"Prepay Loan": "선불대출", "Prepay Loan": "선불대출",
"Products": "제품", "Products": "제품",
"Profile": "프로필", "Profile": "프로필",
"Re-Ageing": "노화", "Re-Age": "노화",
"Recover From Guarantor": "보증인으로부터의 회복", "Recover From Guarantor": "보증인으로부터의 회복",
"Reject": "거부하다", "Reject": "거부하다",
"Reports": "보고서", "Reports": "보고서",
@@ -2167,6 +2167,7 @@
"Undo Activation": "실행 취소 활성화", "Undo Activation": "실행 취소 활성화",
"Undo Approval": "승인 취소", "Undo Approval": "승인 취소",
"Undo Disbursal": "지급 취소", "Undo Disbursal": "지급 취소",
"Undo Re-Age": "노화 취소",
"User Management": "사용자 관리", "User Management": "사용자 관리",
"User Panel": "사용자 패널", "User Panel": "사용자 패널",
"Users": "사용자", "Users": "사용자",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Išankstinio mokėjimo paskola", "Prepay Loan": "Išankstinio mokėjimo paskola",
"Products": "Produktai", "Products": "Produktai",
"Profile": "Profilis", "Profile": "Profilis",
"Re-Ageing": "Senėjimas", "Re-Age": "Senėjimas",
"Recover From Guarantor": "Išieškojimas iš garanto", "Recover From Guarantor": "Išieškojimas iš garanto",
"Recovery Payment": "Išieškojimo mokėjimas", "Recovery Payment": "Išieškojimo mokėjimas",
"Reject": "Atmesti", "Reject": "Atmesti",
@@ -2167,6 +2167,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 Re-Age": "Anuliuoti senėjimas",
"User Management": "Vartotojo valdymas", "User Management": "Vartotojo valdymas",
"User Panel": "Vartotojo skydelis", "User Panel": "Vartotojo skydelis",
"Users": "Vartotojai", "Users": "Vartotojai",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Priekšapmaksas aizdevums", "Prepay Loan": "Priekšapmaksas aizdevums",
"Products": "Produkti", "Products": "Produkti",
"Profile": "Profils", "Profile": "Profils",
"Re-Ageing": "Novecošanās", "Re-Age": "Novecošanās",
"Recover From Guarantor": "Atgūšana no galvotāja", "Recover From Guarantor": "Atgūšana no galvotāja",
"Recovery Payment": "Atgūšanas maksājums", "Recovery Payment": "Atgūšanas maksājums",
"Reject": "Noraidīt", "Reject": "Noraidīt",
@@ -2167,6 +2167,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 Re-Age": "Atsaukt novecošanās",
"User Management": "Lietotāju pārvaldība", "User Management": "Lietotāju pārvaldība",
"User Panel": "Lietotāja panelis", "User Panel": "Lietotāja panelis",
"Users": "Lietotāji", "Users": "Lietotāji",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "पूर्व भुक्तानी ऋण", "Prepay Loan": "पूर्व भुक्तानी ऋण",
"Products": "उत्पादनहरू", "Products": "उत्पादनहरू",
"Profile": "प्रोफाइल", "Profile": "प्रोफाइल",
"Re-Ageing": "बुढ्यौडो", "Re-Age": "बुढ्यौडो",
"Recover From Guarantor": "ग्यारेन्टरबाट रिकभरी", "Recover From Guarantor": "ग्यारेन्टरबाट रिकभरी",
"Recovery Payment": "रिकभरी भुक्तानी", "Recovery Payment": "रिकभरी भुक्तानी",
"Reject": "अस्वीकार गर्नुहोस्", "Reject": "अस्वीकार गर्नुहोस्",
@@ -2167,6 +2167,7 @@
"Undo Activation": "अन्डु सक्रियता", "Undo Activation": "अन्डु सक्रियता",
"Undo Approval": "अनुमोदन अनडू गर्नुहोस्", "Undo Approval": "अनुमोदन अनडू गर्नुहोस्",
"Undo Disbursal": "वितरण पूर्ववत गर्नुहोस्", "Undo Disbursal": "वितरण पूर्ववत गर्नुहोस्",
"Undo Re-Age": "बुढ्यौडो अनडू",
"User Management": "प्रयोगकर्ता व्यवस्थापन", "User Management": "प्रयोगकर्ता व्यवस्थापन",
"User Panel": "प्रयोगकर्ता प्यानल", "User Panel": "प्रयोगकर्ता प्यानल",
"Users": "प्रयोगकर्ताहरू", "Users": "प्रयोगकर्ताहरू",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Empréstimo pré-pago", "Prepay Loan": "Empréstimo pré-pago",
"Products": "Produtos", "Products": "Produtos",
"Profile": "Perfil", "Profile": "Perfil",
"Re-Ageing": "Envelhecimento", "Re-Age": "Envelhecimento",
"Recover From Guarantor": "Recuperação do Fiador", "Recover From Guarantor": "Recuperação do Fiador",
"Recovery Payment": "Pagamento de recuperação", "Recovery Payment": "Pagamento de recuperação",
"Reject": "Rejeitar", "Reject": "Rejeitar",
@@ -2167,6 +2167,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 Re-Age": "Desfazer envelhecimento",
"User Management": "Gerenciamento de usuários", "User Management": "Gerenciamento de usuários",
"User Panel": "Painel do usuário", "User Panel": "Painel do usuário",
"Users": "Usuários", "Users": "Usuários",
+2 -1
View File
@@ -2145,7 +2145,7 @@
"Prepay Loan": "Lipa Mkopo", "Prepay Loan": "Lipa Mkopo",
"Products": "Bidhaa", "Products": "Bidhaa",
"Profile": "Wasifu", "Profile": "Wasifu",
"Re-Ageing": "Kuzeeka", "Re-Age": "Kuzeeka",
"Recover From Guarantor": "Urejeshaji Kutoka kwa Mdhamini", "Recover From Guarantor": "Urejeshaji Kutoka kwa Mdhamini",
"Recovery Payment": "Malipo ya uokoaji", "Recovery Payment": "Malipo ya uokoaji",
"Reject": "Kataa", "Reject": "Kataa",
@@ -2167,6 +2167,7 @@
"Undo Activation": "Uanzishaji", "Undo Activation": "Uanzishaji",
"Undo Approval": "Tendua Uidhinishaji", "Undo Approval": "Tendua Uidhinishaji",
"Undo Disbursal": "Tendua Utoaji", "Undo Disbursal": "Tendua Utoaji",
"Undo Re-Age": "Tendua Kuzeeka",
"User Management": "Usimamizi wa Mtumiaji", "User Management": "Usimamizi wa Mtumiaji",
"User Panel": "Jopo la Mtumiaji", "User Panel": "Jopo la Mtumiaji",
"Users": "Watumiaji", "Users": "Watumiaji",