@@ -5,6 +5,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from '../loans.service';
|
import { LoansService } from '../loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Step Components */
|
/** Step Components */
|
||||||
import { LoansAccountDetailsStepComponent } from '../loans-account-stepper/loans-account-details-step/loans-account-details-step.component';
|
import { LoansAccountDetailsStepComponent } from '../loans-account-stepper/loans-account-details-step/loans-account-details-step.component';
|
||||||
@@ -39,11 +40,13 @@ export class CreateLoansAccountComponent implements OnInit {
|
|||||||
* @param {router} Router Router.
|
* @param {router} Router Router.
|
||||||
* @param {datePipe} DatePipe Date Pipe
|
* @param {datePipe} DatePipe Date Pipe
|
||||||
* @param {loansService} LoansService Loans Service
|
* @param {loansService} LoansService Loans Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private loansService: LoansService
|
private loansService: LoansService,
|
||||||
|
private settingsService: SettingsService
|
||||||
) {
|
) {
|
||||||
this.route.data.subscribe((data: { loansAccountTemplate: any }) => {
|
this.route.data.subscribe((data: { loansAccountTemplate: any }) => {
|
||||||
this.loansAccountTemplate = data.loansAccountTemplate;
|
this.loansAccountTemplate = data.loansAccountTemplate;
|
||||||
@@ -95,8 +98,8 @@ export class CreateLoansAccountComponent implements OnInit {
|
|||||||
* Submits Data to create loan account
|
* Submits Data to create loan account
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const loanType = 'individual';
|
const loanType = 'individual';
|
||||||
const loansAccountData = {
|
const loansAccountData = {
|
||||||
...this.loansAccount,
|
...this.loansAccount,
|
||||||
|
|||||||
@@ -6,6 +6,12 @@ import { LoansAccountDetailsStepComponent } from '../loans-account-stepper/loans
|
|||||||
import { LoansAccountTermsStepComponent } from '../loans-account-stepper/loans-account-terms-step/loans-account-terms-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 { LoansAccountChargesStepComponent } from '../loans-account-stepper/loans-account-charges-step/loans-account-charges-step.component';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit Loans
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-edit-loans-account',
|
selector: 'mifosx-edit-loans-account',
|
||||||
templateUrl: './edit-loans-account.component.html',
|
templateUrl: './edit-loans-account.component.html',
|
||||||
@@ -31,11 +37,13 @@ export class EditLoansAccountComponent implements OnInit {
|
|||||||
* @param {router} Router Router.
|
* @param {router} Router Router.
|
||||||
* @param {datePipe} DatePipe Date Pipe
|
* @param {datePipe} DatePipe Date Pipe
|
||||||
* @param {loansService} LoansService Loans Service
|
* @param {loansService} LoansService Loans Service
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private loansService: LoansService
|
private loansService: LoansService,
|
||||||
|
private settingsService: SettingsService
|
||||||
) {
|
) {
|
||||||
this.route.data.subscribe((data: { loansAccountAndTemplate: any }) => {
|
this.route.data.subscribe((data: { loansAccountAndTemplate: any }) => {
|
||||||
this.loansAccountAndTemplate = data.loansAccountAndTemplate;
|
this.loansAccountAndTemplate = data.loansAccountAndTemplate;
|
||||||
@@ -93,8 +101,8 @@ export class EditLoansAccountComponent implements OnInit {
|
|||||||
* Submits Data to create loan account
|
* Submits Data to create loan account
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const loanType = 'individual';
|
const loanType = 'individual';
|
||||||
const loansAccountData = {
|
const loansAccountData = {
|
||||||
...this.loansAccount,
|
...this.loansAccount,
|
||||||
|
|||||||
+5
-2
@@ -13,6 +13,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
|
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||||
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recurring Deposit Account Charges Step
|
* Recurring Deposit Account Charges Step
|
||||||
@@ -54,9 +55,11 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
|
|||||||
* Loans Account Charges Form Step
|
* Loans Account Charges Form Step
|
||||||
* @param {dialog} MatDialog Mat Dialog
|
* @param {dialog} MatDialog Mat Dialog
|
||||||
* @param {datePipe} DatePipe DatePipe
|
* @param {datePipe} DatePipe DatePipe
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(public dialog: MatDialog,
|
constructor(public dialog: MatDialog,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -139,7 +142,7 @@ export class LoansAccountChargesStepComponent implements OnInit, OnChanges {
|
|||||||
editNoteDialogRef.afterClosed().subscribe((response: any) => {
|
editNoteDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
let newCharge: any;
|
let newCharge: any;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const date = this.datePipe.transform(response.data.value.date, dateFormat);
|
const date = this.datePipe.transform(response.data.value.date, dateFormat);
|
||||||
switch (charge.chargeTimeType.value) {
|
switch (charge.chargeTimeType.value) {
|
||||||
case 'Specified due date':
|
case 'Specified due date':
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Dialogs */
|
/** Custom Dialogs */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
@@ -46,12 +47,14 @@ export class ChargesTabComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Retrieves the loans data from `resolve`.
|
* Retrieves the loans data from `resolve`.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private loansService: LoansService,
|
constructor(private loansService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.parent.data.subscribe(( data: { loanDetailsData: any }) => {
|
this.route.parent.data.subscribe(( data: { loanDetailsData: any }) => {
|
||||||
this.loanDetails = data.loanDetailsData;
|
this.loanDetails = data.loanDetailsData;
|
||||||
});
|
});
|
||||||
@@ -105,7 +108,7 @@ export class ChargesTabComponent implements OnInit {
|
|||||||
payChargeDialogRef.afterClosed().subscribe((response: any) => {
|
payChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
const locale = 'en';
|
const locale = 'en';
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dataObject = {
|
const dataObject = {
|
||||||
...response.data.value,
|
...response.data.value,
|
||||||
dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat),
|
dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat),
|
||||||
@@ -158,8 +161,8 @@ export class ChargesTabComponent implements OnInit {
|
|||||||
const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||||
editChargeDialogRef.afterClosed().subscribe((response: any) => {
|
editChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dataObject = {
|
const dataObject = {
|
||||||
...response.data.value,
|
...response.data.value,
|
||||||
dateFormat,
|
dateFormat,
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
/** Custom Dialogs */
|
/** Custom Dialogs */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
import { DeleteDialogComponent } from '../../../../shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from '../../../../shared/delete-dialog/delete-dialog.component';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Models */
|
/** Custom Models */
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||||
@@ -52,11 +53,13 @@ export class MultiRowComponent implements OnInit, OnChanges {
|
|||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
* @param {LoansService} loansService Loans Service.
|
* @param {LoansService} loansService Loans Service.
|
||||||
* @param {MatDialog} dialog Mat Dialog.
|
* @param {MatDialog} dialog Mat Dialog.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private loansService: LoansService,
|
private loansService: LoansService,
|
||||||
private dialog: MatDialog) {
|
private dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.parent.snapshot.paramMap.get('loanId');
|
this.loanId = this.route.parent.parent.snapshot.paramMap.get('loanId');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +121,7 @@ export class MultiRowComponent implements OnInit, OnChanges {
|
|||||||
});
|
});
|
||||||
case 'DATE': {
|
case 'DATE': {
|
||||||
dateTransformColumns.push(column.columnName);
|
dateTransformColumns.push(column.columnName);
|
||||||
dataTableEntryObject.dateFormat = 'yyyy-MM-dd';
|
dataTableEntryObject.dateFormat = this.settingsService.dateFormat;
|
||||||
return new DatepickerBase({
|
return new DatepickerBase({
|
||||||
controlName: column.columnName,
|
controlName: column.columnName,
|
||||||
label: column.columnName,
|
label: column.columnName,
|
||||||
@@ -129,7 +132,7 @@ export class MultiRowComponent implements OnInit, OnChanges {
|
|||||||
}
|
}
|
||||||
case 'DATETIME': {
|
case 'DATETIME': {
|
||||||
dateTransformColumns.push(column.columnName);
|
dateTransformColumns.push(column.columnName);
|
||||||
dataTableEntryObject.dateFormat = 'yyyy-MM-dd HH:mm';
|
dataTableEntryObject.dateFormat = this.settingsService.dateFormat;
|
||||||
return new DatepickerBase({
|
return new DatepickerBase({
|
||||||
controlName: column.columnName,
|
controlName: column.columnName,
|
||||||
label: column.columnName,
|
label: column.columnName,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
/** Custom Components */
|
/** Custom Components */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
import { DeleteDialogComponent } from '../../../../shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from '../../../../shared/delete-dialog/delete-dialog.component';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Models */
|
/** Custom Models */
|
||||||
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
|
||||||
@@ -40,11 +41,13 @@ export class SingleRowComponent implements OnInit {
|
|||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
* @param {LoansService} loansService Loans Service.
|
* @param {LoansService} loansService Loans Service.
|
||||||
* @param {MatDialog} dialog Mat Dialog.
|
* @param {MatDialog} dialog Mat Dialog.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private loansService: LoansService) {
|
private loansService: LoansService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.parent.snapshot.paramMap.get('loanId');
|
this.loanId = this.route.parent.parent.snapshot.paramMap.get('loanId');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +65,7 @@ export class SingleRowComponent implements OnInit {
|
|||||||
* Creates a new instance of the given single row data table.
|
* Creates a new instance of the given single row data table.
|
||||||
*/
|
*/
|
||||||
add() {
|
add() {
|
||||||
let dataTableEntryObject: any = { locale: 'en' };
|
let dataTableEntryObject: any = { locale: this.settingsService.language.code };
|
||||||
const dateTransformColumns: string[] = [];
|
const dateTransformColumns: string[] = [];
|
||||||
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
||||||
return ((column.columnName !== 'id') && (column.columnName !== 'loan_id'));
|
return ((column.columnName !== 'id') && (column.columnName !== 'loan_id'));
|
||||||
@@ -92,7 +95,7 @@ export class SingleRowComponent implements OnInit {
|
|||||||
* Edits the current instance of single row data table.
|
* Edits the current instance of single row data table.
|
||||||
*/
|
*/
|
||||||
edit() {
|
edit() {
|
||||||
let dataTableEntryObject: any = { locale: 'en' };
|
let dataTableEntryObject: any = { locale: this.settingsService.language.code };
|
||||||
const dateTransformColumns: string[] = [];
|
const dateTransformColumns: string[] = [];
|
||||||
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
const columns = this.dataObject.columnHeaders.filter((column: any) => {
|
||||||
return ((column.columnName !== 'id') && (column.columnName !== 'loan_id'));
|
return ((column.columnName !== 'id') && (column.columnName !== 'loan_id'));
|
||||||
@@ -177,7 +180,7 @@ export class SingleRowComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
case 'DATE': {
|
case 'DATE': {
|
||||||
dateTransformColumns.push(column.columnName);
|
dateTransformColumns.push(column.columnName);
|
||||||
dataTableEntryObject.dateFormat = 'yyyy-MM-dd';
|
dataTableEntryObject.dateFormat = this.settingsService.dateFormat;
|
||||||
return new DatepickerBase({
|
return new DatepickerBase({
|
||||||
controlName: column.columnName,
|
controlName: column.columnName,
|
||||||
label: column.columnName,
|
label: column.columnName,
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from '../../../loans.service';
|
import { LoansService } from '../../../loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Add Loan Charge component.
|
* Create Add Loan Charge component.
|
||||||
@@ -48,12 +49,14 @@ export class AddLoanChargeComponent implements OnInit {
|
|||||||
* @param {AccountingService} accountingService Accounting Service.
|
* @param {AccountingService} accountingService Accounting Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private loansService: LoansService) {
|
private loansService: LoansService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { actionButtonData: any }) => {
|
this.route.data.subscribe((data: { actionButtonData: any }) => {
|
||||||
this.loanChargeOptions = data.actionButtonData.chargeOptions;
|
this.loanChargeOptions = data.actionButtonData.chargeOptions;
|
||||||
});
|
});
|
||||||
@@ -97,12 +100,12 @@ export class AddLoanChargeComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevDueDate: Date = this.loanChargeForm.value.dueDate;
|
const prevDueDate: Date = this.loanChargeForm.value.dueDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.loanChargeForm.patchValue({
|
this.loanChargeForm.patchValue({
|
||||||
dueDate: this.datePipe.transform(prevDueDate, dateFormat)
|
dueDate: this.datePipe.transform(prevDueDate, dateFormat)
|
||||||
});
|
});
|
||||||
const loanCharge = this.loanChargeForm.value;
|
const loanCharge = this.loanChargeForm.value;
|
||||||
loanCharge.locale = 'en';
|
loanCharge.locale = this.settingsService.language.code;
|
||||||
loanCharge.dateFormat = dateFormat;
|
loanCharge.dateFormat = dateFormat;
|
||||||
this.loansService.createLoanCharge(this.loanId, 'charges', loanCharge).subscribe(res => {
|
this.loansService.createLoanCharge(this.loanId, 'charges', loanCharge).subscribe(res => {
|
||||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||||
|
|||||||
+6
-3
@@ -7,6 +7,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services. */
|
/** Custom Services. */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Approve Loan component.
|
* Approve Loan component.
|
||||||
@@ -36,12 +37,14 @@ export class ApproveLoanComponent implements OnInit {
|
|||||||
* @param datePipe Date Pipe.
|
* @param datePipe Date Pipe.
|
||||||
* @param loanService Loan Service.
|
* @param loanService Loan Service.
|
||||||
* @param router Router.
|
* @param router Router.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private router: Router) {
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { actionButtonData: any }) => {
|
this.route.data.subscribe((data: { actionButtonData: any }) => {
|
||||||
this.loanData = data.actionButtonData;
|
this.loanData = data.actionButtonData;
|
||||||
});
|
});
|
||||||
@@ -74,8 +77,8 @@ export class ApproveLoanComponent implements OnInit {
|
|||||||
* Submits Approve form.
|
* Submits Approve form.
|
||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const local = this.settingsService.language.code;
|
||||||
const local = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const approvedOnDate = this.approveLoanForm.value.approvedOnDate;
|
const approvedOnDate = this.approveLoanForm.value.approvedOnDate;
|
||||||
const expectedDisbursementDate = this.approveLoanForm.value.expectedDisbursementDate;
|
const expectedDisbursementDate = this.approveLoanForm.value.expectedDisbursementDate;
|
||||||
this.approveLoanForm.patchValue({
|
this.approveLoanForm.patchValue({
|
||||||
|
|||||||
+8
-3
@@ -5,6 +5,9 @@ import { MatDialog } from '@angular/material/dialog';
|
|||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
import { FormGroup, FormBuilder, Validators } from '@angular/forms';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-assign-loan-officer',
|
selector: 'mifosx-assign-loan-officer',
|
||||||
templateUrl: './assign-loan-officer.component.html',
|
templateUrl: './assign-loan-officer.component.html',
|
||||||
@@ -28,12 +31,14 @@ export class AssignLoanOfficerComponent implements OnInit {
|
|||||||
* @param {LoansService} systemService Loan Service.
|
* @param {LoansService} systemService Loan Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,12 +62,12 @@ export class AssignLoanOfficerComponent implements OnInit {
|
|||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
const assignmentDate = this.assignOfficerForm.value.assignmentDate;
|
const assignmentDate = this.assignOfficerForm.value.assignmentDate;
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.assignOfficerForm.patchValue({
|
this.assignOfficerForm.patchValue({
|
||||||
assignmentDate: this.datePipe.transform(assignmentDate, dateFormat)
|
assignmentDate: this.datePipe.transform(assignmentDate, dateFormat)
|
||||||
});
|
});
|
||||||
const assignForm = this.assignOfficerForm.value;
|
const assignForm = this.assignOfficerForm.value;
|
||||||
assignForm.locale = 'en';
|
assignForm.locale = this.settingsService.language.code;
|
||||||
assignForm.dateFormat = dateFormat;
|
assignForm.dateFormat = dateFormat;
|
||||||
assignForm.fromLoanOfficerId = this.dataObject.loanOfficerId || '';
|
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 { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-close-as-rescheduled',
|
selector: 'mifosx-close-as-rescheduled',
|
||||||
templateUrl: './close-as-rescheduled.component.html',
|
templateUrl: './close-as-rescheduled.component.html',
|
||||||
@@ -27,12 +30,14 @@ export class CloseAsRescheduledComponent implements OnInit {
|
|||||||
* @param {LoansService} systemService Loan Service.
|
* @param {LoansService} systemService Loan Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,12 +64,12 @@ export class CloseAsRescheduledComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const transactionDate = this.closeLoanForm.value.transactionDate;
|
const transactionDate = this.closeLoanForm.value.transactionDate;
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.closeLoanForm.patchValue({
|
this.closeLoanForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const closeForm = this.closeLoanForm.value;
|
const closeForm = this.closeLoanForm.value;
|
||||||
closeForm.locale = 'en';
|
closeForm.locale = this.settingsService.language.code;
|
||||||
closeForm.dateFormat = dateFormat;
|
closeForm.dateFormat = dateFormat;
|
||||||
this.loanService.submitLoanActionButton(this.loanId, closeForm, 'close-rescheduled')
|
this.loanService.submitLoanActionButton(this.loanId, closeForm, 'close-rescheduled')
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
|
|||||||
+6
-3
@@ -7,6 +7,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { ClientsService } from 'app/clients/clients.service';
|
import { ClientsService } from 'app/clients/clients.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create Guarantor Action
|
* Create Guarantor Action
|
||||||
@@ -42,13 +43,15 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private clientsService: ClientsService) {
|
private clientsService: ClientsService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
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 prevdob: Date = this.newGuarantorForm.value.dob;
|
||||||
const guarantorTypeId: number = this.newGuarantorForm.value.existingClient ? this.dataObject.guarantorTypeOptions[0].id : this.dataObject.guarantorTypeOptions[2].id;
|
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
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'dd-MM-yyyy';
|
const locale = this.settingsService.language.code;
|
||||||
const locale = 'en';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const newGuarantorData = {
|
const newGuarantorData = {
|
||||||
... this.newGuarantorForm.value,
|
... this.newGuarantorForm.value,
|
||||||
locale,
|
locale,
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Service. */
|
/** Custom Service. */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disburse To Savings component.
|
* Disburse To Savings component.
|
||||||
@@ -33,12 +34,14 @@ export class DisburseLoanAccountComponent implements OnInit {
|
|||||||
* @param {Router} router Router.
|
* @param {Router} router Router.
|
||||||
* @param {DatePipe} datePipe DatePipe.
|
* @param {DatePipe} datePipe DatePipe.
|
||||||
* @param {LoansService} loanService Loan Service.
|
* @param {LoansService} loanService Loan Service.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private loanService: LoansService) { }
|
private loanService: LoansService,
|
||||||
|
private settingsService: SettingsService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.setDisbursementToSavingsForm();
|
this.setDisbursementToSavingsForm();
|
||||||
@@ -63,13 +66,13 @@ export class DisburseLoanAccountComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const actualDisbursementDate = this.disbursementForm.value.actualDisbursementDate;
|
const actualDisbursementDate = this.disbursementForm.value.actualDisbursementDate;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.disbursementForm.patchValue({
|
this.disbursementForm.patchValue({
|
||||||
actualDisbursementDate: this.datePipe.transform(actualDisbursementDate, dateFormat)
|
actualDisbursementDate: this.datePipe.transform(actualDisbursementDate, dateFormat)
|
||||||
});
|
});
|
||||||
const loanId = this.route.parent.snapshot.params['loanId'];
|
const loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
const disbursementForm = this.disbursementForm.value;
|
const disbursementForm = this.disbursementForm.value;
|
||||||
disbursementForm.locale = 'en';
|
disbursementForm.locale = this.settingsService.language.code;
|
||||||
disbursementForm.dateFormat = dateFormat;
|
disbursementForm.dateFormat = dateFormat;
|
||||||
this.loanService.loanActionButtons(loanId, 'disbursetosavings', disbursementForm).subscribe((response: any) => {
|
this.loanService.loanActionButtons(loanId, 'disbursetosavings', disbursementForm).subscribe((response: any) => {
|
||||||
this.router.navigate(['../../general'], {relativeTo: this.route});
|
this.router.navigate(['../../general'], {relativeTo: this.route});
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Disburse Loan Option
|
* Disburse Loan Option
|
||||||
@@ -37,12 +38,14 @@ export class DisburseComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,12 +103,12 @@ export class DisburseComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevActualDisbursementDate: Date = this.disbursementLoanForm.value.actualDisbursementDate;
|
const prevActualDisbursementDate: Date = this.disbursementLoanForm.value.actualDisbursementDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'dd-MM-yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.disbursementLoanForm.patchValue({
|
this.disbursementLoanForm.patchValue({
|
||||||
actualDisbursementDate: this.datePipe.transform(prevActualDisbursementDate, dateFormat)
|
actualDisbursementDate: this.datePipe.transform(prevActualDisbursementDate, dateFormat)
|
||||||
});
|
});
|
||||||
const disbursementLoanData = this.disbursementLoanForm.value;
|
const disbursementLoanData = this.disbursementLoanForm.value;
|
||||||
disbursementLoanData.locale = 'en';
|
disbursementLoanData.locale = this.settingsService.language.code;
|
||||||
disbursementLoanData.dateFormat = dateFormat;
|
disbursementLoanData.dateFormat = dateFormat;
|
||||||
this.loanService.loanActionButtons(this.loanId, 'disburse', disbursementLoanData )
|
this.loanService.loanActionButtons(this.loanId, 'disburse', disbursementLoanData )
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
|
|||||||
@@ -4,6 +4,9 @@ import { LoansService } from 'app/loans/loans.service';
|
|||||||
import { ActivatedRoute, Router } from '@angular/router';
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-foreclosure',
|
selector: 'mifosx-foreclosure',
|
||||||
templateUrl: './foreclosure.component.html',
|
templateUrl: './foreclosure.component.html',
|
||||||
@@ -27,12 +30,14 @@ export class ForeclosureComponent implements OnInit {
|
|||||||
* @param {LoansService} systemService Loan Service.
|
* @param {LoansService} systemService Loan Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,12 +67,12 @@ export class ForeclosureComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
retrieveLoanForeclosureTemplate(val: any) {
|
retrieveLoanForeclosureTemplate(val: any) {
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const transactionDateFormatted = this.datePipe.transform(val, dateFormat);
|
const transactionDateFormatted = this.datePipe.transform(val, dateFormat);
|
||||||
const data = {
|
const data = {
|
||||||
command: 'foreclosure',
|
command: 'foreclosure',
|
||||||
dateFormat: 'dd MMMM yyyy',
|
dateFormat: this.settingsService.dateFormat,
|
||||||
locale: 'en',
|
locale: this.settingsService.language.code,
|
||||||
transactionDate: transactionDateFormatted
|
transactionDate: transactionDateFormatted
|
||||||
};
|
};
|
||||||
this.loanService.getForeclosureData(this.loanId, data)
|
this.loanService.getForeclosureData(this.loanId, data)
|
||||||
@@ -104,13 +109,13 @@ export class ForeclosureComponent implements OnInit {
|
|||||||
|
|
||||||
submit() {
|
submit() {
|
||||||
const transactionDate = this.foreclosureForm.value.transactionDate;
|
const transactionDate = this.foreclosureForm.value.transactionDate;
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.foreclosureForm.patchValue({
|
this.foreclosureForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const formData = {
|
const formData = {
|
||||||
transactionDate: this.foreclosureForm.value.transactionDate,
|
transactionDate: this.foreclosureForm.value.transactionDate,
|
||||||
locale: 'en',
|
locale: this.settingsService.language.code,
|
||||||
dateFormat: dateFormat,
|
dateFormat: dateFormat,
|
||||||
note: this.foreclosureForm.value.note
|
note: this.foreclosureForm.value.note
|
||||||
};
|
};
|
||||||
|
|||||||
+8
-3
@@ -5,6 +5,9 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
import { subscribeOn } from 'rxjs/operators';
|
import { subscribeOn } from 'rxjs/operators';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-loan-reschedule',
|
selector: 'mifosx-loan-reschedule',
|
||||||
templateUrl: './loan-reschedule.component.html',
|
templateUrl: './loan-reschedule.component.html',
|
||||||
@@ -32,12 +35,14 @@ export class LoanRescheduleComponent implements OnInit {
|
|||||||
* @param {LoansService} systemService Loan Service.
|
* @param {LoansService} systemService Loan Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -65,7 +70,7 @@ export class LoanRescheduleComponent implements OnInit {
|
|||||||
const rescheduleFromDate = this.rescheduleLoanForm.value.rescheduleFromDate;
|
const rescheduleFromDate = this.rescheduleLoanForm.value.rescheduleFromDate;
|
||||||
const adjustedDueDate = this.rescheduleLoanForm.value.adjustedDueDate;
|
const adjustedDueDate = this.rescheduleLoanForm.value.adjustedDueDate;
|
||||||
const submittedOnDate = this.rescheduleLoanForm.value.submittedOnDate;
|
const submittedOnDate = this.rescheduleLoanForm.value.submittedOnDate;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
|
||||||
this.rescheduleLoanForm.patchValue({
|
this.rescheduleLoanForm.patchValue({
|
||||||
rescheduleFromDate: this.datePipe.transform(rescheduleFromDate, dateFormat),
|
rescheduleFromDate: this.datePipe.transform(rescheduleFromDate, dateFormat),
|
||||||
@@ -73,7 +78,7 @@ export class LoanRescheduleComponent implements OnInit {
|
|||||||
submittedOnDate: this.datePipe.transform(submittedOnDate, dateFormat)
|
submittedOnDate: this.datePipe.transform(submittedOnDate, dateFormat)
|
||||||
});
|
});
|
||||||
const rescheduleForm = this.rescheduleLoanForm.value;
|
const rescheduleForm = this.rescheduleLoanForm.value;
|
||||||
rescheduleForm.locale = 'en';
|
rescheduleForm.locale = this.settingsService.language.code;
|
||||||
rescheduleForm.dateFormat = dateFormat;
|
rescheduleForm.dateFormat = dateFormat;
|
||||||
rescheduleForm.loanId = this.loanId;
|
rescheduleForm.loanId = this.loanId;
|
||||||
this.loanService.submitRescheduleData(rescheduleForm).subscribe((response: any) => {
|
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 { LoansService } from 'app/loans/loans.service';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-loans-account-close',
|
selector: 'mifosx-loans-account-close',
|
||||||
templateUrl: './loans-account-close.component.html',
|
templateUrl: './loans-account-close.component.html',
|
||||||
@@ -28,12 +31,14 @@ export class LoansAccountCloseComponent implements OnInit {
|
|||||||
* @param {LoansService} systemService Loan Service.
|
* @param {LoansService} systemService Loan Service.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,12 +65,12 @@ export class LoansAccountCloseComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const transactionDate = this.closeLoanForm.value.transactionDate;
|
const transactionDate = this.closeLoanForm.value.transactionDate;
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.closeLoanForm.patchValue({
|
this.closeLoanForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const closeForm = this.closeLoanForm.value;
|
const closeForm = this.closeLoanForm.value;
|
||||||
closeForm.locale = 'en';
|
closeForm.locale = this.settingsService.language.code;
|
||||||
closeForm.dateFormat = dateFormat;
|
closeForm.dateFormat = dateFormat;
|
||||||
this.loanService.submitLoanActionButton(this.loanId, closeForm, 'close')
|
this.loanService.submitLoanActionButton(this.loanId, closeForm, 'close')
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loan Make Repayment Component
|
* Loan Make Repayment Component
|
||||||
@@ -37,12 +38,14 @@ export class MakeRepaymentComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -99,12 +102,12 @@ export class MakeRepaymentComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevTransactionDate: Date = this.repaymentLoanForm.value.transactionDate;
|
const prevTransactionDate: Date = this.repaymentLoanForm.value.transactionDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'dd-MM-yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.repaymentLoanForm.patchValue({
|
this.repaymentLoanForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const repaymentLoanData = this.repaymentLoanForm.value;
|
const repaymentLoanData = this.repaymentLoanForm.value;
|
||||||
repaymentLoanData.locale = 'en';
|
repaymentLoanData.locale = this.settingsService.language.code;
|
||||||
repaymentLoanData.dateFormat = dateFormat;
|
repaymentLoanData.dateFormat = dateFormat;
|
||||||
this.loanService.submitLoanActionButton(this.loanId, repaymentLoanData, 'repayment')
|
this.loanService.submitLoanActionButton(this.loanId, repaymentLoanData, 'repayment')
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loan Prepay Loan Option
|
* Loan Prepay Loan Option
|
||||||
@@ -41,12 +43,14 @@ export class PrepayLoanComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,12 +115,12 @@ export class PrepayLoanComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevTransactionDate: Date = this.prepayLoanForm.value.transactionDate;
|
const prevTransactionDate: Date = this.prepayLoanForm.value.transactionDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'dd-MM-yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.prepayLoanForm.patchValue({
|
this.prepayLoanForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const prepayLoanData = this.prepayLoanForm.value;
|
const prepayLoanData = this.prepayLoanForm.value;
|
||||||
prepayLoanData.locale = 'en';
|
prepayLoanData.locale = this.settingsService.language.code;
|
||||||
prepayLoanData.dateFormat = dateFormat;
|
prepayLoanData.dateFormat = dateFormat;
|
||||||
this.loanService.submitLoanActionButton(this.loanId, prepayLoanData, 'repayment')
|
this.loanService.submitLoanActionButton(this.loanId, prepayLoanData, 'repayment')
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Loan Recovery Repayment Action
|
* Loan Recovery Repayment Action
|
||||||
@@ -37,12 +38,14 @@ export class RecoveryRepaymentComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,12 +103,12 @@ export class RecoveryRepaymentComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevTransactionDate: Date = this.recoveryRepaymentLoanForm.value.transactionDate;
|
const prevTransactionDate: Date = this.recoveryRepaymentLoanForm.value.transactionDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'dd-MM-yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.recoveryRepaymentLoanForm.patchValue({
|
this.recoveryRepaymentLoanForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const recoveryRepaymentLoanData = this.recoveryRepaymentLoanForm.value;
|
const recoveryRepaymentLoanData = this.recoveryRepaymentLoanForm.value;
|
||||||
recoveryRepaymentLoanData.locale = 'en';
|
recoveryRepaymentLoanData.locale = this.settingsService.language.code;
|
||||||
recoveryRepaymentLoanData.dateFormat = dateFormat;
|
recoveryRepaymentLoanData.dateFormat = dateFormat;
|
||||||
this.loanService.submitLoanActionButton(this.loanId, recoveryRepaymentLoanData, 'recoverypayment')
|
this.loanService.submitLoanActionButton(this.loanId, recoveryRepaymentLoanData, 'recoverypayment')
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom services. */
|
/** Custom services. */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reject Loan component.
|
* Reject Loan component.
|
||||||
@@ -32,12 +33,14 @@ export class RejectLoanComponent implements OnInit {
|
|||||||
* @param router Router.
|
* @param router Router.
|
||||||
* @param route Activated Route.
|
* @param route Activated Route.
|
||||||
* @param datePipe Date Pipe.
|
* @param datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private datePipe: DatePipe ) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService ) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,12 +63,12 @@ export class RejectLoanComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const rejectedOnDate = this.rejectLoanForm.value.rejectedOnDate;
|
const rejectedOnDate = this.rejectLoanForm.value.rejectedOnDate;
|
||||||
const dateFormat = 'yyyy-MM-dd';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.rejectLoanForm.patchValue({
|
this.rejectLoanForm.patchValue({
|
||||||
rejectedOnDate: this.datePipe.transform(rejectedOnDate, dateFormat)
|
rejectedOnDate: this.datePipe.transform(rejectedOnDate, dateFormat)
|
||||||
});
|
});
|
||||||
const rejectForm = this.rejectLoanForm.value;
|
const rejectForm = this.rejectLoanForm.value;
|
||||||
rejectForm.locale = 'en';
|
rejectForm.locale = this.settingsService.language.code;
|
||||||
rejectForm.dateFormat = dateFormat;
|
rejectForm.dateFormat = dateFormat;
|
||||||
this.loanService.loanActionButtons(this.loanId, 'reject', rejectForm).subscribe((response: any) => {
|
this.loanService.loanActionButtons(this.loanId, 'reject', rejectForm).subscribe((response: any) => {
|
||||||
this.router.navigate(['../../general'], { relativeTo: this.route });
|
this.router.navigate(['../../general'], { relativeTo: this.route });
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { ActivatedRoute, Router } from '@angular/router';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Withdrawn By Applicant Loan Form
|
* Withdrawn By Applicant Loan Form
|
||||||
@@ -33,12 +34,14 @@ export class WithdrawnByClientComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe) {
|
private datePipe: DatePipe,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,12 +67,12 @@ export class WithdrawnByClientComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevTransactionDate: Date = this.withdrawnByClientLoanForm.value.withdrawnOnDate;
|
const prevTransactionDate: Date = this.withdrawnByClientLoanForm.value.withdrawnOnDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'dd-MM-yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.withdrawnByClientLoanForm.patchValue({
|
this.withdrawnByClientLoanForm.patchValue({
|
||||||
withdrawnOnDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
withdrawnOnDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const WithdrawnByClientLoanData = this.withdrawnByClientLoanForm.value;
|
const WithdrawnByClientLoanData = this.withdrawnByClientLoanForm.value;
|
||||||
WithdrawnByClientLoanData.locale = 'en';
|
WithdrawnByClientLoanData.locale = this.settingsService.language.code;
|
||||||
WithdrawnByClientLoanData.dateFormat = dateFormat;
|
WithdrawnByClientLoanData.dateFormat = dateFormat;
|
||||||
this.loanService.loanActionButtons(this.loanId, 'withdrawnByApplicant', WithdrawnByClientLoanData)
|
this.loanService.loanActionButtons(this.loanId, 'withdrawnByApplicant', WithdrawnByClientLoanData)
|
||||||
.subscribe((response: any) => {
|
.subscribe((response: any) => {
|
||||||
|
|||||||
+7
-3
@@ -6,6 +6,8 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services. */
|
/** Custom Services. */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write Off component.
|
* Write Off component.
|
||||||
*/
|
*/
|
||||||
@@ -33,12 +35,14 @@ export class WriteOffPageComponent implements OnInit {
|
|||||||
* @param {LoansService} loanService Loan Service.
|
* @param {LoansService} loanService Loan Service.
|
||||||
* @param {DatePipe} datePipe Date Pipe.
|
* @param {DatePipe} datePipe Date Pipe.
|
||||||
* @param {Router} router Router.
|
* @param {Router} router Router.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private loanService: LoansService,
|
private loanService: LoansService,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private router: Router) { }
|
private router: Router,
|
||||||
|
private settingsService: SettingsService) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.setWriteOffForm();
|
this.setWriteOffForm();
|
||||||
@@ -60,14 +64,14 @@ export class WriteOffPageComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
submit() {
|
submit() {
|
||||||
const transactionDate = this.writeOffForm.value.transactionDate;
|
const transactionDate = this.writeOffForm.value.transactionDate;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.writeOffForm.patchValue({
|
this.writeOffForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(transactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const loanId = this.route.parent.snapshot.params['loanId'];
|
const loanId = this.route.parent.snapshot.params['loanId'];
|
||||||
const writeOffForm = this.writeOffForm.value;
|
const writeOffForm = this.writeOffForm.value;
|
||||||
delete writeOffForm.amount;
|
delete writeOffForm.amount;
|
||||||
writeOffForm.locale = 'en';
|
writeOffForm.locale = this.settingsService.language.code;
|
||||||
writeOffForm.dateFormat = dateFormat;
|
writeOffForm.dateFormat = dateFormat;
|
||||||
this.loanService.submitLoanActionButton(loanId, writeOffForm, 'writeoff').subscribe((response: any) => {
|
this.loanService.submitLoanActionButton(loanId, writeOffForm, 'writeoff').subscribe((response: any) => {
|
||||||
this.router.navigate(['../../../general'], {relativeTo: this.route});
|
this.router.navigate(['../../../general'], {relativeTo: this.route});
|
||||||
|
|||||||
+6
-3
@@ -7,6 +7,7 @@ import { ActivatedRoute } from '@angular/router';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { AccountTransfersService } from 'app/account-transfers/account-transfers.service';
|
import { AccountTransfersService } from 'app/account-transfers/account-transfers.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Dialog Components */
|
/** Dialog Components */
|
||||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||||
@@ -36,11 +37,13 @@ export class StandingInstructionsTabComponent implements OnInit {
|
|||||||
/**
|
/**
|
||||||
* Retrieves Loans Account Data from `resolve`.
|
* Retrieves Loans Account Data from `resolve`.
|
||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private loansService: LoansService,
|
private loansService: LoansService,
|
||||||
private dialog: MatDialog,
|
private dialog: MatDialog,
|
||||||
private accountTransfersService: AccountTransfersService) {
|
private accountTransfersService: AccountTransfersService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
|
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
|
||||||
this.loanDetailsData = data.loanDetailsData;
|
this.loanDetailsData = data.loanDetailsData;
|
||||||
});
|
});
|
||||||
@@ -57,8 +60,8 @@ export class StandingInstructionsTabComponent implements OnInit {
|
|||||||
const clientId = this.loanDetailsData.clientId;
|
const clientId = this.loanDetailsData.clientId;
|
||||||
const clientName = this.loanDetailsData.clientName;
|
const clientName = this.loanDetailsData.clientName;
|
||||||
const accountId = this.loanDetailsData.id;
|
const accountId = this.loanDetailsData.id;
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.loansService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => {
|
this.loansService.getStandingInstructions(clientId, clientName, accountId, locale, dateFormat).subscribe((response: any) => {
|
||||||
this.instructionsData = response.pageItems;
|
this.instructionsData = response.pageItems;
|
||||||
this.dataSource.data = this.instructionsData;
|
this.dataSource.data = this.instructionsData;
|
||||||
|
|||||||
+6
-3
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Edit Transaction component.
|
* Edit Transaction component.
|
||||||
@@ -45,12 +46,14 @@ export class EditTransactionComponent implements OnInit {
|
|||||||
* @param {ActivatedRoute} route Activated Route.
|
* @param {ActivatedRoute} route Activated Route.
|
||||||
* @param {DatePipe} datePipe DatePipe.
|
* @param {DatePipe} datePipe DatePipe.
|
||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private formBuilder: FormBuilder,
|
constructor(private formBuilder: FormBuilder,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private loansService: LoansService) {
|
private loansService: LoansService,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { loansAccountTransactionTemplate: any }) => {
|
this.route.data.subscribe((data: { loansAccountTransactionTemplate: any }) => {
|
||||||
this.transactionTemplateData = data.loansAccountTransactionTemplate;
|
this.transactionTemplateData = data.loansAccountTransactionTemplate;
|
||||||
this.paymentTypeOptions = this.transactionTemplateData.paymentTypeOptions;
|
this.paymentTypeOptions = this.transactionTemplateData.paymentTypeOptions;
|
||||||
@@ -107,12 +110,12 @@ export class EditTransactionComponent implements OnInit {
|
|||||||
submit() {
|
submit() {
|
||||||
const prevTransactionDate: Date = this.editTransactionForm.value.transactionDate;
|
const prevTransactionDate: Date = this.editTransactionForm.value.transactionDate;
|
||||||
// TODO: Update once language and date settings are setup
|
// TODO: Update once language and date settings are setup
|
||||||
const dateFormat = 'dd-MM-yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
this.editTransactionForm.patchValue({
|
this.editTransactionForm.patchValue({
|
||||||
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
transactionDate: this.datePipe.transform(prevTransactionDate, dateFormat)
|
||||||
});
|
});
|
||||||
const transactionData = this.editTransactionForm.value;
|
const transactionData = this.editTransactionForm.value;
|
||||||
transactionData.locale = 'en';
|
transactionData.locale = this.settingsService.language.code;
|
||||||
transactionData.dateFormat = dateFormat;
|
transactionData.dateFormat = dateFormat;
|
||||||
this.loansService.executeLoansAccountTransactionsCommand(this.loanAccountId, 'modify', transactionData, this.transactionTemplateData.id)
|
this.loansService.executeLoansAccountTransactionsCommand(this.loanAccountId, 'modify', transactionData, this.transactionTemplateData.id)
|
||||||
.subscribe((res: any) => {
|
.subscribe((res: any) => {
|
||||||
|
|||||||
+6
-3
@@ -7,6 +7,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
|
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Dialogs */
|
/** Custom Dialogs */
|
||||||
|
|
||||||
@@ -31,12 +32,14 @@ export class ViewTransactionComponent {
|
|||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {MatDialog} dialog Dialog reference.
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
* @param {DatePipe} datePipe DatePipe.
|
* @param {DatePipe} datePipe DatePipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private loansService: LoansService,
|
constructor(private loansService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { loansAccountTransaction: any }) => {
|
this.route.data.subscribe((data: { loansAccountTransaction: any }) => {
|
||||||
this.transactionData = data.loansAccountTransaction;
|
this.transactionData = data.loansAccountTransaction;
|
||||||
});
|
});
|
||||||
@@ -52,8 +55,8 @@ export class ViewTransactionComponent {
|
|||||||
});
|
});
|
||||||
undoTransactionAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
|
undoTransactionAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
|
||||||
if (response.confirm) {
|
if (response.confirm) {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const data = {
|
const data = {
|
||||||
transactionDate: this.datePipe.transform(this.transactionData.date && new Date(this.transactionData.date), dateFormat),
|
transactionDate: this.datePipe.transform(this.transactionData.date && new Date(this.transactionData.date), dateFormat),
|
||||||
transactionAmount: 0,
|
transactionAmount: 0,
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { DatePipe } from '@angular/common';
|
|||||||
|
|
||||||
/** Custom Services */
|
/** Custom Services */
|
||||||
import { LoansService } from 'app/loans/loans.service';
|
import { LoansService } from 'app/loans/loans.service';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
/** Custom Dialogs */
|
/** Custom Dialogs */
|
||||||
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
|
||||||
@@ -39,12 +40,14 @@ export class ViewChargeComponent {
|
|||||||
* @param {Router} router Router for navigation.
|
* @param {Router} router Router for navigation.
|
||||||
* @param {MatDialog} dialog Dialog reference.
|
* @param {MatDialog} dialog Dialog reference.
|
||||||
* @param {DatePipe} datePipe DatePipe.
|
* @param {DatePipe} datePipe DatePipe.
|
||||||
|
* @param {SettingsService} settingsService Settings Service
|
||||||
*/
|
*/
|
||||||
constructor(private loansService: LoansService,
|
constructor(private loansService: LoansService,
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private datePipe: DatePipe,
|
private datePipe: DatePipe,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public dialog: MatDialog) {
|
public dialog: MatDialog,
|
||||||
|
private settingsService: SettingsService) {
|
||||||
this.route.data.subscribe((data: { loansAccountCharge: any, loanDetailsData: any }) => {
|
this.route.data.subscribe((data: { loansAccountCharge: any, loanDetailsData: any }) => {
|
||||||
this.chargeData = data.loansAccountCharge;
|
this.chargeData = data.loansAccountCharge;
|
||||||
this.loansAccountData = data.loanDetailsData;
|
this.loansAccountData = data.loanDetailsData;
|
||||||
@@ -79,8 +82,8 @@ export class ViewChargeComponent {
|
|||||||
const payChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
const payChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||||
payChargeDialogRef.afterClosed().subscribe((response: any) => {
|
payChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dataObject = {
|
const dataObject = {
|
||||||
...response.data.value,
|
...response.data.value,
|
||||||
dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat),
|
dueDate: this.datePipe.transform(response.data.value.dueDate, dateFormat),
|
||||||
@@ -131,8 +134,8 @@ export class ViewChargeComponent {
|
|||||||
const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
const editChargeDialogRef = this.dialog.open(FormDialogComponent, { data });
|
||||||
editChargeDialogRef.afterClosed().subscribe((response: any) => {
|
editChargeDialogRef.afterClosed().subscribe((response: any) => {
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
const locale = 'en';
|
const locale = this.settingsService.language.code;
|
||||||
const dateFormat = 'dd MMMM yyyy';
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
const dataObject = {
|
const dataObject = {
|
||||||
...response.data.value,
|
...response.data.value,
|
||||||
dateFormat,
|
dateFormat,
|
||||||
|
|||||||
Reference in New Issue
Block a user