@@ -95,11 +95,11 @@ export class AccountTransfersService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getStandingInstructionsTransactions(standingInstructionsId: any) {
|
getStandingInstructionsTransactions(standingInstructionsId: any, dateFormat: any, locale: any) {
|
||||||
const httpParams = new HttpParams().set('associations', 'transactions')
|
const httpParams = new HttpParams().set('associations', 'transactions')
|
||||||
.set('dateFormat', 'dd MMMM yyyy')
|
.set('dateFormat', dateFormat)
|
||||||
.set('limit', '14')
|
.set('limit', '14')
|
||||||
.set('locale', 'en')
|
.set('locale', locale)
|
||||||
.set('offset', '0');
|
.set('offset', '0');
|
||||||
return this.http.get(`/standinginstructions/${standingInstructionsId}`, { params: httpParams });
|
return this.http.get(`/standinginstructions/${standingInstructionsId}`, { params: httpParams });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { Observable } from 'rxjs';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AccountTransfersService } from '../account-transfers.service';
|
import { AccountTransfersService } from '../account-transfers.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* View Standing Instructions resolver.
|
* View Standing Instructions resolver.
|
||||||
@@ -15,9 +16,11 @@ import { AccountTransfersService } from '../account-transfers.service';
|
|||||||
export class ListTransactionsResolver implements Resolve<Object> {
|
export class ListTransactionsResolver implements Resolve<Object> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {accountTransfersService} AccountTransfersService Account Transfers service.
|
* @param {AccountTransfersService} accountTransfersService Account Transfers service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private accountTransfersService: AccountTransfersService) { }
|
constructor(private accountTransfersService: AccountTransfersService,
|
||||||
|
private settingsService: SettingsService) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Standing Instructions Data.
|
* Returns the Standing Instructions Data.
|
||||||
@@ -26,6 +29,8 @@ export class ListTransactionsResolver implements Resolve<Object> {
|
|||||||
*/
|
*/
|
||||||
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
resolve(route: ActivatedRouteSnapshot): Observable<any> {
|
||||||
const id = route.parent.paramMap.get('standingInstructionsId');
|
const id = route.parent.paramMap.get('standingInstructionsId');
|
||||||
return this.accountTransfersService.getStandingInstructionsTransactions(id);
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
const locale = this.settingsService.language.code;
|
||||||
|
return this.accountTransfersService.getStandingInstructionsTransactions(id, dateFormat, locale);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-4
@@ -1,9 +1,16 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { AccountTransfersService } from '../account-transfers.service';
|
|
||||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { AccountTransfersService } from '../account-transfers.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create Standing Instructions
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-create-standing-instructions',
|
selector: 'mifosx-create-standing-instructions',
|
||||||
templateUrl: './create-standing-instructions.component.html',
|
templateUrl: './create-standing-instructions.component.html',
|
||||||
@@ -62,12 +69,14 @@ export class CreateStandingInstructionsComponent implements OnInit {
|
|||||||
* @param {FormBuilder} formBuilder Form Builder
|
* @param {FormBuilder} formBuilder Form Builder
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
* @param {AccountTransfersService} accountTransfersService Account Transfers Service
|
* @param {AccountTransfersService} accountTransfersService Account Transfers Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private accountTransfersService: AccountTransfersService,
|
private accountTransfersService: AccountTransfersService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe) {
|
||||||
this.route.data.subscribe((data: { standingIntructionsTemplate: any }) => {
|
this.route.data.subscribe((data: { standingIntructionsTemplate: any }) => {
|
||||||
this.standingIntructionsTemplate = data.standingIntructionsTemplate;
|
this.standingIntructionsTemplate = data.standingIntructionsTemplate;
|
||||||
@@ -75,6 +84,7 @@ export class CreateStandingInstructionsComponent implements OnInit {
|
|||||||
this.setOptions();
|
this.setOptions();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Sets the value from the URL */
|
/** Sets the value from the URL */
|
||||||
setParams() {
|
setParams() {
|
||||||
this.officeId = this.route.snapshot.queryParams['officeId'];
|
this.officeId = this.route.snapshot.queryParams['officeId'];
|
||||||
@@ -202,11 +212,12 @@ export class CreateStandingInstructionsComponent implements OnInit {
|
|||||||
* Submits the standing instructions form
|
* Submits the standing instructions form
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
const locale = this.settingsService.language.code;
|
||||||
const standingInstructionData = {
|
const standingInstructionData = {
|
||||||
... this.createStandingInstructionsForm.value,
|
... this.createStandingInstructionsForm.value,
|
||||||
dateFormat: dateFormat,
|
dateFormat,
|
||||||
locale: 'en',
|
locale,
|
||||||
monthDayFormat: 'dd MMMM',
|
monthDayFormat: 'dd MMMM',
|
||||||
fromClientId: this.clientId,
|
fromClientId: this.clientId,
|
||||||
fromOfficeId: this.officeId,
|
fromOfficeId: this.officeId,
|
||||||
|
|||||||
+1
-1
@@ -159,7 +159,7 @@
|
|||||||
</mat-card-content>
|
</mat-card-content>
|
||||||
|
|
||||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||||
<button type="button" mat-raised-button [routerLink]="['../']">Cancel</button>
|
<button type="button" mat-raised-button [routerLink]="['../view']">Cancel</button>
|
||||||
<button mat-raised-button color="primary" [disabled]="!editStandingInstructionsForm.valid"
|
<button mat-raised-button color="primary" [disabled]="!editStandingInstructionsForm.valid"
|
||||||
(click)="submit()" *mifosxHasPermission="'UPDATE_STANDINGINSTRUCTION'">Submit</button>
|
(click)="submit()" *mifosxHasPermission="'UPDATE_STANDINGINSTRUCTION'">Submit</button>
|
||||||
</mat-card-actions>
|
</mat-card-actions>
|
||||||
|
|||||||
+20
-6
@@ -1,9 +1,16 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { AccountTransfersService } from '../account-transfers.service';
|
|
||||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { AccountTransfersService } from '../account-transfers.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit Standing Instructions
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-edit-standing-instructions',
|
selector: 'mifosx-edit-standing-instructions',
|
||||||
templateUrl: './edit-standing-instructions.component.html',
|
templateUrl: './edit-standing-instructions.component.html',
|
||||||
@@ -35,13 +42,19 @@ export class EditStandingInstructionsComponent implements OnInit {
|
|||||||
maxDate = new Date();
|
maxDate = new Date();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the standing instructions data from `resolve`.
|
* Retrieves the standing instructions template from `resolve`.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {FormBuilder} formBuilder Form Builder
|
||||||
|
* @param {Router} router Router
|
||||||
|
* @param {AccountTransfersService} accountTransfersService Account Transfers Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private accountTransfersService: AccountTransfersService,
|
private accountTransfersService: AccountTransfersService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe) {
|
||||||
this.route.data.subscribe((data: { standingInstructionsDataAndTemplate: any }) => {
|
this.route.data.subscribe((data: { standingInstructionsDataAndTemplate: any }) => {
|
||||||
this.standingInstructionsData = data.standingInstructionsDataAndTemplate;
|
this.standingInstructionsData = data.standingInstructionsDataAndTemplate;
|
||||||
@@ -127,12 +140,13 @@ export class EditStandingInstructionsComponent implements OnInit {
|
|||||||
* Submits the standing instructions form
|
* Submits the standing instructions form
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
const locale = this.settingsService.language.code;
|
||||||
const standingInstructionData = {
|
const standingInstructionData = {
|
||||||
amount: this.editStandingInstructionsForm.value.amount,
|
amount: this.editStandingInstructionsForm.value.amount,
|
||||||
dateFormat: dateFormat,
|
dateFormat,
|
||||||
instructionType: this.editStandingInstructionsForm.value.instructionType,
|
instructionType: this.editStandingInstructionsForm.value.instructionType,
|
||||||
locale: 'en',
|
locale,
|
||||||
monthDayFormat: 'dd MMMM',
|
monthDayFormat: 'dd MMMM',
|
||||||
priority: this.editStandingInstructionsForm.value.priority,
|
priority: this.editStandingInstructionsForm.value.priority,
|
||||||
recurrenceFrequency: this.editStandingInstructionsForm.value.recurrenceFrequency,
|
recurrenceFrequency: this.editStandingInstructionsForm.value.recurrenceFrequency,
|
||||||
@@ -144,7 +158,7 @@ export class EditStandingInstructionsComponent implements OnInit {
|
|||||||
validTill: this.datePipe.transform(this.editStandingInstructionsForm.value.validTill, dateFormat)
|
validTill: this.datePipe.transform(this.editStandingInstructionsForm.value.validTill, dateFormat)
|
||||||
};
|
};
|
||||||
this.accountTransfersService.updateStandingInstructionsData(this.standingInstructionsId, standingInstructionData).subscribe((response: any) => {
|
this.accountTransfersService.updateStandingInstructionsData(this.standingInstructionsId, standingInstructionData).subscribe((response: any) => {
|
||||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
this.router.navigate(['../view'], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+7
-2
@@ -11,6 +11,7 @@ import { AccountTransfersService } from '../account-transfers.service';
|
|||||||
|
|
||||||
/** Dialog Components */
|
/** Dialog Components */
|
||||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Lists all the standing intructions of particular ID
|
* Lists all the standing intructions of particular ID
|
||||||
@@ -61,10 +62,12 @@ export class ListStandingInstructionsComponent implements OnInit {
|
|||||||
* Retrieves Standing Instructions Data from `resolve`.
|
* Retrieves Standing Instructions Data from `resolve`.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {MatDialog} route Mat Dialog
|
* @param {MatDialog} route Mat Dialog
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
* @param {AccountTransfersService} accountTransfersService Account Transfers Service
|
* @param {AccountTransfersService} accountTransfersService Account Transfers Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private accountTransfersService: AccountTransfersService,
|
private accountTransfersService: AccountTransfersService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private dialog: MatDialog) {
|
private dialog: MatDialog) {
|
||||||
this.route.data.subscribe((data: { standingIntructionsTemplate: any }) => {
|
this.route.data.subscribe((data: { standingIntructionsTemplate: any }) => {
|
||||||
this.standingIntructionsTemplateData = data.standingIntructionsTemplate;
|
this.standingIntructionsTemplateData = data.standingIntructionsTemplate;
|
||||||
@@ -103,11 +106,13 @@ export class ListStandingInstructionsComponent implements OnInit {
|
|||||||
* Retrieves standing instructions and initializes instructions table.
|
* Retrieves standing instructions and initializes instructions table.
|
||||||
*/
|
*/
|
||||||
getStandingInstructions() {
|
getStandingInstructions() {
|
||||||
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
const locale = this.settingsService.language.code;
|
||||||
const searchData = {
|
const searchData = {
|
||||||
clientId : this.standingIntructionsTemplateData.fromClient.id || this.fromClientId.value,
|
clientId : this.standingIntructionsTemplateData.fromClient.id || this.fromClientId.value,
|
||||||
clientName: this.standingIntructionsTemplateData.fromClient.displayName || this.clientNameControl.value,
|
clientName: this.standingIntructionsTemplateData.fromClient.displayName || this.clientNameControl.value,
|
||||||
locale : 'en',
|
locale,
|
||||||
dateFormat : 'dd MMMM yyyy',
|
dateFormat,
|
||||||
limit: 14,
|
limit: 14,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
fromAccountType: this.accountTypeId,
|
fromAccountType: this.accountTypeId,
|
||||||
|
|||||||
+14
-3
@@ -1,10 +1,18 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, AfterViewInit } from '@angular/core';
|
import { Component, OnInit, AfterViewInit } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { AccountTransfersService } from '../account-transfers.service';
|
|
||||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { AccountTransfersService } from '../account-transfers.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
import { ClientsService } from 'app/clients/clients.service';
|
import { ClientsService } from 'app/clients/clients.service';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create account transfers
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-make-account-transfers',
|
selector: 'mifosx-make-account-transfers',
|
||||||
templateUrl: './make-account-transfers.component.html',
|
templateUrl: './make-account-transfers.component.html',
|
||||||
@@ -44,12 +52,15 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit {
|
|||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
* @param {AccountTransfersService} accountTransfersService Account Transfers Service
|
* @param {AccountTransfersService} accountTransfersService Account Transfers Service
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
|
* @param {ClientsService} clientsService Clients Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private accountTransfersService: AccountTransfersService,
|
private accountTransfersService: AccountTransfersService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private clientsService: ClientsService) {
|
private clientsService: ClientsService) {
|
||||||
this.route.data.subscribe((data: { accountTransferTemplate: any }) => {
|
this.route.data.subscribe((data: { accountTransferTemplate: any }) => {
|
||||||
this.accountTransferTemplateData = data.accountTransferTemplate;
|
this.accountTransferTemplateData = data.accountTransferTemplate;
|
||||||
@@ -161,8 +172,8 @@ export class MakeAccountTransfersComponent implements OnInit, AfterViewInit {
|
|||||||
* Submits the standing instructions form
|
* Submits the standing instructions form
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const makeAccountTransferData = {
|
const makeAccountTransferData = {
|
||||||
... this.makeAccountTransferForm.value,
|
... this.makeAccountTransferForm.value,
|
||||||
transferDate: this.datePipe.transform(this.makeAccountTransferForm.value.transferDate, dateFormat),
|
transferDate: this.datePipe.transform(this.makeAccountTransferForm.value.transferDate, dateFormat),
|
||||||
|
|||||||
Reference in New Issue
Block a user