diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.html index c4f98d03f..8c72618fc 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.html +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.html @@ -68,22 +68,27 @@ Actions - - - - - diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.ts index 8bc3f2e0f..eb73ad7de 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/charges-tab/charges-tab.component.ts @@ -1,10 +1,26 @@ /** Angular Imports */ import { Component, OnInit, ViewChild } from '@angular/core'; -import { MatTableDataSource, MatTable } from '@angular/material'; -import { ActivatedRoute } from '@angular/router'; +import { ActivatedRoute, Router } from '@angular/router'; +import { MatDialog, MatTableDataSource, MatTable } from '@angular/material'; +import { DatePipe } from '@angular/common'; + +/** Custom Services */ +import { SavingsService } from 'app/savings/savings.service'; + +/** Custom Dialogs */ +import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component'; +import { WaiveChargeDialogComponent } from '../custom-dialogs/waive-charge-dialog/waive-charge-dialog.component'; +import { InactivateChargeDialogComponent } from '../custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component'; +import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component'; + +/** Custom Models */ +import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base'; +import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base'; +import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base'; /** * Charges Tab Component + * Note: Fixed deposits endpoints are not supported so using Savings endpoints. */ @Component({ selector: 'mifosx-charges-tab', @@ -40,10 +56,18 @@ export class ChargesTabComponent implements OnInit { @ViewChild('chargesTable') chargesTableRef: MatTable; /** - * Retrieves Fixed Deposits Account Data from `resolve`. + * Retrieves the Fixed Deposits account data from `resolve`. + * @param {SavingsService} savingsService Savings Service * @param {ActivatedRoute} route Activated Route. + * @param {Router} router Router for navigation. + * @param {MatDialog} dialog Dialog reference. + * @param {DatePipe} datePipe DatePipe. */ - constructor(private route: ActivatedRoute) { + constructor(private savingsService: SavingsService, + private route: ActivatedRoute, + private datePipe: DatePipe, + private router: Router, + public dialog: MatDialog) { this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => { this.fixedDepositsAccountData = data.fixedDepositsAccountData; this.chargesData = this.fixedDepositsAccountData.charges; @@ -70,6 +94,138 @@ export class ChargesTabComponent implements OnInit { this.chargesTableRef.renderRows(); } + /** + * Pays the charge. + * @param {any} chargeId Charge Id + */ + payCharge(chargeId: any) { + const formfields: FormfieldBase[] = [ + new InputBase({ + controlName: 'amount', + label: 'Amount', + value: '', + type: 'number', + required: true + }), + new DatepickerBase({ + controlName: 'dueDate', + label: 'Payment Date', + value: '', + type: 'date', + required: true + }) + ]; + const data = { + title: `Pay Charge ${chargeId}`, + layout: { addButtonText: 'Confirm' }, + formfields: formfields + }; + const payChargeDialogRef = this.dialog.open(FormDialogComponent, { data }); + payChargeDialogRef.afterClosed().subscribe((response: any) => { + if (response.data) { + const locale = 'en'; + const dateFormat = 'dd MMMM yyyy'; + const dataObject = { + ...response.data.value, + dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat), + dateFormat, + locale + }; + this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'paycharge', dataObject, chargeId) + .subscribe(() => { + this.reload(); + }); + } + }); + } + + /** + * Waive's the charge + * @param {any} chargeId Charge Id + */ + waiveCharge(chargeId: any) { + const waiveChargeDialogRef = this.dialog.open(WaiveChargeDialogComponent, { data: { id: chargeId } }); + waiveChargeDialogRef.afterClosed().subscribe((response: any) => { + if (response.confirm) { + this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'waive', {}, chargeId) + .subscribe(() => { + this.reload(); + }); + } + }); + } + + /** + * Inactivate's the charge + * @param {any} chargeId Charge Id + */ + inactivateCharge(chargeId: any) { + const inactivateChargeDialogRef = this.dialog.open(InactivateChargeDialogComponent, { data: { id: chargeId } }); + inactivateChargeDialogRef.afterClosed().subscribe((response: any) => { + if (response.confirm) { + this.savingsService.executeSavingsAccountChargesCommand(this.fixedDepositsAccountData.id, 'inactivate', {}, chargeId) + .subscribe(() => { + this.reload(); + }); + } + }); + } + + /** + * Edits the charge + * @param {any} charge Charge + */ + editCharge(charge: any) { + const formfields: FormfieldBase[] = [ + new InputBase({ + controlName: 'amount', + label: 'Amount', + value: charge.amount || charge.amountOrPercentage, + type: 'number', + required: true + }) + ]; + const data = { + title: `Edit Charge ${charge.id}`, + layout: { addButtonText: 'Confirm' }, + formfields: formfields + }; + const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data }); + editChargeDialogRef.afterClosed().subscribe((response: any) => { + if (response.data) { + const locale = 'en'; + const dateFormat = 'dd MMMM yyyy'; + const dataObject = { + ...response.data.value, + dateFormat, + locale + }; + this.savingsService.editSavingsAccountCharge(this.fixedDepositsAccountData.id, dataObject, charge.id) + .subscribe(() => { + this.reload(); + }); + } + }); + } + + /** + * Deletes the charge + * @param {any} chargeId Charge Id + */ + deleteCharge(chargeId: any) { + const deleteChargeDialogRef = this.dialog.open(DeleteDialogComponent, { + data: { deleteContext: `charge id:${chargeId}` } + }); + deleteChargeDialogRef.afterClosed().subscribe((response: any) => { + if (response.delete) { + this.savingsService.deleteSavingsAccountCharge(this.fixedDepositsAccountData.id, chargeId) + .subscribe(() => { + this.reload(); + }); + } + }); + } + /** * Checks if charge is recurring. * @param {any} charge Charge @@ -78,4 +234,23 @@ export class ChargesTabComponent implements OnInit { return charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee' || charge.chargeTimeType.value === 'Weekly Fee'; } + /** + * Stops the propagation to view charge page. + * @param $event Mouse Event + */ + routeEdit($event: MouseEvent) { + $event.stopPropagation(); + } + + /** + * Refetches data fot the component + * TODO: Replace by a custom reload component instead of hard-coded back-routing. + */ + private reload() { + const clientId = this.fixedDepositsAccountData.clientId; + const url: string = this.router.url; + this.router.navigateByUrl(`/clients/${clientId}/fixed-deposits-accounts`, {skipLocationChange: true}) + .then(() => this.router.navigate([url])); + } + } diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.html new file mode 100644 index 000000000..ce159445f --- /dev/null +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.html @@ -0,0 +1,8 @@ +

