diff --git a/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts b/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts
index 341e9fb8b..7694139b0 100644
--- a/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts
+++ b/src/app/account-transfers/edit-standing-instructions/edit-standing-instructions.component.ts
@@ -70,6 +70,7 @@ export class EditStandingInstructionsComponent implements OnInit {
* Creates and sets the edit standing instructions form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditStandingInstructionsForm();
const presentDate = new Date();
const n = presentDate.getFullYear();
diff --git a/src/app/accounting/closing-entries/create-closure/create-closure.component.ts b/src/app/accounting/closing-entries/create-closure/create-closure.component.ts
index 6ec193aef..70496bd8d 100644
--- a/src/app/accounting/closing-entries/create-closure/create-closure.component.ts
+++ b/src/app/accounting/closing-entries/create-closure/create-closure.component.ts
@@ -49,6 +49,7 @@ export class CreateClosureComponent implements OnInit {
* Creates the accounting closure form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createAccountingClosureForm();
}
diff --git a/src/app/accounting/create-journal-entry/create-journal-entry.component.ts b/src/app/accounting/create-journal-entry/create-journal-entry.component.ts
index fc265a92a..be0a92792 100644
--- a/src/app/accounting/create-journal-entry/create-journal-entry.component.ts
+++ b/src/app/accounting/create-journal-entry/create-journal-entry.component.ts
@@ -63,6 +63,7 @@ export class CreateJournalEntryComponent implements OnInit {
* Creates the journal entry form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createJournalEntryForm();
}
diff --git a/src/app/accounting/frequent-postings/frequent-postings.component.ts b/src/app/accounting/frequent-postings/frequent-postings.component.ts
index f90b4e81d..087f1870c 100644
--- a/src/app/accounting/frequent-postings/frequent-postings.component.ts
+++ b/src/app/accounting/frequent-postings/frequent-postings.component.ts
@@ -71,6 +71,7 @@ export class FrequentPostingsComponent implements OnInit {
* Creates the frequent postings form and sets the affected gl entry form array.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createFrequentPostingsForm();
this.setAffectedGLEntryForm();
}
diff --git a/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts b/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts
index e09a98aea..043aed38a 100644
--- a/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts
+++ b/src/app/accounting/migrate-opening-balances/migrate-opening-balances.component.ts
@@ -64,6 +64,7 @@ export class MigrateOpeningBalancesComponent implements OnInit {
* Creates the opening balances form. (initially retrieves gl accounts on the basis of specified office)
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createOpeningBalancesForm();
}
diff --git a/src/app/accounting/periodic-accruals/periodic-accruals.component.ts b/src/app/accounting/periodic-accruals/periodic-accruals.component.ts
index d3ac93d77..4c341138c 100644
--- a/src/app/accounting/periodic-accruals/periodic-accruals.component.ts
+++ b/src/app/accounting/periodic-accruals/periodic-accruals.component.ts
@@ -42,6 +42,7 @@ export class PeriodicAccrualsComponent implements OnInit {
* Creates periodic accruals form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createPeriodicAccrualsForm();
}
diff --git a/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts b/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts
index d0627b20e..a8f1ddc84 100644
--- a/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts
+++ b/src/app/accounting/provisioning-entries/create-provisioning-entry/create-provisioning-entry.component.ts
@@ -42,6 +42,7 @@ export class CreateProvisioningEntryComponent implements OnInit {
* Creates the provisioning entry form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createProvisioningEntryForm();
}
diff --git a/src/app/accounting/search-journal-entry/search-journal-entry.component.ts b/src/app/accounting/search-journal-entry/search-journal-entry.component.ts
index fbbf128f1..61be9b542 100644
--- a/src/app/accounting/search-journal-entry/search-journal-entry.component.ts
+++ b/src/app/accounting/search-journal-entry/search-journal-entry.component.ts
@@ -133,6 +133,7 @@ export class SearchJournalEntryComponent implements OnInit, AfterViewInit {
* Sets filtered offices and gl accounts for autocomplete and journal entries table.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setFilteredOffices();
this.setFilteredGlAccounts();
this.getJournalEntries();
diff --git a/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.ts b/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.ts
index dbb329d34..061c1bd5d 100644
--- a/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.ts
+++ b/src/app/centers/centers-view/center-actions/activate-center/activate-center.component.ts
@@ -48,6 +48,7 @@ export class ActivateCenterComponent implements OnInit {
* Creates the activate center form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createActivateCenterForm();
}
diff --git a/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.ts b/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.ts
index ee07d5d95..32c2caa29 100644
--- a/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.ts
+++ b/src/app/centers/centers-view/center-actions/attach-center-meeting/attach-center-meeting.component.ts
@@ -59,6 +59,7 @@ export class AttachCenterMeetingComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCenterMeetingForm();
this.buildDependencies();
}
diff --git a/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.ts b/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.ts
index 2093cb6af..91bfc67f4 100644
--- a/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.ts
+++ b/src/app/centers/centers-view/center-actions/center-attendance/center-attendance.component.ts
@@ -70,6 +70,7 @@ export class CenterAttendanceComponent implements OnInit {
* Sets the members table.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (this.membersData !== undefined && this.membersData !== null) {
this.dataSource = this.membersData.map((member: any) => ({ clientId: member.id, attendanceType: 1 }));
}
diff --git a/src/app/centers/centers-view/center-actions/close-center/close-center.component.ts b/src/app/centers/centers-view/center-actions/close-center/close-center.component.ts
index 3d1bc66d5..2753b1988 100644
--- a/src/app/centers/centers-view/center-actions/close-center/close-center.component.ts
+++ b/src/app/centers/centers-view/center-actions/close-center/close-center.component.ts
@@ -50,6 +50,7 @@ export class CloseCenterComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCloseCenterForm();
}
diff --git a/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.ts b/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.ts
index c4e1f76c1..5d5359051 100644
--- a/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.ts
+++ b/src/app/centers/centers-view/center-actions/edit-center-meeting-schedule/edit-center-meeting-schedule.component.ts
@@ -57,6 +57,7 @@ export class EditCenterMeetingScheduleComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditMeetingScheduleForm();
}
diff --git a/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.ts b/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.ts
index 7287af4fa..06821751d 100644
--- a/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.ts
+++ b/src/app/centers/centers-view/center-actions/edit-center-meeting/edit-center-meeting.component.ts
@@ -62,6 +62,7 @@ export class EditCenterMeetingComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditCenterMeetingForm();
this.buildDependencies();
}
diff --git a/src/app/centers/create-center/create-center.component.ts b/src/app/centers/create-center/create-center.component.ts
index daa943fbc..6715db201 100644
--- a/src/app/centers/create-center/create-center.component.ts
+++ b/src/app/centers/create-center/create-center.component.ts
@@ -62,6 +62,7 @@ export class CreateCenterComponent implements OnInit {
* Creates and sets the center form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCenterForm();
}
diff --git a/src/app/centers/edit-center/edit-center.component.ts b/src/app/centers/edit-center/edit-center.component.ts
index 004c3dd60..0d6dc3bc0 100644
--- a/src/app/centers/edit-center/edit-center.component.ts
+++ b/src/app/centers/edit-center/edit-center.component.ts
@@ -54,6 +54,7 @@ export class EditCenterComponent implements OnInit {
* Creates the edit center form.
*/
ngOnInit(): void {
+ this.maxDate = this.settingsService.businessDate;
this.createEditCenterForm();
}
diff --git a/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.ts b/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.ts
index a227b4970..7cc129ed4 100644
--- a/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.ts
+++ b/src/app/clients/client-stepper/client-family-members-step/client-family-member-dialog/client-family-member-dialog.component.ts
@@ -39,6 +39,7 @@ export class ClientFamilyMemberDialogComponent implements OnInit {
private settingsService: SettingsService) { }
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createFamilyMemberForm();
if (this.data.context === 'Edit') {
this.familyMemberForm.patchValue({
diff --git a/src/app/clients/client-stepper/client-general-step/client-general-step.component.html b/src/app/clients/client-stepper/client-general-step/client-general-step.component.html
index 8554aec2f..d3d0b6658 100644
--- a/src/app/clients/client-stepper/client-general-step/client-general-step.component.html
+++ b/src/app/clients/client-stepper/client-general-step/client-general-step.component.html
@@ -136,13 +136,15 @@
+
+
Active?
Activation Date
-
diff --git a/src/app/clients/client-stepper/client-general-step/client-general-step.component.ts b/src/app/clients/client-stepper/client-general-step/client-general-step.component.ts
index d779fbe08..843721867 100644
--- a/src/app/clients/client-stepper/client-general-step/client-general-step.component.ts
+++ b/src/app/clients/client-stepper/client-general-step/client-general-step.component.ts
@@ -57,6 +57,7 @@ export class ClientGeneralStepComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setOptions();
this.buildDependencies();
}
diff --git a/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.ts b/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.ts
index b9a8633f4..3f3c1a7cc 100644
--- a/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.ts
+++ b/src/app/clients/clients-view/client-actions/activate-client/activate-client.component.ts
@@ -48,6 +48,7 @@ export class ActivateClientComponent implements OnInit {
* Creates the activate client form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createActivateClientForm();
}
diff --git a/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.ts b/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.ts
index 2857d8f5e..88f9dc0a8 100644
--- a/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.ts
+++ b/src/app/clients/clients-view/client-actions/add-client-charge/add-client-charge.component.ts
@@ -55,6 +55,7 @@ export class AddClientChargeComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createClientsChargeForm();
this.buildDependencies();
}
diff --git a/src/app/clients/clients-view/client-actions/close-client/close-client.component.ts b/src/app/clients/clients-view/client-actions/close-client/close-client.component.ts
index 07fe50a4f..58b982513 100644
--- a/src/app/clients/clients-view/client-actions/close-client/close-client.component.ts
+++ b/src/app/clients/clients-view/client-actions/close-client/close-client.component.ts
@@ -50,6 +50,7 @@ export class CloseClientComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCloseClientForm();
}
diff --git a/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.ts b/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.ts
index 83018da71..51dc6843d 100644
--- a/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.ts
+++ b/src/app/clients/clients-view/client-actions/reactivate-client/reactivate-client.component.ts
@@ -48,6 +48,7 @@ export class ReactivateClientComponent implements OnInit {
* Creates the reactivate client form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createReactivateClientForm();
}
diff --git a/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.ts b/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.ts
index ea0149ca0..b54663579 100644
--- a/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.ts
+++ b/src/app/clients/clients-view/client-actions/reject-client/reject-client.component.ts
@@ -50,6 +50,7 @@ export class RejectClientComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRejectClientForm();
}
diff --git a/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.ts b/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.ts
index f55973c31..de4f25a3d 100644
--- a/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.ts
+++ b/src/app/clients/clients-view/client-actions/transfer-client/transfer-client.component.ts
@@ -50,6 +50,7 @@ export class TransferClientComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createTransferClientForm();
}
diff --git a/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.ts b/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.ts
index 89cd58447..3316f4eb6 100644
--- a/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.ts
+++ b/src/app/clients/clients-view/client-actions/undo-client-rejection/undo-client-rejection.component.ts
@@ -47,6 +47,7 @@ export class UndoClientRejectionComponent implements OnInit {
* Creates the undo client rejection form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createUndoClientRejectionForm();
}
diff --git a/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.ts b/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.ts
index 030b1129b..206213382 100644
--- a/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.ts
+++ b/src/app/clients/clients-view/client-actions/withdraw-client/withdraw-client.component.ts
@@ -50,6 +50,7 @@ export class WithdrawClientComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createWithdrawClientForm();
}
diff --git a/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.ts b/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.ts
index 27fa3ac9e..649a8f4e1 100644
--- a/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.ts
+++ b/src/app/clients/clients-view/family-members-tab/add-family-member/add-family-member.component.ts
@@ -51,6 +51,7 @@ export class AddFamilyMemberComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createAddFamilyMemberForm();
}
diff --git a/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.ts b/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.ts
index bcfbda07e..a95b4c651 100644
--- a/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.ts
+++ b/src/app/clients/clients-view/family-members-tab/edit-family-member/edit-family-member.component.ts
@@ -50,6 +50,7 @@ export class EditFamilyMemberComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditFamilyMemberForm(this.familyMemberDetails);
}
diff --git a/src/app/clients/edit-client/edit-client.component.ts b/src/app/clients/edit-client/edit-client.component.ts
index d7294f2ec..1c12590c4 100644
--- a/src/app/clients/edit-client/edit-client.component.ts
+++ b/src/app/clients/edit-client/edit-client.component.ts
@@ -66,6 +66,7 @@ export class EditClientComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditClientForm();
this.setOptions();
this.buildDependencies();
diff --git a/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.ts b/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.ts
index 12af80ac1..2156fefe8 100644
--- a/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.ts
+++ b/src/app/collections/individual-collection-sheet/individual-collection-sheet.component.ts
@@ -100,6 +100,7 @@ export class IndividualCollectionSheetComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (localStorage.getItem('Success')) {
localStorage.removeItem('Success');
this.Success = true;
diff --git a/src/app/core/utils/dates.ts b/src/app/core/utils/dates.ts
index 5f29fd694..d4a8da8d8 100644
--- a/src/app/core/utils/dates.ts
+++ b/src/app/core/utils/dates.ts
@@ -1,6 +1,5 @@
import { DatePipe } from '@angular/common';
import { Injectable } from '@angular/core';
-import { SettingsService } from 'app/settings/settings.service';
import * as moment from 'moment';
@Injectable({
@@ -8,12 +7,10 @@ import * as moment from 'moment';
})
export class Dates {
- constructor(private settingsService: SettingsService,
- private datePipe: DatePipe) {}
+ constructor(private datePipe: DatePipe) {}
public getDate(timestamp: any): string {
- const dateFormat = this.settingsService.dateFormat;
- return this.datePipe.transform(timestamp, dateFormat);
+ return this.datePipe.transform(timestamp, 'YYYY-MM-DD');
}
public formatDate(timestamp: any, dateFormat: string): string {
@@ -27,4 +24,8 @@ export class Dates {
return moment(value).toDate();
}
}
+
+ public convertToDate(value: any, format: string): Date {
+ return moment(value).toDate();
+ }
}
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts
index 48368d236..db4271206 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-details-step/fixed-deposit-account-details-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/** Custom Services */
import { FixedDepositsService } from '../../fixed-deposits.service';
@@ -38,13 +39,16 @@ export class FixedDepositAccountDetailsStepComponent implements OnInit {
* Sets fixed deposits account details form.
* @param {FormBuilder} formBuilder Form Builder.
* @param {FixedDepositsService} fixedDepositsService Fixed Deposits Service.
+ * @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: FormBuilder,
- private fixedDepositsService: FixedDepositsService) {
+ private fixedDepositsService: FixedDepositsService,
+ private settingsService: SettingsService) {
this.createFixedDepositsAccountDetailsForm();
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.buildDependencies();
if (this.fixedDepositsAccountTemplate) {
this.productData = this.fixedDepositsAccountTemplate.productOptions;
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.ts
index d6dc49bbd..7bb216956 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-settings-step/fixed-deposit-account-settings-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import { FormGroup, FormBuilder, FormControl, Validators } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Fixed Deposits Account Settings Step
@@ -34,8 +35,10 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
/**
* @param {FormBuilder} formBuilder Form Builder
+ * @param {SettingsService} settingsService Settings Service
*/
- constructor(private formBuilder: FormBuilder) {
+ constructor(private formBuilder: FormBuilder,
+ private settingsService: SettingsService) {
this.createFixedDepositAccountSettingsForm();
this.buildDependencies();
}
@@ -72,6 +75,7 @@ export class FixedDepositAccountSettingsStepComponent implements OnInit, OnChang
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (this.fixedDepositsAccountTemplate) {
this.fixedDepositAccountSettingsForm.patchValue({
'lockinPeriodFrequency': this.fixedDepositsAccountTemplate.lockinPeriodFrequency,
diff --git a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.ts b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.ts
index 24bc4d650..2e0a1cca4 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposit-account-stepper/fixed-deposit-account-terms-step/fixed-deposit-account-terms-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import { FormGroup, FormBuilder, Validators} from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Fixed Deposits Terms Step
@@ -36,8 +37,10 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
/**
* @param {FormBuilder} formBuilder Form Builder
+ * @param {SettingsService} settingsService Settings Service
*/
- constructor(private formBuilder: FormBuilder) {
+ constructor(private formBuilder: FormBuilder,
+ private settingsService: SettingsService) {
this.createFixedDepositsAccountTermsForm();
}
@@ -48,6 +51,7 @@ export class FixedDepositAccountTermsStepComponent implements OnInit, OnChanges
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (this.fixedDepositsAccountTemplate.interestCompoundingPeriodType) {
this.fixedDepositAccountTermsForm.patchValue({
'interestCompoundingPeriodType': this.fixedDepositsAccountTemplate.interestCompoundingPeriodType.id,
diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.ts
index 8e2d5ef8c..0efbb3040 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/activate-fixed-deposits-account/activate-fixed-deposits-account.component.ts
@@ -49,6 +49,7 @@ export class ActivateFixedDepositsAccountComponent implements OnInit {
* Creates the activate fixed deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createActivateFixedDepositsAccountForm();
}
diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.ts
index 9704bfd58..530596e0e 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/add-charge-fixed-deposits-account/add-charge-fixed-deposits-account.component.ts
@@ -59,6 +59,7 @@ export class AddChargeFixedDepositsAccountComponent implements OnInit {
* Creates the Fixed Deposits Charge form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createFixedDepositsChargeForm();
this.buildDependencies();
}
diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts
index 1a9f0022a..05bd7770f 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/approve-fixed-deposits-account/approve-fixed-deposits-account.component.ts
@@ -48,6 +48,7 @@ export class ApproveFixedDepositsAccountComponent implements OnInit {
* Creates the approve fixed deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createApproveFixedDepositsAccountForm();
}
diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.ts
index 863c13597..f11daa887 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/close-fixed-deposits-account/close-fixed-deposits-account.component.ts
@@ -60,6 +60,7 @@ export class CloseFixedDepositsAccountComponent implements OnInit {
* Creates the close on maturity fd account form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCloseOnMaturityAccountForm();
this.addTransferDetails();
}
diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.ts
index a3af00303..76d7f16b9 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/premature-close-fixed-deposits-account/premature-close-fixed-deposits-account.component.ts
@@ -55,6 +55,7 @@ export class PrematureCloseFixedDepositsAccountComponent implements OnInit {
* Creates the premature close fd account form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createPrematureCloseAccountForm();
this.buildDependencies();
}
diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.ts
index 61d40223e..6abb7d6a3 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/reject-fixed-deposits-account/reject-fixed-deposits-account.component.ts
@@ -48,6 +48,7 @@ export class RejectFixedDepositsAccountComponent implements OnInit {
* Creates the reject fixed deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRejectFixedDepositsAccountForm();
}
diff --git a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.ts b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.ts
index a91549b79..8a307d0d9 100644
--- a/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.ts
+++ b/src/app/deposits/fixed-deposits/fixed-deposits-account-actions/withdraw-by-client-fixed-deposits-account/withdraw-by-client-fixed-deposits-account.component.ts
@@ -48,6 +48,7 @@ export class WithdrawByClientFixedDepositsAccountComponent implements OnInit {
* Creates the withdraw fixed deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createWithdrawFixedDepositsAccountForm();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.ts
index 81630172b..c908feec3 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/activate-recurring-deposits-account/activate-recurring-deposits-account.component.ts
@@ -48,6 +48,7 @@ export class ActivateRecurringDepositsAccountComponent implements OnInit {
* Creates the activate recurring deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createActivateRecurringDepositsAccountForm();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.ts
index 5831b6edc..f58a3299f 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/add-charge-recurring-deposits-account/add-charge-recurring-deposits-account.component.ts
@@ -58,6 +58,7 @@ export class AddChargeRecurringDepositsAccountComponent implements OnInit {
* Creates the Recurring Deposits Charge form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRecurringDepositsChargeForm();
this.buildDependencies();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts
index f3adbae8c..a40d34b47 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/approve-recurring-deposits-account/approve-recurring-deposits-account.component.ts
@@ -48,6 +48,7 @@ export class ApproveRecurringDepositsAccountComponent implements OnInit {
* Creates the approve recurring deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createApproveRecurringDepositsAccountForm();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.ts
index 4570b6afb..5d74888cb 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/close-recurring-deposits-account/close-recurring-deposits-account.component.ts
@@ -67,6 +67,7 @@ export class CloseRecurringDepositsAccountComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createcloseRecurringDepositForm();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.ts
index 390ee33e7..0adc6890c 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/deposit-recurring-deposits-account/deposit-recurring-deposits-account.component.ts
@@ -63,6 +63,7 @@ export class DepositRecurringDepositsAccountComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createdepositRecurringDepositForm();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.ts
index c2700fae8..285786522 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/premature-close-recurring-deposit-account/premature-close-recurring-deposit-account.component.ts
@@ -49,6 +49,7 @@ export class PrematureCloseRecurringDepositAccountComponent implements OnInit {
* Creates the premature close recurring deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createprematureCloseRecurringDepositsAccountForm();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.ts
index a06acca8d..480251de5 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/reject-recurring-deposits-account/reject-recurring-deposits-account.component.ts
@@ -49,6 +49,7 @@ export class RejectRecurringDepositsAccountComponent implements OnInit {
* Creates the reject recurring deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRejectRecurringDepositsAccountForm();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.ts
index e3dd8a3aa..a90a9fa35 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-actions/withdraw-by-client-recurring-deposits-account/withdraw-by-client-recurring-deposits-account.component.ts
@@ -39,7 +39,7 @@ export class WithdrawByClientRecurringDepositsAccountComponent implements OnInit
private dateUtils: Dates,
private route: ActivatedRoute,
private router: Router,
- private settingsService: SettingsService, ) {
+ private settingsService: SettingsService) {
this.accountId = this.route.parent.snapshot.params['recurringDepositAccountId'];
}
@@ -47,6 +47,7 @@ export class WithdrawByClientRecurringDepositsAccountComponent implements OnInit
* Creates the withdraw recurring deposits form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createWithdrawRecurringDepositsAccountForm();
}
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts
index 38dc4f28f..2fcba23c8 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-details-step/recurring-deposits-account-details-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/** Custom Services */
import { RecurringDepositsService } from '../../recurring-deposits.service';
@@ -38,13 +39,16 @@ export class RecurringDepositsAccountDetailsStepComponent implements OnInit {
* Sets recurring deposits account details form.
* @param {FormBuilder} formBuilder Form Builder.
* @param {RecurringDepositsService} recurringDepositsService Recurring Deposits Service.
+ * @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: FormBuilder,
- private recurringDepositsService: RecurringDepositsService) {
+ private recurringDepositsService: RecurringDepositsService,
+ private settingsService: SettingsService) {
this.createRecurringDepositsAccountDetailsForm();
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.buildDependencies();
if (this.recurringDepositsAccountTemplate) {
this.productData = this.recurringDepositsAccountTemplate.productOptions;
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.ts
index b815012d9..5db664f18 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-settings-step/recurring-deposits-account-settings-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/** Custom Services */
@@ -34,8 +35,10 @@ export class RecurringDepositsAccountSettingsStepComponent implements OnInit, On
/**
* @param {FormBuilder} formBuilder Form Builder
+ * @param {SettingsService} settingsService Settings Service
*/
- constructor(private formBuilder: FormBuilder) {
+ constructor(private formBuilder: FormBuilder,
+ private settingsService: SettingsService) {
this.createRecurringDepositAccountSettingsForm();
this.buildDependencies();
}
@@ -79,6 +82,7 @@ export class RecurringDepositsAccountSettingsStepComponent implements OnInit, On
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (this.recurringDepositsAccountTemplate) {
this.recurringDepositAccountSettingsForm.patchValue({
'lockinPeriodFrequency': this.recurringDepositsAccountTemplate.lockinPeriodFrequency,
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.ts
index 309d21ca3..371237768 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-stepper/recurring-deposits-account-terms-step/recurring-deposits-account-terms-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, OnChanges } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Recurring Deposits Terms Step
@@ -32,8 +33,10 @@ export class RecurringDepositsAccountTermsStepComponent implements OnInit, OnCha
/**
* @param {FormBuilder} formBuilder Form Builder
+ * @param {SettingsService} settingsService Settings Service
*/
- constructor(private formBuilder: FormBuilder) {
+ constructor(private formBuilder: FormBuilder,
+ private settingsService: SettingsService) {
this.createRecurringDepositsAccountTermsForm();
}
@@ -44,6 +47,7 @@ export class RecurringDepositsAccountTermsStepComponent implements OnInit, OnCha
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (this.recurringDepositsAccountTemplate.interestCompoundingPeriodType) {
this.recurringDepositAccountTermsForm.patchValue({
'interestCompoundingPeriodType': this.recurringDepositsAccountTemplate.interestCompoundingPeriodType.id,
diff --git a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.ts b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.ts
index 3361d5cc4..2628df201 100644
--- a/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.ts
+++ b/src/app/deposits/recurring-deposits/recurring-deposits-account-view/transactions-tab/edit-transaction/edit-transaction.component.ts
@@ -65,6 +65,7 @@ export class EditTransactionComponent implements OnInit {
* Creates the Recurring Deposits account transaction form when component loads.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditTransactionForm();
this.editTransactionForm.patchValue({
'transactionDate': this.transactionTemplateData.date && new Date(this.transactionTemplateData.date),
diff --git a/src/app/groups/create-group/create-group.component.ts b/src/app/groups/create-group/create-group.component.ts
index 69a930522..7e8cda29a 100644
--- a/src/app/groups/create-group/create-group.component.ts
+++ b/src/app/groups/create-group/create-group.component.ts
@@ -62,6 +62,7 @@ export class CreateGroupComponent implements OnInit, AfterViewInit {
* Creates and sets the group form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createGroupForm();
}
diff --git a/src/app/groups/edit-group/edit-group.component.ts b/src/app/groups/edit-group/edit-group.component.ts
index 36686b8ac..d19765ef6 100644
--- a/src/app/groups/edit-group/edit-group.component.ts
+++ b/src/app/groups/edit-group/edit-group.component.ts
@@ -57,6 +57,7 @@ export class EditGroupComponent implements OnInit {
* Creates and sets the edit group form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditGroupForm();
this.editGroupForm.patchValue({
'name': this.groupData.name,
diff --git a/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts b/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts
index df7a5e825..f2e925f1a 100644
--- a/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts
+++ b/src/app/groups/groups-view/group-actions/activate-group/activate-group.component.ts
@@ -45,6 +45,7 @@ export class ActivateGroupComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createActivateGroupForm();
}
diff --git a/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.ts b/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.ts
index c95c89303..ce6293500 100644
--- a/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.ts
+++ b/src/app/groups/groups-view/group-actions/attach-group-meeting/attach-group-meeting.component.ts
@@ -59,6 +59,7 @@ export class AttachGroupMeetingComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createGroupMeetingForm();
this.buildDependencies();
}
diff --git a/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts b/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts
index 0aa6c744f..f31220c05 100644
--- a/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts
+++ b/src/app/groups/groups-view/group-actions/close-group/close-group.component.ts
@@ -50,6 +50,7 @@ export class CloseGroupComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCloseGroupForm();
}
diff --git a/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.ts b/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.ts
index 9111a0faa..b7f08675c 100644
--- a/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.ts
+++ b/src/app/groups/groups-view/group-actions/edit-group-meeting-schedule/edit-group-meeting-schedule.component.ts
@@ -57,6 +57,7 @@ export class EditGroupMeetingScheduleComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditMeetingScheduleForm();
}
diff --git a/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.ts b/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.ts
index 26d052b99..cf316ae39 100644
--- a/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.ts
+++ b/src/app/groups/groups-view/group-actions/edit-group-meeting/edit-group-meeting.component.ts
@@ -62,6 +62,7 @@ export class EditGroupMeetingComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditGroupMeetingForm();
this.buildDependencies();
}
diff --git a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts
index f0d98afdb..2577f94b3 100644
--- a/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts
+++ b/src/app/loans/loans-account-stepper/loans-account-details-step/loans-account-details-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/** Custom Services */
import { LoansService } from '../../loans.service';
@@ -43,13 +44,16 @@ export class LoansAccountDetailsStepComponent implements OnInit {
* Sets loans account details form.
* @param {FormBuilder} formBuilder Form Builder.
* @param {LoansService} loansService Loans Service.
+ * @param {SettingsService} settingsService SettingsService
*/
constructor(private formBuilder: FormBuilder,
- private loansService: LoansService) {
+ private loansService: LoansService,
+ private settingsService: SettingsService) {
this.createLoansAccountDetailsForm();
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.buildDependencies();
if (this.loansAccountTemplate) {
this.productData = this.loansAccountTemplate.productOptions;
diff --git a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
index 1f9c2f7d8..50d06c981 100644
--- a/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
+++ b/src/app/loans/loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component.ts
@@ -1,7 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, OnChanges } from '@angular/core';
-import { FormGroup, FormBuilder, Validators, FormControl, FormArray } from '@angular/forms';
-import { ActivatedRoute, Router } from '@angular/router';
+import { FormGroup, FormBuilder, Validators, FormArray } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Create Loans Account Terms Step
@@ -46,12 +46,10 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
/**
* Create Loans Account Terms Form
* @param formBuilder FormBuilder
- * @param route Route
- * @param router Router
+ * @param {SettingsService} settingsService SettingsService
*/
constructor(private formBuilder: FormBuilder,
- private route: ActivatedRoute,
- private router: Router) {
+ private settingsService: SettingsService) {
this.createloansAccountTermsForm();
}
/**
@@ -87,6 +85,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (this.loansAccountTemplate) {
if (this.loansAccountTemplate.loanProductId) {
this.loansAccountTermsForm.patchValue({
diff --git a/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.ts b/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.ts
index ef78c1768..58d748277 100644
--- a/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/add-loan-charge/add-loan-charge.component.ts
@@ -67,6 +67,7 @@ export class AddLoanChargeComponent implements OnInit {
* Creates the Loan Charge form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createLoanChargeForm();
this.loanChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => {
const chargeDetails = this.loanChargeOptions.find(option => {
diff --git a/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.ts b/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.ts
index 4741ef1b5..c96f6983b 100644
--- a/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/assign-loan-officer/assign-loan-officer.component.ts
@@ -45,6 +45,7 @@ export class AssignLoanOfficerComponent implements OnInit {
* Creates the assign officer form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createassignOfficerForm();
this.loanOfficers = this.dataObject.loanOfficerOptions;
}
diff --git a/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.ts b/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.ts
index 6f6d99958..1df4df8c8 100644
--- a/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/close-as-rescheduled/close-as-rescheduled.component.ts
@@ -45,6 +45,7 @@ export class CloseAsRescheduledComponent implements OnInit {
* Creates the close form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCloseForm();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.ts b/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.ts
index 23953bf5a..e1508cd32 100644
--- a/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/create-guarantor/create-guarantor.component.ts
@@ -55,6 +55,7 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createNewGuarantorForm();
this.setNewGuarantorDetailsForm();
this.buildDependencies();
diff --git a/src/app/loans/loans-view/loan-account-actions/disburse-loan-account/disburse-loan-account.component.ts b/src/app/loans/loans-view/loan-account-actions/disburse-loan-account/disburse-loan-account.component.ts
index 3fd8fbed1..60978ca23 100644
--- a/src/app/loans/loans-view/loan-account-actions/disburse-loan-account/disburse-loan-account.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/disburse-loan-account/disburse-loan-account.component.ts
@@ -43,6 +43,7 @@ export class DisburseLoanAccountComponent implements OnInit {
private settingsService: SettingsService) { }
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setDisbursementToSavingsForm();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts b/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts
index 6979b5adb..1c14dcb3b 100644
--- a/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/disburse/disburse.component.ts
@@ -54,6 +54,7 @@ export class DisburseComponent implements OnInit {
* and initialize with the required values
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createDisbursementLoanForm();
this.setDisbursementLoanDetails();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.ts b/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.ts
index 1d8f4a8c1..0c3fe1007 100644
--- a/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/foreclosure/foreclosure.component.ts
@@ -39,6 +39,7 @@ export class ForeclosureComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createforeclosureForm();
this.onChanges();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.ts
index 6427792d8..0437b606c 100644
--- a/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/loan-reschedule/loan-reschedule.component.ts
@@ -46,6 +46,7 @@ export class LoanRescheduleComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.codes = this.dataObject.rescheduleReasons;
this.setRescheduleLoanForm();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.ts b/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.ts
index b345a3f06..4e7520054 100644
--- a/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/loans-account-close/loans-account-close.component.ts
@@ -46,6 +46,7 @@ export class LoansAccountCloseComponent implements OnInit {
* Creates the close form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCloseForm();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts b/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts
index b11065059..0b2baabc0 100644
--- a/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/make-repayment/make-repayment.component.ts
@@ -53,6 +53,7 @@ export class MakeRepaymentComponent implements OnInit {
* and initialize with the required values
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRepaymentLoanForm();
this.setRepaymentLoanDetails();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.ts b/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.ts
index 09d80559c..035d2cc3b 100644
--- a/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/prepay-loan/prepay-loan.component.ts
@@ -58,6 +58,7 @@ export class PrepayLoanComponent implements OnInit {
* and initialize with the required values
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createprepayLoanForm();
this.setPrepayLoanDetails();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.ts b/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.ts
index 08b12e201..6b854ec0d 100644
--- a/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/recovery-repayment/recovery-repayment.component.ts
@@ -53,6 +53,7 @@ export class RecoveryRepaymentComponent implements OnInit {
* and initialize with the required values
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRecoveryRepaymentLoanForm();
this.setRecoveryRepaymentLoanDetails();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.ts b/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.ts
index fdcb1c8ea..9eb2a89b5 100644
--- a/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/reject-loan/reject-loan.component.ts
@@ -44,6 +44,7 @@ export class RejectLoanComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setRejectLoanForm();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.ts b/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.ts
index d92034c46..ee367933d 100644
--- a/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/waive-interest/waive-interest.component.ts
@@ -42,6 +42,7 @@ export class WaiveInterestComponent implements OnInit {
private route: ActivatedRoute) { }
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setLoanInterestForm();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.ts b/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.ts
index 266cb6636..96568eb48 100644
--- a/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component.ts
@@ -49,6 +49,7 @@ export class WithdrawnByClientComponent implements OnInit {
* and initialize with the required values
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createWithdrawnByClientLoanForm();
}
diff --git a/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts b/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts
index 2b2d06c85..1fecf0769 100644
--- a/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/write-off-page/write-off-page.component.ts
@@ -45,6 +45,7 @@ export class WriteOffPageComponent implements OnInit {
private settingsService: SettingsService) { }
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setWriteOffForm();
}
diff --git a/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.ts b/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.ts
index 6ff89fa52..047b1fb7a 100644
--- a/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.ts
+++ b/src/app/loans/loans-view/transactions/edit-transaction/edit-transaction.component.ts
@@ -65,6 +65,7 @@ export class EditTransactionComponent implements OnInit {
* Creates the Loan account transaction form when component loads.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditTransactionForm();
this.editTransactionForm.patchValue({
'transactionDate': this.transactionTemplateData.date && new Date(this.transactionTemplateData.date),
diff --git a/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.ts b/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.ts
index 7949e40aa..4f3fd31ca 100644
--- a/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.ts
+++ b/src/app/loans/loans-view/transactions/export-transactions/export-transactions.component.ts
@@ -7,6 +7,7 @@ import { ActivatedRoute } from '@angular/router';
/** Custom Services */
import { ReportsService } from 'app/reports/reports.service';
import { Dates } from 'app/core/utils/dates';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Export Client Loans Transactions Component
@@ -38,19 +39,21 @@ export class ExportTransactionsComponent implements OnInit {
* @param {FormBuilder} formBuilder Form Builder
* @param {Dates} dateUtils Date Utils
* @param {ActivatedRoute} route Activated Route
+ * @param {SettingsService} settingsService Settings Service
*/
constructor(private sanitizer: DomSanitizer,
private reportsService: ReportsService,
private formBuilder: FormBuilder,
private dateUtils: Dates,
- private route: ActivatedRoute) {
+ private route: ActivatedRoute,
+ private settingsService: SettingsService) {
this.route.parent.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loansAccountId = data.loanDetailsData.accountNo;
});
}
-
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createTransactionsReportForm();
}
diff --git a/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts b/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts
index c9cce482a..ba9164dc9 100644
--- a/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts
+++ b/src/app/organization/bulk-loan-reassignmnet/bulk-loan-reassignmnet.component.ts
@@ -57,6 +57,7 @@ export class BulkLoanReassignmnetComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setBulkLoanForm();
}
diff --git a/src/app/organization/employees/create-employee/create-employee.component.ts b/src/app/organization/employees/create-employee/create-employee.component.ts
index 46470f42e..fdaf32d5b 100644
--- a/src/app/organization/employees/create-employee/create-employee.component.ts
+++ b/src/app/organization/employees/create-employee/create-employee.component.ts
@@ -51,6 +51,7 @@ export class CreateEmployeeComponent implements OnInit {
* Creates the employee form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEmployeeForm();
}
diff --git a/src/app/organization/employees/edit-employee/edit-employee.component.ts b/src/app/organization/employees/edit-employee/edit-employee.component.ts
index 4a9a68235..bb4998690 100644
--- a/src/app/organization/employees/edit-employee/edit-employee.component.ts
+++ b/src/app/organization/employees/edit-employee/edit-employee.component.ts
@@ -54,6 +54,7 @@ export class EditEmployeeComponent implements OnInit {
* Creates the edit employee form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditEmployeeForm();
}
diff --git a/src/app/organization/fund-mapping/fund-mapping.component.ts b/src/app/organization/fund-mapping/fund-mapping.component.ts
index 2b0b364c8..b3a1094a8 100644
--- a/src/app/organization/fund-mapping/fund-mapping.component.ts
+++ b/src/app/organization/fund-mapping/fund-mapping.component.ts
@@ -61,6 +61,7 @@ export class FundMappingComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createFundMappingForm();
this.buildDependencies();
}
diff --git a/src/app/organization/holidays/edit-holiday/edit-holiday.component.ts b/src/app/organization/holidays/edit-holiday/edit-holiday.component.ts
index 3846bda48..a06a5326d 100644
--- a/src/app/organization/holidays/edit-holiday/edit-holiday.component.ts
+++ b/src/app/organization/holidays/edit-holiday/edit-holiday.component.ts
@@ -58,6 +58,7 @@ export class EditHolidayComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setEditForm();
if (!this.isActiveHoliday) {
this.getReschedulingType();
diff --git a/src/app/organization/offices/create-office/create-office.component.ts b/src/app/organization/offices/create-office/create-office.component.ts
index a53061ba6..e51b865e8 100644
--- a/src/app/organization/offices/create-office/create-office.component.ts
+++ b/src/app/organization/offices/create-office/create-office.component.ts
@@ -48,6 +48,7 @@ export class CreateOfficeComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createofficeForm();
}
diff --git a/src/app/organization/offices/edit-office/edit-office.component.ts b/src/app/organization/offices/edit-office/edit-office.component.ts
index d3ebb3591..c1193a74f 100644
--- a/src/app/organization/offices/edit-office/edit-office.component.ts
+++ b/src/app/organization/offices/edit-office/edit-office.component.ts
@@ -49,6 +49,7 @@ export class EditOfficeComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createOfficeForm();
}
diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.ts
index 18f792168..6e7a2c36e 100644
--- a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.ts
+++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-business-rule-parameters/edit-business-rule-parameters.component.ts
@@ -1,5 +1,5 @@
/** Angular Imports */
-import { Component, OnChanges, Input, Output, EventEmitter } from '@angular/core';
+import { Component, OnChanges, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { Validators, FormGroup, FormControl } from '@angular/forms';
/** Rxjs Imports */
@@ -22,7 +22,7 @@ import { Dates } from 'app/core/utils/dates';
templateUrl: './edit-business-rule-parameters.component.html',
styleUrls: ['./edit-business-rule-parameters.component.scss']
})
-export class EditBusinessRuleParametersComponent implements OnChanges {
+export class EditBusinessRuleParametersComponent implements OnInit, OnChanges {
/** Run Report Parameters Data */
@Input() paramData: any;
@@ -44,11 +44,16 @@ export class EditBusinessRuleParametersComponent implements OnChanges {
/**
* @param {ReportsService} reportsService Reports Service
+ * @param {SettingsService} settingsService Settings Service.
*/
constructor(private reportsService: ReportsService,
private settingsService: SettingsService,
private dateUtils: Dates) { }
+ ngOnInit(): void {
+ this.maxDate = this.settingsService.businessDate;
+ }
+
ngOnChanges() {
if (this.paramData) {
this.ReportForm = new FormGroup({});
diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.ts
index b24d00782..d901d7056 100644
--- a/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.ts
+++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/edit-sms-campaign-step/edit-sms-campaign-step.component.ts
@@ -7,6 +7,7 @@ import { ReportsService } from 'app/reports/reports.service';
/** Custom Models */
import { ReportParameter } from 'app/reports/common-models/report-parameter.model';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Edit SMS Campaign step.
@@ -46,9 +47,11 @@ export class EditSmsCampaignStepComponent implements OnInit {
/**
* @param {FormBuilder} formBuilder Form Builder
* @param {ReportsService} reportService Reports Service
+ * @param {SettingsService} settingsService Settings Service.
*/
constructor(private formBuilder: FormBuilder,
- private reportService: ReportsService) {
+ private reportService: ReportsService,
+ private settingsService: SettingsService) {
this.createSMSCampaignDetailsForm();
}
@@ -66,6 +69,7 @@ export class EditSmsCampaignStepComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.triggerTypes = this.smsCampaignTemplate.triggerTypeOptions;
this.smsProviders = this.smsCampaignTemplate.smsProviderOptions;
this.businessRules = this.smsCampaignTemplate.businessRulesOptions;
diff --git a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts
index 000c0ebf7..a70b3b97d 100644
--- a/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts
+++ b/src/app/organization/sms-campaigns/sms-campaign-stepper/sms-campaign-step/business-rule-parameters/business-rule-parameters.component.ts
@@ -1,5 +1,5 @@
/** Angular Imports */
-import { Component, OnChanges, Input, Output, EventEmitter } from '@angular/core';
+import { Component, OnChanges, Input, Output, EventEmitter, OnInit } from '@angular/core';
import { Validators, FormGroup, FormControl } from '@angular/forms';
/** Custom Services */
@@ -19,7 +19,7 @@ import { Dates } from 'app/core/utils/dates';
templateUrl: './business-rule-parameters.component.html',
styleUrls: ['./business-rule-parameters.component.scss']
})
-export class BusinessRuleParametersComponent implements OnChanges {
+export class BusinessRuleParametersComponent implements OnInit, OnChanges {
/** Run Report Parameters Data */
@Input() paramData: any;
@@ -47,6 +47,10 @@ export class BusinessRuleParametersComponent implements OnChanges {
private settingsService: SettingsService,
private dateUtils: Dates) { }
+ ngOnInit(): void {
+ this.maxDate = this.settingsService.businessDate;
+ }
+
ngOnChanges() {
if (this.paramData) {
this.ReportForm = new FormGroup({});
diff --git a/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.ts b/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.ts
index 212b0f290..cb9a8be66 100644
--- a/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.ts
+++ b/src/app/organization/sms-campaigns/view-campaign/view-campaign.component.ts
@@ -92,8 +92,8 @@ export class ViewCampaignComponent implements OnInit {
});
}
-
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createSMSForm();
}
diff --git a/src/app/organization/standing-instructions-history/standing-instructions-history.component.ts b/src/app/organization/standing-instructions-history/standing-instructions-history.component.ts
index 86c859d39..cf1750e09 100644
--- a/src/app/organization/standing-instructions-history/standing-instructions-history.component.ts
+++ b/src/app/organization/standing-instructions-history/standing-instructions-history.component.ts
@@ -63,6 +63,7 @@ export class StandingInstructionsHistoryComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createInstructionForm();
this.buildDependencies();
}
diff --git a/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.ts b/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.ts
index 88d96e379..4ff05b8f2 100644
--- a/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.ts
+++ b/src/app/organization/tellers/cashiers/allocate-cash/allocate-cash.component.ts
@@ -48,6 +48,7 @@ export class AllocateCashComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setCashierForm();
}
diff --git a/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.ts b/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.ts
index 1d221dd8f..4f0550f36 100644
--- a/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.ts
+++ b/src/app/organization/tellers/cashiers/create-cashier/create-cashier.component.ts
@@ -48,6 +48,7 @@ export class CreateCashierComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setCreateCashierForm();
}
diff --git a/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.ts b/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.ts
index 08e78592c..8da460270 100644
--- a/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.ts
+++ b/src/app/organization/tellers/cashiers/edit-cashier/edit-cashier.component.ts
@@ -52,6 +52,7 @@ export class EditCashierComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setEditChargeForm();
}
diff --git a/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.ts b/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.ts
index 25c4b91f4..91bc89b18 100644
--- a/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.ts
+++ b/src/app/organization/tellers/cashiers/settle-cash/settle-cash.component.ts
@@ -45,6 +45,7 @@ export class SettleCashComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setCashierForm();
}
diff --git a/src/app/organization/tellers/create-teller/create-teller.component.ts b/src/app/organization/tellers/create-teller/create-teller.component.ts
index 20aa067b2..cf2d3c16e 100644
--- a/src/app/organization/tellers/create-teller/create-teller.component.ts
+++ b/src/app/organization/tellers/create-teller/create-teller.component.ts
@@ -55,6 +55,7 @@ export class CreateTellerComponent implements OnInit {
* Creates the teller form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createTellerForm();
}
diff --git a/src/app/organization/tellers/edit-teller/edit-teller.component.ts b/src/app/organization/tellers/edit-teller/edit-teller.component.ts
index 8a6db7675..739f9c7ab 100644
--- a/src/app/organization/tellers/edit-teller/edit-teller.component.ts
+++ b/src/app/organization/tellers/edit-teller/edit-teller.component.ts
@@ -67,6 +67,7 @@ export class EditTellerComponent implements OnInit {
* Creates the Edit teller form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditTellerForm();
}
diff --git a/src/app/products/charges/create-charge/create-charge.component.ts b/src/app/products/charges/create-charge/create-charge.component.ts
index 40a62c3e1..ef630e563 100644
--- a/src/app/products/charges/create-charge/create-charge.component.ts
+++ b/src/app/products/charges/create-charge/create-charge.component.ts
@@ -54,8 +54,12 @@ export class CreateChargeComponent implements OnInit {
private settingsService: SettingsService) {
this.route.data.subscribe((data: { chargesTemplate: any }) => {
this.chargesTemplateData = data.chargesTemplate;
- this.incomeAndLiabilityAccountData = data.chargesTemplate.incomeOrLiabilityAccountOptions.incomeAccountOptions
- .concat(data.chargesTemplate.incomeOrLiabilityAccountOptions.liabilityAccountOptions);
+ if (data.chargesTemplate.incomeOrLiabilityAccountOptions.liabilityAccountOptions) {
+ this.incomeAndLiabilityAccountData = data.chargesTemplate.incomeOrLiabilityAccountOptions.incomeAccountOptions
+ .concat(data.chargesTemplate.incomeOrLiabilityAccountOptions.liabilityAccountOptions);
+ } else {
+ this.incomeAndLiabilityAccountData = data.chargesTemplate.incomeOrLiabilityAccountOptions.incomeAccountOptions;
+ }
});
}
diff --git a/src/app/products/share-products/create-dividend/create-dividend.component.ts b/src/app/products/share-products/create-dividend/create-dividend.component.ts
index 22e175e92..5d72625ae 100644
--- a/src/app/products/share-products/create-dividend/create-dividend.component.ts
+++ b/src/app/products/share-products/create-dividend/create-dividend.component.ts
@@ -49,6 +49,7 @@ export class CreateDividendComponent implements OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setDividendForm();
}
diff --git a/src/app/reports/run-report/run-report.component.ts b/src/app/reports/run-report/run-report.component.ts
index 6e537824e..32fef77db 100644
--- a/src/app/reports/run-report/run-report.component.ts
+++ b/src/app/reports/run-report/run-report.component.ts
@@ -79,6 +79,7 @@ export class RunReportComponent implements OnInit {
* Creates and sets the run report form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRunReportForm();
}
diff --git a/src/app/reports/xbrl-report/xbrl-report.component.ts b/src/app/reports/xbrl-report/xbrl-report.component.ts
index 186c4382c..196b5ccb4 100644
--- a/src/app/reports/xbrl-report/xbrl-report.component.ts
+++ b/src/app/reports/xbrl-report/xbrl-report.component.ts
@@ -54,6 +54,7 @@ export class XBRLReportComponent implements OnInit {
* Creates the XBRL form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createXbrlForm();
}
diff --git a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts
index dcdbfa4e8..84ad3c8e1 100644
--- a/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/activate-savings-account/activate-savings-account.component.ts
@@ -48,6 +48,7 @@ export class ActivateSavingsAccountComponent implements OnInit {
* Creates the activate savings form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createActivateSavingsAccountForm();
}
diff --git a/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.ts b/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.ts
index 7447c7eee..6de9805cc 100644
--- a/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/add-charge-savings-account/add-charge-savings-account.component.ts
@@ -56,6 +56,7 @@ export class AddChargeSavingsAccountComponent implements OnInit {
* Creates the Savings Charge form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createSavingsChargeForm();
this.buildDependencies();
}
diff --git a/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts b/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts
index 70b19a23a..d6628ef1f 100644
--- a/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/apply-annual-fees-savings-account/apply-annual-fees-savings-account.component.ts
@@ -55,6 +55,7 @@ export class ApplyAnnualFeesSavingsAccountComponent implements OnInit {
* Creates the apply annual fees form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createApplyAnnualFeesForm();
this.applyCharge();
}
diff --git a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts
index cc45e60af..ddc3c5771 100644
--- a/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/approve-savings-account/approve-savings-account.component.ts
@@ -48,6 +48,7 @@ export class ApproveSavingsAccountComponent implements OnInit {
* Creates the approve savings form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createApproveSavingsAccountForm();
}
diff --git a/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.ts b/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.ts
index 743dd5aee..7c3af4980 100644
--- a/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/close-savings-account/close-savings-account.component.ts
@@ -58,6 +58,7 @@ export class CloseSavingsAccountComponent implements OnInit {
* Creates the close savings form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCloseSavingsAccountForm();
this.buildDependencies();
}
diff --git a/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.ts b/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.ts
index c8e4431b0..d9b977555 100644
--- a/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/post-interest-as-on-savings-account/post-interest-as-on-savings-account.component.ts
@@ -48,6 +48,7 @@ export class PostInterestAsOnSavingsAccountComponent implements OnInit {
* Creates the post interest savings form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createPostInterestSavingsAccountForm();
}
diff --git a/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.ts b/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.ts
index f53bd5fcf..f46ae968d 100644
--- a/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/reject-savings-account/reject-savings-account.component.ts
@@ -48,6 +48,7 @@ export class RejectSavingsAccountComponent implements OnInit {
* Creates the reject savings form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRejectSavingsAccountForm();
}
diff --git a/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.ts b/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.ts
index 471e1f891..ceb0fb4e4 100644
--- a/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.ts
+++ b/src/app/savings/saving-account-actions/savings-account-assign-staff/savings-account-assign-staff.component.ts
@@ -55,6 +55,7 @@ export class SavingsAccountAssignStaffComponent implements OnInit {
* Creates the savings account assign staff form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.fieldOfficerData = this.savingsAccountData.fieldOfficerOptions;
this.createSavingsAssignStaffForm();
}
diff --git a/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts b/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts
index 775c99649..d05ea14aa 100644
--- a/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts
+++ b/src/app/savings/saving-account-actions/savings-account-transactions/savings-account-transactions.component.ts
@@ -68,6 +68,7 @@ export class SavingsAccountTransactionsComponent implements OnInit {
* Creates the Saving account transaction form when component loads.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createSavingAccountTransactionForm();
}
diff --git a/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.ts b/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.ts
index 1b35f7070..2fa243496 100644
--- a/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.ts
+++ b/src/app/savings/saving-account-actions/savings-account-unassign-staff/savings-account-unassign-staff.component.ts
@@ -48,6 +48,7 @@ export class SavingsAccountUnassignStaffComponent implements OnInit {
* Creates the savings account unassign staff form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createSavingsUnassignStaffForm();
}
diff --git a/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.ts b/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.ts
index 493e2f251..0b5487d51 100644
--- a/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.ts
+++ b/src/app/savings/saving-account-actions/withdraw-by-client-savings-account/withdraw-by-client-savings-account.component.ts
@@ -48,6 +48,7 @@ export class WithdrawByClientSavingsAccountComponent implements OnInit {
* Creates the withdraw savings form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createWithdrawSavingsAccountForm();
}
diff --git a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts
index 7006f21a9..7854e0bf4 100644
--- a/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts
+++ b/src/app/savings/savings-account-stepper/savings-account-details-step/savings-account-details-step.component.ts
@@ -4,6 +4,7 @@ import { FormGroup, FormBuilder, Validators } from '@angular/forms';
/** Custom Services */
import { SavingsService } from 'app/savings/savings.service';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Savings Account Details Step
@@ -38,13 +39,16 @@ export class SavingsAccountDetailsStepComponent implements OnInit {
* Sets share account details form.
* @param {FormBuilder} formBuilder Form Builder.
* @param {SavingsService} savingsService Savings Service.
+ * @param {SettingsService} settingsService Setting service
*/
constructor(private formBuilder: FormBuilder,
- private savingsService: SavingsService) {
+ private savingsService: SavingsService,
+ private settingsService: SettingsService) {
this.createSavingsAccountDetailsForm();
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.buildDependencies();
if (this.savingsAccountTemplate) {
this.productData = this.savingsAccountTemplate.productOptions;
diff --git a/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.ts b/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.ts
index 5b90265d8..6bd57af69 100644
--- a/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.ts
+++ b/src/app/savings/savings-account-stepper/savings-account-terms-step/savings-account-terms-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnChanges, OnInit, Input } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Savings Account Terms Step
@@ -36,8 +37,10 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit {
/**
* @param {FormBuilder} formBuilder Form Builder
+ * @param {SettingsService} settingsService Setting service
*/
- constructor(private formBuilder: FormBuilder) {
+ constructor(private formBuilder: FormBuilder,
+ private settingsService: SettingsService) {
this.createSavingsAccountTermsForm();
this.buildDependencies();
}
@@ -55,6 +58,7 @@ export class SavingsAccountTermsStepComponent implements OnChanges, OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (this.savingsAccountTemplate) {
this.savingsAccountTermsForm.patchValue({
'nominalAnnualInterestRate': this.savingsAccountTemplate.nominalAnnualInterestRate,
diff --git a/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.ts b/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.ts
index 612770e8d..a4945a3b2 100644
--- a/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.ts
+++ b/src/app/savings/savings-account-view/transactions-tab/export-transactions/export-transactions.component.ts
@@ -54,6 +54,7 @@ export class ExportTransactionsComponent implements OnInit {
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createTransactionsReportForm();
}
diff --git a/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.ts b/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.ts
index fde5146f1..9939cac08 100644
--- a/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.ts
+++ b/src/app/savings/savings-account-view/transactions/edit-transaction/edit-transaction.component.ts
@@ -65,6 +65,7 @@ export class EditTransactionComponent implements OnInit {
* Creates the Saving account transaction form when component loads.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createEditTransactionForm();
this.editTransactionForm.patchValue({
'transactionDate': this.transactionTemplateData.date && new Date(this.transactionTemplateData.date),
diff --git a/src/app/self-service/users/create-user/create-user.component.ts b/src/app/self-service/users/create-user/create-user.component.ts
index 59658bf68..ad9783c41 100644
--- a/src/app/self-service/users/create-user/create-user.component.ts
+++ b/src/app/self-service/users/create-user/create-user.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { FormControl } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Create self service user component.
@@ -31,9 +32,13 @@ export class CreateUserComponent implements OnInit {
/** Maximum date of birth of user allowed. */
maxDate = new Date();
- constructor() { }
+ /**
+ * @param {SettingsService} settingsService Settings Service
+ */
+ constructor(private settingsService: SettingsService) { }
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
}
}
diff --git a/src/app/self-service/users/edit-user/edit-user.component.ts b/src/app/self-service/users/edit-user/edit-user.component.ts
index 3aad4bcdd..a228828b1 100644
--- a/src/app/self-service/users/edit-user/edit-user.component.ts
+++ b/src/app/self-service/users/edit-user/edit-user.component.ts
@@ -1,5 +1,6 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Edit self service user component.
@@ -24,9 +25,13 @@ export class EditUserComponent implements OnInit {
/** Maximum date of birth of user allowed. */
maxDate = new Date();
- constructor() { }
+ /**
+ * @param {SettingsService} settingsService Settings Service
+ */
+ constructor(private settingsService: SettingsService) { }
- ngOnInit() {
- }
+ ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
+ }
}
diff --git a/src/app/settings/settings.service.ts b/src/app/settings/settings.service.ts
index fa4bf4089..a23f5698d 100644
--- a/src/app/settings/settings.service.ts
+++ b/src/app/settings/settings.service.ts
@@ -14,6 +14,7 @@ import { environment } from '../../environments/environment';
})
export class SettingsService {
+ public static businessDateFormat = 'yyyy-MM-dd';
public static businessDateConfigName = 'enable_business_date';
public static businessDateType = 'BUSINESS_DATE';
public static cobDateType = 'COB_DATE';
@@ -60,6 +61,22 @@ export class SettingsService {
localStorage.setItem('mifosXServers', JSON.stringify(list));
}
+ /**
+ * Sets server Date setting for max datepicker, default today
+ * @param {string} date
+ */
+ setBusinessDate(date: string) {
+ localStorage.setItem('mifosXServerDate', date);
+ }
+
+ /**
+ * Sets server Date config is enabled
+ * @param {string} enabled
+ */
+ setBusinessDateConfig(enabled: string) {
+ localStorage.setItem('mifosXServerBusinessDateEnabled', enabled);
+ }
+
/**
* Returns date format setting.
*/
@@ -101,6 +118,20 @@ export class SettingsService {
return this.server + environment.apiProvider + environment.apiVersion;
}
+ /**
+ * Returns current Business date server
+ */
+ get businessDate(): Date {
+ return this.dateUtils.convertToDate(localStorage.getItem('mifosXServerDate'), SettingsService.businessDateFormat);
+ }
+
+ /**
+ * Returns current Business date Config if it's enabled
+ */
+ get businessDateConfig(): any {
+ return localStorage.getItem('mifosXServerBusinessDateEnabled');
+ }
+
/**
* Validate If the enable_business_date configuration is enabled or disabled.
*/
@@ -119,11 +150,11 @@ export class SettingsService {
businessDateData.some((data: any) => {
if (data.type === dateType) {
const dateVal = new Date(data.date);
+ this.setBusinessDate(this.dateUtils.formatDate(dateVal, SettingsService.businessDateFormat));
this.alertService.alert({ type: dateType + ' Set',
message: this.dateUtils.formatDate(dateVal, this.dateFormat())});
return;
}
});
}
-
}
diff --git a/src/app/shared/footer/footer.component.ts b/src/app/shared/footer/footer.component.ts
index 4e70dce62..4888d0a98 100644
--- a/src/app/shared/footer/footer.component.ts
+++ b/src/app/shared/footer/footer.component.ts
@@ -3,6 +3,7 @@ import { Component, OnDestroy, OnInit } from '@angular/core';
import { Alert } from 'app/core/alert/alert.model';
import { AlertService } from 'app/core/alert/alert.service';
import { AuthenticationService } from 'app/core/authentication/authentication.service';
+import { Dates } from 'app/core/utils/dates';
import { SettingsService } from 'app/settings/settings.service';
import { SystemService } from 'app/system/system.service';
@@ -34,8 +35,10 @@ export class FooterComponent implements OnInit, OnDestroy {
timer: any;
constructor(private systemService: SystemService,
+ private settingsService: SettingsService,
private authenticationService: AuthenticationService,
- private alertService: AlertService) { }
+ private alertService: AlertService,
+ private dateUtils: Dates) { }
ngOnInit() {
this.alert$ = this.alertService.alertEvent.subscribe((alertEvent: Alert) => {
@@ -64,11 +67,12 @@ export class FooterComponent implements OnInit, OnDestroy {
/**
* Get the Configuration for Business Date
*/
- getConfigurations(): void {
+ getConfigurations(): void {
if (this.authenticationService.isAuthenticated()) {
this.systemService.getConfigurationByName(SettingsService.businessDateConfigName)
.subscribe((configurationData: any) => {
this.isBusinessDateEnabled = configurationData.enabled;
+ this.settingsService.setBusinessDateConfig(configurationData.enabled);
if (this.isBusinessDateEnabled) {
this.setBusinessDate();
this.timer = setTimeout(() => { this.getConfigurations(); }, 60000);
@@ -84,6 +88,7 @@ export class FooterComponent implements OnInit, OnDestroy {
this.systemService.getBusinessDate(SettingsService.businessDateType)
.subscribe((data: any) => {
this.businessDate = new Date(data.date);
+ this.settingsService.setBusinessDate(this.dateUtils.formatDate(this.businessDate, SettingsService.businessDateFormat));
this.isBusinessDateDefined = true;
});
}
diff --git a/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.ts b/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.ts
index 2a181993f..5dd80061e 100644
--- a/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/activate-shares-account/activate-shares-account.component.ts
@@ -48,6 +48,7 @@ export class ActivateSharesAccountComponent implements OnInit {
* Creates the activate shares form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createActivateSharesAccountForm();
}
diff --git a/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.ts b/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.ts
index 38abba6f0..c39d0bf4d 100644
--- a/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.ts
+++ b/src/app/shares/shares-account-actions/apply-shares/apply-shares.component.ts
@@ -56,6 +56,7 @@ export class ApplySharesComponent implements OnInit {
* in clients view upon using a common resolver.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createApplySharesAccountForm();
this.applySharesForm.get('unitPrice').patchValue(this.sharesAccountData.currentMarketPrice || '');
}
diff --git a/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.ts b/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.ts
index ffcbddd25..2839da346 100644
--- a/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/approve-shares-account/approve-shares-account.component.ts
@@ -48,6 +48,7 @@ export class ApproveSharesAccountComponent implements OnInit {
* Creates the approve shares form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createApproveSharesAccountForm();
}
diff --git a/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.ts b/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.ts
index 4cc001afd..7689966b2 100644
--- a/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/close-shares-account/close-shares-account.component.ts
@@ -48,6 +48,7 @@ export class CloseSharesAccountComponent implements OnInit {
* Creates the close shares form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createCloseSharesAccountForm();
}
diff --git a/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.ts b/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.ts
index dbb4cde1b..856ca474c 100644
--- a/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.ts
+++ b/src/app/shares/shares-account-actions/redeem-shares/redeem-shares.component.ts
@@ -56,6 +56,7 @@ export class RedeemSharesComponent implements OnInit {
* in clients view upon using a common resolver.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRedeemSharesAccountForm();
this.redeemSharesForm.get('unitPrice').patchValue(this.sharesAccountData.currentMarketPrice || '');
}
diff --git a/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.ts b/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.ts
index 2325698d1..ea3e071e6 100644
--- a/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.ts
+++ b/src/app/shares/shares-account-actions/reject-shares-account/reject-shares-account.component.ts
@@ -48,6 +48,7 @@ export class RejectSharesAccountComponent implements OnInit {
* Creates the reject shares form.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.createRejectSharesAccountForm();
}
diff --git a/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.ts b/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.ts
index fd3e11d29..60309f4ee 100644
--- a/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-details-step/shares-account-details-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/** Custom Services */
import { SharesService } from 'app/shares/shares.service';
@@ -34,13 +35,16 @@ export class SharesAccountDetailsStepComponent implements OnInit {
* Sets share account details form.
* @param {FormBuilder} formBuilder Form Builder.
* @param {SharesService} sharesService Shares Service.
+ * @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: FormBuilder,
- private sharesService: SharesService) {
+ private sharesService: SharesService,
+ private settingsService: SettingsService) {
this.createSharesAccountDetailsForm();
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.buildDependencies();
if (this.sharesAccountTemplate) {
this.productData = this.sharesAccountTemplate.productOptions;
diff --git a/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.ts b/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.ts
index a382db0e1..ff3ea39bd 100644
--- a/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.ts
+++ b/src/app/shares/shares-account-stepper/shares-account-terms-step/shares-account-terms-step.component.ts
@@ -1,6 +1,7 @@
/** Angular Imports */
import { Component, OnChanges, OnInit, Input } from '@angular/core';
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
+import { SettingsService } from 'app/settings/settings.service';
/**
* Shares Account Terms Step
@@ -34,8 +35,10 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
/**
* @param {FormBuilder} formBuilder Form Builder
+ * @param {SettingsService} settingsService Settings Service
*/
- constructor(private formBuilder: FormBuilder) {
+ constructor(private formBuilder: FormBuilder,
+ private settingsService: SettingsService) {
this.createSharesAccountTermsForm();
}
@@ -59,6 +62,7 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
}
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
if (this.sharesAccountTemplate) {
this.sharesAccountTermsForm.patchValue({
'requestedShares': this.sharesAccountTemplate.summary.totalPendingForApprovalShares,
diff --git a/src/app/system/audit-trails/audit-trails.component.ts b/src/app/system/audit-trails/audit-trails.component.ts
index e0af8388f..39c63e885 100644
--- a/src/app/system/audit-trails/audit-trails.component.ts
+++ b/src/app/system/audit-trails/audit-trails.component.ts
@@ -128,6 +128,8 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
* Retrieves the audit trail search template data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
* @param {SystemService} systemService System Service.
+ * @param {Dates} dateUtils Dates utils
+ * @param {SettingsService} settingsService Settings Service
*/
constructor(private route: ActivatedRoute,
private systemService: SystemService,
@@ -142,6 +144,7 @@ export class AuditTrailsComponent implements OnInit, AfterViewInit {
* Sets filtered users, actions and entities for autocomplete and audit trails table.
*/
ngOnInit() {
+ this.maxDate = this.settingsService.businessDate;
this.setFilteredUsers();
this.setFilteredActions();
this.setFilteredEntities();
diff --git a/src/app/web-app.component.ts b/src/app/web-app.component.ts
index c309b3a45..2fdbc88da 100644
--- a/src/app/web-app.component.ts
+++ b/src/app/web-app.component.ts
@@ -24,6 +24,7 @@ import { SettingsService } from './settings/settings.service';
/** Custom Items */
import { Alert } from './core/alert/alert.model';
import { KeyboardShortcutsConfiguration } from './keyboards-shortcut-config';
+import { Dates } from './core/utils/dates';
/** Initialize Logger */
const log = new Logger('MifosX');
@@ -51,6 +52,7 @@ export class WebAppComponent implements OnInit {
* @param {AlertService} alertService Alert Service.
* @param {SettingsService} settingsService Settings Service.
* @param {AuthenticationService} authenticationService Authentication service.
+ * @param {Dates} dateUtils Dates service.
*/
constructor(private router: Router,
private activatedRoute: ActivatedRoute,
@@ -60,7 +62,8 @@ export class WebAppComponent implements OnInit {
public snackBar: MatSnackBar,
private alertService: AlertService,
private settingsService: SettingsService,
- private authenticationService: AuthenticationService) { }
+ private authenticationService: AuthenticationService,
+ private dateUtils: Dates) { }
/**
* Initial Setup:
@@ -143,6 +146,8 @@ export class WebAppComponent implements OnInit {
if (!localStorage.getItem('mifosXDateFormat')) {
this.settingsService.setDateFormat('dd MMMM yyyy');
}
+ // Set default max date picker as Today
+ this.settingsService.setBusinessDate(this.dateUtils.formatDate(new Date(), SettingsService.businessDateFormat));
// Set the server list from the env var FINERACT_API_URLS
this.settingsService.setServers(environment.baseApiUrls.split(','));
}