Loan account fixed due required fields
This commit is contained in:
+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