Inactivate Charge

+
+

Are you sure you want to inactivate charge with id: {{ data.id }} ?

+
+ + + + diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.scss b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.scss similarity index 100% rename from src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.scss rename to src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.scss diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts new file mode 100644 index 000000000..6bf5313f2 --- /dev/null +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { InactivateChargeDialogComponent } from './inactivate-charge-dialog.component'; + +describe('InactivateChargeDialogComponent', () => { + let component: InactivateChargeDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ InactivateChargeDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(InactivateChargeDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts new file mode 100644 index 000000000..6a3515dfc --- /dev/null +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component.ts @@ -0,0 +1,22 @@ +/** Angular Imports */ +import { Component, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +/** + * Inactivate charge dialog component. + */ +@Component({ + selector: 'mifosx-inactivate-charge-dialog', + templateUrl: './inactivate-charge-dialog.component.html', + styleUrls: ['./inactivate-charge-dialog.component.scss'] +}) +export class InactivateChargeDialogComponent { + + /** + * @param {MatDialogRef} dialogRef Component reference to dialog. + * @param {any} data. + */ + constructor(public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { } + +} diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.html deleted file mode 100644 index 688f28271..000000000 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.html +++ /dev/null @@ -1,8 +0,0 @@ -

Undo Transaction

-
-

Are you sure you want to undo this transaction ?

-
- - - - diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.spec.ts deleted file mode 100644 index dbc966965..000000000 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.spec.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { async, ComponentFixture, TestBed } from '@angular/core/testing'; - -import { UndoTransactionDialogComponent } from './undo-transaction-dialog.component'; - -describe('UndoTransactionDialogComponent', () => { - let component: UndoTransactionDialogComponent; - let fixture: ComponentFixture; - - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [ UndoTransactionDialogComponent ] - }) - .compileComponents(); - })); - - beforeEach(() => { - fixture = TestBed.createComponent(UndoTransactionDialogComponent); - component = fixture.componentInstance; - fixture.detectChanges(); - }); - - it('should create', () => { - expect(component).toBeTruthy(); - }); -}); diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.ts deleted file mode 100644 index 07720213b..000000000 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component.ts +++ /dev/null @@ -1,20 +0,0 @@ -/** Angular Imports */ -import { Component } from '@angular/core'; -import { MatDialogRef } from '@angular/material'; - -/** - * Undo transaction dialog component. - */ -@Component({ - selector: 'mifosx-undo-transaction-dialog', - templateUrl: './undo-transaction-dialog.component.html', - styleUrls: ['./undo-transaction-dialog.component.scss'] -}) -export class UndoTransactionDialogComponent { - - /** - * @param {MatDialogRef} dialogRef Component reference to dialog. - */ - constructor(public dialogRef: MatDialogRef) { } - -} diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.html new file mode 100644 index 000000000..1508d786e --- /dev/null +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.html @@ -0,0 +1,8 @@ +

