Datepickers using max date with business date

This commit is contained in:
Jose Alberto Hernandez
2022-07-28 17:06:39 +02:00
committed by Arnold Gálovics
parent 753791a078
commit a4b266080b
132 changed files with 268 additions and 42 deletions
@@ -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;
@@ -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({
@@ -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 => {
@@ -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;
}
@@ -45,6 +45,7 @@ export class CloseAsRescheduledComponent implements OnInit {
* Creates the close form.
*/
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.createCloseForm();
}
@@ -55,6 +55,7 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.createNewGuarantorForm();
this.setNewGuarantorDetailsForm();
this.buildDependencies();
@@ -43,6 +43,7 @@ export class DisburseLoanAccountComponent implements OnInit {
private settingsService: SettingsService) { }
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.setDisbursementToSavingsForm();
}
@@ -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();
}
@@ -39,6 +39,7 @@ export class ForeclosureComponent implements OnInit {
}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.createforeclosureForm();
this.onChanges();
}
@@ -46,6 +46,7 @@ export class LoanRescheduleComponent implements OnInit {
}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.codes = this.dataObject.rescheduleReasons;
this.setRescheduleLoanForm();
}
@@ -46,6 +46,7 @@ export class LoansAccountCloseComponent implements OnInit {
* Creates the close form.
*/
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.createCloseForm();
}
@@ -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();
}
@@ -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();
}
@@ -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();
}
@@ -44,6 +44,7 @@ export class RejectLoanComponent implements OnInit {
}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.setRejectLoanForm();
}
@@ -42,6 +42,7 @@ export class WaiveInterestComponent implements OnInit {
private route: ActivatedRoute) { }
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.setLoanInterestForm();
}
@@ -49,6 +49,7 @@ export class WithdrawnByClientComponent implements OnInit {
* and initialize with the required values
*/
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.createWithdrawnByClientLoanForm();
}
@@ -45,6 +45,7 @@ export class WriteOffPageComponent implements OnInit {
private settingsService: SettingsService) { }
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.setWriteOffForm();
}
@@ -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),
@@ -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();
}