diff --git a/src/app/account-transfers/account-transfers-routing.module.ts b/src/app/account-transfers/account-transfers-routing.module.ts new file mode 100644 index 000000000..e746487bb --- /dev/null +++ b/src/app/account-transfers/account-transfers-routing.module.ts @@ -0,0 +1,44 @@ +/** Angular Imports */ +import { NgModule } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +/** Translation Imports */ +import { extract } from '../core/i18n/i18n.service'; + +/** Custom Components */ +import { ViewStandingInstructionsComponent } from './view-standing-instructions/view-standing-instructions.component'; + +/** Custom Resolvers */ +import { ViewStandingInstructionsResolver } from './common-resolvers/view-standing-instructions.resolver'; + +/** Loans Route. */ +const routes: Routes = [ + { + path: '', + children: [ + { + path: ':standingInstructionsId', + data: { title: extract('Standing Instructions'), routeParamBreadcrumb: 'standingInstructionsId' }, + children: [ + { + path: 'view', + data: { title: extract('View Standing Instructions'), breadcrumb: 'view', routeParamBreadcrumb: false }, + component: ViewStandingInstructionsComponent, + resolve: { + standingInstructionsData: ViewStandingInstructionsResolver, + }, + }, + ] + }] + } +]; +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule], + declarations: [], + providers: [ + ViewStandingInstructionsResolver, + ] +}) + +export class AccountTransfersRoutingModule { } diff --git a/src/app/account-transfers/account-transfers.module.ts b/src/app/account-transfers/account-transfers.module.ts new file mode 100644 index 000000000..24fa7ceb0 --- /dev/null +++ b/src/app/account-transfers/account-transfers.module.ts @@ -0,0 +1,26 @@ +/** Angular Imports */ +import { NgModule } from '@angular/core'; +import { DatePipe } from '@angular/common'; + +/** Custom Modules */ +import { AccountTransfersRoutingModule } from './account-transfers-routing.module'; +import { SharedModule } from 'app/shared/shared.module'; +import { PipesModule } from '../pipes/pipes.module'; +import { DirectivesModule } from '../directives/directives.module'; + +/** Custom Components */ +import { ViewStandingInstructionsComponent } from './view-standing-instructions/view-standing-instructions.component'; + +/** + * Account Transfers Module + * + * All components related to Account Transfers functions should be declared here. + */ +@NgModule({ + imports: [SharedModule, PipesModule, DirectivesModule, AccountTransfersRoutingModule], + declarations: [ + ViewStandingInstructionsComponent + ], + providers: [DatePipe] +}) +export class AccountTransfersModule { } diff --git a/src/app/account-transfers/account-transfers.service.ts b/src/app/account-transfers/account-transfers.service.ts new file mode 100644 index 000000000..ed54875f8 --- /dev/null +++ b/src/app/account-transfers/account-transfers.service.ts @@ -0,0 +1,26 @@ +/** Angular Imports */ +import { Injectable } from '@angular/core'; +import { HttpClient, HttpParams } from '@angular/common/http'; + +/** rxjs Imports */ +import { Observable } from 'rxjs'; + +/** + * Account Transfers Service. + */ +@Injectable({ + providedIn: 'root' +}) +export class AccountTransfersService { + + constructor(private http: HttpClient) { } + + /** + * @params standingInstructionsId + * Returns the details of a particular Standing Instruction + */ + getStandingInstructionsData(standingInstructionsId: any): Observable { + return this.http.get(`/standinginstructions/${standingInstructionsId}`); + } + +} diff --git a/src/app/account-transfers/common-resolvers/view-standing-instructions.resolver.ts b/src/app/account-transfers/common-resolvers/view-standing-instructions.resolver.ts new file mode 100644 index 000000000..e115453c1 --- /dev/null +++ b/src/app/account-transfers/common-resolvers/view-standing-instructions.resolver.ts @@ -0,0 +1,32 @@ +/** Angular Imports */ +import { Injectable } from '@angular/core'; +import { Resolve, ActivatedRouteSnapshot } from '@angular/router'; + +/** rxjs Imports */ +import { Observable } from 'rxjs'; + +/** Custom Services */ +import { AccountTransfersService } from '../account-transfers.service'; + +/** + * View Standing Instructions resolver. + */ +@Injectable() +export class ViewStandingInstructionsResolver implements Resolve { + + /** + * @param {accountTransfersService} AccountTransfersService Account Transfers service. + */ + constructor(private accountTransfersService: AccountTransfersService) { } + + /** + * Returns the Standing Instructions Data. + * @param {ActivatedRouteSnapshot} route Route Snapshot + * @returns {Observable} + */ + resolve(route: ActivatedRouteSnapshot): Observable { + const standingInstructionsId = route.parent.paramMap.get('standingInstructionsId'); + return this.accountTransfersService.getStandingInstructionsData(standingInstructionsId); + } + +} diff --git a/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.html b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.html new file mode 100644 index 000000000..b6b4d2a57 --- /dev/null +++ b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.html @@ -0,0 +1,122 @@ +
+ + +
+ +
+ + + + + +
+ +

{{ standingInstructionsData.name }}

