Loan account fixed due required fields
This commit is contained in:
@@ -1,2 +1,3 @@
|
||||
<!-- Display the content for the visited route. -->
|
||||
<router-outlet></router-outlet>
|
||||
<div id="push"></div>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
mifosx-content { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -30px; }
|
||||
#push { height:30px;}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from '../loans.service';
|
||||
@@ -11,6 +10,7 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
import { LoansAccountDetailsStepComponent } from '../loans-account-stepper/loans-account-details-step/loans-account-details-step.component';
|
||||
import { LoansAccountTermsStepComponent } from '../loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component';
|
||||
import { LoansAccountChargesStepComponent } from '../loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Create loans account
|
||||
@@ -44,7 +44,7 @@ export class CreateLoansAccountComponent implements OnInit {
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private loansService: LoansService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
@@ -107,17 +107,17 @@ export class CreateLoansAccountComponent implements OnInit {
|
||||
charges: this.loansAccount.charges.map((charge: any) => ({
|
||||
chargeId: charge.id,
|
||||
amount: charge.amount,
|
||||
dueDate: charge.dueDate && this.datePipe.transform(charge.dueDate, dateFormat),
|
||||
dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat),
|
||||
})),
|
||||
collateral: this.loansAccount.collateral.map((collateralEle: any) => ({
|
||||
type: collateralEle.type,
|
||||
value: collateralEle.value,
|
||||
description: collateralEle.description
|
||||
})),
|
||||
interestChargedFromDate: this.datePipe.transform(this.loansAccount.interestChargedFromDate, dateFormat),
|
||||
repaymentsStartingFromDate: this.datePipe.transform(this.loansAccount.repaymentsStartingFromDate, dateFormat),
|
||||
submittedOnDate: this.datePipe.transform(this.loansAccount.submittedOnDate, dateFormat),
|
||||
expectedDisbursementDate: this.datePipe.transform(this.loansAccount.expectedDisbursementDate, dateFormat),
|
||||
interestChargedFromDate: this.dateUtils.formatDate(this.loansAccount.interestChargedFromDate, dateFormat),
|
||||
repaymentsStartingFromDate: this.dateUtils.formatDate(this.loansAccount.repaymentsStartingFromDate, dateFormat),
|
||||
submittedOnDate: this.dateUtils.formatDate(this.loansAccount.submittedOnDate, dateFormat),
|
||||
expectedDisbursementDate: this.dateUtils.formatDate(this.loansAccount.expectedDisbursementDate, dateFormat),
|
||||
dateFormat,
|
||||
locale,
|
||||
loanType
|
||||
@@ -129,10 +129,14 @@ export class CreateLoansAccountComponent implements OnInit {
|
||||
}
|
||||
|
||||
if (loansAccountData.recalculationRestFrequencyDate) {
|
||||
loansAccountData.recalculationRestFrequencyDate = this.datePipe.transform(this.loansAccount.recalculationRestFrequencyDate, dateFormat);
|
||||
loansAccountData.recalculationRestFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationRestFrequencyDate, dateFormat);
|
||||
}
|
||||
|
||||
if (!loansAccountData.recalculationCompoundingFrequencyDate) {
|
||||
if (this.loansAccountProductTemplate.isInterestRecalculationEnabled) {
|
||||
if (loansAccountData.recalculationCompoundingFrequencyDate !== null) {
|
||||
loansAccountData.recalculationCompoundingFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationCompoundingFrequencyDate, dateFormat);
|
||||
}
|
||||
} else {
|
||||
delete loansAccountData.recalculationCompoundingFrequencyDate;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { LoansService } from '../loans.service';
|
||||
import { LoansAccountDetailsStepComponent } from '../loans-account-stepper/loans-account-details-step/loans-account-details-step.component';
|
||||
import { LoansAccountTermsStepComponent } from '../loans-account-stepper/loans-account-terms-step/loans-account-terms-step.component';
|
||||
@@ -8,6 +7,7 @@ import { LoansAccountChargesStepComponent } from '../loans-account-stepper/loans
|
||||
|
||||
/** Custom Services */
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Edit Loans
|
||||
@@ -41,7 +41,7 @@ export class EditLoansAccountComponent implements OnInit {
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private loansService: LoansService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
@@ -110,17 +110,17 @@ export class EditLoansAccountComponent implements OnInit {
|
||||
charges: this.loansAccount.charges.map((charge: any) => ({
|
||||
chargeId: charge.id,
|
||||
amount: charge.amount,
|
||||
dueDate: charge.dueDate && this.datePipe.transform(charge.dueDate, dateFormat),
|
||||
dueDate: charge.dueDate && this.dateUtils.formatDate(charge.dueDate, dateFormat),
|
||||
})),
|
||||
collateral: this.loansAccount.collateral.map((collateralEle: any) => ({
|
||||
type: collateralEle.type,
|
||||
value: collateralEle.value,
|
||||
description: collateralEle.description
|
||||
})),
|
||||
interestChargedFromDate: this.datePipe.transform(this.loansAccount.interestChargedFromDate, dateFormat),
|
||||
repaymentsStartingFromDate: this.datePipe.transform(this.loansAccount.repaymentsStartingFromDate, dateFormat),
|
||||
submittedOnDate: this.datePipe.transform(this.loansAccount.submittedOnDate, dateFormat),
|
||||
expectedDisbursementDate: this.datePipe.transform(this.loansAccount.expectedDisbursementDate, dateFormat),
|
||||
interestChargedFromDate: this.dateUtils.formatDate(this.loansAccount.interestChargedFromDate, dateFormat),
|
||||
repaymentsStartingFromDate: this.dateUtils.formatDate(this.loansAccount.repaymentsStartingFromDate, dateFormat),
|
||||
submittedOnDate: this.dateUtils.formatDate(this.loansAccount.submittedOnDate, dateFormat),
|
||||
expectedDisbursementDate: this.dateUtils.formatDate(this.loansAccount.expectedDisbursementDate, dateFormat),
|
||||
dateFormat,
|
||||
locale,
|
||||
loanType
|
||||
@@ -132,11 +132,15 @@ export class EditLoansAccountComponent implements OnInit {
|
||||
}
|
||||
|
||||
if (loansAccountData.recalculationRestFrequencyDate) {
|
||||
loansAccountData.recalculationRestFrequencyDate = this.datePipe.transform(this.loansAccount.recalculationRestFrequencyDate, dateFormat);
|
||||
loansAccountData.recalculationRestFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationRestFrequencyDate, dateFormat);
|
||||
}
|
||||
|
||||
if (loansAccountData.recalculationCompoundingFrequencyDate) {
|
||||
loansAccountData.recalculationCompoundingFrequencyDate = this.datePipe.transform(this.loansAccount.recalculationCompoundingFrequencyDate, dateFormat);
|
||||
if (this.loansAccountProductTemplate.isInterestRecalculationEnabled) {
|
||||
if (loansAccountData.recalculationCompoundingFrequencyDate !== null) {
|
||||
loansAccountData.recalculationCompoundingFrequencyDate = this.dateUtils.formatDate(this.loansAccount.recalculationCompoundingFrequencyDate, dateFormat);
|
||||
}
|
||||
} else {
|
||||
delete loansAccountData.recalculationCompoundingFrequencyDate;
|
||||
}
|
||||
|
||||
if (loansAccountData.interestCalculationPeriodType === 0) {
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ export class LoansAccountDetailsStepComponent implements OnInit {
|
||||
'loanOfficerId': [''],
|
||||
'loanPurposeId': [''],
|
||||
'fundId': [''],
|
||||
'submittedOnDate': ['', Validators.required],
|
||||
'submittedOnDate': [new Date(), Validators.required],
|
||||
'expectedDisbursementDate': ['', Validators.required],
|
||||
'externalId': [''],
|
||||
'linkAccountId': [''],
|
||||
|
||||
+2
-2
@@ -72,7 +72,7 @@
|
||||
|
||||
<mat-form-field fxFlex="48%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value == 2">
|
||||
<mat-label>Select On</mat-label>
|
||||
<mat-select formControlName="repaymentFrequencyNthDayType" required>
|
||||
<mat-select formControlName="repaymentFrequencyNthDayType">
|
||||
<mat-option
|
||||
*ngFor="let repaymentFrequencyNthDayType of repaymentFrequencyNthDayTypeData"
|
||||
[value]="repaymentFrequencyNthDayType.id">
|
||||
@@ -83,7 +83,7 @@
|
||||
|
||||
<mat-form-field fxFlex="48%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value == 2">
|
||||
<mat-label>Select Day</mat-label>
|
||||
<mat-select formControlName="repaymentFrequencyDayOfWeekType" required>
|
||||
<mat-select formControlName="repaymentFrequencyDayOfWeekType">
|
||||
<mat-option
|
||||
*ngFor="let repaymentFrequencyDayOfWeekType of repaymentFrequencyDaysOfWeekTypeData"
|
||||
[value]="repaymentFrequencyDayOfWeekType.id">
|
||||
|
||||
+9
-4
@@ -91,6 +91,12 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
'repaymentsStartingFromDate': this.loansAccountTemplate.expectedFirstRepaymentOnDate && new Date(this.loansAccountTemplate.expectedFirstRepaymentOnDate)
|
||||
});
|
||||
}
|
||||
|
||||
if (this.loansAccountTemplate.isInterestRecalculationEnabled) {
|
||||
this.loansAccountTermsForm.patchValue({
|
||||
'recalculationCompoundingFrequencyDate': ''
|
||||
});
|
||||
}
|
||||
}
|
||||
this.createloansAccountTermsForm();
|
||||
this.setCustomValidators();
|
||||
@@ -126,8 +132,8 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
'numberOfRepayments': ['', Validators.required],
|
||||
'repaymentEvery': ['', Validators.required],
|
||||
'repaymentFrequencyType': ['', Validators.required],
|
||||
'repaymentFrequencyNthDayType': ['', Validators.required],
|
||||
'repaymentFrequencyDayOfWeekType': ['', Validators.required],
|
||||
'repaymentFrequencyNthDayType': [''],
|
||||
'repaymentFrequencyDayOfWeekType': [''],
|
||||
'repaymentsStartingFromDate': [''],
|
||||
'interestChargedFromDate': [''],
|
||||
'interestRatePerPeriod': [''],
|
||||
@@ -147,8 +153,7 @@ export class LoansAccountTermsStepComponent implements OnInit, OnChanges {
|
||||
'loanIdToClose': [''],
|
||||
'fixedEmiAmount': [''],
|
||||
'isTopup': [''],
|
||||
'maxOutstandingLoanBalance': [''],
|
||||
'recalculationCompoundingFrequencyDate': ['']
|
||||
'maxOutstandingLoanBalance': ['']
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -2,11 +2,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from '../../../loans.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Create Add Loan Charge component.
|
||||
@@ -54,7 +54,7 @@ export class AddLoanChargeComponent implements OnInit {
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private loansService: LoansService,
|
||||
private settingsService: SettingsService) {
|
||||
this.route.data.subscribe((data: { actionButtonData: any }) => {
|
||||
@@ -102,7 +102,7 @@ export class AddLoanChargeComponent implements OnInit {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.loanChargeForm.patchValue({
|
||||
dueDate: this.datePipe.transform(prevDueDate, dateFormat)
|
||||
dueDate: this.dateUtils.formatDate(prevDueDate, dateFormat)
|
||||
});
|
||||
const loanCharge = this.loanChargeForm.value;
|
||||
loanCharge.locale = this.settingsService.language.code;
|
||||
|
||||
+6
-7
@@ -2,8 +2,7 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { distinctUntilChanged } from 'rxjs/operators';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/** Custom Services. */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
@@ -41,7 +40,7 @@ export class ApproveLoanComponent implements OnInit {
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private loanService: LoansService,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
@@ -77,18 +76,18 @@ export class ApproveLoanComponent implements OnInit {
|
||||
* Submits Approve form.
|
||||
*/
|
||||
submit() {
|
||||
const local = this.settingsService.language.code;
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const approvedOnDate = this.approveLoanForm.value.approvedOnDate;
|
||||
const expectedDisbursementDate = this.approveLoanForm.value.expectedDisbursementDate;
|
||||
this.approveLoanForm.patchValue({
|
||||
approvedOnDate: this.datePipe.transform(approvedOnDate, dateFormat),
|
||||
expectedDisbursementDate: this.datePipe.transform(expectedDisbursementDate, dateFormat)
|
||||
approvedOnDate: this.dateUtils.formatDate(approvedOnDate, dateFormat),
|
||||
expectedDisbursementDate: this.dateUtils.formatDate(expectedDisbursementDate, dateFormat)
|
||||
});
|
||||
const approveLoanFormData = {
|
||||
... this.approveLoanForm.value,
|
||||
dateFormat,
|
||||
local
|
||||
locale
|
||||
};
|
||||
this.loanService.loanActionButtons(this.loanId, 'approve', approveLoanFormData).subscribe((response: any) => {
|
||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||
|
||||
+3
-4
@@ -1,12 +1,11 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
|
||||
/** Custom Services */
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-assign-loan-officer',
|
||||
@@ -37,7 +36,7 @@ export class AssignLoanOfficerComponent implements OnInit {
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -64,7 +63,7 @@ export class AssignLoanOfficerComponent implements OnInit {
|
||||
const assignmentDate = this.assignOfficerForm.value.assignmentDate;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.assignOfficerForm.patchValue({
|
||||
assignmentDate: this.datePipe.transform(assignmentDate, dateFormat)
|
||||
assignmentDate: this.dateUtils.formatDate(assignmentDate, dateFormat)
|
||||
});
|
||||
const assignForm = this.assignOfficerForm.value;
|
||||
assignForm.locale = this.settingsService.language.code;
|
||||
|
||||
+3
-3
@@ -2,10 +2,10 @@ import { Component, OnInit, Input } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services */
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-close-as-rescheduled',
|
||||
@@ -36,7 +36,7 @@ export class CloseAsRescheduledComponent implements OnInit {
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export class CloseAsRescheduledComponent implements OnInit {
|
||||
const transactionDate = this.closeLoanForm.value.transactionDate;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.closeLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||
transactionDate: this.dateUtils.formatDate(transactionDate, dateFormat)
|
||||
});
|
||||
const closeForm = this.closeLoanForm.value;
|
||||
closeForm.locale = this.settingsService.language.code;
|
||||
|
||||
+3
-4
@@ -5,9 +5,9 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ClientsService } from 'app/clients/clients.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Create Guarantor Action
|
||||
@@ -42,14 +42,13 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private clientsService: ClientsService,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
@@ -164,7 +163,7 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
|
||||
if (this.newGuarantorForm.value.existingClient) {
|
||||
newGuarantorData['entityId'] = this.newGuarantorForm.controls.name.value.id;
|
||||
} else {
|
||||
newGuarantorData['dob'] = this.datePipe.transform(prevdob, dateFormat),
|
||||
newGuarantorData['dob'] = this.dateUtils.formatDate(prevdob, dateFormat),
|
||||
newGuarantorData['dateFormat'] = dateFormat;
|
||||
}
|
||||
|
||||
|
||||
+3
-4
@@ -2,11 +2,11 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { FormBuilder, Validators, FormGroup, FormControl } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Service. */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Disburse To Savings component.
|
||||
@@ -32,14 +32,13 @@ export class DisburseLoanAccountComponent implements OnInit {
|
||||
* @param {FormBuilder} formBuilder FormBuilder.
|
||||
* @param {ActivatedRoute} route ActivatedRoute.
|
||||
* @param {Router} router Router.
|
||||
* @param {DatePipe} datePipe DatePipe.
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private loanService: LoansService,
|
||||
private settingsService: SettingsService) { }
|
||||
|
||||
@@ -68,7 +67,7 @@ export class DisburseLoanAccountComponent implements OnInit {
|
||||
const actualDisbursementDate = this.disbursementForm.value.actualDisbursementDate;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.disbursementForm.patchValue({
|
||||
actualDisbursementDate: this.datePipe.transform(actualDisbursementDate, dateFormat)
|
||||
actualDisbursementDate: this.dateUtils.formatDate(actualDisbursementDate, dateFormat)
|
||||
});
|
||||
const loanId = this.route.parent.snapshot.params['loanId'];
|
||||
const disbursementForm = this.disbursementForm.value;
|
||||
|
||||
@@ -5,8 +5,8 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Disburse Loan Option
|
||||
@@ -37,14 +37,13 @@ export class DisburseComponent implements OnInit {
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -105,7 +104,7 @@ export class DisburseComponent implements OnInit {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.disbursementLoanForm.patchValue({
|
||||
actualDisbursementDate: this.datePipe.transform(prevActualDisbursementDate, dateFormat)
|
||||
actualDisbursementDate: this.dateUtils.formatDate(prevActualDisbursementDate, dateFormat)
|
||||
});
|
||||
const disbursementLoanData = this.disbursementLoanForm.value;
|
||||
disbursementLoanData.locale = this.settingsService.language.code;
|
||||
|
||||
@@ -2,10 +2,10 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services */
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-foreclosure',
|
||||
@@ -36,7 +36,7 @@ export class ForeclosureComponent implements OnInit {
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -68,7 +68,7 @@ export class ForeclosureComponent implements OnInit {
|
||||
|
||||
retrieveLoanForeclosureTemplate(val: any) {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const transactionDateFormatted = this.datePipe.transform(val, dateFormat);
|
||||
const transactionDateFormatted = this.dateUtils.formatDate(val, dateFormat);
|
||||
const data = {
|
||||
command: 'foreclosure',
|
||||
dateFormat: this.settingsService.dateFormat,
|
||||
@@ -111,7 +111,7 @@ export class ForeclosureComponent implements OnInit {
|
||||
const transactionDate = this.foreclosureForm.value.transactionDate;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.foreclosureForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||
transactionDate: this.dateUtils.formatDate(transactionDate, dateFormat)
|
||||
});
|
||||
const formData = {
|
||||
transactionDate: this.foreclosureForm.value.transactionDate,
|
||||
|
||||
+5
-6
@@ -2,11 +2,10 @@ import { Component, OnInit, Input } from '@angular/core';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { FormBuilder, FormGroup, Validators, FormControl } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { subscribeOn } from 'rxjs/operators';
|
||||
|
||||
/** Custom Services */
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-loan-reschedule',
|
||||
@@ -41,7 +40,7 @@ export class LoanRescheduleComponent implements OnInit {
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -73,9 +72,9 @@ export class LoanRescheduleComponent implements OnInit {
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
|
||||
this.rescheduleLoanForm.patchValue({
|
||||
rescheduleFromDate: this.datePipe.transform(rescheduleFromDate, dateFormat),
|
||||
adjustedDueDate: this.datePipe.transform(adjustedDueDate, dateFormat),
|
||||
submittedOnDate: this.datePipe.transform(submittedOnDate, dateFormat)
|
||||
rescheduleFromDate: this.dateUtils.formatDate(rescheduleFromDate, dateFormat),
|
||||
adjustedDueDate: this.dateUtils.formatDate(adjustedDueDate, dateFormat),
|
||||
submittedOnDate: this.dateUtils.formatDate(submittedOnDate, dateFormat)
|
||||
});
|
||||
const rescheduleForm = this.rescheduleLoanForm.value;
|
||||
rescheduleForm.locale = this.settingsService.language.code;
|
||||
|
||||
+3
-3
@@ -3,10 +3,10 @@ import { Component, OnInit, Input } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services */
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-loans-account-close',
|
||||
@@ -37,7 +37,7 @@ export class LoansAccountCloseComponent implements OnInit {
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export class LoansAccountCloseComponent implements OnInit {
|
||||
const transactionDate = this.closeLoanForm.value.transactionDate;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.closeLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||
transactionDate: this.dateUtils.formatDate(transactionDate, dateFormat)
|
||||
});
|
||||
const closeForm = this.closeLoanForm.value;
|
||||
closeForm.locale = this.settingsService.language.code;
|
||||
|
||||
+3
-4
@@ -5,8 +5,8 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Loan Make Repayment Component
|
||||
@@ -37,14 +37,13 @@ export class MakeRepaymentComponent implements OnInit {
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -104,7 +103,7 @@ export class MakeRepaymentComponent implements OnInit {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.repaymentLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
transactionDate: this.dateUtils.formatDate(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const repaymentLoanData = this.repaymentLoanForm.value;
|
||||
repaymentLoanData.locale = this.settingsService.language.code;
|
||||
|
||||
@@ -7,6 +7,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
|
||||
/**
|
||||
@@ -42,14 +43,13 @@ export class PrepayLoanComponent implements OnInit {
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -117,7 +117,7 @@ export class PrepayLoanComponent implements OnInit {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.prepayLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
transactionDate: this.dateUtils.formatDate(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const prepayLoanData = this.prepayLoanForm.value;
|
||||
prepayLoanData.locale = this.settingsService.language.code;
|
||||
|
||||
+3
-4
@@ -5,8 +5,8 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Loan Recovery Repayment Action
|
||||
@@ -37,14 +37,13 @@ export class RecoveryRepaymentComponent implements OnInit {
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -105,7 +104,7 @@ export class RecoveryRepaymentComponent implements OnInit {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.recoveryRepaymentLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
transactionDate: this.dateUtils.formatDate(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const recoveryRepaymentLoanData = this.recoveryRepaymentLoanForm.value;
|
||||
recoveryRepaymentLoanData.locale = this.settingsService.language.code;
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom services. */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Reject Loan component.
|
||||
@@ -32,14 +32,13 @@ export class RejectLoanComponent implements OnInit {
|
||||
* @param formBuilder Form Builder.
|
||||
* @param router Router.
|
||||
* @param route Activated Route.
|
||||
* @param datePipe Date Pipe.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private loanService: LoansService,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService ) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -65,7 +64,7 @@ export class RejectLoanComponent implements OnInit {
|
||||
const rejectedOnDate = this.rejectLoanForm.value.rejectedOnDate;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.rejectLoanForm.patchValue({
|
||||
rejectedOnDate: this.datePipe.transform(rejectedOnDate, dateFormat)
|
||||
rejectedOnDate: this.dateUtils.formatDate(rejectedOnDate, dateFormat)
|
||||
});
|
||||
const rejectForm = this.rejectLoanForm.value;
|
||||
rejectForm.locale = this.settingsService.language.code;
|
||||
|
||||
+3
-4
@@ -2,10 +2,10 @@
|
||||
import { Component, OnInit, Input } from '@angular/core';
|
||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services. */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Waive Interest component.
|
||||
@@ -30,13 +30,12 @@ export class WaiveInterestComponent implements OnInit {
|
||||
* Get data from `Resolver`.
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {Router} router Router.
|
||||
* @param {DatePipe} datePipe DatePipe.
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute) { }
|
||||
|
||||
@@ -63,7 +62,7 @@ export class WaiveInterestComponent implements OnInit {
|
||||
const transactionAmount = this.loanInterestForm.value.transactionAmount;
|
||||
const dateFormat = 'dd MMMM yyyy';
|
||||
this.loanInterestForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat),
|
||||
transactionDate: this.dateUtils.formatDate(transactionDate, dateFormat),
|
||||
transactionAmount: parseInt(transactionAmount, 10)
|
||||
});
|
||||
const loanId = this.route.parent.snapshot.params['loanId'];
|
||||
|
||||
+3
-4
@@ -5,8 +5,8 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
/**
|
||||
* Withdrawn By Applicant Loan Form
|
||||
@@ -33,14 +33,13 @@ export class WithdrawnByClientComponent implements OnInit {
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private dateUtils: Dates,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
@@ -69,7 +68,7 @@ export class WithdrawnByClientComponent implements OnInit {
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.withdrawnByClientLoanForm.patchValue({
|
||||
withdrawnOnDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
withdrawnOnDate: this.dateUtils.formatDate(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const WithdrawnByClientLoanData = this.withdrawnByClientLoanForm.value;
|
||||
WithdrawnByClientLoanData.locale = this.settingsService.language.code;
|
||||
|
||||
Reference in New Issue
Block a user