+19
-3
@@ -3,6 +3,9 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { MatDialog } from '@angular/material';
|
import { MatDialog } from '@angular/material';
|
||||||
|
|
||||||
|
/** Custom Dialogs */
|
||||||
|
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||||
|
|
||||||
/** Custom Button Config. */
|
/** Custom Button Config. */
|
||||||
import { FixedDepositsButtonsConfiguration } from './fixed-deposits-buttons.config';
|
import { FixedDepositsButtonsConfiguration } from './fixed-deposits-buttons.config';
|
||||||
|
|
||||||
@@ -76,9 +79,7 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
|||||||
case 'Close':
|
case 'Close':
|
||||||
case 'Undo Approval':
|
case 'Undo Approval':
|
||||||
case 'Post Interest As On':
|
case 'Post Interest As On':
|
||||||
case 'Assign Staff':
|
|
||||||
case 'Add Charge':
|
case 'Add Charge':
|
||||||
case 'Unassign Staff':
|
|
||||||
case 'Withdraw By Client':
|
case 'Withdraw By Client':
|
||||||
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
|
this.router.navigate([`actions/${name}`], { relativeTo: this.route });
|
||||||
break;
|
break;
|
||||||
@@ -89,7 +90,7 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
|||||||
this.router.navigate(['edit-savings-account'], { relativeTo: this.route });
|
this.router.navigate(['edit-savings-account'], { relativeTo: this.route });
|
||||||
break;
|
break;
|
||||||
case 'Delete':
|
case 'Delete':
|
||||||
|
this.deleteFixedDepositsAccount();
|
||||||
break;
|
break;
|
||||||
case 'Calculate Interest':
|
case 'Calculate Interest':
|
||||||
|
|
||||||
@@ -106,5 +107,20 @@ export class FixedDepositAccountViewComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes Fixed Deposits Account.
|
||||||
|
*/
|
||||||
|
private deleteFixedDepositsAccount() {
|
||||||
|
const deleteFixedDepositsAccountDialogRef = this.dialog.open(DeleteDialogComponent, {
|
||||||
|
data: { deleteContext: `fixed deposit account with id: ${this.fixedDepositsAccountData.id}` }
|
||||||
|
});
|
||||||
|
deleteFixedDepositsAccountDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
|
if (response.delete) {
|
||||||
|
this.fixedDepositsService.deleteFixedDepositsAccount(this.fixedDepositsAccountData.id).subscribe(() => {
|
||||||
|
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
-8
@@ -16,28 +16,20 @@ export class FixedDepositsAccountActionsComponent {
|
|||||||
actions: {
|
actions: {
|
||||||
'Approve': boolean
|
'Approve': boolean
|
||||||
'Reject': boolean
|
'Reject': boolean
|
||||||
'Withdrawal': boolean
|
|
||||||
'Deposit': boolean
|
|
||||||
'Activate': boolean
|
'Activate': boolean
|
||||||
'Close': boolean
|
'Close': boolean
|
||||||
'Undo Approval': boolean
|
'Undo Approval': boolean
|
||||||
'Post Interest As On': boolean
|
'Post Interest As On': boolean
|
||||||
'Assign Staff': boolean
|
|
||||||
'Add Charge': boolean
|
'Add Charge': boolean
|
||||||
'Unassign Staff': boolean
|
|
||||||
'Withdraw By Client': boolean
|
'Withdraw By Client': boolean
|
||||||
} = {
|
} = {
|
||||||
'Approve': false,
|
'Approve': false,
|
||||||
'Reject': false,
|
'Reject': false,
|
||||||
'Withdrawal': false,
|
|
||||||
'Deposit': false,
|
|
||||||
'Activate': false,
|
'Activate': false,
|
||||||
'Close': false,
|
'Close': false,
|
||||||
'Undo Approval': false,
|
'Undo Approval': false,
|
||||||
'Post Interest As On': false,
|
'Post Interest As On': false,
|
||||||
'Assign Staff': false,
|
|
||||||
'Add Charge': false,
|
'Add Charge': false,
|
||||||
'Unassign Staff': false,
|
|
||||||
'Withdraw By Client': false
|
'Withdraw By Client': false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,14 @@ export class FixedDepositsService {
|
|||||||
return this.http.get(`/fixeddepositaccounts/${accountId}`, { params: httpParams });
|
return this.http.get(`/fixeddepositaccounts/${accountId}`, { params: httpParams });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {string} accountId fixed deposits account Id
|
||||||
|
* @returns {Observable<any>}
|
||||||
|
*/
|
||||||
|
deleteFixedDepositsAccount(accountId: string): Observable<any> {
|
||||||
|
return this.http.delete(`/fixeddepositaccounts/${accountId}`);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {string} accountId Savings Account Id
|
* @param {string} accountId Savings Account Id
|
||||||
* @param {string} command Command
|
* @param {string} command Command
|
||||||
|
|||||||
Reference in New Issue
Block a user