+ + + +
+ Applicant: + {{ standingInstructionsData.fromClient.displayName }} +
+ +
+ Type: + {{ standingInstructionsData.transferType.value }} +
+ +
+ Priority: + {{ standingInstructionsData.priority.value }} +
+ +
+ Status: + {{ standingInstructionsData.status.value }} +
+ +
+ From Account Type: + {{ standingInstructionsData.fromAccountType.value }} +
+ +
+ From Account: + {{ standingInstructionsData.fromAccount.productName }} - {{ standingInstructionsData.fromAccount.accountNo }} +
+ +
+ Destination: + + Within Bank + Own Account + +
+ +
+ To Office: + {{ standingInstructionsData.toOffice.name }} +
+ +
+ Beneficiary: + {{ standingInstructionsData.toClient.displayName }} +
+ +
+ To Account Type: + {{ standingInstructionsData.toAccountType.value }} +
+ +
+ To Account: + {{ standingInstructionsData.toAccount.productName }} - {{standingInstructionsData.toAccount.accountNo}} +
+ +
+ Standing Instruction Type: + {{ standingInstructionsData.instructionType.value }} +
+ +
+ Amount: + {{ standingInstructionsData.amount }} +
+ +
+ Validity: + {{ standingInstructionsData.validFrom | date }} - {{ standingInstructionsData.validTill | date }} +
+ +
+ Recurrence type: + {{ standingInstructionsData.recurrenceType.value }} +
+ +
+ Interval: + {{ standingInstructionsData.recurrenceInterval }} +
+ +
+ Recurrence Frequency: + {{ standingInstructionsData.recurrenceFrequency.value }} +
+ +
+ On Month Day: + {{ standingInstructionsData.recurrenceOnMonthDay | date }} +
+ +
+ +
+ +
+ +
diff --git a/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.scss b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.scss new file mode 100644 index 000000000..2a8399b99 --- /dev/null +++ b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.scss @@ -0,0 +1,20 @@ +.mat-elevation-z1 { + margin: 1em 0 1.5em 0; +} + +h2, h3, h4 { + margin: 0; + font-weight: 500; +} + +span { + margin: 0.5em 0; +} + +.margin-t { + margin-top: 1em; +} + +mat-divider { + margin: 0 0 1em 0; +} diff --git a/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.spec.ts b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.spec.ts new file mode 100644 index 000000000..ad2d63547 --- /dev/null +++ b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ViewStandingInstructionsComponent } from './view-standing-instructions.component'; + +describe('ViewStandingInstructionsComponent', () => { + let component: ViewStandingInstructionsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ViewStandingInstructionsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ViewStandingInstructionsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.ts b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.ts new file mode 100644 index 000000000..fa9237cc1 --- /dev/null +++ b/src/app/account-transfers/view-standing-instructions/view-standing-instructions.component.ts @@ -0,0 +1,30 @@ +/** Angular Imports */ +import { Component } from '@angular/core'; +import { ActivatedRoute } from '@angular/router'; + +@Component({ + selector: 'mifosx-view-standing-instructions', + templateUrl: './view-standing-instructions.component.html', + styleUrls: ['./view-standing-instructions.component.scss'] +}) +export class ViewStandingInstructionsComponent { + + /** Standing Instructions Data */ + standingInstructionsData: any; + /** Allow Client Edit */ + allowclientedit = false; + + /** + * Retrieves the standing instructions data from `resolve`. + * @param {ActivatedRoute} route Activated Route. + */ + constructor(private route: ActivatedRoute) { + this.route.data.subscribe((data: { standingInstructionsData: any}) => { + this.standingInstructionsData = data.standingInstructionsData; + if (this.standingInstructionsData.fromClient.id === this.standingInstructionsData.toClient.id) { + this.allowclientedit = false; + } + }); + } + +} diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.html b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.html index 84c0a7698..ca89f53bf 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.html +++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/standing-instructions-tab/standing-instructions-tab.component.html @@ -58,7 +58,7 @@ diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-routing.module.ts b/src/app/deposits/recurring-deposits/recurring-deposits-routing.module.ts index 65f1ce16e..207a7ba7f 100644 --- a/src/app/deposits/recurring-deposits/recurring-deposits-routing.module.ts +++ b/src/app/deposits/recurring-deposits/recurring-deposits-routing.module.ts @@ -32,7 +32,7 @@ import { RecurringDepositsAccountTransactionTemplateResolver } from './common-re const routes: Routes = [ { path: '', - data: { title: extract('All Recurring Deposits'), breadcrumb: 'Recurring Deposits', routeParamBreadcrumb: false }, + data: { title: extract('Recurring Deposits'), breadcrumb: 'Recurring Deposits', routeParamBreadcrumb: false }, children: [ { path: 'create-recurring-deposits-account', @@ -147,6 +147,23 @@ const routes: Routes = [ ] } ] + }, + { + path: '', + data: { title: extract('All Recurring Deposits'), breadcrumb: 'Recurring Deposits', routeParamBreadcrumb: false }, + children: [ + { + path: ':recurringDepositAccountId', + data: { title: extract('RecurringDeposit Account View'), routeParamBreadcrumb: 'recurringDepositAccountId' }, + children: [ + { + path: 'standing-instructions', + data: { title: extract('Standing Instructions'), breadcrumb: 'standing-instructions', routeParamBreadcrumb: false }, + loadChildren: '../../account-transfers/account-transfers.module#AccountTransfersModule' + }, + ] + } + ] } ]; @NgModule({