Skip to content

Commit

Permalink
Support for Recurring Deposits undo Activation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Alberto Hernandez authored and adamsaghy committed Jan 15, 2024
1 parent ff49125 commit 3e58989
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<mifosx-activate-recurring-deposits-account *ngIf="actions['Activate']"></mifosx-activate-recurring-deposits-account>
<mifosx-undo-approval-recurring-deposits-account *ngIf="actions['Undo Approval']"></mifosx-undo-approval-recurring-deposits-account>
<mifosx-undo-approval-recurring-deposits-account *ngIf="actions['Undo Approval'] || actions['Undo Activation']"></mifosx-undo-approval-recurring-deposits-account>
<mifosx-approve-recurring-deposits-account *ngIf="actions['Approve']"></mifosx-approve-recurring-deposits-account>
<mifosx-reject-recurring-deposits-account *ngIf="actions['Reject']"></mifosx-reject-recurring-deposits-account>
<mifosx-withdraw-by-client-recurring-deposits-account *ngIf="actions['Withdrawn by client']"></mifosx-withdraw-by-client-recurring-deposits-account>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export class RecurringDepositsAccountActionsComponent {
/** Flag object to store possible actions and render appropriate UI to the user */
actions: {
'Activate': boolean
'Undo Activation': boolean
'Undo Approval': boolean
'Approve': boolean
'Reject': boolean
Expand All @@ -23,6 +24,7 @@ export class RecurringDepositsAccountActionsComponent {
'Withdrawal': boolean
} = {
'Activate': false,
'Undo Activation': false,
'Undo Approval': false,
'Approve': false,
'Reject': false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit {
undoApprovalRecurringDepositsAccountForm: UntypedFormGroup;
/** Recurring Deposits Account Id */
accountId: any;
/** Action to be Undo */
undoAction: string;
undoCommand: string;

/**
* @param {FormBuilder} formBuilder Form Builder
Expand All @@ -31,6 +34,11 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit {
private recurringDepositsService: RecurringDepositsService,
private route: ActivatedRoute,
private router: Router) {
this.undoCommand = 'undoapproval'; // Default command
this.undoAction = this.route.snapshot.params['name'];
if (this.undoAction === 'Undo Activation') {
this.undoCommand = 'undoactivate';
}
this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId'];
}

Expand Down Expand Up @@ -58,9 +66,15 @@ export class UndoApprovalRecurringDepositsAccountComponent implements OnInit {
const data = {
...this.undoApprovalRecurringDepositsAccountForm.value,
};
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'undoapproval', data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
if (this.undoAction === 'Undo Activation') {
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, this.undoCommand, data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
} else {
this.recurringDepositsService.executeRecurringDepositsAccountCommand(this.accountId, 'undoapproval', data).subscribe(() => {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,7 @@ <h3> {{"labels.heading.Account Overview" | translate}} </h3>
<mat-menu #accountMenu="matMenu">
<ng-container *ngFor="let item of buttonConfig.singleButtons">
<button mat-menu-item *mifosxHasPermission="item.taskPermissionName" (click)="doAction(item.name)">
<mat-icon matListIcon>
<fa-icon icon="{{item.icon}}" size="sm"></fa-icon>
</mat-icon>
<span> {{'labels.menus.' + item.name | translate}} </span>
<i ngClass="{{item.icon}}"></i> {{'labels.menus.' + item.name | translate}}
</button>
</ng-container>

Expand Down Expand Up @@ -105,7 +102,7 @@ <h3> {{"labels.heading.Account Overview" | translate}} </h3>
[active]="IRC.isActive">
{{"labels.inputs.Interest Rate Chart" | translate }}
</a>
<ng-container *ngIf="recurringDepositsAccountData.transactions">
<ng-container *ngIf="showTransactions">
<a mat-tab-link [routerLink]="['./transactions']" routerLinkActive #transactions="routerLinkActive"
[active]="transactions.isActive">
{{"labels.inputs.Transactions" | translate }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
isprematureAllowed: any;
entityType: string;
currency: Currency;
showTransactions = false;
/**
* Fetches recurringDeposits account data from `resolve`
* @param {ActivatedRoute} route Activated Route
Expand All @@ -64,6 +65,8 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
} else if (this.router.url.includes('centers')) {
this.entityType = 'Center';
}
const status: any = data.recurringDepositsAccountData.status;
this.showTransactions = (status.id >= 300);
});
}

Expand Down Expand Up @@ -156,6 +159,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
doAction(name: string) {
switch (name) {
case 'Activate':
case 'Undo Activation':
case 'Approve':
case 'Reject':
case 'Undo Approval':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ export class RecurringDepositsButtonsConfiguration {
name: 'Calculate Interest',
icon: 'calculator',
taskPermissionName: 'CALCULATEINTEREST_RECURRINGDEPOSITACCOUNT'
},
{
name: 'Undo Activation',
icon: 'fa fa-undo',
taskPermissionName: 'UNDO_ACTIVATE_RECURRINGDEPOSITACCOUNT'
}
];
break;
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/cs-CS.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Typ rodiče",
"Parent officeData": "Data mateřské kanceláře",
"Password": "Heslo",
"Password never expires": "Heslo Nikdy nevyprší",
"Passwords": "Hesla",
"Passwords should be": "Hesla by měla být",
"Past Due Days": "Dny po splatnosti",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Vyberte příslušné kanceláře",
"Selected Products": "Vybrané produkty",
"Send": "Poslat",
"Send password to email address": "Odeslat heslo na e -mailovou adresu",
"Server": "Server",
"Server Key": "Klíč serveru",
"Settlement": "Vyrovnání",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Odblokujte účet",
"Unblock Deposit": "Odblokovat vklad",
"Unblock Withdrawal": "Odblokovat výběr",
"Undo Activation": "Znovu aktivace",
"Undo Approval": "Zrušit schválení",
"Undo Disbursal": "Zrušit výplatu",
"User Management": "správa uživatelů",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Übergeordneter Typ",
"Parent officeData": "Daten des übergeordneten Büros",
"Password": "Passwort",
"Password never expires": "Passwort verfällt niemals",
"Passwords": "Passwörter",
"Passwords should be": "Passwörter sollten sein",
"Past Due Days": "Überfällige Tage",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Wählen Sie die entsprechenden Büros aus",
"Selected Products": "Ausgewählte Produkte",
"Send": "Schicken",
"Send password to email address": "Senden Sie Passwort an E -Mail -Adresse",
"Server": "Server",
"Server Key": "Serverschlüssel",
"Settlement": "Siedlung",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Konto entsperren",
"Unblock Deposit": "Entsperren Sie die Einzahlung",
"Unblock Withdrawal": "Entsperren Sie die Auszahlung",
"Undo Activation": "Aktivierung rückgängig",
"Undo Approval": "Genehmigung rückgängig machen",
"Undo Disbursal": "Auszahlung rückgängig machen",
"User Management": "Benutzerverwaltung",
Expand Down
1 change: 1 addition & 0 deletions src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -2151,6 +2151,7 @@
"Unblock Account": "Unblock Account",
"Unblock Deposit": "Unblock Deposit",
"Unblock Withdrawal": "Unblock Withdrawal",
"Undo Activation": "Undo Activation",
"Undo Approval": "Undo Approval",
"Undo Disbursal": "Undo Disbursal",
"User Management": "User Management",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Tipo de padre",
"Parent officeData": "Oficina matrizDatos",
"Password": "Contraseña",
"Password never expires": "La contraseña nunca expira",
"Passwords": "Contraseñas",
"Passwords should be": "Las contraseñas deben ser",
"Past Due Days": "Días vencidos",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Seleccione las oficinas aplicables",
"Selected Products": "Productos seleccionados",
"Send": "Enviar",
"Send password to email address": "Enviar contraseña al correo electrónico",
"Server": "Servidor",
"Server Key": "Clave del servidor",
"Settlement": "Asentamiento",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Desbloquear cuenta",
"Unblock Deposit": "Desbloquear depósito",
"Unblock Withdrawal": "Desbloquear retiro",
"Undo Activation": "Deshacer la activación",
"Undo Approval": "Deshacer aprobación",
"Undo Disbursal": "Deshacer desembolso",
"User Management": "Gestión de usuarios",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Type de parent",
"Parent officeData": "Bureau parentDonnées",
"Password": "Mot de passe",
"Password never expires": "Le mot de passe n'expire jamais",
"Passwords": "Mots de passe",
"Passwords should be": "Les mots de passe doivent être",
"Past Due Days": "Jours en souffrance",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Sélectionnez les bureaux concernés",
"Selected Products": "Produits sélectionnés",
"Send": "Envoyer",
"Send password to email address": "Envoyer un mot de passe à l'adresse e-mail",
"Server": "Serveur",
"Server Key": "Clé du serveur",
"Settlement": "Règlement",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Débloquer le compte",
"Unblock Deposit": "Débloquer le dépôt",
"Unblock Withdrawal": "Débloquer le retrait",
"Undo Activation": "Annuler l'activation",
"Undo Approval": "Annuler l'approbation",
"Undo Disbursal": "Annuler le décaissement",
"User Management": "Gestion des utilisateurs",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Tipo genitore",
"Parent officeData": "Dati della sede principale",
"Password": "Parola d'ordine",
"Password never expires": "La password non ha scadenza",
"Passwords": "Le password",
"Passwords should be": "Le password dovrebbero essere",
"Past Due Days": "Giorni scaduti",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Seleziona gli uffici applicabili",
"Selected Products": "Prodotti selezionati",
"Send": "Inviare",
"Send password to email address": "Invia password all'indirizzo e -mail",
"Server": "server",
"Server Key": "Chiave del server",
"Settlement": "Insediamento",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Sblocca conto",
"Unblock Deposit": "Sblocca deposito",
"Unblock Withdrawal": "Sblocca il ritiro",
"Undo Activation": "Annullare l'attivazione",
"Undo Approval": "Annulla l'approvazione",
"Undo Disbursal": "Annullare l'esborso",
"User Management": "Gestione utenti",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/ko-KO.json
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,7 @@
"Parent Type": "상위 유형",
"Parent officeData": "본사데이터",
"Password": "비밀번호",
"Password never expires": "암호는 만료되지 않습니다",
"Passwords": "비밀번호",
"Passwords should be": "비밀번호는 다음과 같아야 합니다.",
"Past Due Days": "연체일",
Expand Down Expand Up @@ -1850,6 +1851,7 @@
"Select applicable offices": "해당 사무소를 선택하세요",
"Selected Products": "선택된 제품",
"Send": "보내다",
"Send password to email address": "이메일 주소로 비밀번호를 보냅니다",
"Server": "섬기는 사람",
"Server Key": "서버 키",
"Settlement": "합의",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "계정 차단 해제",
"Unblock Deposit": "입금 차단 해제",
"Unblock Withdrawal": "출금 차단 해제",
"Undo Activation": "실행 취소 활성화",
"Undo Approval": "승인 취소",
"Undo Disbursal": "지급 취소",
"User Management": "사용자 관리",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/lt-LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Tėvų tipas",
"Parent officeData": "Tėvų biurasDuomenys",
"Password": "Slaptažodis",
"Password never expires": "Slaptažodis niekada nesibaigia",
"Passwords": "Slaptažodžiai",
"Passwords should be": "Slaptažodžiai turėtų būti",
"Past Due Days": "Praėjusios termino dienos",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Pasirinkite atitinkamus biurus",
"Selected Products": "Atrinkti produktai",
"Send": "Siųsti",
"Send password to email address": "Siųsti slaptažodį į el. Pašto adresą",
"Server": "Serveris",
"Server Key": "Serverio raktas",
"Settlement": "Atsiskaitymas",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Atblokuoti paskyrą",
"Unblock Deposit": "Atblokuoti indėlį",
"Unblock Withdrawal": "Atblokuoti išėmimą",
"Undo Activation": "Anuliuoti aktyvaciją",
"Undo Approval": "Anuliuoti patvirtinimą",
"Undo Disbursal": "Anuliuoti išmokėjimą",
"User Management": "Vartotojo valdymas",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/lv-LV.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Vecāku veids",
"Parent officeData": "Vecāku birojsDati",
"Password": "Parole",
"Password never expires": "Parole nekad nav derīga",
"Passwords": "Paroles",
"Passwords should be": "Parolēm jābūt",
"Past Due Days": "Pagājušās dienas",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Izvēlieties atbilstošos birojus",
"Selected Products": "Izvēlētie produkti",
"Send": "Sūtīt",
"Send password to email address": "Nosūtiet paroli uz e -pasta adresi",
"Server": "Serveris",
"Server Key": "Servera atslēga",
"Settlement": "Norēķins",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Atbloķēt kontu",
"Unblock Deposit": "Atbloķēt depozītu",
"Unblock Withdrawal": "Atbloķēt izņemšanu",
"Undo Activation": "Atsaukt aktivizēšanu",
"Undo Approval": "Atsaukt apstiprinājumu",
"Undo Disbursal": "Atsaukt izmaksu",
"User Management": "Lietotāju pārvaldība",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/ne-NE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "अभिभावक प्रकार",
"Parent officeData": "अभिभावक कार्यालय डाटा",
"Password": "पासवर्ड",
"Password never expires": "पासवर्ड कहिले समाप्त हुँदैन",
"Passwords": "पासवर्डहरू",
"Passwords should be": "पासवर्ड हुनुपर्छ",
"Past Due Days": "विगतका दिनहरू",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "लागू हुने कार्यालयहरू छान्नुहोस्",
"Selected Products": "चयन गरिएका उत्पादनहरू",
"Send": "पठाउनुहोस्",
"Send password to email address": "ईमेल ठेगानामा पासवर्ड पठाउनुहोस्",
"Server": "सर्भर",
"Server Key": "सर्भर कुञ्जी",
"Settlement": "बस्ती",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "खाता अनब्लक गर्नुहोस्",
"Unblock Deposit": "निक्षेप अनब्लक गर्नुहोस्",
"Unblock Withdrawal": "निकासी अनब्लक गर्नुहोस्",
"Undo Activation": "अन्डु सक्रियता",
"Undo Approval": "अनुमोदन अनडू गर्नुहोस्",
"Undo Disbursal": "वितरण पूर्ववत गर्नुहोस्",
"User Management": "प्रयोगकर्ता व्यवस्थापन",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/pt-PT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Tipo pai",
"Parent officeData": "Dados da matriz",
"Password": "Senha",
"Password never expires": "A senha nunca expira",
"Passwords": "Senhas",
"Passwords should be": "As senhas devem ser",
"Past Due Days": "Dias vencidos",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Selecione os escritórios aplicáveis",
"Selected Products": "Produtos Selecionados",
"Send": "Enviar",
"Send password to email address": "Envie a senha para o endereço de e -mail",
"Server": "Servidor",
"Server Key": "Chave do servidor",
"Settlement": "Povoado",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Desbloquear conta",
"Unblock Deposit": "Desbloquear depósito",
"Unblock Withdrawal": "Desbloquear retirada",
"Undo Activation": "Desfazer ativação",
"Undo Approval": "Desfazer aprovação",
"Undo Disbursal": "Desfazer desembolso",
"User Management": "Gerenciamento de usuários",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/sw-SW.json
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,7 @@
"Parent Type": "Aina ya Mzazi",
"Parent officeData": "Ofisi ya mzaziData",
"Password": "Nenosiri",
"Password never expires": "Nenosiri halijamalizika",
"Passwords": "Nywila",
"Passwords should be": "Nywila zinapaswa kuwa",
"Past Due Days": "Siku Zilizopita",
Expand Down Expand Up @@ -1849,6 +1850,7 @@
"Select applicable offices": "Chagua ofisi zinazotumika",
"Selected Products": "Bidhaa Zilizochaguliwa",
"Send": "Tuma",
"Send password to email address": "Tuma nywila kwa anwani ya barua pepe",
"Server": "Seva",
"Server Key": "Ufunguo wa Seva",
"Settlement": "Suluhu",
Expand Down Expand Up @@ -2150,6 +2152,7 @@
"Unblock Account": "Fungua Akaunti",
"Unblock Deposit": "Ondoa kizuizi cha Amana",
"Unblock Withdrawal": "Ondoa kizuizi cha Uondoaji",
"Undo Activation": "Uanzishaji",
"Undo Approval": "Tendua Uidhinishaji",
"Undo Disbursal": "Tendua Utoaji",
"User Management": "Usimamizi wa Mtumiaji",
Expand Down

0 comments on commit 3e58989

Please sign in to comment.