Waive Charge

+
+

Are you sure you want to waive charge with id: {{ data.id }} ?

+
+ + + + diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.scss b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts new file mode 100644 index 000000000..7d9bbd5ae --- /dev/null +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { WaiveChargeDialogComponent } from './waive-charge-dialog.component'; + +describe('WaiveChargeDialogComponent', () => { + let component: WaiveChargeDialogComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ WaiveChargeDialogComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(WaiveChargeDialogComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts new file mode 100644 index 000000000..12d7865c9 --- /dev/null +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component.ts @@ -0,0 +1,22 @@ +/** Angular Imports */ +import { Component, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +/** + * Waive charge dialog component. + */ +@Component({ + selector: 'mifosx-waive-charge-dialog', + templateUrl: './waive-charge-dialog.component.html', + styleUrls: ['./waive-charge-dialog.component.scss'] +}) +export class WaiveChargeDialogComponent { + + /** + * @param {MatDialogRef} dialogRef Component reference to dialog. + * @param {any} data. + */ + constructor(public dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public data: any) { } + +} diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.html index b707c6d6f..b2de6318f 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.html +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/fixed-deposit-account-view.component.html @@ -59,7 +59,7 @@
-

Fixed Deposits Details

+

Fixed Deposit Details

diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.html index 05ee03c80..9b67e4323 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.html +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/interest-rate-chart-tab/interest-rate-chart-tab.component.html @@ -1,5 +1,11 @@
+
+
+

All Interest Rates

+
+
+
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.html index 51dc78be9..51a1a4cce 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.html +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions-tab/transactions-tab.component.html @@ -1,5 +1,11 @@
+
+
+

All Transactions

+
+
+
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.ts deleted file mode 100644 index 4ee08643b..000000000 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.ts +++ /dev/null @@ -1,68 +0,0 @@ -/** Angular Imports */ -import { Component } from '@angular/core'; -import { ActivatedRoute, Router } from '@angular/router'; -import { MatDialog } from '@angular/material'; -import { DatePipe } from '@angular/common'; - -/** Custom Services */ -import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service'; - -/** Custom Dialogs */ -import { UndoTransactionDialogComponent } from '../../custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component'; - -/** - * View Transaction Component. - * TODO: Add support for account transfers. - */ -@Component({ - selector: 'mifosx-view-transaction', - templateUrl: './view-transaction.component.html', - styleUrls: ['./view-transaction.component.scss'] -}) -export class ViewTransactionComponent { - - /** Transaction data. */ - transactionData: any; - - /** - * Retrieves the Transaction data from `resolve`. - * @param {FixedDepositsService} fixedDepositsService Savings Service - * @param {ActivatedRoute} route Activated Route. - * @param {Router} router Router for navigation. - * @param {MatDialog} dialog Dialog reference. - * @param {DatePipe} datePipe DatePipe. - */ - constructor(private fixedDepositsService: FixedDepositsService, - private route: ActivatedRoute, - private datePipe: DatePipe, - private router: Router, - public dialog: MatDialog) { - this.route.data.subscribe((data: { fixedDepositsAccountTransaction: any }) => { - this.transactionData = data.fixedDepositsAccountTransaction; - }); - } - - /** - * Undo the savings transaction - */ - undoTransaction() { - const accountId = this.route.parent.snapshot.params['fixedDepositAccountId']; - const undoTransactionAccountDialogRef = this.dialog.open(UndoTransactionDialogComponent); - undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => { - if (response.confirm) { - const locale = 'en'; - const dateFormat = 'dd MMMM yyyy'; - const data = { - transactionDate: this.datePipe.transform(this.transactionData.date && new Date(this.transactionData.date), dateFormat), - transactionAmount: 0, - dateFormat, - locale - }; - this.fixedDepositsService.executeFixedDepositsAccountTransactionsCommand(accountId, 'undo', data, this.transactionData.id).subscribe(() => { - this.router.navigate(['../'], { relativeTo: this.route }); - }); - } - }); - } - -} diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.html b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.html similarity index 83% rename from src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.html rename to src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.html index 51f37aa65..3a6c258f4 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.html +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.html @@ -1,19 +1,3 @@ -
- - - - -
-
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.scss b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.scss similarity index 100% rename from src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.scss rename to src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.scss diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.spec.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.spec.ts similarity index 100% rename from src/app/deposits/fixed-deposits/fixed-deposit-account-view/transactions/view-transaction/view-transaction.component.spec.ts rename to src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.spec.ts diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.ts new file mode 100644 index 000000000..c1c510ef1 --- /dev/null +++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-view/view-transaction/view-transaction.component.ts @@ -0,0 +1,32 @@ +/** Angular Imports */ +import { Component } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; +import { MatDialog } from '@angular/material'; + +/** + * View Transaction Component. + * TODO: Add support for account transfers. + */ +@Component({ + selector: 'mifosx-view-transaction', + templateUrl: './view-transaction.component.html', + styleUrls: ['./view-transaction.component.scss'] +}) +export class ViewTransactionComponent { + + /** Transaction data. */ + transactionData: any; + + /** + * Retrieves the Transaction data from `resolve`. + * @param {ActivatedRoute} route Activated Route. + * @param {MatDialog} dialog Dialog reference. + */ + constructor(private route: ActivatedRoute, + public dialog: MatDialog) { + this.route.data.subscribe((data: { fixedDepositsAccountTransaction: any }) => { + this.transactionData = data.fixedDepositsAccountTransaction; + }); + } + +} diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-routing.module.ts b/src/app/deposits/fixed-deposits/fixed-deposits-routing.module.ts index 2e8a5e3bd..35eb2fe83 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits-routing.module.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits-routing.module.ts @@ -13,7 +13,7 @@ import { ChargesTabComponent } from './fixed-deposit-account-view/charges-tab/ch import { StandingInstructionsTabComponent } from './fixed-deposit-account-view/standing-instructions-tab/standing-instructions-tab.component'; import { DatatableTabsComponent } from './fixed-deposit-account-view/datatable-tabs/datatable-tabs.component'; import { FixedDepositsAccountActionsComponent } from './fixed-deposits-account-actions/fixed-deposits-account-actions.component'; -import { ViewTransactionComponent } from './fixed-deposit-account-view/transactions/view-transaction/view-transaction.component'; +import { ViewTransactionComponent } from './fixed-deposit-account-view/view-transaction/view-transaction.component'; /** Custom Resolvers */ import { FixedDepositsAccountViewResolver } from '../fixed-deposits/common-resolvers/fixed-deposit-account-view.resolver'; diff --git a/src/app/deposits/fixed-deposits/fixed-deposits.module.ts b/src/app/deposits/fixed-deposits/fixed-deposits.module.ts index 8263c438a..5a5f05e0a 100644 --- a/src/app/deposits/fixed-deposits/fixed-deposits.module.ts +++ b/src/app/deposits/fixed-deposits/fixed-deposits.module.ts @@ -26,8 +26,9 @@ import { ToggleWithholdTaxDialogComponent } from './fixed-deposit-account-view/c import { ActivateFixedDepositsAccountComponent } from './fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component'; import { UndoApprovalFixedDepositsAccountComponent } from './fixed-deposits-account-actions/undo-approval-fixed-deposits-account/undo-approval-fixed-deposits-account.component'; import { WithdrawByClientFixedDepositsAccountComponent } from './fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component'; -import { ViewTransactionComponent } from './fixed-deposit-account-view/transactions/view-transaction/view-transaction.component'; -import { UndoTransactionDialogComponent } from './fixed-deposit-account-view/custom-dialogs/undo-transaction-dialog/undo-transaction-dialog.component'; +import { ViewTransactionComponent } from './fixed-deposit-account-view/view-transaction/view-transaction.component'; +import { WaiveChargeDialogComponent } from './fixed-deposit-account-view/custom-dialogs/waive-charge-dialog/waive-charge-dialog.component'; +import { InactivateChargeDialogComponent } from './fixed-deposit-account-view/custom-dialogs/inactivate-charge-dialog/inactivate-charge-dialog.component'; @NgModule({ declarations: [ @@ -49,7 +50,8 @@ import { UndoTransactionDialogComponent } from './fixed-deposit-account-view/cus UndoApprovalFixedDepositsAccountComponent, WithdrawByClientFixedDepositsAccountComponent, ViewTransactionComponent, - UndoTransactionDialogComponent + WaiveChargeDialogComponent, + InactivateChargeDialogComponent ], imports: [ SharedModule, @@ -61,7 +63,8 @@ import { UndoTransactionDialogComponent } from './fixed-deposit-account-view/cus PostInterestDialogComponent, CalculateInterestDialogComponent, ToggleWithholdTaxDialogComponent, - UndoTransactionDialogComponent + WaiveChargeDialogComponent, + InactivateChargeDialogComponent ], providers: [DatePipe] })