i18n: Adding new languages: Part 2 (#1885)
Co-authored-by: radhathakare <radhathakare322@gmail.com>
This commit is contained in:
co-authored by
radhathakare
parent
408f004450
commit
3c625d81c4
+18
-3
@@ -27,9 +27,14 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
|
||||
transactionType: {
|
||||
holdamount: boolean,
|
||||
blockaccount: boolean
|
||||
blockaccount: boolean,
|
||||
blockdeposit: boolean,
|
||||
blockwithdrawal: boolean
|
||||
} = {
|
||||
holdamount: false, blockaccount: false
|
||||
holdamount: false,
|
||||
blockaccount: false,
|
||||
blockdeposit: false,
|
||||
blockwithdrawal: false
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -58,7 +63,8 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
ngOnInit() {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
this.createManageSavingsAccountForm();
|
||||
if (this.transactionType.holdamount || this.transactionType.blockaccount) {
|
||||
if (this.transactionType.holdamount || this.transactionType.blockaccount
|
||||
|| this.transactionType.blockdeposit || this.transactionType.blockwithdrawal) {
|
||||
this.getCodeValues();
|
||||
}
|
||||
}
|
||||
@@ -67,6 +73,10 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
let codeName = 'SavingsTransactionFreezeReasons'; // Default Hold Amount
|
||||
if (this.transactionType.blockaccount) {
|
||||
codeName = 'SavingsAccountBlockReasons';
|
||||
} else if (this.transactionType.blockdeposit) {
|
||||
codeName = 'CreditTransactionFreezeReasons';
|
||||
} else if (this.transactionType.blockwithdrawal) {
|
||||
codeName = 'DebitTransactionFreezeReasons';
|
||||
}
|
||||
|
||||
this.systemService.getCodes().subscribe((codes: any) => {
|
||||
@@ -126,6 +136,11 @@ export class ManageSavingsAccountComponent implements OnInit {
|
||||
... this.manageSavingsAccountForm.value
|
||||
};
|
||||
command = 'block';
|
||||
if (this.transactionType.blockdeposit) {
|
||||
command = 'blockCredit';
|
||||
} else if (this.transactionType.blockwithdrawal) {
|
||||
command = 'blockDebit';
|
||||
}
|
||||
|
||||
this.savingsService.executeSavingsAccountCommand(this.savingAccountId, command, payload).subscribe((response: any) => {
|
||||
this.router.navigate(['../../transactions'], { relativeTo: this.route });
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
<mifosx-savings-transactions [currencyCode]="currencyCode" *ngIf="actions['Withdrawal'] || actions['Deposit']"></mifosx-savings-transactions>
|
||||
<mifosx-close-savings-account *ngIf="actions['Close']"></mifosx-close-savings-account>
|
||||
<mifosx-apply-annual-fees-savings-account *ngIf="actions['Apply Annual Fees']"></mifosx-apply-annual-fees-savings-account>
|
||||
<mifosx-manage-savings-account *ngIf="actions['Hold Amount'] || actions['Block Account']"></mifosx-manage-savings-account>
|
||||
<mifosx-manage-savings-account *ngIf="actions['Hold Amount'] || actions['Block Account'] || actions['Block Deposit'] || actions['Block Withdrawal']"></mifosx-manage-savings-account>
|
||||
|
||||
@@ -30,6 +30,10 @@ export class SavingAccountActionsComponent {
|
||||
'Hold Amount': boolean
|
||||
'Block Account': boolean
|
||||
'Unblock Account': boolean
|
||||
'Block Deposit': boolean
|
||||
'Unblock Deposit': boolean
|
||||
'Block Withdrawal': boolean
|
||||
'Unblock Withdrawal': boolean
|
||||
} = {
|
||||
'Approve': false,
|
||||
'Reject': false,
|
||||
@@ -46,7 +50,11 @@ export class SavingAccountActionsComponent {
|
||||
'Apply Annual Fees': false,
|
||||
'Hold Amount': false,
|
||||
'Block Account': false,
|
||||
'Unblock Account': false
|
||||
'Unblock Account': false,
|
||||
'Block Deposit': false,
|
||||
'Unblock Deposit': false,
|
||||
'Block Withdrawal': false,
|
||||
'Unblock Withdrawal': false
|
||||
};
|
||||
|
||||
currencyCode: string;
|
||||
|
||||
@@ -143,6 +143,8 @@ export class SavingsAccountViewComponent implements OnInit {
|
||||
case 'Add Charge':
|
||||
case 'Hold Amount':
|
||||
case 'Block Account':
|
||||
case 'Block Deposit':
|
||||
case 'Block Withdrawal':
|
||||
case 'Unassign Staff':
|
||||
case 'Withdraw By Client':
|
||||
case 'Apply Annual Fees':
|
||||
@@ -174,7 +176,9 @@ export class SavingsAccountViewComponent implements OnInit {
|
||||
this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams });
|
||||
break;
|
||||
case 'Unblock Account':
|
||||
this.unblockSavingsAccount();
|
||||
case 'Unblock Deposit':
|
||||
case 'Unblock Withdrawal':
|
||||
this.unblockSavingsAccount(name);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -260,13 +264,20 @@ export class SavingsAccountViewComponent implements OnInit {
|
||||
/**
|
||||
* Unblock Savings Account.
|
||||
*/
|
||||
private unblockSavingsAccount() {
|
||||
private unblockSavingsAccount(action: string) {
|
||||
const unblockSavingsAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
data: { heading: 'Unblock Savings Account', dialogContext: 'Are you sure you want Unblock this Savings Account' }
|
||||
data: { heading: 'Savings Account', dialogContext: 'Are you sure you want ' + action + ' this Savings Account' }
|
||||
});
|
||||
let command = 'unblock';
|
||||
if (action === 'Unblock Deposit') {
|
||||
command = 'unblockCredit';
|
||||
}
|
||||
if (action === 'Unblock Withdrawal') {
|
||||
command = 'unblockDebit';
|
||||
}
|
||||
unblockSavingsAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
|
||||
if (response.confirm) {
|
||||
this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, 'unblock', { })
|
||||
this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, command, { })
|
||||
.subscribe(() => {
|
||||
this.reload();
|
||||
});
|
||||
|
||||
@@ -36,6 +36,19 @@ export class SavingsButtonsConfiguration {
|
||||
name: 'Deposit',
|
||||
icon: 'arrow-up',
|
||||
taskPermissionName: 'DEPOSIT_SAVINGSACCOUNT'
|
||||
},
|
||||
{
|
||||
name: 'Block Deposit',
|
||||
icon: 'lock',
|
||||
taskPermissionName: 'BLOCKDEPOSIT_SAVINGSACCOUNT'
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.buttonsArray.push(
|
||||
{
|
||||
name: 'Unblock Deposit',
|
||||
icon: 'lock-open',
|
||||
taskPermissionName: 'UNBLOCKDEPOSIT_SAVINGSACCOUNT'
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -45,6 +58,19 @@ export class SavingsButtonsConfiguration {
|
||||
name: 'Withdrawal',
|
||||
icon: 'arrow-down',
|
||||
taskPermissionName: 'WITHDRAWAL_SAVINGSACCOUNT'
|
||||
},
|
||||
{
|
||||
name: 'Block Withdrawal',
|
||||
icon: 'lock',
|
||||
taskPermissionName: 'BLOCKWITHDRAWAL_SAVINGSACCOUNT'
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.buttonsArray.push(
|
||||
{
|
||||
name: 'Unblock Withdrawal',
|
||||
icon: 'lock-open',
|
||||
taskPermissionName: 'UNBLOCKWITHDRAWAL_SAVINGSACCOUNT'
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user