+ [matTooltip]="savingsAccountData.status.value" *ngIf="!savingsAccountData.subStatus.block">
+
Savings Product : {{savingsAccountData.savingsProductName}}({{savingsAccountData.accountNo}})
@@ -53,7 +55,7 @@
-
+
diff --git a/src/app/savings/savings-account-view/savings-account-view.component.ts b/src/app/savings/savings-account-view/savings-account-view.component.ts
index eba3a8e4c..3466fe649 100644
--- a/src/app/savings/savings-account-view/savings-account-view.component.ts
+++ b/src/app/savings/savings-account-view/savings-account-view.component.ts
@@ -12,6 +12,7 @@ import { ToggleWithholdTaxDialogComponent } from './custom-dialogs/toggle-withho
/** Custom Buttons Configuration */
import { SavingsButtonsConfiguration } from './savings-buttons.config';
import { SavingsService } from '../savings.service';
+import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
/**
* Savings Account View Component
@@ -64,7 +65,8 @@ export class SavingsAccountViewComponent implements OnInit {
*/
setConditionalButtons() {
const status = this.savingsAccountData.status.value;
- this.buttonConfig = new SavingsButtonsConfiguration(status);
+ const subStatus = this.savingsAccountData.subStatus;
+ this.buttonConfig = new SavingsButtonsConfiguration(status, subStatus);
if (this.savingsAccountData.clientId) {
this.buttonConfig.addOption({
name: 'Transfer Funds',
@@ -108,7 +110,6 @@ export class SavingsAccountViewComponent implements OnInit {
}
}
-
/**
* Refetches data foe the component
* TODO: Replace by a custom reload component instead of hard-coded back-routing.
@@ -137,7 +138,6 @@ export class SavingsAccountViewComponent implements OnInit {
case 'Add Charge':
case 'Hold Amount':
case 'Block Account':
- case 'Unblock Account':
case 'Unassign Staff':
case 'Withdraw By Client':
case 'Apply Annual Fees':
@@ -168,6 +168,9 @@ export class SavingsAccountViewComponent implements OnInit {
const queryParams: any = { savingsId: this.savingsAccountData.id, accountType: 'fromsavings' };
this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams });
break;
+ case 'Unblock Account':
+ this.unblockSavingsAccount();
+ break;
}
}
@@ -249,4 +252,20 @@ export class SavingsAccountViewComponent implements OnInit {
});
}
+ /**
+ * Unblock Savings Account.
+ */
+ private unblockSavingsAccount() {
+ const unblockSavingsAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
+ data: { heading: 'Unblock Savings Account', dialogContext: 'Are you sure you want Unblock this Savings Account' }
+ });
+ unblockSavingsAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
+ if (response.confirm) {
+ this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, 'unblock', { })
+ .subscribe(() => {
+ this.reload();
+ });
+ }
+ });
+ }
}
diff --git a/src/app/savings/savings-account-view/savings-buttons.config.ts b/src/app/savings/savings-account-view/savings-buttons.config.ts
index 9c70e75a1..67e163151 100644
--- a/src/app/savings/savings-account-view/savings-buttons.config.ts
+++ b/src/app/savings/savings-account-view/savings-buttons.config.ts
@@ -12,9 +12,9 @@ export class SavingsButtonsConfiguration {
taskPermissionName: string,
}[];
- constructor(status: string) {
+ constructor(status: string, substatus: any) {
this.setOptions(status);
- this.setButtons(status);
+ this.setButtons(status, substatus);
}
get singleButtons() {
@@ -25,36 +25,60 @@ export class SavingsButtonsConfiguration {
return this.optionArray;
}
- setButtons(status: string) {
+ setButtons(status: string, substatus: any) {
switch (status) {
case 'Active':
- this.buttonsArray = [
+ this.buttonsArray = [];
+ if (!substatus.block) {
+ if (!substatus.blockCredit) {
+ this.buttonsArray.push(
+ {
+ name: 'Deposit',
+ icon: 'arrow-up',
+ taskPermissionName: 'DEPOSIT_SAVINGSACCOUNT'
+ }
+ );
+ }
+ if (!substatus.blockDebit) {
+ this.buttonsArray.push(
+ {
+ name: 'Withdrawal',
+ icon: 'arrow-down',
+ taskPermissionName: 'WITHDRAWAL_SAVINGSACCOUNT'
+ }
+ );
+ }
+ this.buttonsArray = this.buttonsArray.concat([
+ {
+ name: 'Block Account',
+ icon: 'lock',
+ taskPermissionName: 'BLOCK_SAVINGSACCOUNT'
+ },
+ {
+ name: 'Hold Amount',
+ icon: 'lock',
+ taskPermissionName: 'HOLDAMOUNT_SAVINGSACCOUNT'
+ },
+ {
+ name: 'Calculate Interest',
+ icon: 'table',
+ taskPermissionName: 'CALCULATEINTEREST_SAVINGSACCOUNT'
+ },
+ {
+ name: 'Post Interest As On',
+ icon: 'arrow-right',
+ taskPermissionName: 'POSTINTEREST_SAVINGSACCOUNT',
+ },
+ ]);
+ } else {
+ this.buttonsArray = [
{
- name: 'Deposit',
- icon: 'arrow-up',
- taskPermissionName: 'DEPOSIT_SAVINGSACCOUNT'
- },
- {
- name: 'Withdraw',
- icon: 'arrow-down',
- taskPermissionName: 'WITHDRAW_SAVINGSACCOUNT'
- },
- {
- name: 'Hold Amount',
- icon: 'lock',
- taskPermissionName: 'HOLDAMOUNT_SAVINGSACCOUNT'
- },
- {
- name: 'Calculate Interest',
- icon: 'table',
- taskPermissionName: 'CALCULATEINTEREST_SAVINGSACCOUNT'
- },
- {
- name: 'Post Interest As On',
- icon: 'arrow-right',
- taskPermissionName: 'POSTINTEREST_SAVINGSACCOUNT',
- },
- ];
+ name: 'Unblock Account',
+ icon: 'lock-open',
+ taskPermissionName: 'UNBLOCK_SAVINGSACCOUNT'
+ }
+ ];
+ }
break;
case 'Submitted and pending approval':
this.buttonsArray = [
diff --git a/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.html b/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.html
index b5e83bca2..aacc31afd 100644
--- a/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.html
+++ b/src/app/savings/savings-account-view/transactions/view-transaction/view-transaction.component.html
@@ -50,20 +50,20 @@
{{ transactionData.date | dateFormat }}
-
- Currency
-
-
-
- {{ transactionData.currency.displayLabel }}
-
-
Amount
- {{ transactionData.amount }}
+ {{ transactionData.currency.displaySymbol }} {{ transactionData.amount | number }} ({{ transactionData.currency.code }})
+
+
+
+ Currency
+
+
+
+ {{ transactionData.currency.name }}
diff --git a/src/app/savings/savings-routing.module.ts b/src/app/savings/savings-routing.module.ts
index aa0f4b745..01a36570d 100644
--- a/src/app/savings/savings-routing.module.ts
+++ b/src/app/savings/savings-routing.module.ts
@@ -178,7 +178,7 @@ const routes: Routes = [
},
{
path: 'actions/:name',
- data: { title: extract('Savings Account Actions'), routeParamBreadcrumb: 'name' },
+ data: { title: extract('Savings Account Actions'), breadcrumb: 'name', routeParamBreadcrumb: false },
component: SavingAccountActionsComponent,
resolve: {
savingsAccountActionData: SavingsAccountActionsResolver
diff --git a/src/assets/styles/_status.scss b/src/assets/styles/_status.scss
index 0c6718604..e9e729287 100644
--- a/src/assets/styles/_status.scss
+++ b/src/assets/styles/_status.scss
@@ -26,6 +26,10 @@
color: $status-active-overdue;
}
+.status-block {
+ color: $status-active-overdue;
+}
+
.status-matured {
color: $status-matured;
}