+6
-3
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from '../../../loans.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
/**
|
||||
* Create Add Loan Charge component.
|
||||
@@ -48,12 +49,14 @@ export class AddLoanChargeComponent implements OnInit {
|
||||
* @param {AccountingService} accountingService Accounting Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe,
|
||||
private loansService: LoansService) {
|
||||
private loansService: LoansService,
|
||||
private settingsService: SettingsService) {
|
||||
this.route.data.subscribe((data: { actionButtonData: any }) => {
|
||||
this.loanChargeOptions = data.actionButtonData.chargeOptions;
|
||||
});
|
||||
@@ -97,12 +100,12 @@ export class AddLoanChargeComponent implements OnInit {
|
||||
submit() {
|
||||
const prevDueDate: Date = this.loanChargeForm.value.dueDate;
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = 'yyyy-MM-dd';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.loanChargeForm.patchValue({
|
||||
dueDate: this.datePipe.transform(prevDueDate, dateFormat)
|
||||
});
|
||||
const loanCharge = this.loanChargeForm.value;
|
||||
loanCharge.locale = 'en';
|
||||
loanCharge.locale = this.settingsService.language.code;
|
||||
loanCharge.dateFormat = dateFormat;
|
||||
this.loansService.createLoanCharge(this.loanId, 'charges', loanCharge).subscribe(res => {
|
||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||
|
||||
+6
-3
@@ -7,6 +7,7 @@ import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services. */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
/**
|
||||
* Approve Loan component.
|
||||
@@ -36,12 +37,14 @@ export class ApproveLoanComponent implements OnInit {
|
||||
* @param datePipe Date Pipe.
|
||||
* @param loanService Loan Service.
|
||||
* @param router Router.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private datePipe: DatePipe,
|
||||
private loanService: LoansService,
|
||||
private router: Router) {
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) {
|
||||
this.route.data.subscribe((data: { actionButtonData: any }) => {
|
||||
this.loanData = data.actionButtonData;
|
||||
});
|
||||
@@ -74,8 +77,8 @@ export class ApproveLoanComponent implements OnInit {
|
||||
* Submits Approve form.
|
||||
*/
|
||||
submit() {
|
||||
const dateFormat = 'dd MMMM yyyy';
|
||||
const local = 'en';
|
||||
const local = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const approvedOnDate = this.approveLoanForm.value.approvedOnDate;
|
||||
const expectedDisbursementDate = this.approveLoanForm.value.expectedDisbursementDate;
|
||||
this.approveLoanForm.patchValue({
|
||||
|
||||
+8
-3
@@ -5,6 +5,9 @@ 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';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-assign-loan-officer',
|
||||
templateUrl: './assign-loan-officer.component.html',
|
||||
@@ -28,12 +31,14 @@ export class AssignLoanOfficerComponent implements OnInit {
|
||||
* @param {LoansService} systemService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe) {
|
||||
private datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -57,12 +62,12 @@ export class AssignLoanOfficerComponent implements OnInit {
|
||||
|
||||
submit() {
|
||||
const assignmentDate = this.assignOfficerForm.value.assignmentDate;
|
||||
const dateFormat = 'yyyy-MM-dd';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.assignOfficerForm.patchValue({
|
||||
assignmentDate: this.datePipe.transform(assignmentDate, dateFormat)
|
||||
});
|
||||
const assignForm = this.assignOfficerForm.value;
|
||||
assignForm.locale = 'en';
|
||||
assignForm.locale = this.settingsService.language.code;
|
||||
assignForm.dateFormat = dateFormat;
|
||||
assignForm.fromLoanOfficerId = this.dataObject.loanOfficerId || '';
|
||||
|
||||
|
||||
+8
-3
@@ -4,6 +4,9 @@ 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';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-close-as-rescheduled',
|
||||
templateUrl: './close-as-rescheduled.component.html',
|
||||
@@ -27,12 +30,14 @@ export class CloseAsRescheduledComponent implements OnInit {
|
||||
* @param {LoansService} systemService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe) {
|
||||
private datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -59,12 +64,12 @@ export class CloseAsRescheduledComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const transactionDate = this.closeLoanForm.value.transactionDate;
|
||||
const dateFormat = 'yyyy-MM-dd';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.closeLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||
});
|
||||
const closeForm = this.closeLoanForm.value;
|
||||
closeForm.locale = 'en';
|
||||
closeForm.locale = this.settingsService.language.code;
|
||||
closeForm.dateFormat = dateFormat;
|
||||
this.loanService.submitLoanActionButton(this.loanId, closeForm, 'close-rescheduled')
|
||||
.subscribe((response: any) => {
|
||||
|
||||
+6
-3
@@ -7,6 +7,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
||||
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';
|
||||
|
||||
/**
|
||||
* Create Guarantor Action
|
||||
@@ -42,13 +43,15 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
|
||||
* @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 clientsService: ClientsService) {
|
||||
private clientsService: ClientsService,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -150,8 +153,8 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
|
||||
const prevdob: Date = this.newGuarantorForm.value.dob;
|
||||
const guarantorTypeId: number = this.newGuarantorForm.value.existingClient ? this.dataObject.guarantorTypeOptions[0].id : this.dataObject.guarantorTypeOptions[2].id;
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = 'dd-MM-yyyy';
|
||||
const locale = 'en';
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const newGuarantorData = {
|
||||
... this.newGuarantorForm.value,
|
||||
locale,
|
||||
|
||||
+6
-3
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Service. */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
/**
|
||||
* Disburse To Savings component.
|
||||
@@ -33,12 +34,14 @@ export class DisburseLoanAccountComponent implements OnInit {
|
||||
* @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 loanService: LoansService) { }
|
||||
private loanService: LoansService,
|
||||
private settingsService: SettingsService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.setDisbursementToSavingsForm();
|
||||
@@ -63,13 +66,13 @@ export class DisburseLoanAccountComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const actualDisbursementDate = this.disbursementForm.value.actualDisbursementDate;
|
||||
const dateFormat = 'dd MMMM yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.disbursementForm.patchValue({
|
||||
actualDisbursementDate: this.datePipe.transform(actualDisbursementDate, dateFormat)
|
||||
});
|
||||
const loanId = this.route.parent.snapshot.params['loanId'];
|
||||
const disbursementForm = this.disbursementForm.value;
|
||||
disbursementForm.locale = 'en';
|
||||
disbursementForm.locale = this.settingsService.language.code;
|
||||
disbursementForm.dateFormat = dateFormat;
|
||||
this.loanService.loanActionButtons(loanId, 'disbursetosavings', disbursementForm).subscribe((response: any) => {
|
||||
this.router.navigate(['../../general'], {relativeTo: this.route});
|
||||
|
||||
@@ -6,6 +6,7 @@ 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';
|
||||
|
||||
/**
|
||||
* Disburse Loan Option
|
||||
@@ -37,12 +38,14 @@ export class DisburseComponent implements OnInit {
|
||||
* @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 datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -100,12 +103,12 @@ export class DisburseComponent implements OnInit {
|
||||
submit() {
|
||||
const prevActualDisbursementDate: Date = this.disbursementLoanForm.value.actualDisbursementDate;
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = 'dd-MM-yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.disbursementLoanForm.patchValue({
|
||||
actualDisbursementDate: this.datePipe.transform(prevActualDisbursementDate, dateFormat)
|
||||
});
|
||||
const disbursementLoanData = this.disbursementLoanForm.value;
|
||||
disbursementLoanData.locale = 'en';
|
||||
disbursementLoanData.locale = this.settingsService.language.code;
|
||||
disbursementLoanData.dateFormat = dateFormat;
|
||||
this.loanService.loanActionButtons(this.loanId, 'disburse', disbursementLoanData )
|
||||
.subscribe((response: any) => {
|
||||
|
||||
@@ -4,6 +4,9 @@ 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';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-foreclosure',
|
||||
templateUrl: './foreclosure.component.html',
|
||||
@@ -27,12 +30,14 @@ export class ForeclosureComponent implements OnInit {
|
||||
* @param {LoansService} systemService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe) {
|
||||
private datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -62,12 +67,12 @@ export class ForeclosureComponent implements OnInit {
|
||||
}
|
||||
|
||||
retrieveLoanForeclosureTemplate(val: any) {
|
||||
const dateFormat = 'dd MMMM yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const transactionDateFormatted = this.datePipe.transform(val, dateFormat);
|
||||
const data = {
|
||||
command: 'foreclosure',
|
||||
dateFormat: 'dd MMMM yyyy',
|
||||
locale: 'en',
|
||||
dateFormat: this.settingsService.dateFormat,
|
||||
locale: this.settingsService.language.code,
|
||||
transactionDate: transactionDateFormatted
|
||||
};
|
||||
this.loanService.getForeclosureData(this.loanId, data)
|
||||
@@ -104,13 +109,13 @@ export class ForeclosureComponent implements OnInit {
|
||||
|
||||
submit() {
|
||||
const transactionDate = this.foreclosureForm.value.transactionDate;
|
||||
const dateFormat = 'yyyy-MM-dd';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.foreclosureForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||
});
|
||||
const formData = {
|
||||
transactionDate: this.foreclosureForm.value.transactionDate,
|
||||
locale: 'en',
|
||||
locale: this.settingsService.language.code,
|
||||
dateFormat: dateFormat,
|
||||
note: this.foreclosureForm.value.note
|
||||
};
|
||||
|
||||
+8
-3
@@ -5,6 +5,9 @@ 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';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-loan-reschedule',
|
||||
templateUrl: './loan-reschedule.component.html',
|
||||
@@ -32,12 +35,14 @@ export class LoanRescheduleComponent implements OnInit {
|
||||
* @param {LoansService} systemService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe) {
|
||||
private datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -65,7 +70,7 @@ export class LoanRescheduleComponent implements OnInit {
|
||||
const rescheduleFromDate = this.rescheduleLoanForm.value.rescheduleFromDate;
|
||||
const adjustedDueDate = this.rescheduleLoanForm.value.adjustedDueDate;
|
||||
const submittedOnDate = this.rescheduleLoanForm.value.submittedOnDate;
|
||||
const dateFormat = 'dd MMMM yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
|
||||
this.rescheduleLoanForm.patchValue({
|
||||
rescheduleFromDate: this.datePipe.transform(rescheduleFromDate, dateFormat),
|
||||
@@ -73,7 +78,7 @@ export class LoanRescheduleComponent implements OnInit {
|
||||
submittedOnDate: this.datePipe.transform(submittedOnDate, dateFormat)
|
||||
});
|
||||
const rescheduleForm = this.rescheduleLoanForm.value;
|
||||
rescheduleForm.locale = 'en';
|
||||
rescheduleForm.locale = this.settingsService.language.code;
|
||||
rescheduleForm.dateFormat = dateFormat;
|
||||
rescheduleForm.loanId = this.loanId;
|
||||
this.loanService.submitRescheduleData(rescheduleForm).subscribe((response: any) => {
|
||||
|
||||
+8
-3
@@ -5,6 +5,9 @@ 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';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-loans-account-close',
|
||||
templateUrl: './loans-account-close.component.html',
|
||||
@@ -28,12 +31,14 @@ export class LoansAccountCloseComponent implements OnInit {
|
||||
* @param {LoansService} systemService Loan Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loanService: LoansService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private datePipe: DatePipe) {
|
||||
private datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -60,12 +65,12 @@ export class LoansAccountCloseComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const transactionDate = this.closeLoanForm.value.transactionDate;
|
||||
const dateFormat = 'yyyy-MM-dd';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.closeLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||
});
|
||||
const closeForm = this.closeLoanForm.value;
|
||||
closeForm.locale = 'en';
|
||||
closeForm.locale = this.settingsService.language.code;
|
||||
closeForm.dateFormat = dateFormat;
|
||||
this.loanService.submitLoanActionButton(this.loanId, closeForm, 'close')
|
||||
.subscribe((response: any) => {
|
||||
|
||||
+6
-3
@@ -6,6 +6,7 @@ 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';
|
||||
|
||||
/**
|
||||
* Loan Make Repayment Component
|
||||
@@ -37,12 +38,14 @@ export class MakeRepaymentComponent implements OnInit {
|
||||
* @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 datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -99,12 +102,12 @@ export class MakeRepaymentComponent implements OnInit {
|
||||
submit() {
|
||||
const prevTransactionDate: Date = this.repaymentLoanForm.value.transactionDate;
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = 'dd-MM-yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.repaymentLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const repaymentLoanData = this.repaymentLoanForm.value;
|
||||
repaymentLoanData.locale = 'en';
|
||||
repaymentLoanData.locale = this.settingsService.language.code;
|
||||
repaymentLoanData.dateFormat = dateFormat;
|
||||
this.loanService.submitLoanActionButton(this.loanId, repaymentLoanData, 'repayment')
|
||||
.subscribe((response: any) => {
|
||||
|
||||
@@ -6,6 +6,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';
|
||||
|
||||
|
||||
/**
|
||||
* Loan Prepay Loan Option
|
||||
@@ -41,12 +43,14 @@ export class PrepayLoanComponent implements OnInit {
|
||||
* @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 datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -111,12 +115,12 @@ export class PrepayLoanComponent implements OnInit {
|
||||
submit() {
|
||||
const prevTransactionDate: Date = this.prepayLoanForm.value.transactionDate;
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = 'dd-MM-yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.prepayLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const prepayLoanData = this.prepayLoanForm.value;
|
||||
prepayLoanData.locale = 'en';
|
||||
prepayLoanData.locale = this.settingsService.language.code;
|
||||
prepayLoanData.dateFormat = dateFormat;
|
||||
this.loanService.submitLoanActionButton(this.loanId, prepayLoanData, 'repayment')
|
||||
.subscribe((response: any) => {
|
||||
|
||||
+6
-3
@@ -6,6 +6,7 @@ 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';
|
||||
|
||||
/**
|
||||
* Loan Recovery Repayment Action
|
||||
@@ -37,12 +38,14 @@ export class RecoveryRepaymentComponent implements OnInit {
|
||||
* @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 datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -100,12 +103,12 @@ export class RecoveryRepaymentComponent implements OnInit {
|
||||
submit() {
|
||||
const prevTransactionDate: Date = this.recoveryRepaymentLoanForm.value.transactionDate;
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = 'dd-MM-yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.recoveryRepaymentLoanForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const recoveryRepaymentLoanData = this.recoveryRepaymentLoanForm.value;
|
||||
recoveryRepaymentLoanData.locale = 'en';
|
||||
recoveryRepaymentLoanData.locale = this.settingsService.language.code;
|
||||
recoveryRepaymentLoanData.dateFormat = dateFormat;
|
||||
this.loanService.submitLoanActionButton(this.loanId, recoveryRepaymentLoanData, 'recoverypayment')
|
||||
.subscribe((response: any) => {
|
||||
|
||||
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom services. */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
/**
|
||||
* Reject Loan component.
|
||||
@@ -32,12 +33,14 @@ export class RejectLoanComponent implements OnInit {
|
||||
* @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 datePipe: DatePipe,
|
||||
private settingsService: SettingsService ) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -60,12 +63,12 @@ export class RejectLoanComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const rejectedOnDate = this.rejectLoanForm.value.rejectedOnDate;
|
||||
const dateFormat = 'yyyy-MM-dd';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.rejectLoanForm.patchValue({
|
||||
rejectedOnDate: this.datePipe.transform(rejectedOnDate, dateFormat)
|
||||
});
|
||||
const rejectForm = this.rejectLoanForm.value;
|
||||
rejectForm.locale = 'en';
|
||||
rejectForm.locale = this.settingsService.language.code;
|
||||
rejectForm.dateFormat = dateFormat;
|
||||
this.loanService.loanActionButtons(this.loanId, 'reject', rejectForm).subscribe((response: any) => {
|
||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||
|
||||
+6
-3
@@ -6,6 +6,7 @@ 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';
|
||||
|
||||
/**
|
||||
* Withdrawn By Applicant Loan Form
|
||||
@@ -33,12 +34,14 @@ export class WithdrawnByClientComponent implements OnInit {
|
||||
* @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 datePipe: DatePipe,
|
||||
private settingsService: SettingsService) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
@@ -64,12 +67,12 @@ export class WithdrawnByClientComponent implements OnInit {
|
||||
submit() {
|
||||
const prevTransactionDate: Date = this.withdrawnByClientLoanForm.value.withdrawnOnDate;
|
||||
// TODO: Update once language and date settings are setup
|
||||
const dateFormat = 'dd-MM-yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.withdrawnByClientLoanForm.patchValue({
|
||||
withdrawnOnDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||
});
|
||||
const WithdrawnByClientLoanData = this.withdrawnByClientLoanForm.value;
|
||||
WithdrawnByClientLoanData.locale = 'en';
|
||||
WithdrawnByClientLoanData.locale = this.settingsService.language.code;
|
||||
WithdrawnByClientLoanData.dateFormat = dateFormat;
|
||||
this.loanService.loanActionButtons(this.loanId, 'withdrawnByApplicant', WithdrawnByClientLoanData)
|
||||
.subscribe((response: any) => {
|
||||
|
||||
+7
-3
@@ -6,6 +6,8 @@ import { DatePipe } from '@angular/common';
|
||||
|
||||
/** Custom Services. */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { SettingsService } from 'app/settings/settings.service';
|
||||
|
||||
/**
|
||||
* Write Off component.
|
||||
*/
|
||||
@@ -33,12 +35,14 @@ export class WriteOffPageComponent implements OnInit {
|
||||
* @param {LoansService} loanService Loan Service.
|
||||
* @param {DatePipe} datePipe Date Pipe.
|
||||
* @param {Router} router Router.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private loanService: LoansService,
|
||||
private datePipe: DatePipe,
|
||||
private router: Router) { }
|
||||
private router: Router,
|
||||
private settingsService: SettingsService) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.setWriteOffForm();
|
||||
@@ -60,14 +64,14 @@ export class WriteOffPageComponent implements OnInit {
|
||||
*/
|
||||
submit() {
|
||||
const transactionDate = this.writeOffForm.value.transactionDate;
|
||||
const dateFormat = 'dd MMMM yyyy';
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
this.writeOffForm.patchValue({
|
||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||
});
|
||||
const loanId = this.route.parent.snapshot.params['loanId'];
|
||||
const writeOffForm = this.writeOffForm.value;
|
||||
delete writeOffForm.amount;
|
||||
writeOffForm.locale = 'en';
|
||||
writeOffForm.locale = this.settingsService.language.code;
|
||||
writeOffForm.dateFormat = dateFormat;
|
||||
this.loanService.submitLoanActionButton(loanId, writeOffForm, 'writeoff').subscribe((response: any) => {
|
||||
this.router.navigate(['../../../general'], {relativeTo: this.route});
|
||||
|
||||
Reference in New Issue
Block a user