Merge branch 'master' of https://github.com/openMF/web-app
This commit is contained in:
Generated
+15
@@ -4009,6 +4009,21 @@
|
|||||||
"tslib": "^1.9.0"
|
"tslib": "^1.9.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@ngx-translate/http-loader": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@ngx-translate/http-loader/-/http-loader-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-LCekn6qCbeXWlhESCxU1rAbZz33WzDG0lI7Ig0pYC1o5YxJWrkU9y3Y4tNi+jakQ7R6YhTR2D3ox6APxDtA0wA==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^2.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "2.3.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz",
|
||||||
|
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"@nodelib/fs.scandir": {
|
"@nodelib/fs.scandir": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz",
|
||||||
|
|||||||
@@ -45,6 +45,7 @@
|
|||||||
"@fortawesome/fontawesome-svg-core": "1.2.18",
|
"@fortawesome/fontawesome-svg-core": "1.2.18",
|
||||||
"@fortawesome/free-solid-svg-icons": "5.8.2",
|
"@fortawesome/free-solid-svg-icons": "5.8.2",
|
||||||
"@ngx-translate/core": "11.0.1",
|
"@ngx-translate/core": "11.0.1",
|
||||||
|
"@ngx-translate/http-loader": "^6.0.0",
|
||||||
"chart.js": "3.0.0-alpha",
|
"chart.js": "3.0.0-alpha",
|
||||||
"core-js": "2.5.0",
|
"core-js": "2.5.0",
|
||||||
"lodash": "4.17.21",
|
"lodash": "4.17.21",
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AccountingService } from '../../accounting.service';
|
import { AccountingService } from '../../accounting.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
/**
|
/**
|
||||||
* Create closure component.
|
* Create closure component.
|
||||||
*/
|
*/
|
||||||
@@ -29,11 +29,13 @@ export class CreateClosureComponent implements OnInit {
|
|||||||
* Retrieves the offices data from `resolve`.
|
* Retrieves the offices data from `resolve`.
|
||||||
* @param {FormBuilder} formBuilder Form Builder.
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
* @param {AccountingService} accountingService Accounting Service.
|
* @param {AccountingService} accountingService Accounting Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private accountingService: AccountingService,
|
private accountingService: AccountingService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router) {
|
||||||
this.route.data.subscribe((data: { offices: any }) => {
|
this.route.data.subscribe((data: { offices: any }) => {
|
||||||
@@ -66,8 +68,8 @@ export class CreateClosureComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const accountingClosure = this.accountingClosureForm.value;
|
const accountingClosure = this.accountingClosureForm.value;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
accountingClosure.locale = 'en';
|
accountingClosure.locale = this.settingsService.language.code;
|
||||||
accountingClosure.dateFormat = 'yyyy-MM-dd';
|
accountingClosure.dateFormat = this.settingsService.dateFormat;
|
||||||
if (accountingClosure.closingDate instanceof Date) {
|
if (accountingClosure.closingDate instanceof Date) {
|
||||||
let day = accountingClosure.closingDate.getDate();
|
let day = accountingClosure.closingDate.getDate();
|
||||||
let month = accountingClosure.closingDate.getMonth() + 1;
|
let month = accountingClosure.closingDate.getMonth() + 1;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AccountingService } from '../accounting.service';
|
import { AccountingService } from '../accounting.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
/**
|
/**
|
||||||
* Create Journal Entry component.
|
* Create Journal Entry component.
|
||||||
*/
|
*/
|
||||||
@@ -35,11 +35,13 @@ export class CreateJournalEntryComponent implements OnInit {
|
|||||||
* Retrieves the offices, currencies, payment types and gl accounts data from `resolve`.
|
* Retrieves the offices, currencies, payment types and gl accounts data from `resolve`.
|
||||||
* @param {FormBuilder} formBuilder Form Builder.
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
* @param {AccountingService} accountingService Accounting Service.
|
* @param {AccountingService} accountingService Accounting Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private accountingService: AccountingService,
|
private accountingService: AccountingService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router) {
|
||||||
this.route.data.subscribe((data: {
|
this.route.data.subscribe((data: {
|
||||||
@@ -134,8 +136,8 @@ export class CreateJournalEntryComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const journalEntry = this.journalEntryForm.value;
|
const journalEntry = this.journalEntryForm.value;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
journalEntry.locale = 'en';
|
journalEntry.locale = this.settingsService.language.code;
|
||||||
journalEntry.dateFormat = 'yyyy-MM-dd';
|
journalEntry.dateFormat = this.settingsService.dateFormat;
|
||||||
if (journalEntry.transactionDate instanceof Date) {
|
if (journalEntry.transactionDate instanceof Date) {
|
||||||
let day = journalEntry.transactionDate.getDate();
|
let day = journalEntry.transactionDate.getDate();
|
||||||
let month = journalEntry.transactionDate.getMonth() + 1;
|
let month = journalEntry.transactionDate.getMonth() + 1;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AccountingService } from '../accounting.service';
|
import { AccountingService } from '../accounting.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
/**
|
/**
|
||||||
* Frequent Postings component.
|
* Frequent Postings component.
|
||||||
*/
|
*/
|
||||||
@@ -43,11 +43,13 @@ export class FrequentPostingsComponent implements OnInit {
|
|||||||
* Retrieves the offices, accounting rules, currencies and payment types data from `resolve`.
|
* Retrieves the offices, accounting rules, currencies and payment types data from `resolve`.
|
||||||
* @param {FormBuilder} formBuilder Form Builder.
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
* @param {AccountingService} accountingService Accounting Service.
|
* @param {AccountingService} accountingService Accounting Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private accountingService: AccountingService,
|
private accountingService: AccountingService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router) {
|
||||||
this.route.data.subscribe((data: {
|
this.route.data.subscribe((data: {
|
||||||
@@ -165,8 +167,8 @@ export class FrequentPostingsComponent implements OnInit {
|
|||||||
const journalEntry = this.frequentPostingsForm.value;
|
const journalEntry = this.frequentPostingsForm.value;
|
||||||
journalEntry.accountingRule = journalEntry.accountingRule.id;
|
journalEntry.accountingRule = journalEntry.accountingRule.id;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
journalEntry.locale = 'en';
|
journalEntry.locale = this.settingsService.language.code;
|
||||||
journalEntry.dateFormat = 'yyyy-MM-dd';
|
journalEntry.dateFormat = this.settingsService.dateFormat;
|
||||||
if (journalEntry.transactionDate instanceof Date) {
|
if (journalEntry.transactionDate instanceof Date) {
|
||||||
let day = journalEntry.transactionDate.getDate();
|
let day = journalEntry.transactionDate.getDate();
|
||||||
let month = journalEntry.transactionDate.getMonth() + 1;
|
let month = journalEntry.transactionDate.getMonth() + 1;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AccountingService } from '../accounting.service';
|
import { AccountingService } from '../accounting.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
/** Custom Validators */
|
/** Custom Validators */
|
||||||
import { onlyOneOfTheFieldsIsRequiredValidator } from './only-one-of-the-fields-is-required.validator';
|
import { onlyOneOfTheFieldsIsRequiredValidator } from './only-one-of-the-fields-is-required.validator';
|
||||||
|
|
||||||
@@ -40,11 +40,13 @@ export class MigrateOpeningBalancesComponent implements OnInit {
|
|||||||
* Retrieves the offices and currencies from `resolve`.
|
* Retrieves the offices and currencies from `resolve`.
|
||||||
* @param {FormBuilder} formBuilder Form Builder.
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
* @param {AccountingService} accountingService Accounting Service.
|
* @param {AccountingService} accountingService Accounting Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private accountingService: AccountingService,
|
private accountingService: AccountingService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router) {
|
||||||
this.route.data.subscribe((data: {
|
this.route.data.subscribe((data: {
|
||||||
@@ -134,8 +136,8 @@ export class MigrateOpeningBalancesComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const openingBalances = this.openingBalancesForm.value;
|
const openingBalances = this.openingBalancesForm.value;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
openingBalances.locale = 'en';
|
openingBalances.locale = this.settingsService.language.code;
|
||||||
openingBalances.dateFormat = 'yyyy-MM-dd';
|
openingBalances.dateFormat = this.settingsService.dateFormat;
|
||||||
if (openingBalances.transactionDate instanceof Date) {
|
if (openingBalances.transactionDate instanceof Date) {
|
||||||
let day = openingBalances.transactionDate.getDate();
|
let day = openingBalances.transactionDate.getDate();
|
||||||
let month = openingBalances.transactionDate.getMonth() + 1;
|
let month = openingBalances.transactionDate.getMonth() + 1;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Router, ActivatedRoute } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AccountingService } from '../accounting.service';
|
import { AccountingService } from '../accounting.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
/**
|
/**
|
||||||
* Periodic accruals component.
|
* Periodic accruals component.
|
||||||
*/
|
*/
|
||||||
@@ -26,11 +26,13 @@ export class PeriodicAccrualsComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* @param {FormBuilder} formBuilder Form Builder.
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
* @param {AccountingService} accountingService Accounting Service.
|
* @param {AccountingService} accountingService Accounting Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private accountingService: AccountingService,
|
private accountingService: AccountingService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) { }
|
private router: Router) { }
|
||||||
|
|
||||||
@@ -57,8 +59,8 @@ export class PeriodicAccrualsComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const periodicAccruals = this.periodicAccrualsForm.value;
|
const periodicAccruals = this.periodicAccrualsForm.value;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
periodicAccruals.locale = 'en';
|
periodicAccruals.locale = this.settingsService.language.code;
|
||||||
periodicAccruals.dateFormat = 'yyyy-MM-dd';
|
periodicAccruals.dateFormat = this.settingsService.dateFormat;
|
||||||
if (periodicAccruals.tillDate instanceof Date) {
|
if (periodicAccruals.tillDate instanceof Date) {
|
||||||
let day = periodicAccruals.tillDate.getDate();
|
let day = periodicAccruals.tillDate.getDate();
|
||||||
let month = periodicAccruals.tillDate.getMonth() + 1;
|
let month = periodicAccruals.tillDate.getMonth() + 1;
|
||||||
|
|||||||
+5
-3
@@ -5,7 +5,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AccountingService } from '../../accounting.service';
|
import { AccountingService } from '../../accounting.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
/**
|
/**
|
||||||
* Create provisioning entry component.
|
* Create provisioning entry component.
|
||||||
*/
|
*/
|
||||||
@@ -26,11 +26,13 @@ export class CreateProvisioningEntryComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* @param {FormBuilder} formBuilder Form Builder.
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
* @param {AccountingService} accountingService Accounting Service.
|
* @param {AccountingService} accountingService Accounting Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private accountingService: AccountingService,
|
private accountingService: AccountingService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) { }
|
private router: Router) { }
|
||||||
|
|
||||||
@@ -58,8 +60,8 @@ export class CreateProvisioningEntryComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const provisioningEntry = this.provisioningEntryForm.value;
|
const provisioningEntry = this.provisioningEntryForm.value;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
provisioningEntry.locale = 'en';
|
provisioningEntry.locale = this.settingsService.language.code;
|
||||||
provisioningEntry.dateFormat = 'yyyy-MM-dd';
|
provisioningEntry.dateFormat = this.settingsService.dateFormat;
|
||||||
if (provisioningEntry.date instanceof Date) {
|
if (provisioningEntry.date instanceof Date) {
|
||||||
let day = provisioningEntry.date.getDate();
|
let day = provisioningEntry.date.getDate();
|
||||||
let month = provisioningEntry.date.getMonth() + 1;
|
let month = provisioningEntry.date.getMonth() + 1;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import { tap, startWith, map, distinctUntilChanged, debounceTime} from 'rxjs/ope
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AccountingService } from '../accounting.service';
|
import { AccountingService } from '../accounting.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
/** Custom Data Source */
|
/** Custom Data Source */
|
||||||
import { JournalEntriesDataSource } from './journal-entry.datasource';
|
import { JournalEntriesDataSource } from './journal-entry.datasource';
|
||||||
|
|
||||||
@@ -96,11 +96,11 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'dateFormat',
|
type: 'dateFormat',
|
||||||
value: 'yyyy-MM-dd'
|
value: this.settingsService.dateFormat
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'locale',
|
type: 'locale',
|
||||||
value: 'en'
|
value: this.settingsService.language.code
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -113,8 +113,10 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit {
|
|||||||
* Retrieves the offices and gl accounts data from `resolve`.
|
* Retrieves the offices and gl accounts data from `resolve`.
|
||||||
* @param {AccountingService} accountingService Accounting Service.
|
* @param {AccountingService} accountingService Accounting Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private accountingService: AccountingService,
|
constructor(private accountingService: AccountingService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private route: ActivatedRoute) {
|
private route: ActivatedRoute) {
|
||||||
this.route.data.subscribe((data: {
|
this.route.data.subscribe((data: {
|
||||||
offices: any,
|
offices: any,
|
||||||
|
|||||||
@@ -5,9 +5,6 @@ import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|||||||
import { HttpClientModule } from '@angular/common/http';
|
import { HttpClientModule } from '@angular/common/http';
|
||||||
import { ServiceWorkerModule } from '@angular/service-worker';
|
import { ServiceWorkerModule } from '@angular/service-worker';
|
||||||
|
|
||||||
/** Tanslation Imports */
|
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
|
||||||
|
|
||||||
/** Environment Configuration */
|
/** Environment Configuration */
|
||||||
import { environment } from 'environments/environment';
|
import { environment } from 'environments/environment';
|
||||||
|
|
||||||
@@ -55,7 +52,6 @@ import { AppRoutingModule } from './app-routing.module';
|
|||||||
HammerModule,
|
HammerModule,
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
ServiceWorkerModule.register('./ngsw-worker.js', { enabled: environment.production }),
|
ServiceWorkerModule.register('./ngsw-worker.js', { enabled: environment.production }),
|
||||||
TranslateModule.forRoot(),
|
|
||||||
CoreModule,
|
CoreModule,
|
||||||
HomeModule,
|
HomeModule,
|
||||||
LoginModule,
|
LoginModule,
|
||||||
|
|||||||
+14
-9
@@ -19,6 +19,9 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-
|
|||||||
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
||||||
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Individual Collection Sheet
|
* Individual Collection Sheet
|
||||||
*/
|
*/
|
||||||
@@ -82,13 +85,15 @@ export class IndividualCollectionSheetComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe to format date.
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
* @param {Dialog} dialog Dialog component.
|
* @param {Dialog} dialog Dialog component.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private collectionsService: CollectionsService,
|
private collectionsService: CollectionsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private router: Router, ) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { officesData: any }) => {
|
this.route.data.subscribe((data: { officesData: any }) => {
|
||||||
this.officesData = data.officesData;
|
this.officesData = data.officesData;
|
||||||
});
|
});
|
||||||
@@ -276,8 +281,8 @@ export class IndividualCollectionSheetComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
previewCollectionSheet() {
|
previewCollectionSheet() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const collectionSheet = {
|
const collectionSheet = {
|
||||||
...this.collectionSheetForm.value,
|
...this.collectionSheetForm.value,
|
||||||
'transactionDate': this.datePipe.transform(this.collectionSheetForm.value.transactionDate, dateFormat),
|
'transactionDate': this.datePipe.transform(this.collectionSheetForm.value.transactionDate, dateFormat),
|
||||||
@@ -304,8 +309,8 @@ export class IndividualCollectionSheetComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.bulkDisbursementTransactionsData['bulkRepaymentTransactions'] = this.bulkRepaymentTransactions;
|
this.bulkDisbursementTransactionsData['bulkRepaymentTransactions'] = this.bulkRepaymentTransactions;
|
||||||
this.bulkDisbursementTransactionsData['bulkSavingsDueTransactions'] = this.bulkSavingsDueTransactions;
|
this.bulkDisbursementTransactionsData['bulkSavingsDueTransactions'] = this.bulkSavingsDueTransactions;
|
||||||
const finalSubmitData = {
|
const finalSubmitData = {
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ import { HTTP_INTERCEPTORS, HttpClient, HttpClientModule } from '@angular/common
|
|||||||
import { RouteReuseStrategy, RouterModule } from '@angular/router';
|
import { RouteReuseStrategy, RouterModule } from '@angular/router';
|
||||||
|
|
||||||
/** Translation Imports */
|
/** Translation Imports */
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule, TranslateLoader } from '@ngx-translate/core';
|
||||||
|
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
|
||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { AuthenticationService } from './authentication/authentication.service';
|
import { AuthenticationService } from './authentication/authentication.service';
|
||||||
@@ -47,7 +48,15 @@ import { ContentComponent } from './shell/content/content.component';
|
|||||||
imports: [
|
imports: [
|
||||||
SharedModule,
|
SharedModule,
|
||||||
HttpClientModule,
|
HttpClientModule,
|
||||||
TranslateModule,
|
TranslateModule.forRoot({
|
||||||
|
loader: {
|
||||||
|
provide: TranslateLoader,
|
||||||
|
useFactory: (http: HttpClient) => {
|
||||||
|
return new TranslateHttpLoader(http, `${ window.location.protocol }//${ window.location.host }/assets/translations/`, '.json');
|
||||||
|
},
|
||||||
|
deps: [HttpClient]
|
||||||
|
}
|
||||||
|
}),
|
||||||
RouterModule
|
RouterModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
|
|||||||
@@ -18,7 +18,13 @@ export class ApiPrefixInterceptor implements HttpInterceptor {
|
|||||||
* Intercepts a Http request and prefixes it with `environment.serverUrl`.
|
* Intercepts a Http request and prefixes it with `environment.serverUrl`.
|
||||||
*/
|
*/
|
||||||
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
intercept(request: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
|
||||||
request = request.clone({ url: environment.serverUrl + request.url });
|
/**
|
||||||
|
* Ignore URLs that are complete for i18n
|
||||||
|
*/
|
||||||
|
if (!request.url.includes('http:') && !request.url.includes('https:')) {
|
||||||
|
request = request.clone({ url: environment.serverUrl + request.url });
|
||||||
|
}
|
||||||
|
|
||||||
return next.handle(request);
|
return next.handle(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,11 +34,7 @@ export class I18nService {
|
|||||||
defaultLanguage: string;
|
defaultLanguage: string;
|
||||||
supportedLanguages: string[];
|
supportedLanguages: string[];
|
||||||
|
|
||||||
constructor(private translateService: TranslateService) {
|
constructor(private translateService: TranslateService) { }
|
||||||
// Embed languages to avoid extra HTTP requests
|
|
||||||
translateService.setTranslation('en-US', enUS);
|
|
||||||
translateService.setTranslation('fr-FR', frFR);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializes i18n for the application.
|
* Initializes i18n for the application.
|
||||||
@@ -78,7 +74,8 @@ export class I18nService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
log.debug(`Language set to ${language}`);
|
log.debug(`Language set to ${language}`);
|
||||||
this.translateService.use(language);
|
localStorage.setItem(this.languageStorageKey, language);
|
||||||
|
this.translateService.setDefaultLang(language);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,19 +20,19 @@
|
|||||||
|
|
||||||
<a mat-tab-link class="tab-link" [routerLink]="['/accounting']">
|
<a mat-tab-link class="tab-link" [routerLink]="['/accounting']">
|
||||||
<fa-icon class="mr-05" icon="money-bill-alt" size="lg"></fa-icon>
|
<fa-icon class="mr-05" icon="money-bill-alt" size="lg"></fa-icon>
|
||||||
Accounting
|
{{ 'Accounting' | translate }}
|
||||||
</a>
|
</a>
|
||||||
<a mat-tab-link class="tab-link" [matMenuTriggerFor]="reportsMenu" #reportsMenuTrigger="matMenuTrigger" >
|
<a mat-tab-link class="tab-link" [matMenuTriggerFor]="reportsMenu" #reportsMenuTrigger="matMenuTrigger" >
|
||||||
<fa-icon class="mr-05" icon="chart-bar" size="lg"></fa-icon>
|
<fa-icon class="mr-05" icon="chart-bar" size="lg"></fa-icon>
|
||||||
Reports
|
{{ 'Reports' | translate }}
|
||||||
</a>
|
</a>
|
||||||
<a mat-tab-link class="tab-link" [matMenuTriggerFor]="adminMenu" #adminMenuTrigger="matMenuTrigger">
|
<a mat-tab-link class="tab-link" [matMenuTriggerFor]="adminMenu" #adminMenuTrigger="matMenuTrigger">
|
||||||
<fa-icon class="mr-05" icon="shield-alt" size="lg"></fa-icon>
|
<fa-icon class="mr-05" icon="shield-alt" size="lg"></fa-icon>
|
||||||
Admin
|
{{ 'Admin' | translate }}
|
||||||
</a>
|
</a>
|
||||||
<a mat-tab-link class="tab-link" [matMenuTriggerFor]="selfServiceMenu" #selfServiceMenuTrigger="matMenuTrigger">
|
<a mat-tab-link class="tab-link" [matMenuTriggerFor]="selfServiceMenu" #selfServiceMenuTrigger="matMenuTrigger">
|
||||||
<fa-icon class="mr-05" icon="users" size="lg"></fa-icon>
|
<fa-icon class="mr-05" icon="users" size="lg"></fa-icon>
|
||||||
Self Service
|
{{ 'Self Service' | translate }}
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
+6
-3
@@ -5,6 +5,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { FixedDepositsService } from '../fixed-deposits.service';
|
import { FixedDepositsService } from '../fixed-deposits.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Components */
|
/** Custom Components */
|
||||||
import { FixedDepositAccountDetailsStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component';
|
import { FixedDepositAccountDetailsStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component';
|
||||||
@@ -45,11 +46,13 @@ export class CreateFixedDepositAccountComponent {
|
|||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private fixedDepositsService: FixedDepositsService) {
|
private fixedDepositsService: FixedDepositsService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { fixedDepositsAccountTemplate: any }) => {
|
this.route.data.subscribe((data: { fixedDepositsAccountTemplate: any }) => {
|
||||||
this.fixedDepositsAccountTemplate = data.fixedDepositsAccountTemplate;
|
this.fixedDepositsAccountTemplate = data.fixedDepositsAccountTemplate;
|
||||||
});
|
});
|
||||||
@@ -118,8 +121,8 @@ export class CreateFixedDepositAccountComponent {
|
|||||||
* Submits the fixed deposit form and creates a new fixed deposit account
|
* Submits the fixed deposit form and creates a new fixed deposit account
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const monthDayFormat = 'dd MMMM';
|
const monthDayFormat = 'dd MMMM';
|
||||||
const fixedDepositAccount = {
|
const fixedDepositAccount = {
|
||||||
...this.fixedDepositAccount,
|
...this.fixedDepositAccount,
|
||||||
|
|||||||
+6
-3
@@ -5,6 +5,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { FixedDepositsService } from '../fixed-deposits.service';
|
import { FixedDepositsService } from '../fixed-deposits.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Components */
|
/** Custom Components */
|
||||||
import { FixedDepositAccountDetailsStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component';
|
import { FixedDepositAccountDetailsStepComponent } from '../fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component';
|
||||||
@@ -45,11 +46,13 @@ export class EditFixedDepositAccountComponent {
|
|||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private fixedDepositsService: FixedDepositsService) {
|
private fixedDepositsService: FixedDepositsService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { fixedDepositsAccountAndTemplate: any }) => {
|
this.route.data.subscribe((data: { fixedDepositsAccountAndTemplate: any }) => {
|
||||||
this.fixedDepositsAccountAndTemplate = data.fixedDepositsAccountAndTemplate;
|
this.fixedDepositsAccountAndTemplate = data.fixedDepositsAccountAndTemplate;
|
||||||
});
|
});
|
||||||
@@ -124,8 +127,8 @@ export class EditFixedDepositAccountComponent {
|
|||||||
* Submits the fixed deposit form and creates a new fixed deposit account
|
* Submits the fixed deposit form and creates a new fixed deposit account
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const monthDayFormat = 'dd MMMM';
|
const monthDayFormat = 'dd MMMM';
|
||||||
const fixedDepositAccount = {
|
const fixedDepositAccount = {
|
||||||
...this.fixedDepositAccount,
|
...this.fixedDepositAccount,
|
||||||
|
|||||||
+5
-2
@@ -5,6 +5,7 @@ import { MatDialog } from '@angular/material/dialog';
|
|||||||
|
|
||||||
/** Dialog Components */
|
/** Dialog Components */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
@@ -45,9 +46,11 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
|||||||
/**
|
/**
|
||||||
* @param {MatDialog} dialog Mat Dialog
|
* @param {MatDialog} dialog Mat Dialog
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(public dialog: MatDialog,
|
constructor(public dialog: MatDialog,
|
||||||
private datePipe: DatePipe) { }
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.currencyCode.valueChanges.subscribe(() => {
|
this.currencyCode.valueChanges.subscribe(() => {
|
||||||
@@ -128,7 +131,7 @@ export class FixedDepositAccountChargesStepComponent implements OnInit, OnChange
|
|||||||
editChargeDateDialogRef.afterClosed().subscribe((response: any) => {
|
editChargeDateDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
let newCharge: any;
|
let newCharge: any;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const date = this.datePipe.transform(response.data.value.date, dateFormat);
|
const date = this.datePipe.transform(response.data.value.date, dateFormat);
|
||||||
switch (charge.chargeTimeType.value) {
|
switch (charge.chargeTimeType.value) {
|
||||||
case 'Specified due date':
|
case 'Specified due date':
|
||||||
|
|||||||
+8
-5
@@ -7,6 +7,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SavingsService } from 'app/savings/savings.service';
|
import { SavingsService } from 'app/savings/savings.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Dialogs */
|
/** Custom Dialogs */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
@@ -63,12 +64,14 @@ export class ChargesTabComponent implements OnInit {
|
|||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {MatDialog} dialog Dialog reference.
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
* @param {DatePipe} datePipe DatePipe.
|
* @param {DatePipe} datePipe DatePipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private savingsService: SavingsService,
|
constructor(private savingsService: SavingsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
|
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
|
||||||
this.fixedDepositsAccountData = data.fixedDepositsAccountData;
|
this.fixedDepositsAccountData = data.fixedDepositsAccountData;
|
||||||
this.chargesData = this.fixedDepositsAccountData.charges;
|
this.chargesData = this.fixedDepositsAccountData.charges;
|
||||||
@@ -124,8 +127,8 @@ export class ChargesTabComponent implements OnInit {
|
|||||||
const payChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
const payChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||||
payChargeDialogRef.afterClosed().subscribe((response: any) => {
|
payChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dataObject = {
|
const dataObject = {
|
||||||
...response.data.value,
|
...response.data.value,
|
||||||
dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat),
|
dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat),
|
||||||
@@ -194,8 +197,8 @@ export class ChargesTabComponent implements OnInit {
|
|||||||
const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||||
editChargeDialogRef.afterClosed().subscribe((response: any) => {
|
editChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dataObject = {
|
const dataObject = {
|
||||||
...response.data.value,
|
...response.data.value,
|
||||||
dateFormat,
|
dateFormat,
|
||||||
|
|||||||
+6
-3
@@ -18,6 +18,7 @@ import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicke
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SavingsService } from 'app/savings/savings.service';
|
import { SavingsService } from 'app/savings/savings.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Savings Account Multi Row Data Tables
|
* Savings Account Multi Row Data Tables
|
||||||
@@ -52,11 +53,13 @@ export class MultiRowComponent implements OnInit, OnChanges {
|
|||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
* @param {SavingsService} savingsService Savingss Service.
|
* @param {SavingsService} savingsService Savingss Service.
|
||||||
* @param {MatDialog} dialog Mat Dialog.
|
* @param {MatDialog} dialog Mat Dialog.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private savingsService: SavingsService,
|
private savingsService: SavingsService,
|
||||||
private dialog: MatDialog) {
|
private dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.parent.snapshot.paramMap.get('fixedDepositAccountId');
|
this.accountId = this.route.parent.parent.snapshot.paramMap.get('fixedDepositAccountId');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,7 +88,7 @@ export class MultiRowComponent implements OnInit, OnChanges {
|
|||||||
* Adds a new row to the given multi row data table.
|
* Adds a new row to the given multi row data table.
|
||||||
*/
|
*/
|
||||||
add() {
|
add() {
|
||||||
let dataTableEntryObject: any = { locale: 'en' };
|
let dataTableEntryObject: any = { locale: this.settingsService.language.code };
|
||||||
const dateTransformColumns: string[] = [];
|
const dateTransformColumns: string[] = [];
|
||||||
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
||||||
return ((column.columnName !== 'id') && (column.columnName !== 'savings_account_id'));
|
return ((column.columnName !== 'id') && (column.columnName !== 'savings_account_id'));
|
||||||
@@ -118,7 +121,7 @@ export class MultiRowComponent implements OnInit, OnChanges {
|
|||||||
});
|
});
|
||||||
case 'DATE': {
|
case 'DATE': {
|
||||||
dateTransformColumns.push(column.columnName);
|
dateTransformColumns.push(column.columnName);
|
||||||
dataTableEntryObject.dateFormat = 'yyyy-MM-dd';
|
dataTableEntryObject.dateFormat = this.settingsService.dateFormat;
|
||||||
return new DatepickerBase({
|
return new DatepickerBase({
|
||||||
controlName: column.columnName,
|
controlName: column.columnName,
|
||||||
label: column.columnName,
|
label: column.columnName,
|
||||||
|
|||||||
+7
-4
@@ -17,6 +17,7 @@ import { CheckboxBase } from 'app/shared/form-dialog/formfield/model/checkbox-ba
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SavingsService } from 'app/savings/savings.service';
|
import { SavingsService } from 'app/savings/savings.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -43,11 +44,13 @@ export class SingleRowComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
* @param {SavingsService} savingsService Savingss Service.
|
* @param {SavingsService} savingsService Savingss Service.
|
||||||
* @param {MatDialog} dialog Mat Dialog.
|
* @param {MatDialog} dialog Mat Dialog.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private savingsService: SavingsService) {
|
private savingsService: SavingsService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.parent.snapshot.paramMap.get('fixedDepositAccountId');
|
this.accountId = this.route.parent.parent.snapshot.paramMap.get('fixedDepositAccountId');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +68,7 @@ export class SingleRowComponent implements OnInit {
|
|||||||
* Creates a new instance of the given single row data table.
|
* Creates a new instance of the given single row data table.
|
||||||
*/
|
*/
|
||||||
add() {
|
add() {
|
||||||
let dataTableEntryObject: any = { locale: 'en' };
|
let dataTableEntryObject: any = { locale: this.settingsService.language.code };
|
||||||
const dateTransformColumns: string[] = [];
|
const dateTransformColumns: string[] = [];
|
||||||
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
||||||
return ((column.columnName !== 'id') && (column.columnName !== 'savings_account_id'));
|
return ((column.columnName !== 'id') && (column.columnName !== 'savings_account_id'));
|
||||||
@@ -95,7 +98,7 @@ export class SingleRowComponent implements OnInit {
|
|||||||
* Edits the current instance of single row data table.
|
* Edits the current instance of single row data table.
|
||||||
*/
|
*/
|
||||||
edit() {
|
edit() {
|
||||||
let dataTableEntryObject: any = { locale: 'en' };
|
let dataTableEntryObject: any = { locale: this.settingsService.language.code };
|
||||||
const dateTransformColumns: string[] = [];
|
const dateTransformColumns: string[] = [];
|
||||||
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
||||||
return ((column.columnName !== 'id') && (column.columnName !== 'savings_account_id'));
|
return ((column.columnName !== 'id') && (column.columnName !== 'savings_account_id'));
|
||||||
@@ -180,7 +183,7 @@ export class SingleRowComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
case 'DATE': {
|
case 'DATE': {
|
||||||
dateTransformColumns.push(column.columnName);
|
dateTransformColumns.push(column.columnName);
|
||||||
dataTableEntryObject.dateFormat = 'yyyy-MM-dd';
|
dataTableEntryObject.dateFormat = this.settingsService.dateFormat;
|
||||||
return new DatepickerBase({
|
return new DatepickerBase({
|
||||||
controlName: column.columnName,
|
controlName: column.columnName,
|
||||||
label: column.columnName,
|
label: column.columnName,
|
||||||
|
|||||||
+6
-3
@@ -7,6 +7,7 @@ import { ActivatedRoute } from '@angular/router';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
||||||
import { AccountTransfersService } from 'app/account-transfers/account-transfers.service';
|
import { AccountTransfersService } from 'app/account-transfers/account-transfers.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.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';
|
||||||
@@ -47,11 +48,13 @@ export class StandingInstructionsTabComponent implements OnInit {
|
|||||||
* @param {FixedDepositsService} fixedDepositsService FixedDepositsService
|
* @param {FixedDepositsService} fixedDepositsService FixedDepositsService
|
||||||
* @param {MatDialog} dialog Mat Dialog
|
* @param {MatDialog} dialog Mat Dialog
|
||||||
* @param {AccountTransfersService} accountTransfersService Accounts Transfer Service
|
* @param {AccountTransfersService} accountTransfersService Accounts Transfer Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private fixedDepositsService: FixedDepositsService,
|
private fixedDepositsService: FixedDepositsService,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private accountTransfersService: AccountTransfersService) {
|
private accountTransfersService: AccountTransfersService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
|
this.route.parent.data.subscribe((data: { fixedDepositsAccountData: any }) => {
|
||||||
this.fixedDepositsData = data.fixedDepositsAccountData;
|
this.fixedDepositsData = data.fixedDepositsAccountData;
|
||||||
});
|
});
|
||||||
@@ -68,8 +71,8 @@ export class StandingInstructionsTabComponent implements OnInit {
|
|||||||
const clientId = this.fixedDepositsData.clientId;
|
const clientId = this.fixedDepositsData.clientId;
|
||||||
const clientName = this.fixedDepositsData.clientName;
|
const clientName = this.fixedDepositsData.clientName;
|
||||||
const accountId = this.fixedDepositsData.id;
|
const accountId = this.fixedDepositsData.id;
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.fixedDepositsService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => {
|
this.fixedDepositsService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => {
|
||||||
this.instructionsData = response.pageItems;
|
this.instructionsData = response.pageItems;
|
||||||
this.dataSource.data = this.instructionsData;
|
this.dataSource.data = this.instructionsData;
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SavingsService } from 'app/savings/savings.service';
|
import { SavingsService } from 'app/savings/savings.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate Fixed Deposits Account Component
|
* Activate Fixed Deposits Account Component
|
||||||
@@ -33,12 +34,14 @@ export class ActivateFixedDepositsAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private savingsService: SavingsService,
|
private savingsService: SavingsService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +67,8 @@ export class ActivateFixedDepositsAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const prevActivatedOnDate: Date = this.activateFixedDepositsAccountForm.value.activatedOnDate;
|
const prevActivatedOnDate: Date = this.activateFixedDepositsAccountForm.value.activatedOnDate;
|
||||||
this.activateFixedDepositsAccountForm.patchValue({
|
this.activateFixedDepositsAccountForm.patchValue({
|
||||||
activatedOnDate: this.datePipe.transform(prevActivatedOnDate, dateFormat),
|
activatedOnDate: this.datePipe.transform(prevActivatedOnDate, dateFormat),
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SavingsService } from 'app/savings/savings.service';
|
import { SavingsService } from 'app/savings/savings.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add Fixed Deposits Charge component.
|
* Add Fixed Deposits Charge component.
|
||||||
@@ -38,13 +39,15 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
|||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {SavingsService} savingsService Savings Service
|
* @param {SavingsService} savingsService Savings Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private savingsService: SavingsService
|
private savingsService: SavingsService,
|
||||||
|
private settingsService: SettingsService
|
||||||
) {
|
) {
|
||||||
this.route.data.subscribe((data: { fixedDepositsAccountActionData: any }) => {
|
this.route.data.subscribe((data: { fixedDepositsAccountActionData: any }) => {
|
||||||
this.savingsChargeOptions = data.fixedDepositsAccountActionData.chargeOptions;
|
this.savingsChargeOptions = data.fixedDepositsAccountActionData.chargeOptions;
|
||||||
@@ -112,7 +115,7 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const savingsCharge = this.fixedDepositsChargeForm.value;
|
const savingsCharge = this.fixedDepositsChargeForm.value;
|
||||||
savingsCharge.locale = 'en';
|
savingsCharge.locale = this.settingsService.language.code;
|
||||||
if (!savingsCharge.feeInterval) {
|
if (!savingsCharge.feeInterval) {
|
||||||
savingsCharge.feeInterval = this.chargeDetails.feeInterval;
|
savingsCharge.feeInterval = this.chargeDetails.feeInterval;
|
||||||
}
|
}
|
||||||
@@ -125,7 +128,7 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
|
|||||||
savingsCharge.feeOnMonthDay = this.datePipe.transform(prevDate, monthDayFormat);
|
savingsCharge.feeOnMonthDay = this.datePipe.transform(prevDate, monthDayFormat);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
savingsCharge.dateFormat = dateFormat;
|
savingsCharge.dateFormat = dateFormat;
|
||||||
if (savingsCharge.dueDate) {
|
if (savingsCharge.dueDate) {
|
||||||
const prevDate = this.fixedDepositsChargeForm.value.dueDate;
|
const prevDate = this.fixedDepositsChargeForm.value.dueDate;
|
||||||
|
|||||||
+6
-4
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Approve Fixed Deposits Account Component
|
* Approve Fixed Deposits Account Component
|
||||||
@@ -32,12 +33,14 @@ export class ApproveFixedDepositsAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private fixedDepositsService: FixedDepositsService,
|
private fixedDepositsService: FixedDepositsService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,9 +66,8 @@ export class ApproveFixedDepositsAccountComponent implements OnInit {
|
|||||||
* if successful redirects to the fixed deposit account.
|
* if successful redirects to the fixed deposit account.
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
|
||||||
const prevApprovedOnDate: Date = this.approveFixedDepositsAccountForm.value.approvedOnDate;
|
const prevApprovedOnDate: Date = this.approveFixedDepositsAccountForm.value.approvedOnDate;
|
||||||
this.approveFixedDepositsAccountForm.patchValue({
|
this.approveFixedDepositsAccountForm.patchValue({
|
||||||
approvedOnDate: this.datePipe.transform(prevApprovedOnDate, dateFormat),
|
approvedOnDate: this.datePipe.transform(prevApprovedOnDate, dateFormat),
|
||||||
|
|||||||
+6
-4
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { FixedDepositsService } from '../../fixed-deposits.service';
|
import { FixedDepositsService } from '../../fixed-deposits.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close On Maturity Fixed Deposits Account Component
|
* Close On Maturity Fixed Deposits Account Component
|
||||||
@@ -39,12 +40,14 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private fixedDepositsService: FixedDepositsService,
|
private fixedDepositsService: FixedDepositsService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { fixedDepositsAccountActionData: any }) => {
|
this.route.data.subscribe((data: { fixedDepositsAccountActionData: any }) => {
|
||||||
this.savingsAccountsData = data.fixedDepositsAccountActionData.savingsAccounts;
|
this.savingsAccountsData = data.fixedDepositsAccountActionData.savingsAccounts;
|
||||||
this.onAccountClosureOptions = data.fixedDepositsAccountActionData.onAccountClosureOptions;
|
this.onAccountClosureOptions = data.fixedDepositsAccountActionData.onAccountClosureOptions;
|
||||||
@@ -93,9 +96,8 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
|
|||||||
* if successful redirects to the fd account.
|
* if successful redirects to the fd account.
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
|
||||||
const prevClosedDate: Date = this.closeOnMaturityAccountForm.value.closedOnDate;
|
const prevClosedDate: Date = this.closeOnMaturityAccountForm.value.closedOnDate;
|
||||||
this.closeOnMaturityAccountForm.patchValue({
|
this.closeOnMaturityAccountForm.patchValue({
|
||||||
closedOnDate: this.datePipe.transform(prevClosedDate, dateFormat),
|
closedOnDate: this.datePipe.transform(prevClosedDate, dateFormat),
|
||||||
|
|||||||
+12
-11
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { FixedDepositsService } from '../../fixed-deposits.service';
|
import { FixedDepositsService } from '../../fixed-deposits.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Premature Close Fixed Deposits Account Component
|
* Premature Close Fixed Deposits Account Component
|
||||||
@@ -39,12 +40,14 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private fixedDepositsService: FixedDepositsService,
|
private fixedDepositsService: FixedDepositsService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,9 +84,8 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
|||||||
* @param {Date} date Premature Close Date
|
* @param {Date} date Premature Close Date
|
||||||
*/
|
*/
|
||||||
calculatePrematureAmount(date: Date) {
|
calculatePrematureAmount(date: Date) {
|
||||||
// TODO: Update once language and date settings are setup
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
|
||||||
const data = {
|
const data = {
|
||||||
closedOnDate: this.datePipe.transform(date, dateFormat),
|
closedOnDate: this.datePipe.transform(date, dateFormat),
|
||||||
dateFormat,
|
dateFormat,
|
||||||
@@ -93,7 +95,7 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
|||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.savingsAccountsData = response.savingsAccounts;
|
this.savingsAccountsData = response.savingsAccounts;
|
||||||
this.onAccountClosureOptions = response.onAccountClosureOptions;
|
this.onAccountClosureOptions = response.onAccountClosureOptions;
|
||||||
this.prematureCloseAccountForm.addControl('maturityAmount', new FormControl({value: '', disabled: true}));
|
this.prematureCloseAccountForm.addControl('maturityAmount', new FormControl({ value: '', disabled: true }));
|
||||||
this.prematureCloseAccountForm.addControl('onAccountClosureId', new FormControl('', Validators.required));
|
this.prematureCloseAccountForm.addControl('onAccountClosureId', new FormControl('', Validators.required));
|
||||||
this.prematureCloseAccountForm.addControl('note', new FormControl(''));
|
this.prematureCloseAccountForm.addControl('note', new FormControl(''));
|
||||||
this.prematureCloseAccountForm.get('maturityAmount').patchValue(response.maturityAmount);
|
this.prematureCloseAccountForm.get('maturityAmount').patchValue(response.maturityAmount);
|
||||||
@@ -123,9 +125,8 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
this.isSubmitted = true;
|
this.isSubmitted = true;
|
||||||
// TODO: Update once language and date settings are setup
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
|
||||||
const prevClosedDate: Date = this.prematureCloseAccountForm.value.closedOnDate;
|
const prevClosedDate: Date = this.prematureCloseAccountForm.value.closedOnDate;
|
||||||
this.prematureCloseAccountForm.patchValue({
|
this.prematureCloseAccountForm.patchValue({
|
||||||
closedOnDate: this.datePipe.transform(prevClosedDate, dateFormat),
|
closedOnDate: this.datePipe.transform(prevClosedDate, dateFormat),
|
||||||
|
|||||||
+6
-4
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reject Fixed Deposits Account Component
|
* Reject Fixed Deposits Account Component
|
||||||
@@ -32,12 +33,14 @@ export class RejectFixedDepositsAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private fixedDepositsService: FixedDepositsService,
|
private fixedDepositsService: FixedDepositsService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,9 +66,8 @@ export class RejectFixedDepositsAccountComponent implements OnInit {
|
|||||||
* if successful redirects to the fixed deposit account.
|
* if successful redirects to the fixed deposit account.
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
|
||||||
const prevRejectedOnDate: Date = this.rejectFixedDepositsAccountForm.value.rejectedOnDate;
|
const prevRejectedOnDate: Date = this.rejectFixedDepositsAccountForm.value.rejectedOnDate;
|
||||||
this.rejectFixedDepositsAccountForm.patchValue({
|
this.rejectFixedDepositsAccountForm.patchValue({
|
||||||
rejectedOnDate: this.datePipe.transform(prevRejectedOnDate, dateFormat),
|
rejectedOnDate: this.datePipe.transform(prevRejectedOnDate, dateFormat),
|
||||||
|
|||||||
+6
-4
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
import { FixedDepositsService } from 'app/deposits/fixed-deposits/fixed-deposits.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Withdraw By Client Fixed Deposits Account Component
|
* Withdraw By Client Fixed Deposits Account Component
|
||||||
@@ -32,12 +33,14 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private fixedDepositsService: FixedDepositsService,
|
private fixedDepositsService: FixedDepositsService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
this.accountId = this.route.parent.snapshot.params['fixedDepositAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,9 +66,8 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
|
|||||||
* if successful redirects to the fixed deposit account.
|
* if successful redirects to the fixed deposit account.
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
|
||||||
const prevWithdrawnOnDate: Date = this.withdrawFixedDepositsAccountForm.value.withdrawnOnDate;
|
const prevWithdrawnOnDate: Date = this.withdrawFixedDepositsAccountForm.value.withdrawnOnDate;
|
||||||
this.withdrawFixedDepositsAccountForm.patchValue({
|
this.withdrawFixedDepositsAccountForm.patchValue({
|
||||||
withdrawnOnDate: this.datePipe.transform(prevWithdrawnOnDate, dateFormat),
|
withdrawnOnDate: this.datePipe.transform(prevWithdrawnOnDate, dateFormat),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ProductsService } from '../../products.service';
|
import { ProductsService } from '../../products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create charge component.
|
* Create charge component.
|
||||||
@@ -43,12 +44,14 @@ export class CreateChargeComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe to format date.
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { chargesTemplate: any }) => {
|
this.route.data.subscribe((data: { chargesTemplate: any }) => {
|
||||||
this.chargesTemplateData = data.chargesTemplate;
|
this.chargesTemplateData = data.chargesTemplate;
|
||||||
this.incomeAndLiabilityAccountData = data.chargesTemplate.incomeOrLiabilityAccountOptions.incomeAccountOptions
|
this.incomeAndLiabilityAccountData = data.chargesTemplate.incomeOrLiabilityAccountOptions.incomeAccountOptions
|
||||||
@@ -216,7 +219,7 @@ export class CreateChargeComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
const charge = this.chargeForm.getRawValue();
|
const charge = this.chargeForm.getRawValue();
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
charge.locale = 'en';
|
charge.locale = this.settingsService.language.code;
|
||||||
charge.monthDayFormat = monthDayFormat;
|
charge.monthDayFormat = monthDayFormat;
|
||||||
delete charge.addFeeFrequency;
|
delete charge.addFeeFrequency;
|
||||||
if (!charge.taxGroupId) {
|
if (!charge.taxGroupId) {
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit Charge component.
|
* Edit Charge component.
|
||||||
@@ -43,19 +45,19 @@ export class EditChargeComponent implements OnInit {
|
|||||||
/** Show Fee Options. */
|
/** Show Fee Options. */
|
||||||
showFeeOptions = false;
|
showFeeOptions = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the charge data from `resolve`.
|
* Retrieves the charge data from `resolve`.
|
||||||
* @param {ProductsService} productsService Products Service.
|
* @param {ProductsService} productsService Products Service.
|
||||||
* @param {FormBuilder} formBuilder Form Builder.
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
*/
|
* @param {SettingsService} settingsService Settings Service
|
||||||
constructor(
|
*/
|
||||||
private productsService: ProductsService,
|
constructor(private productsService: ProductsService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
) {
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { chargesTemplate: any }) => {
|
this.route.data.subscribe((data: { chargesTemplate: any }) => {
|
||||||
this.chargeData = data.chargesTemplate;
|
this.chargeData = data.chargesTemplate;
|
||||||
});
|
});
|
||||||
@@ -71,7 +73,7 @@ export class EditChargeComponent implements OnInit {
|
|||||||
editChargeForm() {
|
editChargeForm() {
|
||||||
this.chargeForm = this.formBuilder.group({
|
this.chargeForm = this.formBuilder.group({
|
||||||
'name': [this.chargeData.name, Validators.required],
|
'name': [this.chargeData.name, Validators.required],
|
||||||
'chargeAppliesTo': [{value: this.chargeData.chargeAppliesTo.id, disabled: true}, Validators.required],
|
'chargeAppliesTo': [{ value: this.chargeData.chargeAppliesTo.id, disabled: true }, Validators.required],
|
||||||
'currencyCode': [this.chargeData.currency.code, Validators.required],
|
'currencyCode': [this.chargeData.currency.code, Validators.required],
|
||||||
'amount': [this.chargeData.amount, Validators.required],
|
'amount': [this.chargeData.amount, Validators.required],
|
||||||
'active': [this.chargeData.active],
|
'active': [this.chargeData.active],
|
||||||
@@ -112,9 +114,9 @@ export class EditChargeComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.chargeData.taxGroup) {
|
if (this.chargeData.taxGroup) {
|
||||||
this.chargeForm.addControl('taxGroupId', this.formBuilder.control({value: this.chargeData.taxGroup.id, disabled: true}, Validators.required));
|
this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: this.chargeData.taxGroup.id, disabled: true }, Validators.required));
|
||||||
} else {
|
} else {
|
||||||
this.chargeForm.addControl('taxGroupId', this.formBuilder.control({value: '?', disabled: true}));
|
this.chargeForm.addControl('taxGroupId', this.formBuilder.control({ value: '?', disabled: true }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,12 +139,12 @@ export class EditChargeComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const charges = this.chargeForm.value;
|
const charges = this.chargeForm.value;
|
||||||
charges.locale = 'en';
|
charges.locale = this.settingsService.language.code;
|
||||||
charges.chargePaymentMode = this.chargeData.chargePaymentMode.id;
|
charges.chargePaymentMode = this.chargeData.chargePaymentMode.id;
|
||||||
this.productsService.updateCharge(this.chargeData.id.toString(), charges)
|
this.productsService.updateCharge(this.chargeData.id.toString(), charges)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../'], { relativeTo: this.route });
|
this.router.navigate(['../'], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-3
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { FixedDepositProductDetailsStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component';
|
import { FixedDepositProductDetailsStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component';
|
||||||
import { FixedDepositProductCurrencyStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component';
|
import { FixedDepositProductCurrencyStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component';
|
||||||
import { FixedDepositProductTermsStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component';
|
import { FixedDepositProductTermsStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component';
|
||||||
@@ -9,7 +11,9 @@ import { FixedDepositProductInterestRateChartStepComponent } from '../fixed-depo
|
|||||||
import { FixedDepositProductChargesStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component';
|
import { FixedDepositProductChargesStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component';
|
||||||
import { FixedDepositProductAccountingStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component';
|
import { FixedDepositProductAccountingStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-create-fixed-deposit-product',
|
selector: 'mifosx-create-fixed-deposit-product',
|
||||||
@@ -29,9 +33,17 @@ export class CreateFixedDepositProductComponent implements OnInit {
|
|||||||
fixedDepositProductsTemplate: any;
|
fixedDepositProductsTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash'];
|
accountingRuleData = ['None', 'Cash'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { fixedDepositProductsTemplate: any }) => {
|
this.route.data.subscribe((data: { fixedDepositProductsTemplate: any }) => {
|
||||||
this.fixedDepositProductsTemplate = data.fixedDepositProductsTemplate;
|
this.fixedDepositProductsTemplate = data.fixedDepositProductsTemplate;
|
||||||
});
|
});
|
||||||
@@ -92,13 +104,13 @@ export class CreateFixedDepositProductComponent implements OnInit {
|
|||||||
const fixedDepositProduct = {
|
const fixedDepositProduct = {
|
||||||
...this.fixedDepositProduct,
|
...this.fixedDepositProduct,
|
||||||
charges: this.fixedDepositProduct.charges.map((charge: any) => ({ id: charge.id })),
|
charges: this.fixedDepositProduct.charges.map((charge: any) => ({ id: charge.id })),
|
||||||
locale: 'en' // locale required for depositAmount
|
locale: this.settingsService.language.code // locale required for depositAmount
|
||||||
};
|
};
|
||||||
delete fixedDepositProduct.advancedAccountingRules;
|
delete fixedDepositProduct.advancedAccountingRules;
|
||||||
this.productsService.createFixedDepositProduct(fixedDepositProduct)
|
this.productsService.createFixedDepositProduct(fixedDepositProduct)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+15
-3
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { FixedDepositProductDetailsStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component';
|
import { FixedDepositProductDetailsStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-details-step/fixed-deposit-product-details-step.component';
|
||||||
import { FixedDepositProductCurrencyStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component';
|
import { FixedDepositProductCurrencyStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-currency-step/fixed-deposit-product-currency-step.component';
|
||||||
import { FixedDepositProductTermsStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component';
|
import { FixedDepositProductTermsStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-terms-step/fixed-deposit-product-terms-step.component';
|
||||||
@@ -9,7 +11,9 @@ import { FixedDepositProductInterestRateChartStepComponent } from '../fixed-depo
|
|||||||
import { FixedDepositProductChargesStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component';
|
import { FixedDepositProductChargesStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-charges-step/fixed-deposit-product-charges-step.component';
|
||||||
import { FixedDepositProductAccountingStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component';
|
import { FixedDepositProductAccountingStepComponent } from '../fixed-deposit-product-stepper/fixed-deposit-product-accounting-step/fixed-deposit-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-edit-fixed-deposit-product',
|
selector: 'mifosx-edit-fixed-deposit-product',
|
||||||
@@ -29,9 +33,17 @@ export class EditFixedDepositProductComponent implements OnInit {
|
|||||||
fixedDepositProductsTemplate: any;
|
fixedDepositProductsTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash'];
|
accountingRuleData = ['None', 'Cash'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { fixedDepositProductAndTemplate: any }) => {
|
this.route.data.subscribe((data: { fixedDepositProductAndTemplate: any }) => {
|
||||||
this.fixedDepositProductsTemplate = data.fixedDepositProductAndTemplate;
|
this.fixedDepositProductsTemplate = data.fixedDepositProductAndTemplate;
|
||||||
});
|
});
|
||||||
@@ -100,7 +112,7 @@ export class EditFixedDepositProductComponent implements OnInit {
|
|||||||
const fixedDepositProduct = {
|
const fixedDepositProduct = {
|
||||||
...this.fixedDepositProduct,
|
...this.fixedDepositProduct,
|
||||||
charges: this.fixedDepositProduct.charges.map((charge: any) => ({ id: charge.id })),
|
charges: this.fixedDepositProduct.charges.map((charge: any) => ({ id: charge.id })),
|
||||||
locale: 'en' // locale required for depositAmount
|
locale: this.settingsService.language.code // locale required for depositAmount
|
||||||
};
|
};
|
||||||
if (!fixedDepositProduct.description) {
|
if (!fixedDepositProduct.description) {
|
||||||
fixedDepositProduct.description = '';
|
fixedDepositProduct.description = '';
|
||||||
|
|||||||
+18
-4
@@ -1,17 +1,23 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, Input } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms';
|
import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
import { DepositProductIncentiveFormDialogComponent } from 'app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component';
|
import { DepositProductIncentiveFormDialogComponent } from 'app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component';
|
||||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||||
|
|
||||||
|
/** Dialog Components */
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||||
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
||||||
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-fixed-deposit-product-interest-rate-chart-step',
|
selector: 'mifosx-fixed-deposit-product-interest-rate-chart-step',
|
||||||
templateUrl: './fixed-deposit-product-interest-rate-chart-step.component.html',
|
templateUrl: './fixed-deposit-product-interest-rate-chart-step.component.html',
|
||||||
@@ -50,9 +56,17 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
|
|||||||
chartDetailData: any = [];
|
chartDetailData: any = [];
|
||||||
chartsDetail: any[] = [];
|
chartsDetail: any[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.createFixedDepositProductInterestRateChartForm();
|
this.createFixedDepositProductInterestRateChartForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -284,7 +298,7 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
|
|||||||
|
|
||||||
getData(formType: string, values?: any) {
|
getData(formType: string, values?: any) {
|
||||||
switch (formType) {
|
switch (formType) {
|
||||||
case 'Slab': return { title: 'Slab', formfields: this.getSlabFormfields(values) };
|
case 'Slab': return { title: 'Slab', formfields: this.getSlabFormfields(values) };
|
||||||
case 'Incentive': return { values, chartTemplate: this.fixedDepositProductsTemplate.chartTemplate };
|
case 'Incentive': return { values, chartTemplate: this.fixedDepositProductsTemplate.chartTemplate };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,8 +363,8 @@ export class FixedDepositProductInterestRateChartStepComponent implements OnInit
|
|||||||
|
|
||||||
get fixedDepositProductInterestRateChart() {
|
get fixedDepositProductInterestRateChart() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const fixedDepositProductInterestRateChart = this.fixedDepositProductInterestRateChartForm.value;
|
const fixedDepositProductInterestRateChart = this.fixedDepositProductInterestRateChartForm.value;
|
||||||
for (const chart of fixedDepositProductInterestRateChart.charts) {
|
for (const chart of fixedDepositProductInterestRateChart.charts) {
|
||||||
chart.dateFormat = dateFormat;
|
chart.dateFormat = dateFormat;
|
||||||
|
|||||||
+7
-4
@@ -10,6 +10,7 @@ import { MatTableDataSource } from '@angular/material/table';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ProductsService } from '../../products.service';
|
import { ProductsService } from '../../products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Components */
|
/** Custom Components */
|
||||||
import { FloatingRatePeriodDialogComponent } from '../floating-rate-period-dialog/floating-rate-period-dialog.component';
|
import { FloatingRatePeriodDialogComponent } from '../floating-rate-period-dialog/floating-rate-period-dialog.component';
|
||||||
@@ -36,7 +37,7 @@ export class CreateFloatingRateComponent implements OnInit {
|
|||||||
/** Data source for floating rate periods table. */
|
/** Data source for floating rate periods table. */
|
||||||
dataSource: MatTableDataSource<any>;
|
dataSource: MatTableDataSource<any>;
|
||||||
/** Date Format. */
|
/** Date Format. */
|
||||||
dateFormat = 'dd MMMM yyyy';
|
dateFormat = this.settingsService.dateFormat;
|
||||||
|
|
||||||
/** Paginator for floating rate periods table. */
|
/** Paginator for floating rate periods table. */
|
||||||
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
@ViewChild(MatPaginator, { static: true }) paginator: MatPaginator;
|
||||||
@@ -50,13 +51,15 @@ export class CreateFloatingRateComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
* @param {MatDialog} dialog Dialog reference.
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private router: Router,
|
constructor(private router: Router,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private dialog: MatDialog) { }
|
private dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the floating rate periods table.
|
* Sets the floating rate periods table.
|
||||||
@@ -111,7 +114,7 @@ export class CreateFloatingRateComponent implements OnInit {
|
|||||||
fromDate: this.datePipe.transform(response.fromDate, this.dateFormat),
|
fromDate: this.datePipe.transform(response.fromDate, this.dateFormat),
|
||||||
interestRate: response.interestRate,
|
interestRate: response.interestRate,
|
||||||
isDifferentialToBaseLendingRate: response.isDifferentialToBaseLendingRate,
|
isDifferentialToBaseLendingRate: response.isDifferentialToBaseLendingRate,
|
||||||
locale: 'en',
|
locale: this.settingsService.language.code,
|
||||||
dateFormat: this.dateFormat
|
dateFormat: this.dateFormat
|
||||||
});
|
});
|
||||||
this.dataSource.connect().next(this.floatingRatePeriodsData);
|
this.dataSource.connect().next(this.floatingRatePeriodsData);
|
||||||
@@ -137,7 +140,7 @@ export class CreateFloatingRateComponent implements OnInit {
|
|||||||
fromDate: this.datePipe.transform(response.fromDate, this.dateFormat),
|
fromDate: this.datePipe.transform(response.fromDate, this.dateFormat),
|
||||||
interestRate: response.interestRate,
|
interestRate: response.interestRate,
|
||||||
isDifferentialToBaseLendingRate: response.isDifferentialToBaseLendingRate,
|
isDifferentialToBaseLendingRate: response.isDifferentialToBaseLendingRate,
|
||||||
locale: 'en',
|
locale: this.settingsService.language.code,
|
||||||
dateFormat: this.dateFormat
|
dateFormat: this.dateFormat
|
||||||
};
|
};
|
||||||
this.dataSource.connect().next(this.floatingRatePeriodsData);
|
this.dataSource.connect().next(this.floatingRatePeriodsData);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { MatTableDataSource } from '@angular/material/table';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ProductsService } from '../../products.service';
|
import { ProductsService } from '../../products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Components */
|
/** Custom Components */
|
||||||
import { FloatingRatePeriodDialogComponent } from '../floating-rate-period-dialog/floating-rate-period-dialog.component';
|
import { FloatingRatePeriodDialogComponent } from '../floating-rate-period-dialog/floating-rate-period-dialog.component';
|
||||||
@@ -38,7 +39,7 @@ export class EditFloatingRateComponent implements OnInit {
|
|||||||
/** Data source for floating rate periods table. */
|
/** Data source for floating rate periods table. */
|
||||||
dataSource: MatTableDataSource<any>;
|
dataSource: MatTableDataSource<any>;
|
||||||
/** Date Format. */
|
/** Date Format. */
|
||||||
dateFormat = 'dd MMMM yyyy';
|
dateFormat = this.settingsService.dateFormat;
|
||||||
/** Floating Rate Period Data. */
|
/** Floating Rate Period Data. */
|
||||||
floatingRatePeriodsData: any[] = [];
|
floatingRatePeriodsData: any[] = [];
|
||||||
|
|
||||||
@@ -55,13 +56,15 @@ export class EditFloatingRateComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
* @param {MatDialog} dialog Dialog reference.
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private router: Router,
|
constructor(private router: Router,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private dialog: MatDialog) {
|
private dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { floatingRate: any }) => {
|
this.route.data.subscribe((data: { floatingRate: any }) => {
|
||||||
this.floatingRateData = data.floatingRate;
|
this.floatingRateData = data.floatingRate;
|
||||||
this.floatingRatePeriodsData = data.floatingRate.ratePeriods ? data.floatingRate.ratePeriods : [];
|
this.floatingRatePeriodsData = data.floatingRate.ratePeriods ? data.floatingRate.ratePeriods : [];
|
||||||
@@ -109,7 +112,7 @@ export class EditFloatingRateComponent implements OnInit {
|
|||||||
fromDate: this.datePipe.transform(response.fromDate, this.dateFormat),
|
fromDate: this.datePipe.transform(response.fromDate, this.dateFormat),
|
||||||
interestRate: response.interestRate,
|
interestRate: response.interestRate,
|
||||||
isDifferentialToBaseLendingRate: response.isDifferentialToBaseLendingRate,
|
isDifferentialToBaseLendingRate: response.isDifferentialToBaseLendingRate,
|
||||||
locale: 'en',
|
locale: this.settingsService.language.code,
|
||||||
dateFormat: this.dateFormat
|
dateFormat: this.dateFormat
|
||||||
});
|
});
|
||||||
this.dataSource.connect().next(this.floatingRatePeriodsData);
|
this.dataSource.connect().next(this.floatingRatePeriodsData);
|
||||||
@@ -136,7 +139,7 @@ export class EditFloatingRateComponent implements OnInit {
|
|||||||
fromDate: this.datePipe.transform(response.fromDate, this.dateFormat),
|
fromDate: this.datePipe.transform(response.fromDate, this.dateFormat),
|
||||||
interestRate: response.interestRate,
|
interestRate: response.interestRate,
|
||||||
isDifferentialToBaseLendingRate: response.isDifferentialToBaseLendingRate,
|
isDifferentialToBaseLendingRate: response.isDifferentialToBaseLendingRate,
|
||||||
locale: 'en',
|
locale: this.settingsService.language.code,
|
||||||
dateFormat: this.dateFormat
|
dateFormat: this.dateFormat
|
||||||
};
|
};
|
||||||
this.dataSource.connect().next(this.floatingRatePeriodsData);
|
this.dataSource.connect().next(this.floatingRatePeriodsData);
|
||||||
@@ -174,7 +177,7 @@ export class EditFloatingRateComponent implements OnInit {
|
|||||||
floatingRatePeriod.modifiedBy = undefined;
|
floatingRatePeriod.modifiedBy = undefined;
|
||||||
floatingRatePeriod.createdBy = undefined;
|
floatingRatePeriod.createdBy = undefined;
|
||||||
floatingRatePeriod.isActive = undefined;
|
floatingRatePeriod.isActive = undefined;
|
||||||
floatingRatePeriod.locale = 'en';
|
floatingRatePeriod.locale = this.settingsService.language.code;
|
||||||
floatingRatePeriod.dateFormat = this.dateFormat;
|
floatingRatePeriod.dateFormat = this.dateFormat;
|
||||||
floatingRatePeriod.fromDate = this.datePipe.transform(floatingRatePeriod.fromDate, this.dateFormat);
|
floatingRatePeriod.fromDate = this.datePipe.transform(floatingRatePeriod.fromDate, this.dateFormat);
|
||||||
});
|
});
|
||||||
|
|||||||
+15
-3
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { LoanProductDetailsStepComponent } from '../loan-product-stepper/loan-product-details-step/loan-product-details-step.component';
|
import { LoanProductDetailsStepComponent } from '../loan-product-stepper/loan-product-details-step/loan-product-details-step.component';
|
||||||
import { LoanProductCurrencyStepComponent } from '../loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component';
|
import { LoanProductCurrencyStepComponent } from '../loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component';
|
||||||
import { LoanProductTermsStepComponent } from '../loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component';
|
import { LoanProductTermsStepComponent } from '../loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component';
|
||||||
@@ -8,7 +10,9 @@ import { LoanProductSettingsStepComponent } from '../loan-product-stepper/loan-p
|
|||||||
import { LoanProductChargesStepComponent } from '../loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component';
|
import { LoanProductChargesStepComponent } from '../loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component';
|
||||||
import { LoanProductAccountingStepComponent } from '../loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component';
|
import { LoanProductAccountingStepComponent } from '../loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-create-loan-product',
|
selector: 'mifosx-create-loan-product',
|
||||||
@@ -27,8 +31,16 @@ export class CreateLoanProductComponent implements OnInit {
|
|||||||
loanProductsTemplate: any;
|
loanProductsTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash', 'Accrual (periodic)', 'Accrual (upfront)'];
|
accountingRuleData = ['None', 'Cash', 'Accrual (periodic)', 'Accrual (upfront)'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Product Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
|
* @param {Router} router Router for navigation.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private router: Router) {
|
private router: Router) {
|
||||||
this.route.data.subscribe((data: { loanProductsTemplate: any }) => {
|
this.route.data.subscribe((data: { loanProductsTemplate: any }) => {
|
||||||
this.loanProductsTemplate = data.loanProductsTemplate;
|
this.loanProductsTemplate = data.loanProductsTemplate;
|
||||||
@@ -81,19 +93,19 @@ export class CreateLoanProductComponent implements OnInit {
|
|||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const loanProduct = {
|
const loanProduct = {
|
||||||
...this.loanProduct,
|
...this.loanProduct,
|
||||||
charges: this.loanProduct.charges.map((charge: any) => ({ id: charge.id })),
|
charges: this.loanProduct.charges.map((charge: any) => ({ id: charge.id })),
|
||||||
dateFormat,
|
dateFormat,
|
||||||
locale: 'en'
|
locale: this.settingsService.language.code
|
||||||
};
|
};
|
||||||
delete loanProduct.allowAttributeConfiguration;
|
delete loanProduct.allowAttributeConfiguration;
|
||||||
delete loanProduct.advancedAccountingRules;
|
delete loanProduct.advancedAccountingRules;
|
||||||
this.productsService.createLoanProduct(loanProduct)
|
this.productsService.createLoanProduct(loanProduct)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { LoanProductDetailsStepComponent } from '../loan-product-stepper/loan-product-details-step/loan-product-details-step.component';
|
import { LoanProductDetailsStepComponent } from '../loan-product-stepper/loan-product-details-step/loan-product-details-step.component';
|
||||||
import { LoanProductCurrencyStepComponent } from '../loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component';
|
import { LoanProductCurrencyStepComponent } from '../loan-product-stepper/loan-product-currency-step/loan-product-currency-step.component';
|
||||||
import { LoanProductTermsStepComponent } from '../loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component';
|
import { LoanProductTermsStepComponent } from '../loan-product-stepper/loan-product-terms-step/loan-product-terms-step.component';
|
||||||
@@ -8,7 +10,9 @@ import { LoanProductSettingsStepComponent } from '../loan-product-stepper/loan-p
|
|||||||
import { LoanProductChargesStepComponent } from '../loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component';
|
import { LoanProductChargesStepComponent } from '../loan-product-stepper/loan-product-charges-step/loan-product-charges-step.component';
|
||||||
import { LoanProductAccountingStepComponent } from '../loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component';
|
import { LoanProductAccountingStepComponent } from '../loan-product-stepper/loan-product-accounting-step/loan-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-edit-loan-product',
|
selector: 'mifosx-edit-loan-product',
|
||||||
@@ -27,8 +31,16 @@ export class EditLoanProductComponent implements OnInit {
|
|||||||
loanProductAndTemplate: any;
|
loanProductAndTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash', 'Accrual (periodic)', 'Accrual (upfront)'];
|
accountingRuleData = ['None', 'Cash', 'Accrual (periodic)', 'Accrual (upfront)'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Product Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
|
* @param {Router} router Router for navigation.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
|
private settingsService: SettingsService,
|
||||||
private router: Router) {
|
private router: Router) {
|
||||||
this.route.data.subscribe((data: { loanProductAndTemplate: any }) => {
|
this.route.data.subscribe((data: { loanProductAndTemplate: any }) => {
|
||||||
this.loanProductAndTemplate = data.loanProductAndTemplate;
|
this.loanProductAndTemplate = data.loanProductAndTemplate;
|
||||||
@@ -89,19 +101,19 @@ export class EditLoanProductComponent implements OnInit {
|
|||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const loanProduct = {
|
const loanProduct = {
|
||||||
...this.loanProduct,
|
...this.loanProduct,
|
||||||
charges: this.loanProduct.charges.map((charge: any) => ({ id: charge.id })),
|
charges: this.loanProduct.charges.map((charge: any) => ({ id: charge.id })),
|
||||||
dateFormat,
|
dateFormat,
|
||||||
locale: 'en'
|
locale: this.settingsService.language.code
|
||||||
};
|
};
|
||||||
delete loanProduct.allowAttributeConfiguration;
|
delete loanProduct.allowAttributeConfiguration;
|
||||||
delete loanProduct.advancedAccountingRules;
|
delete loanProduct.advancedAccountingRules;
|
||||||
this.productsService.updateLoanProduct(this.loanProductAndTemplate.id, loanProduct)
|
this.productsService.updateLoanProduct(this.loanProductAndTemplate.id, loanProduct)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+13
-2
@@ -1,7 +1,11 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, Input } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-loan-product-details-step',
|
selector: 'mifosx-loan-product-details-step',
|
||||||
templateUrl: './loan-product-details-step.component.html',
|
templateUrl: './loan-product-details-step.component.html',
|
||||||
@@ -18,8 +22,15 @@ export class LoanProductDetailsStepComponent implements OnInit {
|
|||||||
minDate = new Date(2000, 0, 1);
|
minDate = new Date(2000, 0, 1);
|
||||||
maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + 10));
|
maxDate = new Date(new Date().setFullYear(new Date().getFullYear() + 10));
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.createLoanProductDetailsForm();
|
this.createLoanProductDetailsForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -53,7 +64,7 @@ export class LoanProductDetailsStepComponent implements OnInit {
|
|||||||
const prevStartDate: Date = this.loanProductDetailsForm.value.startDate;
|
const prevStartDate: Date = this.loanProductDetailsForm.value.startDate;
|
||||||
const prevCloseDate: Date = this.loanProductDetailsForm.value.closeDate;
|
const prevCloseDate: Date = this.loanProductDetailsForm.value.closeDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.loanProductDetailsForm.patchValue({
|
this.loanProductDetailsForm.patchValue({
|
||||||
startDate: this.datePipe.transform(prevStartDate, dateFormat) || '',
|
startDate: this.datePipe.transform(prevStartDate, dateFormat) || '',
|
||||||
closeDate: this.datePipe.transform(prevCloseDate, dateFormat) || ''
|
closeDate: this.datePipe.transform(prevCloseDate, dateFormat) || ''
|
||||||
|
|||||||
+7
-4
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ProductsService } from '../../products.service';
|
import { ProductsService } from '../../products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Tax Component component.
|
* Create Tax Component component.
|
||||||
@@ -41,13 +42,15 @@ export class CreateTaxComponentComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe to format date.
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
this.route.data.subscribe(( data: { taxComponentTemplate: any }) => {
|
private settingsService: SettingsService) {
|
||||||
|
this.route.data.subscribe((data: { taxComponentTemplate: any }) => {
|
||||||
this.taxComponentTemplateData = data.taxComponentTemplate;
|
this.taxComponentTemplateData = data.taxComponentTemplate;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -114,12 +117,12 @@ export class CreateTaxComponentComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevStartDate: Date = this.taxComponentForm.value.startDate;
|
const prevStartDate: Date = this.taxComponentForm.value.startDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.taxComponentForm.patchValue({
|
this.taxComponentForm.patchValue({
|
||||||
startDate: this.datePipe.transform(prevStartDate, dateFormat)
|
startDate: this.datePipe.transform(prevStartDate, dateFormat)
|
||||||
});
|
});
|
||||||
const taxComponent = this.taxComponentForm.value;
|
const taxComponent = this.taxComponentForm.value;
|
||||||
taxComponent.locale = 'en';
|
taxComponent.locale = this.settingsService.language.code;
|
||||||
taxComponent.dateFormat = dateFormat;
|
taxComponent.dateFormat = dateFormat;
|
||||||
this.productsService.createTaxComponent(taxComponent).subscribe((response: any) => {
|
this.productsService.createTaxComponent(taxComponent).subscribe((response: any) => {
|
||||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||||
|
|||||||
+8
-5
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ProductsService } from '../../products.service';
|
import { ProductsService } from '../../products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit tax component.
|
* Edit tax component.
|
||||||
@@ -31,12 +32,14 @@ export class EditTaxComponentComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe to format date.
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { taxComponent: any }) => {
|
this.route.data.subscribe((data: { taxComponent: any }) => {
|
||||||
this.taxComponentData = data.taxComponent;
|
this.taxComponentData = data.taxComponent;
|
||||||
});
|
});
|
||||||
@@ -57,8 +60,8 @@ export class EditTaxComponentComponent implements OnInit {
|
|||||||
'name': [this.taxComponentData.name, [Validators.required]],
|
'name': [this.taxComponentData.name, [Validators.required]],
|
||||||
'percentage': [this.taxComponentData.percentage, [Validators.required, Validators.pattern('^(0*[1-9][0-9]*(\\.[0-9]+)?|0+\\.[0-9]*[1-9][0-9]*)$'), Validators.max(100)]],
|
'percentage': [this.taxComponentData.percentage, [Validators.required, Validators.pattern('^(0*[1-9][0-9]*(\\.[0-9]+)?|0+\\.[0-9]*[1-9][0-9]*)$'), Validators.max(100)]],
|
||||||
'startDate': [this.taxComponentData.startDate && new Date(this.taxComponentData.startDate)],
|
'startDate': [this.taxComponentData.startDate && new Date(this.taxComponentData.startDate)],
|
||||||
'creditAccountType': [{value: this.taxComponentData.creditAccountType.value, disabled: true}],
|
'creditAccountType': [{ value: this.taxComponentData.creditAccountType.value, disabled: true }],
|
||||||
'creditAccount': [{value: this.taxComponentData.creditAccount.name, disabled: true}]
|
'creditAccount': [{ value: this.taxComponentData.creditAccount.name, disabled: true }]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,12 +72,12 @@ export class EditTaxComponentComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevStartDate: Date = this.taxComponentForm.value.startDate;
|
const prevStartDate: Date = this.taxComponentForm.value.startDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.taxComponentForm.patchValue({
|
this.taxComponentForm.patchValue({
|
||||||
startDate: this.datePipe.transform(prevStartDate, dateFormat)
|
startDate: this.datePipe.transform(prevStartDate, dateFormat)
|
||||||
});
|
});
|
||||||
const taxComponent = this.taxComponentForm.value;
|
const taxComponent = this.taxComponentForm.value;
|
||||||
taxComponent.locale = 'en';
|
taxComponent.locale = this.settingsService.language.code;
|
||||||
taxComponent.dateFormat = dateFormat;
|
taxComponent.dateFormat = dateFormat;
|
||||||
this.productsService.updateTaxComponent(this.taxComponentData.id, taxComponent).subscribe((response: any) => {
|
this.productsService.updateTaxComponent(this.taxComponentData.id, taxComponent).subscribe((response: any) => {
|
||||||
this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { MatDialog } from '@angular/material/dialog';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ProductsService } from '../../products.service';
|
import { ProductsService } from '../../products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Dialog Components */
|
/** Dialog Components */
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||||
@@ -48,13 +49,16 @@ export class CreateTaxGroupComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe to format date.
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { taxGroupTemplate: any }) => {
|
this.route.data.subscribe((data: { taxGroupTemplate: any }) => {
|
||||||
this.taxGroupTemplateData = data.taxGroupTemplate;
|
this.taxGroupTemplateData = data.taxGroupTemplate;
|
||||||
this.taxComponentOptions = this.taxGroupTemplateData.taxComponents;
|
this.taxComponentOptions = this.taxGroupTemplateData.taxComponents;
|
||||||
@@ -163,8 +167,8 @@ export class CreateTaxGroupComponent implements OnInit {
|
|||||||
* if successful redirects to Tax Groups.
|
* if successful redirects to Tax Groups.
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const taxGroup = {
|
const taxGroup = {
|
||||||
...this.taxGroupForm.value,
|
...this.taxGroupForm.value,
|
||||||
taxComponents: this.taxComponentsDataSource,
|
taxComponents: this.taxComponentsDataSource,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { MatDialog } from '@angular/material/dialog';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ProductsService } from '../../products.service';
|
import { ProductsService } from '../../products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Dialog Components */
|
/** Dialog Components */
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||||
@@ -48,13 +49,16 @@ export class EditTaxGroupComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe to format date.
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { taxGroup: any }) => {
|
this.route.data.subscribe((data: { taxGroup: any }) => {
|
||||||
this.taxGroupData = data.taxGroup;
|
this.taxGroupData = data.taxGroup;
|
||||||
this.taxComponentOptions = this.taxGroupData.taxComponents;
|
this.taxComponentOptions = this.taxGroupData.taxComponents;
|
||||||
@@ -193,8 +197,8 @@ export class EditTaxGroupComponent implements OnInit {
|
|||||||
* if successful redirects to Tax Groups.
|
* if successful redirects to Tax Groups.
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const taxGroup = {
|
const taxGroup = {
|
||||||
...this.taxGroupForm.value,
|
...this.taxGroupForm.value,
|
||||||
taxComponents: this.taxComponentsDataSource,
|
taxComponents: this.taxComponentsDataSource,
|
||||||
|
|||||||
@@ -5,6 +5,9 @@ import { HttpClient, HttpParams } from '@angular/common/http';
|
|||||||
/** rxjs Imports */
|
/** rxjs Imports */
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Products service.
|
* Products service.
|
||||||
*/
|
*/
|
||||||
@@ -15,8 +18,10 @@ export class ProductsService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {HttpClient} http Http Client to send requests.
|
* @param {HttpClient} http Http Client to send requests.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private http: HttpClient) { }
|
constructor(private http: HttpClient,
|
||||||
|
private settingsService: SettingsService) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @returns {Observable<any>} Loan products data
|
* @returns {Observable<any>} Loan products data
|
||||||
@@ -105,10 +110,10 @@ export class ProductsService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getDividendData(shareProductId: any, dividendId: any): Observable<any> {
|
getDividendData(shareProductId: any, dividendId: any): Observable<any> {
|
||||||
const httpParams = new HttpParams().set('dateFormat', 'dd MMMM yyyy')
|
const httpParams = new HttpParams().set('dateFormat', this.settingsService.dateFormat)
|
||||||
.set('limit', '10')
|
.set('limit', '10')
|
||||||
.set('locale', 'en')
|
.set('locale', this.settingsService.language.code)
|
||||||
.set('offset', '0');
|
.set('offset', '0');
|
||||||
return this.http.get(`/shareproduct/${shareProductId}/dividend/${dividendId}`, { params: httpParams });
|
return this.http.get(`/shareproduct/${shareProductId}/dividend/${dividendId}`, { params: httpParams });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -394,7 +399,7 @@ export class ProductsService {
|
|||||||
*/
|
*/
|
||||||
getAllInterestRateCharts(productId: string): Observable<any> {
|
getAllInterestRateCharts(productId: string): Observable<any> {
|
||||||
const httpParams = new HttpParams().set('productId', productId);
|
const httpParams = new HttpParams().set('productId', productId);
|
||||||
return this.http.get(`/interestratecharts`, {params: httpParams});
|
return this.http.get(`/interestratecharts`, { params: httpParams });
|
||||||
}
|
}
|
||||||
|
|
||||||
createRecurringDepositProduct(recurringDepositProduct: any): Observable<any> {
|
createRecurringDepositProduct(recurringDepositProduct: any): Observable<any> {
|
||||||
|
|||||||
+15
-3
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { RecurringDepositProductDetailsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component';
|
import { RecurringDepositProductDetailsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component';
|
||||||
import { RecurringDepositProductCurrencyStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component';
|
import { RecurringDepositProductCurrencyStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component';
|
||||||
import { RecurringDepositProductTermsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component';
|
import { RecurringDepositProductTermsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component';
|
||||||
@@ -9,7 +11,9 @@ import { RecurringDepositProductInterestRateChartStepComponent } from '../recurr
|
|||||||
import { RecurringDepositProductChargesStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component';
|
import { RecurringDepositProductChargesStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component';
|
||||||
import { RecurringDepositProductAccountingStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component';
|
import { RecurringDepositProductAccountingStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-create-recurring-deposit-product',
|
selector: 'mifosx-create-recurring-deposit-product',
|
||||||
@@ -29,9 +33,17 @@ export class CreateRecurringDepositProductComponent implements OnInit {
|
|||||||
recurringDepositProductsTemplate: any;
|
recurringDepositProductsTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash'];
|
accountingRuleData = ['None', 'Cash'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { recurringDepositProductsTemplate: any }) => {
|
this.route.data.subscribe((data: { recurringDepositProductsTemplate: any }) => {
|
||||||
this.recurringDepositProductsTemplate = data.recurringDepositProductsTemplate;
|
this.recurringDepositProductsTemplate = data.recurringDepositProductsTemplate;
|
||||||
});
|
});
|
||||||
@@ -92,7 +104,7 @@ export class CreateRecurringDepositProductComponent implements OnInit {
|
|||||||
const recurringDepositProduct = {
|
const recurringDepositProduct = {
|
||||||
...this.recurringDepositProduct,
|
...this.recurringDepositProduct,
|
||||||
charges: this.recurringDepositProduct.charges.map((charge: any) => ({ id: charge.id })),
|
charges: this.recurringDepositProduct.charges.map((charge: any) => ({ id: charge.id })),
|
||||||
locale: 'en' // locale required for depositAmount
|
locale: this.settingsService.language.code // locale required for depositAmount
|
||||||
};
|
};
|
||||||
if (!recurringDepositProduct.description) {
|
if (!recurringDepositProduct.description) {
|
||||||
recurringDepositProduct.description = '';
|
recurringDepositProduct.description = '';
|
||||||
|
|||||||
+15
-3
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { RecurringDepositProductDetailsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component';
|
import { RecurringDepositProductDetailsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-details-step/recurring-deposit-product-details-step.component';
|
||||||
import { RecurringDepositProductCurrencyStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component';
|
import { RecurringDepositProductCurrencyStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-currency-step/recurring-deposit-product-currency-step.component';
|
||||||
import { RecurringDepositProductTermsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component';
|
import { RecurringDepositProductTermsStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-terms-step/recurring-deposit-product-terms-step.component';
|
||||||
@@ -9,7 +11,9 @@ import { RecurringDepositProductInterestRateChartStepComponent } from '../recurr
|
|||||||
import { RecurringDepositProductChargesStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component';
|
import { RecurringDepositProductChargesStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-charges-step/recurring-deposit-product-charges-step.component';
|
||||||
import { RecurringDepositProductAccountingStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component';
|
import { RecurringDepositProductAccountingStepComponent } from '../recurring-deposit-product-stepper/recurring-deposit-product-accounting-step/recurring-deposit-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-edit-recurring-deposit-product',
|
selector: 'mifosx-edit-recurring-deposit-product',
|
||||||
@@ -29,9 +33,17 @@ export class EditRecurringDepositProductComponent implements OnInit {
|
|||||||
recurringDepositProductsTemplate: any;
|
recurringDepositProductsTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash'];
|
accountingRuleData = ['None', 'Cash'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { recurringDepositProductAndTemplate: any }) => {
|
this.route.data.subscribe((data: { recurringDepositProductAndTemplate: any }) => {
|
||||||
this.recurringDepositProductsTemplate = data.recurringDepositProductAndTemplate;
|
this.recurringDepositProductsTemplate = data.recurringDepositProductAndTemplate;
|
||||||
});
|
});
|
||||||
@@ -100,7 +112,7 @@ export class EditRecurringDepositProductComponent implements OnInit {
|
|||||||
const recurringDepositProduct = {
|
const recurringDepositProduct = {
|
||||||
...this.recurringDepositProduct,
|
...this.recurringDepositProduct,
|
||||||
charges: this.recurringDepositProduct.charges.map((charge: any) => ({ id: charge.id })),
|
charges: this.recurringDepositProduct.charges.map((charge: any) => ({ id: charge.id })),
|
||||||
locale: 'en' // locale required for depositAmount
|
locale: this.settingsService.language.code // locale required for depositAmount
|
||||||
};
|
};
|
||||||
if (!recurringDepositProduct.description) {
|
if (!recurringDepositProduct.description) {
|
||||||
recurringDepositProduct.description = '';
|
recurringDepositProduct.description = '';
|
||||||
|
|||||||
+18
-4
@@ -1,17 +1,23 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, Input } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms';
|
import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { animate, state, style, transition, trigger } from '@angular/animations';
|
import { animate, state, style, transition, trigger } from '@angular/animations';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
import { DepositProductIncentiveFormDialogComponent } from 'app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component';
|
import { DepositProductIncentiveFormDialogComponent } from 'app/products/deposit-product-incentive-form-dialog/deposit-product-incentive-form-dialog.component';
|
||||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||||
|
|
||||||
|
/** Dialog Components */
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||||
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
|
||||||
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
||||||
|
|
||||||
|
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-recurring-deposit-product-interest-rate-chart-step',
|
selector: 'mifosx-recurring-deposit-product-interest-rate-chart-step',
|
||||||
templateUrl: './recurring-deposit-product-interest-rate-chart-step.component.html',
|
templateUrl: './recurring-deposit-product-interest-rate-chart-step.component.html',
|
||||||
@@ -50,9 +56,17 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On
|
|||||||
chartDetailData: any = [];
|
chartDetailData: any = [];
|
||||||
chartsDetail: any[] = [];
|
chartsDetail: any[] = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.createrecurringDepositProductInterestRateChartForm();
|
this.createrecurringDepositProductInterestRateChartForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -350,8 +364,8 @@ export class RecurringDepositProductInterestRateChartStepComponent implements On
|
|||||||
|
|
||||||
get recurringDepositProductInterestRateChart() {
|
get recurringDepositProductInterestRateChart() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const recurringDepositProductInterestRateChart = this.recurringDepositProductInterestRateChartForm.value;
|
const recurringDepositProductInterestRateChart = this.recurringDepositProductInterestRateChartForm.value;
|
||||||
for (const chart of recurringDepositProductInterestRateChart.charts) {
|
for (const chart of recurringDepositProductInterestRateChart.charts) {
|
||||||
chart.dateFormat = dateFormat;
|
chart.dateFormat = dateFormat;
|
||||||
|
|||||||
+15
-3
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { SavingProductDetailsStepComponent } from '../saving-product-stepper/saving-product-details-step/saving-product-details-step.component';
|
import { SavingProductDetailsStepComponent } from '../saving-product-stepper/saving-product-details-step/saving-product-details-step.component';
|
||||||
import { SavingProductCurrencyStepComponent } from '../saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component';
|
import { SavingProductCurrencyStepComponent } from '../saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component';
|
||||||
import { SavingProductTermsStepComponent } from '../saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component';
|
import { SavingProductTermsStepComponent } from '../saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component';
|
||||||
@@ -8,7 +10,9 @@ import { SavingProductSettingsStepComponent } from '../saving-product-stepper/sa
|
|||||||
import { SavingProductChargesStepComponent } from '../saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component';
|
import { SavingProductChargesStepComponent } from '../saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component';
|
||||||
import { SavingProductAccountingStepComponent } from '../saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component';
|
import { SavingProductAccountingStepComponent } from '../saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-create-saving-product',
|
selector: 'mifosx-create-saving-product',
|
||||||
@@ -27,9 +31,17 @@ export class CreateSavingProductComponent implements OnInit {
|
|||||||
savingProductsTemplate: any;
|
savingProductsTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash'];
|
accountingRuleData = ['None', 'Cash'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { savingProductsTemplate: any }) => {
|
this.route.data.subscribe((data: { savingProductsTemplate: any }) => {
|
||||||
this.savingProductsTemplate = data.savingProductsTemplate;
|
this.savingProductsTemplate = data.savingProductsTemplate;
|
||||||
});
|
});
|
||||||
@@ -84,13 +96,13 @@ export class CreateSavingProductComponent implements OnInit {
|
|||||||
const savingProduct = {
|
const savingProduct = {
|
||||||
...this.savingProduct,
|
...this.savingProduct,
|
||||||
charges: this.savingProduct.charges.map((charge: any) => ({ id: charge.id })),
|
charges: this.savingProduct.charges.map((charge: any) => ({ id: charge.id })),
|
||||||
locale: 'en' // locale required for nominalAnnualInterestRate
|
locale: this.settingsService.language.code // locale required for nominalAnnualInterestRate
|
||||||
};
|
};
|
||||||
delete savingProduct.advancedAccountingRules;
|
delete savingProduct.advancedAccountingRules;
|
||||||
this.productsService.createSavingProduct(savingProduct)
|
this.productsService.createSavingProduct(savingProduct)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-3
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { SavingProductDetailsStepComponent } from '../saving-product-stepper/saving-product-details-step/saving-product-details-step.component';
|
import { SavingProductDetailsStepComponent } from '../saving-product-stepper/saving-product-details-step/saving-product-details-step.component';
|
||||||
import { SavingProductCurrencyStepComponent } from '../saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component';
|
import { SavingProductCurrencyStepComponent } from '../saving-product-stepper/saving-product-currency-step/saving-product-currency-step.component';
|
||||||
import { SavingProductTermsStepComponent } from '../saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component';
|
import { SavingProductTermsStepComponent } from '../saving-product-stepper/saving-product-terms-step/saving-product-terms-step.component';
|
||||||
@@ -8,7 +10,10 @@ import { SavingProductSettingsStepComponent } from '../saving-product-stepper/sa
|
|||||||
import { SavingProductChargesStepComponent } from '../saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component';
|
import { SavingProductChargesStepComponent } from '../saving-product-stepper/saving-product-charges-step/saving-product-charges-step.component';
|
||||||
import { SavingProductAccountingStepComponent } from '../saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component';
|
import { SavingProductAccountingStepComponent } from '../saving-product-stepper/saving-product-accounting-step/saving-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-edit-saving-product',
|
selector: 'mifosx-edit-saving-product',
|
||||||
@@ -27,9 +32,17 @@ export class EditSavingProductComponent implements OnInit {
|
|||||||
savingProductAndTemplate: any;
|
savingProductAndTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash'];
|
accountingRuleData = ['None', 'Cash'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { savingProductAndTemplate: any }) => {
|
this.route.data.subscribe((data: { savingProductAndTemplate: any }) => {
|
||||||
this.savingProductAndTemplate = data.savingProductAndTemplate;
|
this.savingProductAndTemplate = data.savingProductAndTemplate;
|
||||||
});
|
});
|
||||||
@@ -92,13 +105,13 @@ export class EditSavingProductComponent implements OnInit {
|
|||||||
const savingProduct = {
|
const savingProduct = {
|
||||||
...this.savingProduct,
|
...this.savingProduct,
|
||||||
charges: this.savingProduct.charges.map((charge: any) => ({ id: charge.id })),
|
charges: this.savingProduct.charges.map((charge: any) => ({ id: charge.id })),
|
||||||
locale: 'en' // locale required for nominalAnnualInterestRate
|
locale: this.settingsService.language.code // locale required for nominalAnnualInterestRate
|
||||||
};
|
};
|
||||||
delete savingProduct.advancedAccountingRules;
|
delete savingProduct.advancedAccountingRules;
|
||||||
this.productsService.updateSavingProduct(this.savingProductAndTemplate.id, savingProduct)
|
this.productsService.updateSavingProduct(this.savingProductAndTemplate.id, savingProduct)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services. */
|
/** Custom Services. */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Dividend component.
|
* Create Dividend component.
|
||||||
@@ -30,13 +32,17 @@ export class CreateDividendComponent implements OnInit {
|
|||||||
* Get Share Product data from `Resolver`.
|
* Get Share Product data from `Resolver`.
|
||||||
* @param {FormBuilder} formBuilder Form Builder.
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
* @param {Router} router Router.
|
* @param {Router} router Router.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private productService: ProductsService,
|
private productService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { shareProduct: any }) => {
|
this.route.data.subscribe((data: { shareProduct: any }) => {
|
||||||
this.shareProductData = data.shareProduct;
|
this.shareProductData = data.shareProduct;
|
||||||
});
|
});
|
||||||
@@ -61,7 +67,7 @@ export class CreateDividendComponent implements OnInit {
|
|||||||
* Submits Create Dividend form.
|
* Submits Create Dividend form.
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const startDate = this.createDividendForm.value.dividendPeriodStartDate;
|
const startDate = this.createDividendForm.value.dividendPeriodStartDate;
|
||||||
const endDate = this.createDividendForm.value.dividendPeriodEndDate;
|
const endDate = this.createDividendForm.value.dividendPeriodEndDate;
|
||||||
this.createDividendForm.patchValue({
|
this.createDividendForm.patchValue({
|
||||||
@@ -69,7 +75,7 @@ export class CreateDividendComponent implements OnInit {
|
|||||||
'dividendPeriodEndDate': this.datePipe.transform(endDate, dateFormat)
|
'dividendPeriodEndDate': this.datePipe.transform(endDate, dateFormat)
|
||||||
});
|
});
|
||||||
const dividendForm = this.createDividendForm.value;
|
const dividendForm = this.createDividendForm.value;
|
||||||
dividendForm.locale = 'en';
|
dividendForm.locale = this.settingsService.language.code;
|
||||||
dividendForm.dateFormat = dateFormat;
|
dividendForm.dateFormat = dateFormat;
|
||||||
this.productService.createDividend(this.shareProductData.id, dividendForm).subscribe((response: any) => {
|
this.productService.createDividend(this.shareProductData.id, dividendForm).subscribe((response: any) => {
|
||||||
this.router.navigate(['../'], { relativeTo: this.route });
|
this.router.navigate(['../'], { relativeTo: this.route });
|
||||||
|
|||||||
+15
-3
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { ShareProductDetailsStepComponent } from '../share-product-stepper/share-product-details-step/share-product-details-step.component';
|
import { ShareProductDetailsStepComponent } from '../share-product-stepper/share-product-details-step/share-product-details-step.component';
|
||||||
import { ShareProductCurrencyStepComponent } from '../share-product-stepper/share-product-currency-step/share-product-currency-step.component';
|
import { ShareProductCurrencyStepComponent } from '../share-product-stepper/share-product-currency-step/share-product-currency-step.component';
|
||||||
import { ShareProductTermsStepComponent } from '../share-product-stepper/share-product-terms-step/share-product-terms-step.component';
|
import { ShareProductTermsStepComponent } from '../share-product-stepper/share-product-terms-step/share-product-terms-step.component';
|
||||||
@@ -9,7 +11,9 @@ import { ShareProductMarketPriceStepComponent } from '../share-product-stepper/s
|
|||||||
import { ShareProductChargesStepComponent } from '../share-product-stepper/share-product-charges-step/share-product-charges-step.component';
|
import { ShareProductChargesStepComponent } from '../share-product-stepper/share-product-charges-step/share-product-charges-step.component';
|
||||||
import { ShareProductAccountingStepComponent } from '../share-product-stepper/share-product-accounting-step/share-product-accounting-step.component';
|
import { ShareProductAccountingStepComponent } from '../share-product-stepper/share-product-accounting-step/share-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-create-share-product',
|
selector: 'mifosx-create-share-product',
|
||||||
@@ -29,9 +33,17 @@ export class CreateShareProductComponent implements OnInit {
|
|||||||
shareProductsTemplate: any;
|
shareProductsTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash'];
|
accountingRuleData = ['None', 'Cash'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
|
* @param {Router} router Router.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { shareProductsTemplate: any }) => {
|
this.route.data.subscribe((data: { shareProductsTemplate: any }) => {
|
||||||
this.shareProductsTemplate = data.shareProductsTemplate;
|
this.shareProductsTemplate = data.shareProductsTemplate;
|
||||||
});
|
});
|
||||||
@@ -92,12 +104,12 @@ export class CreateShareProductComponent implements OnInit {
|
|||||||
const shareProduct = {
|
const shareProduct = {
|
||||||
...this.shareProduct,
|
...this.shareProduct,
|
||||||
chargesSelected: this.shareProduct.chargesSelected.map((charge: any) => ({ id: charge.id })),
|
chargesSelected: this.shareProduct.chargesSelected.map((charge: any) => ({ id: charge.id })),
|
||||||
locale: 'en' // locale required for digitsAfterDecimal
|
locale: this.settingsService.language.code // locale required for digitsAfterDecimal
|
||||||
};
|
};
|
||||||
this.productsService.createShareProduct(shareProduct)
|
this.productsService.createShareProduct(shareProduct)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Components */
|
||||||
import { ShareProductDetailsStepComponent } from '../share-product-stepper/share-product-details-step/share-product-details-step.component';
|
import { ShareProductDetailsStepComponent } from '../share-product-stepper/share-product-details-step/share-product-details-step.component';
|
||||||
import { ShareProductCurrencyStepComponent } from '../share-product-stepper/share-product-currency-step/share-product-currency-step.component';
|
import { ShareProductCurrencyStepComponent } from '../share-product-stepper/share-product-currency-step/share-product-currency-step.component';
|
||||||
import { ShareProductTermsStepComponent } from '../share-product-stepper/share-product-terms-step/share-product-terms-step.component';
|
import { ShareProductTermsStepComponent } from '../share-product-stepper/share-product-terms-step/share-product-terms-step.component';
|
||||||
@@ -9,7 +11,9 @@ import { ShareProductMarketPriceStepComponent } from '../share-product-stepper/s
|
|||||||
import { ShareProductChargesStepComponent } from '../share-product-stepper/share-product-charges-step/share-product-charges-step.component';
|
import { ShareProductChargesStepComponent } from '../share-product-stepper/share-product-charges-step/share-product-charges-step.component';
|
||||||
import { ShareProductAccountingStepComponent } from '../share-product-stepper/share-product-accounting-step/share-product-accounting-step.component';
|
import { ShareProductAccountingStepComponent } from '../share-product-stepper/share-product-accounting-step/share-product-accounting-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
import { ProductsService } from 'app/products/products.service';
|
import { ProductsService } from 'app/products/products.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-edit-share-product',
|
selector: 'mifosx-edit-share-product',
|
||||||
@@ -29,9 +33,17 @@ export class EditShareProductComponent implements OnInit {
|
|||||||
shareProductAndTemplate: any;
|
shareProductAndTemplate: any;
|
||||||
accountingRuleData = ['None', 'Cash'];
|
accountingRuleData = ['None', 'Cash'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {ProductsService} productsService Products Service.
|
||||||
|
* @param {Router} router Router.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private productsService: ProductsService,
|
private productsService: ProductsService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { shareProductAndTemplate: any }) => {
|
this.route.data.subscribe((data: { shareProductAndTemplate: any }) => {
|
||||||
this.shareProductAndTemplate = data.shareProductAndTemplate;
|
this.shareProductAndTemplate = data.shareProductAndTemplate;
|
||||||
});
|
});
|
||||||
@@ -101,12 +113,12 @@ export class EditShareProductComponent implements OnInit {
|
|||||||
const shareProduct = {
|
const shareProduct = {
|
||||||
...this.shareProduct,
|
...this.shareProduct,
|
||||||
chargesSelected: this.shareProduct.chargesSelected.map((charge: any) => ({ id: charge.id })),
|
chargesSelected: this.shareProduct.chargesSelected.map((charge: any) => ({ id: charge.id })),
|
||||||
locale: 'en' // locale required for digitsAfterDecimal
|
locale: this.settingsService.language.code // locale required for digitsAfterDecimal
|
||||||
};
|
};
|
||||||
this.productsService.updateShareProduct(this.shareProductAndTemplate.id, shareProduct)
|
this.productsService.updateShareProduct(this.shareProductAndTemplate.id, shareProduct)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
|
this.router.navigate(['../../', response.resourceId], { relativeTo: this.route });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+19
-5
@@ -1,15 +1,19 @@
|
|||||||
|
/** Angular Imports */
|
||||||
import { Component, OnInit, Input } from '@angular/core';
|
import { Component, OnInit, Input } from '@angular/core';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
|
import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
|
|
||||||
|
/** Dialog Components */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||||
|
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||||
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
|
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
|
||||||
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-share-product-market-price-step',
|
selector: 'mifosx-share-product-market-price-step',
|
||||||
templateUrl: './share-product-market-price-step.component.html',
|
templateUrl: './share-product-market-price-step.component.html',
|
||||||
@@ -21,11 +25,20 @@ export class ShareProductMarketPriceStepComponent implements OnInit {
|
|||||||
|
|
||||||
shareProductMarketPriceForm: FormGroup;
|
shareProductMarketPriceForm: FormGroup;
|
||||||
|
|
||||||
|
/** For displaying required columns */
|
||||||
displayedColumns: string[] = ['fromDate', 'shareValue', 'actions'];
|
displayedColumns: string[] = ['fromDate', 'shareValue', 'actions'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {FormBuilder} formBuilder Form Builder.
|
||||||
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {DatePipe} datePipe Date Pipe to format date.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
|
*/
|
||||||
|
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
public dialog: MatDialog,
|
public dialog: MatDialog,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.createShareProductMarketPriceForm();
|
this.createShareProductMarketPriceForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -37,7 +50,7 @@ export class ShareProductMarketPriceStepComponent implements OnInit {
|
|||||||
|
|
||||||
createShareProductMarketPriceForm() {
|
createShareProductMarketPriceForm() {
|
||||||
this.shareProductMarketPriceForm = this.formBuilder.group({
|
this.shareProductMarketPriceForm = this.formBuilder.group({
|
||||||
'marketPricePeriods': this.formBuilder.array([])
|
'marketPricePeriods': this.formBuilder.array([])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,14 +126,15 @@ export class ShareProductMarketPriceStepComponent implements OnInit {
|
|||||||
|
|
||||||
get shareProductMarketPrice() {
|
get shareProductMarketPrice() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
const locale = this.settingsService.language.code;
|
||||||
const marketPricePeriods = [];
|
const marketPricePeriods = [];
|
||||||
for (const marketPricePeriod of this.marketPricePeriods.value) {
|
for (const marketPricePeriod of this.marketPricePeriods.value) {
|
||||||
marketPricePeriods.push({
|
marketPricePeriods.push({
|
||||||
...marketPricePeriod,
|
...marketPricePeriod,
|
||||||
fromDate: this.datePipe.transform(marketPricePeriod.fromDate, dateFormat),
|
fromDate: this.datePipe.transform(marketPricePeriod.fromDate, dateFormat),
|
||||||
dateFormat,
|
dateFormat,
|
||||||
locale: 'en'
|
locale
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return { marketPricePeriods };
|
return { marketPricePeriods };
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { Observable } from 'rxjs';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ReportsService } from 'app/reports/reports.service';
|
import { ReportsService } from 'app/reports/reports.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Savings Transaction Reciept resolver.
|
* Savings Transaction Reciept resolver.
|
||||||
@@ -16,8 +17,10 @@ export class SavingsTransactionRecieptResolver implements Resolve<Object> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {ReportsService} reportsService Reports service.
|
* @param {ReportsService} reportsService Reports service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private reportsService: ReportsService) { }
|
constructor(private reportsService: ReportsService,
|
||||||
|
private settingsService: SettingsService) { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the Savings Transaction Reciept
|
* Returns the Savings Transaction Reciept
|
||||||
@@ -30,7 +33,7 @@ export class SavingsTransactionRecieptResolver implements Resolve<Object> {
|
|||||||
'output-type': 'PDF',
|
'output-type': 'PDF',
|
||||||
R_transactionId: transactionId
|
R_transactionId: transactionId
|
||||||
};
|
};
|
||||||
return this.reportsService.getPentahoRunReportData('Savings Transaction Receipt', data, 'default', 'en', 'dd MMMM yyyy');
|
return this.reportsService.getPentahoRunReportData('Savings Transaction Receipt', data, 'default', this.settingsService.language.code, this.settingsService.dateFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-9
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SavingsService } from '../../savings.service';
|
import { SavingsService } from '../../savings.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add Savings Charge component.
|
* Add Savings Charge component.
|
||||||
@@ -37,14 +38,14 @@ export class AddChargeSavingsAccountComponent implements OnInit {
|
|||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {SavingsService} savingsService Savings Service
|
* @param {SavingsService} savingsService Savings Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(
|
constructor(private formBuilder: FormBuilder,
|
||||||
private formBuilder: FormBuilder,
|
private route: ActivatedRoute,
|
||||||
private route: ActivatedRoute,
|
private router: Router,
|
||||||
private router: Router,
|
private datePipe: DatePipe,
|
||||||
private datePipe: DatePipe,
|
private savingsService: SavingsService,
|
||||||
private savingsService: SavingsService
|
private settingsService: SettingsService) {
|
||||||
) {
|
|
||||||
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
||||||
this.savingsChargeOptions = data.savingsAccountActionData.chargeOptions;
|
this.savingsChargeOptions = data.savingsAccountActionData.chargeOptions;
|
||||||
});
|
});
|
||||||
@@ -111,7 +112,7 @@ export class AddChargeSavingsAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const savingsCharge = this.savingsChargeForm.value;
|
const savingsCharge = this.savingsChargeForm.value;
|
||||||
savingsCharge.locale = 'en';
|
savingsCharge.locale = this.settingsService.language.code;
|
||||||
if (!savingsCharge.feeInterval) {
|
if (!savingsCharge.feeInterval) {
|
||||||
savingsCharge.feeInterval = this.chargeDetails.feeInterval;
|
savingsCharge.feeInterval = this.chargeDetails.feeInterval;
|
||||||
}
|
}
|
||||||
@@ -124,7 +125,7 @@ export class AddChargeSavingsAccountComponent implements OnInit {
|
|||||||
savingsCharge.feeOnMonthDay = this.datePipe.transform(prevDate, monthDayFormat);
|
savingsCharge.feeOnMonthDay = this.datePipe.transform(prevDate, monthDayFormat);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
savingsCharge.dateFormat = dateFormat;
|
savingsCharge.dateFormat = dateFormat;
|
||||||
if (savingsCharge.dueDate) {
|
if (savingsCharge.dueDate) {
|
||||||
const prevDate = this.savingsChargeForm.value.dueDate;
|
const prevDate = this.savingsChargeForm.value.dueDate;
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SavingsService } from '../../savings.service';
|
import { SavingsService } from '../../savings.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create savings account transactions component.
|
* Create savings account transactions component.
|
||||||
@@ -47,12 +48,14 @@ export class SavingsAccountTransactionsComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {DatePipe} datePipe DatePipe.
|
* @param {DatePipe} datePipe DatePipe.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private savingsService: SavingsService) {
|
private savingsService: SavingsService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
this.route.data.subscribe((data: { savingsAccountActionData: any }) => {
|
||||||
this.paymentTypeOptions = data.savingsAccountActionData.paymentTypeOptions;
|
this.paymentTypeOptions = data.savingsAccountActionData.paymentTypeOptions;
|
||||||
});
|
});
|
||||||
@@ -106,12 +109,12 @@ export class SavingsAccountTransactionsComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevTransactionDate: Date = this.savingAccountTransactionForm.value.transactionDate;
|
const prevTransactionDate: Date = this.savingAccountTransactionForm.value.transactionDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'dd-MM-yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.savingAccountTransactionForm.patchValue({
|
this.savingAccountTransactionForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const transactionData = this.savingAccountTransactionForm.value;
|
const transactionData = this.savingAccountTransactionForm.value;
|
||||||
transactionData.locale = 'en';
|
transactionData.locale = this.settingsService.language.code;
|
||||||
transactionData.dateFormat = dateFormat;
|
transactionData.dateFormat = dateFormat;
|
||||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.savingAccountId, this.transactionCommand, transactionData).subscribe(res => {
|
this.savingsService.executeSavingsAccountTransactionsCommand(this.savingAccountId, this.transactionCommand, transactionData).subscribe(res => {
|
||||||
this.router.navigate(['../../'], { relativeTo: this.route });
|
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||||
|
|||||||
+7
-4
@@ -7,6 +7,7 @@ import { ActivatedRoute } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { ReportsService } from 'app/reports/reports.service';
|
import { ReportsService } from 'app/reports/reports.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Export Client Savings Transactions Component
|
* Export Client Savings Transactions Component
|
||||||
@@ -38,12 +39,14 @@ export class ExportTransactionsComponent implements OnInit {
|
|||||||
* @param {FormBuilder} formBuilder Form Builder
|
* @param {FormBuilder} formBuilder Form Builder
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private sanitizer: DomSanitizer,
|
constructor(private sanitizer: DomSanitizer,
|
||||||
private reportsService: ReportsService,
|
private reportsService: ReportsService,
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute) {
|
private route: ActivatedRoute,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.parent.parent.data.subscribe((data: { savingsAccountData: any }) => {
|
this.route.parent.parent.data.subscribe((data: { savingsAccountData: any }) => {
|
||||||
this.savingsAccountId = data.savingsAccountData.accountNo;
|
this.savingsAccountId = data.savingsAccountData.accountNo;
|
||||||
});
|
});
|
||||||
@@ -70,11 +73,11 @@ export class ExportTransactionsComponent implements OnInit {
|
|||||||
generate() {
|
generate() {
|
||||||
const data = {
|
const data = {
|
||||||
'output-type': 'PDF',
|
'output-type': 'PDF',
|
||||||
R_startDate: this.datePipe.transform(this.transactionsReportForm.value.fromDate, 'yyyy-MM-dd'),
|
R_startDate: this.datePipe.transform(this.transactionsReportForm.value.fromDate, this.settingsService.dateFormat),
|
||||||
R_endDate: this.datePipe.transform(this.transactionsReportForm.value.toDate, 'yyyy-MM-dd'),
|
R_endDate: this.datePipe.transform(this.transactionsReportForm.value.toDate, this.settingsService.dateFormat),
|
||||||
R_savingsAccountId: this.savingsAccountId
|
R_savingsAccountId: this.savingsAccountId
|
||||||
};
|
};
|
||||||
this.reportsService.getPentahoRunReportData('Client Saving Transactions', data, 'default', 'en', 'dd MMMM yyyy')
|
this.reportsService.getPentahoRunReportData('Client Saving Transactions', data, 'default', this.settingsService.language.code, this.settingsService.dateFormat)
|
||||||
.subscribe( (res: any) => {
|
.subscribe( (res: any) => {
|
||||||
const contentType = res.headers.get('Content-Type');
|
const contentType = res.headers.get('Content-Type');
|
||||||
const file = new Blob([res.body], {type: contentType});
|
const file = new Blob([res.body], {type: contentType});
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ export class LanguageSelectorComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
constructor(private i18nService: I18nService) {
|
constructor(private i18nService: I18nService) {
|
||||||
this.languageSelector.setValue(this.currentLanguage);
|
this.languageSelector.setValue(this.currentLanguage);
|
||||||
|
this.languageSelector.valueChanges.subscribe( language => this.setLanguage(language) );
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { SharesAccountChargesStepComponent } from '../shares-account-stepper/sha
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SharesService } from '../shares.service';
|
import { SharesService } from '../shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Shares Account Component
|
* Create Shares Account Component
|
||||||
@@ -39,11 +40,13 @@ export class CreateSharesAccountComponent {
|
|||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {SharesService} sharesService Shares Service
|
* @param {SharesService} sharesService Shares Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private sharesService: SharesService) {
|
private sharesService: SharesService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { sharesAccountTemplate: any }) => {
|
this.route.data.subscribe((data: { sharesAccountTemplate: any }) => {
|
||||||
this.sharesAccountTemplate = data.sharesAccountTemplate;
|
this.sharesAccountTemplate = data.sharesAccountTemplate;
|
||||||
});
|
});
|
||||||
@@ -97,8 +100,8 @@ export class CreateSharesAccountComponent {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const sharesAccount = {
|
const sharesAccount = {
|
||||||
...this.sharesAccount,
|
...this.sharesAccount,
|
||||||
clientId: this.sharesAccountTemplate.clientId,
|
clientId: this.sharesAccountTemplate.clientId,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { SharesAccountChargesStepComponent } from '../shares-account-stepper/sha
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SharesService } from '../shares.service';
|
import { SharesService } from '../shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit Shares Account Component
|
* Edit Shares Account Component
|
||||||
@@ -39,11 +40,13 @@ export class EditSharesAccountComponent {
|
|||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {SharesService} sharesService Shares Service
|
* @param {SharesService} sharesService Shares Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private sharesService: SharesService) {
|
private sharesService: SharesService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { sharesAccountAndTemplate: any }) => {
|
this.route.data.subscribe((data: { sharesAccountAndTemplate: any }) => {
|
||||||
this.sharesAccountAndTemplate = data.sharesAccountAndTemplate;
|
this.sharesAccountAndTemplate = data.sharesAccountAndTemplate;
|
||||||
});
|
});
|
||||||
@@ -102,8 +105,8 @@ export class EditSharesAccountComponent {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const sharesAccount = {
|
const sharesAccount = {
|
||||||
...this.sharesAccount,
|
...this.sharesAccount,
|
||||||
clientId: this.sharesAccountAndTemplate.clientId,
|
clientId: this.sharesAccountAndTemplate.clientId,
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SharesService } from 'app/shares/shares.service';
|
import { SharesService } from 'app/shares/shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Activate Shares Account Component
|
* Activate Shares Account Component
|
||||||
@@ -32,12 +33,14 @@ export class ActivateSharesAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private sharesService: SharesService,
|
private sharesService: SharesService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -63,8 +66,8 @@ export class ActivateSharesAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const prevActivatedDate: Date = this.activateSharesAccountForm.value.activatedDate;
|
const prevActivatedDate: Date = this.activateSharesAccountForm.value.activatedDate;
|
||||||
this.activateSharesAccountForm.patchValue({
|
this.activateSharesAccountForm.patchValue({
|
||||||
activatedDate: this.datePipe.transform(prevActivatedDate, dateFormat),
|
activatedDate: this.datePipe.transform(prevActivatedDate, dateFormat),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SharesService } from 'app/shares/shares.service';
|
import { SharesService } from 'app/shares/shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply Shares Component
|
* Apply Shares Component
|
||||||
@@ -35,12 +36,14 @@ export class ApplySharesComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private sharesService: SharesService,
|
private sharesService: SharesService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||||
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
||||||
this.sharesAccountData = data.shareAccountActionData;
|
this.sharesAccountData = data.shareAccountActionData;
|
||||||
@@ -74,8 +77,8 @@ export class ApplySharesComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const prevRequestedDate: Date = this.applySharesForm.value.requestedDate;
|
const prevRequestedDate: Date = this.applySharesForm.value.requestedDate;
|
||||||
this.applySharesForm.patchValue({
|
this.applySharesForm.patchValue({
|
||||||
requestedDate: this.datePipe.transform(prevRequestedDate, dateFormat),
|
requestedDate: this.datePipe.transform(prevRequestedDate, dateFormat),
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SharesService } from 'app/shares/shares.service';
|
import { SharesService } from 'app/shares/shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Approve Shares Account Component
|
* Approve Shares Account Component
|
||||||
@@ -32,12 +33,14 @@ export class ApproveSharesAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private sharesService: SharesService,
|
private sharesService: SharesService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +67,8 @@ export class ApproveSharesAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const prevApprovedDate: Date = this.approveSharesAccountForm.value.approvedDate;
|
const prevApprovedDate: Date = this.approveSharesAccountForm.value.approvedDate;
|
||||||
this.approveSharesAccountForm.patchValue({
|
this.approveSharesAccountForm.patchValue({
|
||||||
approvedDate: this.datePipe.transform(prevApprovedDate, dateFormat),
|
approvedDate: this.datePipe.transform(prevApprovedDate, dateFormat),
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { ApproveShareDialogComponent } from './approve-share-dialog/approve-shar
|
|||||||
|
|
||||||
/** Custom Serices */
|
/** Custom Serices */
|
||||||
import { SharesService } from 'app/shares/shares.service';
|
import { SharesService } from 'app/shares/shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Approve shares component.
|
* Approve shares component.
|
||||||
@@ -44,10 +45,14 @@ export class ApproveSharesComponent implements OnInit {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {SharesService} sharesService Shares Service
|
* @param {SharesService} sharesService Shares Service
|
||||||
|
* @param {ActivatedRoute} route Activated Route
|
||||||
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private sharesService: SharesService,
|
constructor(private sharesService: SharesService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||||
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
||||||
this.sharesAccountData = data.shareAccountActionData;
|
this.sharesAccountData = data.shareAccountActionData;
|
||||||
@@ -82,8 +87,8 @@ export class ApproveSharesComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
approveSharesDialogRef.afterClosed().subscribe((response: any) => {
|
approveSharesDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.approve) {
|
if (response.approve) {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const data = {
|
const data = {
|
||||||
requestedShares: [{id}],
|
requestedShares: [{id}],
|
||||||
dateFormat,
|
dateFormat,
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SharesService } from 'app/shares/shares.service';
|
import { SharesService } from 'app/shares/shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Close Shares Account Component
|
* Close Shares Account Component
|
||||||
@@ -32,12 +33,14 @@ export class CloseSharesAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private sharesService: SharesService,
|
private sharesService: SharesService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +67,8 @@ export class CloseSharesAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const prevClosedDate: Date = this.closeSharesAccountForm.value.closedDate;
|
const prevClosedDate: Date = this.closeSharesAccountForm.value.closedDate;
|
||||||
this.closeSharesAccountForm.patchValue({
|
this.closeSharesAccountForm.patchValue({
|
||||||
closedDate: this.datePipe.transform(prevClosedDate, dateFormat),
|
closedDate: this.datePipe.transform(prevClosedDate, dateFormat),
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SharesService } from 'app/shares/shares.service';
|
import { SharesService } from 'app/shares/shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Redeem Shares Component
|
* Redeem Shares Component
|
||||||
@@ -35,12 +36,14 @@ export class RedeemSharesComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private sharesService: SharesService,
|
private sharesService: SharesService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||||
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
||||||
this.sharesAccountData = data.shareAccountActionData;
|
this.sharesAccountData = data.shareAccountActionData;
|
||||||
@@ -74,8 +77,8 @@ export class RedeemSharesComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const prevRequestedDate: Date = this.redeemSharesForm.value.requestedDate;
|
const prevRequestedDate: Date = this.redeemSharesForm.value.requestedDate;
|
||||||
this.redeemSharesForm.patchValue({
|
this.redeemSharesForm.patchValue({
|
||||||
requestedDate: this.datePipe.transform(prevRequestedDate, dateFormat),
|
requestedDate: this.datePipe.transform(prevRequestedDate, dateFormat),
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SharesService } from 'app/shares/shares.service';
|
import { SharesService } from 'app/shares/shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reject Shares Account Component
|
* Reject Shares Account Component
|
||||||
@@ -32,12 +33,14 @@ export class RejectSharesAccountComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe
|
* @param {DatePipe} datePipe Date Pipe
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {Router} router Router
|
* @param {Router} router Router
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private sharesService: SharesService,
|
private sharesService: SharesService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,8 +67,8 @@ export class RejectSharesAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const prevRejectedDate: Date = this.rejectSharesAccountForm.value.rejectedDate;
|
const prevRejectedDate: Date = this.rejectSharesAccountForm.value.rejectedDate;
|
||||||
this.rejectSharesAccountForm.patchValue({
|
this.rejectSharesAccountForm.patchValue({
|
||||||
rejectedDate: this.datePipe.transform(prevRejectedDate, dateFormat),
|
rejectedDate: this.datePipe.transform(prevRejectedDate, dateFormat),
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import { RejectShareDialogComponent } from './reject-share-dialog/reject-share-d
|
|||||||
|
|
||||||
/** Custom Serices */
|
/** Custom Serices */
|
||||||
import { SharesService } from 'app/shares/shares.service';
|
import { SharesService } from 'app/shares/shares.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reject shares component.
|
* Reject shares component.
|
||||||
@@ -46,10 +47,12 @@ export class RejectSharesComponent implements OnInit {
|
|||||||
* @param {SharesService} sharesService Shares Service
|
* @param {SharesService} sharesService Shares Service
|
||||||
* @param {ActivatedRoute} route Activated Route
|
* @param {ActivatedRoute} route Activated Route
|
||||||
* @param {MatDialog} dialog Mat Dialog
|
* @param {MatDialog} dialog Mat Dialog
|
||||||
|
* @param {SettingsService} settingsService Settings Service.
|
||||||
*/
|
*/
|
||||||
constructor(private sharesService: SharesService,
|
constructor(private sharesService: SharesService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
this.accountId = this.route.parent.snapshot.params['shareAccountId'];
|
||||||
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
this.route.data.subscribe((data: { shareAccountActionData: any }) => {
|
||||||
this.sharesAccountData = data.shareAccountActionData;
|
this.sharesAccountData = data.shareAccountActionData;
|
||||||
@@ -84,8 +87,8 @@ export class RejectSharesComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
rejectSharesDialogRef.afterClosed().subscribe((response: any) => {
|
rejectSharesDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.reject) {
|
if (response.reject) {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const data = {
|
const data = {
|
||||||
requestedShares: [{id}],
|
requestedShares: [{id}],
|
||||||
dateFormat,
|
dateFormat,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { AuditTrailsDataSource } from './audit-trail.datasource';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SystemService } from '../system.service';
|
import { SystemService } from '../system.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** rxjs Imports */
|
/** rxjs Imports */
|
||||||
import { merge } from 'rxjs';
|
import { merge } from 'rxjs';
|
||||||
@@ -90,11 +91,11 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'dateFormat',
|
type: 'dateFormat',
|
||||||
value: 'yyyy-MM-dd'
|
value: this.settingsService.dateFormat
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'locale',
|
type: 'locale',
|
||||||
value: 'en'
|
value: this.settingsService.language.code
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
/** User form control. */
|
/** User form control. */
|
||||||
@@ -130,7 +131,8 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
|
|||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private systemService: SystemService,
|
private systemService: SystemService,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { auditTrailSearchTemplate: any }) => {
|
this.route.data.subscribe((data: { auditTrailSearchTemplate: any }) => {
|
||||||
this.auditTrailSearchTemplateData = data.auditTrailSearchTemplate;
|
this.auditTrailSearchTemplateData = data.auditTrailSearchTemplate;
|
||||||
});
|
});
|
||||||
@@ -382,7 +384,7 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
|
|||||||
* Generates the CSV file of Audit Trails Data.
|
* Generates the CSV file of Audit Trails Data.
|
||||||
*/
|
*/
|
||||||
downloadCSV() {
|
downloadCSV() {
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const replacer = (key: any, value: any) => value === undefined ? '' : value;
|
const replacer = (key: any, value: any) => value === undefined ? '' : value;
|
||||||
const header = ['ID', 'Resource ID', 'Status', 'Office', 'Made On', 'Maker', 'Checked On', 'Checker', 'Entity', 'Action', 'Client'];
|
const header = ['ID', 'Resource ID', 'Status', 'Office', 'Made On', 'Maker', 'Checked On', 'Checker', 'Entity', 'Action', 'Client'];
|
||||||
const headerCode = ['id', 'resourceId', 'processingResult', 'officeName', 'madeOnDate', 'maker', 'checkedOnDate', 'checker', 'entityName', 'actionName', 'clientName'];
|
const headerCode = ['id', 'resourceId', 'processingResult', 'officeName', 'madeOnDate', 'maker', 'checkedOnDate', 'checker', 'entityName', 'actionName', 'clientName'];
|
||||||
@@ -411,7 +413,7 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
|
|||||||
* @param {any} timestamp Timestamp from which date is to be extracted.
|
* @param {any} timestamp Timestamp from which date is to be extracted.
|
||||||
*/
|
*/
|
||||||
private getDate(timestamp: any) {
|
private getDate(timestamp: any) {
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
return this.datePipe.transform(timestamp, dateFormat);
|
return this.datePipe.transform(timestamp, dateFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { SystemService } from 'app/system/system.service';
|
import { SystemService } from 'app/system/system.service';
|
||||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Components */
|
/** Custom Components */
|
||||||
import { DeleteDialogComponent } from '../../shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from '../../shared/delete-dialog/delete-dialog.component';
|
||||||
@@ -82,7 +83,8 @@ export class EntityToEntityMappingComponent implements OnInit {
|
|||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
private systemService: SystemService,
|
private systemService: SystemService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private dialog: MatDialog) {
|
private dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { entityMappings: any }) => {
|
this.route.data.subscribe((data: { entityMappings: any }) => {
|
||||||
this.entityMappings = data.entityMappings;
|
this.entityMappings = data.entityMappings;
|
||||||
});
|
});
|
||||||
@@ -313,7 +315,7 @@ export class EntityToEntityMappingComponent implements OnInit {
|
|||||||
if (addMappingForm.value.toId === '') {
|
if (addMappingForm.value.toId === '') {
|
||||||
addMappingForm.value.toId = undefined;
|
addMappingForm.value.toId = undefined;
|
||||||
}
|
}
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
|
||||||
const startDate: Date = addMappingForm.value.startDate;
|
const startDate: Date = addMappingForm.value.startDate;
|
||||||
const endDate: Date = addMappingForm.value.endDate;
|
const endDate: Date = addMappingForm.value.endDate;
|
||||||
@@ -324,7 +326,7 @@ export class EntityToEntityMappingComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
const newMappingData = addMappingForm.value;
|
const newMappingData = addMappingForm.value;
|
||||||
newMappingData.dateFormat = dateFormat;
|
newMappingData.dateFormat = dateFormat;
|
||||||
newMappingData.locale = 'en';
|
newMappingData.locale = this.settingsService.language.code;
|
||||||
this.systemService.createMapping(this.relId, newMappingData).subscribe((response: any) => {
|
this.systemService.createMapping(this.relId, newMappingData).subscribe((response: any) => {
|
||||||
this.showFilteredData();
|
this.showFilteredData();
|
||||||
});
|
});
|
||||||
@@ -335,7 +337,7 @@ export class EntityToEntityMappingComponent implements OnInit {
|
|||||||
* @param editMappingForm Edit Mapping Form Id
|
* @param editMappingForm Edit Mapping Form Id
|
||||||
*/
|
*/
|
||||||
submitEdit(editMappingForm: any) {
|
submitEdit(editMappingForm: any) {
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
|
||||||
const startDate: Date = editMappingForm.value.startDate;
|
const startDate: Date = editMappingForm.value.startDate;
|
||||||
const endDate: Date = editMappingForm.value.endDate;
|
const endDate: Date = editMappingForm.value.endDate;
|
||||||
@@ -346,7 +348,7 @@ export class EntityToEntityMappingComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
const newMappingData = editMappingForm.value;
|
const newMappingData = editMappingForm.value;
|
||||||
newMappingData.dateFormat = dateFormat;
|
newMappingData.dateFormat = dateFormat;
|
||||||
newMappingData.locale = 'en';
|
newMappingData.locale = this.settingsService.language.code;
|
||||||
this.systemService.editMapping(this.mapIdToEdit, newMappingData).subscribe((response: any) => {
|
this.systemService.editMapping(this.mapIdToEdit, newMappingData).subscribe((response: any) => {
|
||||||
this.showFilteredData();
|
this.showFilteredData();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ export class WebAppComponent implements OnInit {
|
|||||||
this.settingsService.setServers([
|
this.settingsService.setServers([
|
||||||
'https://dev.mifos.io',
|
'https://dev.mifos.io',
|
||||||
'https://demo.mifos.io',
|
'https://demo.mifos.io',
|
||||||
|
'https://qa.mifos.io',
|
||||||
'https://staging.mifos.io',
|
'https://staging.mifos.io',
|
||||||
'https://mobile.mifos.io',
|
'https://mobile.mifos.io',
|
||||||
'https://demo.fineract.dev',
|
'https://demo.fineract.dev',
|
||||||
|
|||||||
@@ -11,5 +11,10 @@
|
|||||||
"Username is required": "Username is required",
|
"Username is required": "Username is required",
|
||||||
"Username or password incorrect.": "Username or password incorrect",
|
"Username or password incorrect.": "Username or password incorrect",
|
||||||
"Remember me": "Remember me",
|
"Remember me": "Remember me",
|
||||||
"Version": "Version"
|
"Version": "Version",
|
||||||
|
"Accounting": "Accounting",
|
||||||
|
"Reports": "Reports",
|
||||||
|
"Admin": "Admin",
|
||||||
|
"Self Service": "Self Service",
|
||||||
|
"Institution": "Institution"
|
||||||
}
|
}
|
||||||
@@ -11,5 +11,10 @@
|
|||||||
"Username is required": "Identifiant requis",
|
"Username is required": "Identifiant requis",
|
||||||
"Username or password incorrect.": "Identifiant ou mot de passe incorrect",
|
"Username or password incorrect.": "Identifiant ou mot de passe incorrect",
|
||||||
"Remember me": "Rester connecté",
|
"Remember me": "Rester connecté",
|
||||||
"Version": "Version"
|
"Version": "Version",
|
||||||
|
"Accounting": "Comptabilité",
|
||||||
|
"Reports": "Rapports",
|
||||||
|
"Admin": "Admin",
|
||||||
|
"Self Service": "En libre service",
|
||||||
|
"Institution": "Institution"
|
||||||
}
|
}
|
||||||
@@ -1 +1,10 @@
|
|||||||
@import "~@angular/material/prebuilt-themes/pink-bluegrey.css";
|
@import "~@angular/material/prebuilt-themes/pink-bluegrey.css";
|
||||||
|
|
||||||
|
div.alert {
|
||||||
|
background-color: dimgray !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.mat-table tbody tr:nth-child(even) {
|
||||||
|
background-color: dimgray !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1 +1,10 @@
|
|||||||
@import "~@angular/material/prebuilt-themes/purple-green.css";
|
@import "~@angular/material/prebuilt-themes/purple-green.css";
|
||||||
|
|
||||||
|
div.alert {
|
||||||
|
background-color: dimgray !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.mat-table tbody tr:nth-child(even) {
|
||||||
|
background-color: dimgray !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user