build: Use prettier for typescript

Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
Ralph Hopman
2025-01-15 11:59:30 +00:00
committed by Adam Saghy
parent 9d6cf1514a
commit cac1d11ad7
1812 changed files with 22516 additions and 16862 deletions
@@ -8,9 +8,8 @@ describe('AccountDetailsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AccountDetailsComponent ]
})
.compileComponents();
declarations: [AccountDetailsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -7,17 +7,15 @@ import { ActivatedRoute } from '@angular/router';
styleUrls: ['./account-details.component.scss']
})
export class AccountDetailsComponent {
loanDetails: any;
dataObject: {
property: string,
value: string
property: string;
value: string;
}[];
constructor(private route: ActivatedRoute) {
this.route.parent.data.subscribe((data: { loanDetailsData: any, }) => {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
}
}
@@ -8,9 +8,8 @@ describe('ChargesTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ChargesTabComponent ]
})
.compileComponents();
declarations: [ChargesTabComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -30,7 +30,6 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./charges-tab.component.scss']
})
export class ChargesTabComponent implements OnInit {
/** Loan Details Data */
loanDetails: any;
/** Charges Data */
@@ -38,7 +37,18 @@ export class ChargesTabComponent implements OnInit {
/** Status */
status: any;
/** Columns to be displayed in charges table. */
displayedColumns: string[] = ['name', 'feepenalty', 'paymentdueat', 'dueDate', 'calculationtype', 'due', 'paid', 'waived', 'outstanding', 'actions'];
displayedColumns: string[] = [
'name',
'feepenalty',
'paymentdueat',
'dueDate',
'calculationtype',
'due',
'paid',
'waived',
'outstanding',
'actions'
];
/** Data source for charges table. */
dataSource: MatTableDataSource<any>;
@@ -54,14 +64,16 @@ export class ChargesTabComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private loansService: LoansService,
constructor(
private loansService: LoansService,
private route: ActivatedRoute,
private dateUtils: Dates,
private router: Router,
private translateService: TranslateService,
public dialog: MatDialog,
private settingsService: SettingsService,
private systemService: SystemService) {
private systemService: SystemService
) {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
@@ -69,21 +81,28 @@ export class ChargesTabComponent implements OnInit {
ngOnInit() {
this.systemService.getConfigurationByName('charge-accrual-date').subscribe((config: GlobalConfiguration) => {
this.useDueDate = (config.stringValue === 'due-date');
this.useDueDate = config.stringValue === 'due-date';
});
this.chargesData = this.loanDetails.charges;
this.status = this.loanDetails.status.value;
let actionFlag;
this.chargesData.forEach((element: any) => {
element.dueDate = this.dateUtils.parseDate(element.dueDate);
if (element.paid || element.waived || element.chargeTimeType.value === 'Disbursement' || this.loanDetails.status.value !== 'Active') {
if (
element.paid ||
element.waived ||
element.chargeTimeType.value === 'Disbursement' ||
this.loanDetails.status.value !== 'Active'
) {
actionFlag = true;
} else {
actionFlag = false;
}
element.actionFlag = actionFlag;
});
this.chargesData = this.chargesData.sort(function (a: any, b: any) { return b.dueDate - a.dueDate; });
this.chargesData = this.chargesData.sort(function (a: any, b: any) {
return b.dueDate - a.dueDate;
});
this.dataSource = new MatTableDataSource(this.chargesData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
@@ -110,6 +129,7 @@ export class ChargesTabComponent implements OnInit {
type: 'date',
required: true
})
];
const data = {
title: `Pay Charge ${chargeId}`,
@@ -127,7 +147,8 @@ export class ChargesTabComponent implements OnInit {
dateFormat,
locale
};
this.loansService.executeLoansAccountChargesCommand(this.loanDetails.id, 'pay', dataObject, chargeId)
this.loansService
.executeLoansAccountChargesCommand(this.loanDetails.id, 'pay', dataObject, chargeId)
.subscribe(() => {
this.reload();
});
@@ -140,10 +161,19 @@ export class ChargesTabComponent implements OnInit {
* @param {any} chargeId Charge Id
*/
waiveCharge(chargeId: any) {
const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: this.translateService.instant('labels.heading.Waive Charge'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id') + `${chargeId} ?`, type: 'Basic' } });
const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: {
heading: this.translateService.instant('labels.heading.Waive Charge'),
dialogContext:
this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id') +
`${chargeId} ?`,
type: 'Basic'
}
});
waiveChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.loansService.executeLoansAccountChargesCommand(this.loanDetails.id, 'waive', {}, chargeId)
this.loansService
.executeLoansAccountChargesCommand(this.loanDetails.id, 'waive', {}, chargeId)
.subscribe(() => {
this.reload();
});
@@ -164,6 +194,7 @@ export class ChargesTabComponent implements OnInit {
type: 'number',
required: true
})
];
const data = {
title: `Edit Charge ${charge.id}`,
@@ -180,10 +211,9 @@ export class ChargesTabComponent implements OnInit {
dateFormat,
locale
};
this.loansService.editLoansAccountCharge(this.loanDetails.id, dataObject, charge.id)
.subscribe(() => {
this.reload();
});
this.loansService.editLoansAccountCharge(this.loanDetails.id, dataObject, charge.id).subscribe(() => {
this.reload();
});
}
});
}
@@ -198,10 +228,9 @@ export class ChargesTabComponent implements OnInit {
});
deleteChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.delete) {
this.loansService.deleteLoansAccountCharge(this.loanDetails.id, chargeId)
.subscribe(() => {
this.reload();
});
this.loansService.deleteLoansAccountCharge(this.loanDetails.id, chargeId).subscribe(() => {
this.reload();
});
}
});
}
@@ -221,8 +250,8 @@ export class ChargesTabComponent implements OnInit {
private reload() {
const clientId = this.loanDetails.clientId;
const url: string = this.router.url;
this.router.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true })
this.router
.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('DatatableTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DatatableTabComponent ]
})
.compileComponents();
declarations: [DatatableTabComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router';
styleUrls: ['./datatable-tab.component.scss']
})
export class DatatableTabComponent {
entityId: string;
/** Loan Datatable */
entityDatatable: any = null;
@@ -26,5 +25,4 @@ export class DatatableTabComponent {
this.multiRowDatatableFlag = this.entityDatatable.columnHeaders[0].columnName === 'id' ? true : false;
});
}
}
@@ -8,9 +8,8 @@ describe('ExternalAssetOwnerTabComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ExternalAssetOwnerTabComponent ]
})
.compileComponents();
declarations: [ExternalAssetOwnerTabComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -11,32 +11,40 @@ import { CancelDialogComponent } from 'app/shared/cancel-dialog/cancel-dialog.co
styleUrls: ['./external-asset-owner-tab.component.scss']
})
export class ExternalAssetOwnerTabComponent implements OnInit {
defaultDate = '9999-12-31';
loanTransfersData: any[] = [];
activeTransferData: any;
loanTransferColumns: string[] = ['status', 'effectiveFrom', 'ownerExternalId', 'transferExternalId', 'settlementDate', 'purchasePriceRatio', 'actions'];
loanTransferColumns: string[] = [
'status',
'effectiveFrom',
'ownerExternalId',
'transferExternalId',
'settlementDate',
'purchasePriceRatio',
'actions'
];
currentItem: any;
existActiveTransfer = false;
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog,
private externalAssetOwner: ExternalAssetOwner,
private externalAssetOwnerService: ExternalAssetOwnerService
) {
this.route.data.subscribe((data: { loanTransfersData: any, activeTransferData: any }) => {
this.loanTransfersData = data.loanTransfersData.empty ? [] : data.loanTransfersData.content;
) {
this.route.data.subscribe((data: { loanTransfersData: any; activeTransferData: any }) => {
this.loanTransfersData = data.loanTransfersData.empty ? [] : data.loanTransfersData.content;
this.activeTransferData = data.activeTransferData || null;
this.existActiveTransfer = (data.activeTransferData && data.activeTransferData.transferId != null);
this.existActiveTransfer = data.activeTransferData && data.activeTransferData.transferId != null;
});
}
ngOnInit(): void {
this.currentItem = null;
if (this.loanTransfersData.length > 0) {
this.currentItem = this.loanTransfersData[(this.loanTransfersData.length - 1)];
this.currentItem = this.loanTransfersData[this.loanTransfersData.length - 1];
}
}
@@ -85,10 +93,11 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
const payload: any = {
transferExternalId: this.currentItem.transferExternalId
};
this.externalAssetOwnerService.executeExternalAssetOwnerTransferCommand(this.currentItem.transferId, payload, 'cancel')
this.externalAssetOwnerService
.executeExternalAssetOwnerTransferCommand(this.currentItem.transferId, payload, 'cancel')
.subscribe((result: any) => {
this.reload();
});
});
}
});
}
@@ -103,7 +112,6 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
reload() {
const url: string = this.router.url;
this.router.navigateByUrl(`/`, {skipLocationChange: true})
.then(() => this.router.navigate([url]));
this.router.navigateByUrl(`/`, { skipLocationChange: true }).then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('ExternalAssetTransferComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ExternalAssetTransferComponent ]
})
.compileComponents();
declarations: [ExternalAssetTransferComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -10,10 +10,9 @@ export class ExternalAssetTransferComponent {
/** Input Fields Data */
@Input() transferData: any;
constructor(private externalAssetOwner: ExternalAssetOwner) { }
constructor(private externalAssetOwner: ExternalAssetOwner) {}
itemStatus(status: string): string {
return this.externalAssetOwner.itemStatus(status);
}
}
@@ -8,9 +8,8 @@ describe('FloatingInterestRatesComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ FloatingInterestRatesComponent ]
})
.compileComponents();
declarations: [FloatingInterestRatesComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -7,20 +7,22 @@ import { ActivatedRoute } from '@angular/router';
styleUrls: ['./floating-interest-rates.component.scss']
})
export class FloatingInterestRatesComponent implements OnInit {
/** Loan Details */
loanDetails: any;
/** Interest Rate Data */
interestRateData: any;
/** Columns to be displayed in charges table. */
displayedColumns: string[] = ['fromDate', 'interestRate'];
displayedColumns: string[] = [
'fromDate',
'interestRate'
];
/**
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
this.route.parent.data.subscribe(( data: { loanDetailsData: any }) => {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
}
@@ -28,5 +30,4 @@ export class FloatingInterestRatesComponent implements OnInit {
ngOnInit() {
this.interestRateData = this.loanDetails.interestRatesPeriods;
}
}
@@ -8,9 +8,8 @@ describe('GeneralTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ GeneralTabComponent ]
})
.compileComponents();
declarations: [GeneralTabComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -8,26 +8,36 @@ import { MatTableDataSource } from '@angular/material/table';
styleUrls: ['./general-tab.component.scss']
})
export class GeneralTabComponent implements OnInit {
/** Currency Code */
currencyCode: string;
loanDetails: any;
status: any;
loanSummaryColumns: string[] = ['Empty', 'Original', 'Paid', 'Waived', 'Written Off', 'Outstanding', 'Over Due'];
loanDetailsColumns: string[] = ['Key', 'Value'];
loanSummaryColumns: string[] = [
'Empty',
'Original',
'Paid',
'Waived',
'Written Off',
'Outstanding',
'Over Due'
];
loanDetailsColumns: string[] = [
'Key',
'Value'
];
loanSummaryTableData: {
'property': string,
'original': string,
'adjustment': string,
'paid': string,
'waived': string,
'writtenOff': string,
'outstanding': string,
'overdue': string
property: string;
original: string;
adjustment: string;
paid: string;
waived: string;
writtenOff: string;
outstanding: string;
overdue: string;
}[];
loanDetailsTableData: {
'key': string,
'value'?: string
key: string;
value?: string;
}[];
/** Data source for loans summary table. */
@@ -35,13 +45,22 @@ export class GeneralTabComponent implements OnInit {
detailsDataSource: MatTableDataSource<any>;
constructor(private route: ActivatedRoute) {
this.route.parent.data.subscribe((data: { loanDetailsData: any, }) => {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
this.currencyCode = this.loanDetails.currency.code;
if (this.loanDetails.transactions) {
this.loanDetails.transactions.some((transaction: any) => {
if (transaction.type.code === 'loanTransactionType.chargeback') {
this.loanSummaryColumns = ['Empty', 'Original', 'Adjustments', 'Paid', 'Waived', 'Written Off', 'Outstanding', 'Over Due'];
this.loanSummaryColumns = [
'Empty',
'Original',
'Adjustments',
'Paid',
'Waived',
'Written Off',
'Outstanding',
'Over Due'
];
return;
}
});
@@ -62,123 +81,129 @@ export class GeneralTabComponent implements OnInit {
setloanSummaryTableData() {
this.loanSummaryTableData = [
{
'property': 'Principal',
'original': this.loanDetails.summary.principalDisbursed,
'adjustment': this.loanDetails.summary.principalAdjustments || 0,
'paid': this.loanDetails.summary.principalPaid,
'waived': this.loanDetails.summary.principalWaived || 0,
'writtenOff': this.loanDetails.summary.principalWrittenOff,
'outstanding': this.loanDetails.summary.principalOutstanding,
'overdue': this.loanDetails.summary.principalOverdue,
},
{
'property': 'Interest',
'original': this.loanDetails.summary.interestCharged,
'adjustment': '0',
'paid': this.loanDetails.summary.interestPaid,
'waived': this.loanDetails.summary.interestWaived,
'writtenOff': this.loanDetails.summary.interestWrittenOff,
'outstanding': this.loanDetails.summary.interestOutstanding,
'overdue': this.loanDetails.summary.interestOverdue,
},
{
'property': 'Fees',
'original': this.loanDetails.summary.feeChargesCharged,
'adjustment': '0',
'paid': this.loanDetails.summary.feeChargesPaid,
'waived': this.loanDetails.summary.feeChargesWaived,
'writtenOff': this.loanDetails.summary.feeChargesWrittenOff,
'outstanding': this.loanDetails.summary.feeChargesOutstanding,
'overdue': this.loanDetails.summary.feeChargesOverdue,
},
{
'property': 'Penalties',
'original': this.loanDetails.summary.penaltyChargesCharged,
'adjustment': '0',
'paid': this.loanDetails.summary.penaltyChargesPaid,
'waived': this.loanDetails.summary.penaltyChargesWaived,
'writtenOff': this.loanDetails.summary.penaltyChargesWrittenOff,
'outstanding': this.loanDetails.summary.penaltyChargesOutstanding,
'overdue': this.loanDetails.summary.penaltyChargesOverdue,
},
{
'property': 'Total',
'original': this.loanDetails.summary.totalExpectedRepayment,
'adjustment': this.loanDetails.summary.principalAdjustments || 0,
'paid': this.loanDetails.summary.totalRepayment,
'waived': this.loanDetails.summary.totalWaived,
'writtenOff': this.loanDetails.summary.totalWrittenOff,
'outstanding': this.loanDetails.summary.totalOutstanding,
'overdue': this.loanDetails.summary.totalOverdue,
}
property: 'Principal',
original: this.loanDetails.summary.principalDisbursed,
adjustment: this.loanDetails.summary.principalAdjustments || 0,
paid: this.loanDetails.summary.principalPaid,
waived: this.loanDetails.summary.principalWaived || 0,
writtenOff: this.loanDetails.summary.principalWrittenOff,
outstanding: this.loanDetails.summary.principalOutstanding,
overdue: this.loanDetails.summary.principalOverdue
},
{
property: 'Interest',
original: this.loanDetails.summary.interestCharged,
adjustment: '0',
paid: this.loanDetails.summary.interestPaid,
waived: this.loanDetails.summary.interestWaived,
writtenOff: this.loanDetails.summary.interestWrittenOff,
outstanding: this.loanDetails.summary.interestOutstanding,
overdue: this.loanDetails.summary.interestOverdue
},
{
property: 'Fees',
original: this.loanDetails.summary.feeChargesCharged,
adjustment: '0',
paid: this.loanDetails.summary.feeChargesPaid,
waived: this.loanDetails.summary.feeChargesWaived,
writtenOff: this.loanDetails.summary.feeChargesWrittenOff,
outstanding: this.loanDetails.summary.feeChargesOutstanding,
overdue: this.loanDetails.summary.feeChargesOverdue
},
{
property: 'Penalties',
original: this.loanDetails.summary.penaltyChargesCharged,
adjustment: '0',
paid: this.loanDetails.summary.penaltyChargesPaid,
waived: this.loanDetails.summary.penaltyChargesWaived,
writtenOff: this.loanDetails.summary.penaltyChargesWrittenOff,
outstanding: this.loanDetails.summary.penaltyChargesOutstanding,
overdue: this.loanDetails.summary.penaltyChargesOverdue
},
{
property: 'Total',
original: this.loanDetails.summary.totalExpectedRepayment,
adjustment: this.loanDetails.summary.principalAdjustments || 0,
paid: this.loanDetails.summary.totalRepayment,
waived: this.loanDetails.summary.totalWaived,
writtenOff: this.loanDetails.summary.totalWrittenOff,
outstanding: this.loanDetails.summary.totalOutstanding,
overdue: this.loanDetails.summary.totalOverdue
}
];
this.dataSource = new MatTableDataSource(this.loanSummaryTableData);
}
setloanDetailsTableData() {
this.loanDetailsTableData = [
{
'key': 'Disbursement Date'
key: 'Disbursement Date'
},
{
'key': 'Loan Purpose'
key: 'Loan Purpose'
},
{
'key': 'Loan Officer'
key: 'Loan Officer'
},
{
'key': 'Currency'
key: 'Currency'
},
{
'key': 'External Id'
key: 'External Id'
},
{
'key': 'Proposed Amount',
'value': this.loanDetails.proposedPrincipal,
key: 'Proposed Amount',
value: this.loanDetails.proposedPrincipal
},
{
'key': 'Approved Amount',
'value': this.loanDetails.approvedPrincipal,
key: 'Approved Amount',
value: this.loanDetails.approvedPrincipal
},
{
'key': 'Disburse Amount',
'value': this.loanDetails.principal,
},
key: 'Disburse Amount',
value: this.loanDetails.principal
}
];
this.detailsDataSource = new MatTableDataSource(this.loanDetailsTableData);
}
setloanNonDetailsTableData() {
this.loanDetailsTableData = [
{
'key': 'Disbursement Date'
key: 'Disbursement Date'
},
{
'key': 'Currency'
key: 'Currency'
},
{
'key': 'Loan Officer'
key: 'Loan Officer'
},
{
'key': 'External Id'
key: 'External Id'
}
];
this.detailsDataSource = new MatTableDataSource(this.loanDetailsTableData);
}
showApprovedAmountBasedOnStatus() {
if (this.status === 'Submitted and pending approval' || this.status === 'Withdrawn by applicant' || this.status === 'Rejected') {
return false;
if (
this.status === 'Submitted and pending approval' ||
this.status === 'Withdrawn by applicant' ||
this.status === 'Rejected'
) {
return false;
}
return true;
}
showDisbursedAmountBasedOnStatus = function() {
if (this.status === 'Submitted and pending approval' || this.status === 'Withdrawn by applicant' || this.status === 'Rejected' ||
this.status === 'Approved') {
return false;
showDisbursedAmountBasedOnStatus = function () {
if (
this.status === 'Submitted and pending approval' ||
this.status === 'Withdrawn by applicant' ||
this.status === 'Rejected' ||
this.status === 'Approved'
) {
return false;
}
return true;
};
@@ -8,9 +8,8 @@ describe('AddCollateralComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddCollateralComponent ]
})
.compileComponents();
declarations: [AddCollateralComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -15,7 +15,6 @@ import { LoansService } from 'app/loans/loans.service';
styleUrls: ['./add-collateral.component.scss']
})
export class AddCollateralComponent implements OnInit {
@Input() dataObject: any;
/** Collateral form. */
@@ -30,10 +29,12 @@ export class AddCollateralComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {LoansService} LoansService loans service.
*/
constructor(private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute,
private loanService: LoansService ) { }
constructor(
private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute,
private loanService: LoansService
) {}
ngOnInit() {
this.createAddCollateralForm();
@@ -44,9 +45,15 @@ export class AddCollateralComponent implements OnInit {
*/
createAddCollateralForm() {
this.collateralForm = this.formBuilder.group({
'collateralTypeId': ['', Validators.required],
'value': ['', Validators.required],
'description': ['']
collateralTypeId: [
'',
Validators.required
],
value: [
'',
Validators.required
],
description: ['']
});
}
@@ -56,7 +63,7 @@ export class AddCollateralComponent implements OnInit {
submit() {
const collateralTypeId = this.collateralForm.value.collateralTypeId;
this.collateralForm.patchValue({
'collateralTypeId': collateralTypeId
collateralTypeId: collateralTypeId
});
const loanId = this.route.snapshot.params['loanId'];
const collateralForm = this.collateralForm.value;
@@ -65,5 +72,4 @@ export class AddCollateralComponent implements OnInit {
this.router.navigate(['../../loan-collateral'], { relativeTo: this.route });
});
}
}
@@ -1,47 +1,60 @@
<div class="container mat-elevation-z8">
<mat-card>
<div class="m-b-20" fxLayout="column" *ngIf="maturityDate">
<span class="m-r-10">{{'Maturity Date' | translateKey:'inputs'}} : {{ maturityDate | dateFormat}}</span>
<mat-card>
<div class="m-b-20" fxLayout="column" *ngIf="maturityDate">
<span class="m-r-10">{{ 'Maturity Date' | translateKey: 'inputs' }} : {{ maturityDate | dateFormat }}</span>
</div>
<form [formGroup]="interestPauseLoanForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="column">
<mat-form-field (click)="startDatePicker.open()">
<mat-label>{{ 'labels.inputs.Start Date' | translate }}</mat-label>
<input
matInput
[min]="minDate"
[max]="maxDate"
[matDatepicker]="startDatePicker"
required
formControlName="startDate"
/>
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
<mat-datepicker #startDatePicker></mat-datepicker>
<mat-error *ngIf="interestPauseLoanForm.controls.startDate.hasError('required')">
{{ 'labels.inputs.Start Date' | translate }}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
<mat-form-field (click)="endDatePicker.open()">
<mat-label>{{ 'labels.inputs.End Date' | translate }}</mat-label>
<input
matInput
[min]="interestPauseLoanForm.value.startDate"
[max]="maxDate"
[matDatepicker]="endDatePicker"
required
formControlName="endDate"
/>
<mat-datepicker-toggle matSuffix [for]="endDatePicker"></mat-datepicker-toggle>
<mat-datepicker #endDatePicker></mat-datepicker>
<mat-error *ngIf="interestPauseLoanForm.controls.endDate.hasError('required')">
{{ 'labels.inputs.End Date' | translate }}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
</div>
<form [formGroup]="interestPauseLoanForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="column">
<mat-form-field (click)="startDatePicker.open()">
<mat-label>{{ 'labels.inputs.Start Date' | translate }}</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="startDatePicker"
required formControlName="startDate" />
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
<mat-datepicker #startDatePicker></mat-datepicker>
<mat-error *ngIf="interestPauseLoanForm.controls.startDate.hasError('required')">
{{ 'labels.inputs.Start Date' | translate
}}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
<mat-form-field (click)="endDatePicker.open()">
<mat-label>{{ 'labels.inputs.End Date' | translate }}</mat-label>
<input matInput [min]="interestPauseLoanForm.value.startDate" [max]="maxDate" [matDatepicker]="endDatePicker"
required formControlName="endDate" />
<mat-datepicker-toggle matSuffix [for]="endDatePicker"></mat-datepicker-toggle>
<mat-datepicker #endDatePicker></mat-datepicker>
<mat-error *ngIf="interestPauseLoanForm.controls.endDate.hasError('required')">
{{ 'labels.inputs.End Date' | translate
}}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button mat-raised-button color="primary" [disabled]="!interestPauseLoanForm.valid"
*mifosxHasPermission="'DISBURSE_LOAN'">
{{ 'labels.buttons.Submit' | translate }}
</button>
</mat-card-actions>
</mat-card-content>
</form>
</mat-card>
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../../general']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button
mat-raised-button
color="primary"
[disabled]="!interestPauseLoanForm.valid"
*mifosxHasPermission="'DISBURSE_LOAN'"
>
{{ 'labels.buttons.Submit' | translate }}
</button>
</mat-card-actions>
</mat-card-content>
</form>
</mat-card>
</div>
@@ -1,8 +1,7 @@
.expandcollapsebutton {
margin-top: -7px;
}
.container {
max-width: 37rem;
}
margin-top: -7px;
}
.container {
max-width: 37rem;
}
@@ -8,9 +8,8 @@ describe('AddInterestPauseComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AddInterestPauseComponent ]
})
.compileComponents();
declarations: [AddInterestPauseComponent]
}).compileComponents();
fixture = TestBed.createComponent(AddInterestPauseComponent);
component = fixture.componentInstance;
@@ -11,7 +11,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./add-interest-pause.component.scss']
})
export class AddInterestPauseComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -35,13 +34,14 @@ export class AddInterestPauseComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -64,8 +64,14 @@ export class AddInterestPauseComponent implements OnInit {
*/
createInterestPauseLoanForm() {
this.interestPauseLoanForm = this.formBuilder.group({
'startDate': [this.startDate, Validators.required],
'endDate': [this.startDate, Validators.required]
startDate: [
this.startDate,
Validators.required
],
endDate: [
this.startDate,
Validators.required
]
});
}
@@ -87,10 +93,8 @@ export class AddInterestPauseComponent implements OnInit {
dateFormat,
locale
};
this.loanService.addInterestPauseToLoan(this.loanId, data )
.subscribe((response: any) => {
this.router.navigate(['../../term-variations'], { relativeTo: this.route });
});
this.loanService.addInterestPauseToLoan(this.loanId, data).subscribe((response: any) => {
this.router.navigate(['../../term-variations'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('AddloanchargeComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddLoanChargeComponent ]
})
.compileComponents();
declarations: [AddLoanChargeComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./add-loan-charge.component.scss']
})
export class AddLoanChargeComponent implements OnInit {
/** Minimum Due Date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum Due Date allowed. */
@@ -51,12 +50,14 @@ export class AddLoanChargeComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private loansService: LoansService,
private settingsService: SettingsService) {
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private loansService: LoansService,
private settingsService: SettingsService
) {
this.route.data.subscribe((data: { actionButtonData: any }) => {
this.loanChargeOptions = data.actionButtonData.chargeOptions;
});
@@ -69,8 +70,8 @@ export class AddLoanChargeComponent implements OnInit {
ngOnInit() {
this.maxDate = this.settingsService.maxFutureDate;
this.createLoanChargeForm();
this.loanChargeForm.controls.chargeId.valueChanges.subscribe(chargeId => {
const chargeDetails = this.loanChargeOptions.find(option => {
this.loanChargeForm.controls.chargeId.valueChanges.subscribe((chargeId) => {
const chargeDetails = this.loanChargeOptions.find((option) => {
return option.id === chargeId;
});
if (chargeDetails.chargeTimeType.id === 2) {
@@ -79,9 +80,9 @@ export class AddLoanChargeComponent implements OnInit {
this.loanChargeForm.removeControl('dueDate');
}
this.loanChargeForm.patchValue({
'amount': chargeDetails.amount,
'chargeCalculation': chargeDetails.chargeCalculationType.value,
'chargeTime': chargeDetails.chargeTimeType.value
amount: chargeDetails.amount,
chargeCalculation: chargeDetails.chargeCalculationType.value,
chargeTime: chargeDetails.chargeTimeType.value
});
});
}
@@ -91,10 +92,16 @@ export class AddLoanChargeComponent implements OnInit {
*/
createLoanChargeForm() {
this.loanChargeForm = this.formBuilder.group({
'chargeId': ['', Validators.required],
'amount': ['', Validators.required],
'chargeCalculation': [{ value: '', disabled: true }],
'chargeTime': [{ value: '', disabled: true }]
chargeId: [
'',
Validators.required
],
amount: [
'',
Validators.required
],
chargeCalculation: [{ value: '', disabled: true }],
chargeTime: [{ value: '', disabled: true }]
});
}
@@ -111,7 +118,7 @@ export class AddLoanChargeComponent implements OnInit {
dateFormat,
locale
};
this.loansService.createLoanCharge(this.loanId, 'charges', data).subscribe(res => {
this.loansService.createLoanCharge(this.loanId, 'charges', data).subscribe((res) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
@@ -8,9 +8,8 @@ describe('AdjustLoanChargeComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AdjustLoanChargeComponent ]
})
.compileComponents();
declarations: [AdjustLoanChargeComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -36,19 +36,21 @@ export class AdjustLoanChargeComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService,
private organizationService: OrganizationService) {
this.loanId = this.route.snapshot.params['loanId'];
this.chargeId = this.route.snapshot.params['id'];
this.route.data.subscribe((data: { loansAccountCharge: any, loanDetailsData: any }) => {
this.chargeData = data.loansAccountCharge;
this.loanDetailsData = data.loanDetailsData;
});
}
private organizationService: OrganizationService
) {
this.loanId = this.route.snapshot.params['loanId'];
this.chargeId = this.route.snapshot.params['id'];
this.route.data.subscribe((data: { loansAccountCharge: any; loanDetailsData: any }) => {
this.chargeData = data.loansAccountCharge;
this.loanDetailsData = data.loanDetailsData;
});
}
/**
* Creates the repayment loan form
@@ -65,10 +67,13 @@ export class AdjustLoanChargeComponent implements OnInit {
*/
createAdjustLoanChargeForm() {
this.adjustLoanChargeForm = this.formBuilder.group({
'amount': [this.chargeData.amount, Validators.required],
'externalId': '',
'paymentTypeId': '',
'note': ''
amount: [
this.chargeData.amount,
Validators.required
],
externalId: '',
paymentTypeId: '',
note: ''
});
}
@@ -107,10 +112,10 @@ export class AdjustLoanChargeComponent implements OnInit {
locale
};
const command = 'adjustment';
this.loanService.executeLoansAccountChargesCommand(this.loanId, command, data, this.chargeId)
this.loanService
.executeLoansAccountChargesCommand(this.loanId, command, data, this.chargeId)
.subscribe((response: any) => {
this.router.navigate(['../..'], { relativeTo: this.route });
});
});
}
}
@@ -8,9 +8,8 @@ describe('ApproveLoanComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ApproveLoanComponent ]
})
.compileComponents();
declarations: [ApproveLoanComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./approve-loan.component.scss']
})
export class ApproveLoanComponent implements OnInit {
/** Approve Loan form. */
approveLoanForm: UntypedFormGroup;
/** Loan data. */
@@ -40,12 +39,14 @@ export class ApproveLoanComponent implements OnInit {
* @param router Router.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private dateUtils: Dates,
private loanService: LoansService,
private router: Router,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.route.data.subscribe((data: { actionButtonData: any }) => {
this.loanData = data.actionButtonData;
this.currency = data.actionButtonData.currency;
@@ -58,7 +59,7 @@ export class ApproveLoanComponent implements OnInit {
this.loanService.getApproveAssociationsDetails(this.loanId).subscribe((response: any) => {
this.associationData = response;
this.approveLoanForm.patchValue({
'expectedDisbursementDate': new Date(response.timeline.expectedDisbursementDate)
expectedDisbursementDate: new Date(response.timeline.expectedDisbursementDate)
});
});
}
@@ -68,10 +69,16 @@ export class ApproveLoanComponent implements OnInit {
*/
setApproveLoanForm() {
this.approveLoanForm = this.formBuilder.group({
'approvedOnDate': [this.settingsService.businessDate, Validators.required],
'expectedDisbursementDate': [''],
'approvedLoanAmount': [this.loanData.approvalAmount, Validators.required],
'note': ['']
approvedOnDate: [
this.settingsService.businessDate,
Validators.required
],
expectedDisbursementDate: [''],
approvedLoanAmount: [
this.loanData.approvalAmount,
Validators.required
],
note: ['']
});
}
@@ -99,5 +106,4 @@ export class ApproveLoanComponent implements OnInit {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('AssetTransferLoanComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ AssetTransferLoanComponent ]
})
.compileComponents();
declarations: [AssetTransferLoanComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -11,7 +11,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./asset-transfer-loan.component.scss']
})
export class AssetTransferLoanComponent implements OnInit {
BUYBACK_COMMAND = 'buyback';
SALE_COMMAND = 'sale';
@@ -25,16 +24,18 @@ export class AssetTransferLoanComponent implements OnInit {
/** Sell Loan Form */
saleLoanForm: UntypedFormGroup;
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private externalAssetOwnerService: ExternalAssetOwnerService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
const actionName = this.route.snapshot.params['action'];
this.command = (actionName === 'Sell Loan') ? this.SALE_COMMAND : this.BUYBACK_COMMAND;
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
const actionName = this.route.snapshot.params['action'];
this.command = actionName === 'Sell Loan' ? this.SALE_COMMAND : this.BUYBACK_COMMAND;
}
/**
* Creates the Sell Loan form
@@ -47,7 +48,7 @@ export class AssetTransferLoanComponent implements OnInit {
}
isBuyBack(): boolean {
return (this.command === this.BUYBACK_COMMAND);
return this.command === this.BUYBACK_COMMAND;
}
/**
@@ -55,10 +56,19 @@ export class AssetTransferLoanComponent implements OnInit {
*/
createSaleLoanForm() {
this.saleLoanForm = this.formBuilder.group({
'settlementDate': [this.settingsService.businessDate, Validators.required],
'purchasePriceRatio': ['', Validators.required],
'transferExternalId': '',
'ownerExternalId': ['', Validators.required]
settlementDate: [
this.settingsService.businessDate,
Validators.required
],
purchasePriceRatio: [
'',
Validators.required
],
transferExternalId: '',
ownerExternalId: [
'',
Validators.required
]
});
if (this.isBuyBack()) {
@@ -80,11 +90,10 @@ export class AssetTransferLoanComponent implements OnInit {
dateFormat,
locale
};
this.externalAssetOwnerService.executeExternalAssetOwnerLoanCommand(this.loanId, data, this.command)
this.externalAssetOwnerService
.executeExternalAssetOwnerLoanCommand(this.loanId, data, this.command)
.subscribe((response: any) => {
this.router.navigate(['../../external-asset-owner'], { relativeTo: this.route });
});
});
}
}
@@ -8,9 +8,8 @@ describe('AssignLoanOfficerComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AssignLoanOfficerComponent ]
})
.compileComponents();
declarations: [AssignLoanOfficerComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,7 +13,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./assign-loan-officer.component.scss']
})
export class AssignLoanOfficerComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -32,14 +31,16 @@ export class AssignLoanOfficerComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the assign officer form.
@@ -55,8 +56,14 @@ export class AssignLoanOfficerComponent implements OnInit {
*/
createassignOfficerForm() {
this.assignOfficerForm = this.formBuilder.group({
'toLoanOfficerId': ['', Validators.required],
'assignmentDate': [new Date(), Validators.required]
toLoanOfficerId: [
'',
Validators.required
],
assignmentDate: [
new Date(),
Validators.required
]
});
}
@@ -74,10 +81,8 @@ export class AssignLoanOfficerComponent implements OnInit {
locale
};
data.fromLoanOfficerId = this.dataObject.loanOfficerId || '';
this.loanService.loanActionButtons(this.loanId, 'assignLoanOfficer', data)
.subscribe((response: any) => {
this.router.navigate([`../../general`], { relativeTo: this.route });
this.loanService.loanActionButtons(this.loanId, 'assignLoanOfficer', data).subscribe((response: any) => {
this.router.navigate([`../../general`], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('ChargeOffComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ChargeOffComponent ]
})
.compileComponents();
declarations: [ChargeOffComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -35,14 +35,16 @@ export class ChargeOffComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the repayment loan form
@@ -59,10 +61,13 @@ export class ChargeOffComponent implements OnInit {
*/
createChargeoffLoanForm() {
this.chargeoffLoanForm = this.formBuilder.group({
'transactionDate': [this.settingsService.businessDate, Validators.required],
'externalId': '',
'chargeOffReasonId': '',
'note': ''
transactionDate: [
this.settingsService.businessDate,
Validators.required
],
externalId: '',
chargeOffReasonId: '',
note: ''
});
}
@@ -80,10 +85,8 @@ export class ChargeOffComponent implements OnInit {
locale
};
const command = 'charge-off';
this.loanService.submitLoanActionButton(this.loanId, data, command)
.subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
this.loanService.submitLoanActionButton(this.loanId, data, command).subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('CloseAsRescheduledComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CloseAsRescheduledComponent ]
})
.compileComponents();
declarations: [CloseAsRescheduledComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,7 +13,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./close-as-rescheduled.component.scss']
})
export class CloseAsRescheduledComponent implements OnInit {
@Input() dataObject: any;
/** Close form. */
@@ -32,14 +31,16 @@ export class CloseAsRescheduledComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the close form.
@@ -54,8 +55,11 @@ export class CloseAsRescheduledComponent implements OnInit {
*/
createCloseForm() {
this.closeLoanForm = this.formBuilder.group({
'transactionDate': [new Date(this.dataObject.date) || new Date(), Validators.required],
'note': []
transactionDate: [
new Date(this.dataObject.date) || new Date(),
Validators.required
],
note: []
});
}
@@ -76,9 +80,8 @@ export class CloseAsRescheduledComponent implements OnInit {
dateFormat,
locale
};
this.loanService.submitLoanActionButton(this.loanId, data, 'close-rescheduled')
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
this.loanService.submitLoanActionButton(this.loanId, data, 'close-rescheduled').subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('CreateGuarantorComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CreateGuarantorComponent ]
})
.compileComponents();
declarations: [CreateGuarantorComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./create-guarantor.component.scss']
})
export class CreateGuarantorComponent implements OnInit, AfterViewInit {
@Input() dataObject: any;
/** New Guarantor Form */
newGuarantorForm: UntypedFormGroup;
@@ -44,13 +43,15 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private clientsService: ClientsService,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -64,11 +65,14 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
/** Create Guarantor Details Form */
createNewGuarantorForm() {
this.newGuarantorForm = this.formBuilder.group({
'existingClient': [''],
'name': ['', Validators.required],
'clientRelationshipTypeId': [''],
'savingsId': [''],
'amount': ['']
existingClient: [''],
name: [
'',
Validators.required
],
clientRelationshipTypeId: [''],
savingsId: [''],
amount: ['']
});
}
@@ -123,10 +127,9 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
if (this.newGuarantorForm.value.existingClient) {
this.newGuarantorForm.get('name').valueChanges.subscribe((value: string) => {
if (value.length >= 2) {
this.clientsService.getFilteredClients('displayName', 'ASC', true, value)
.subscribe((data: any) => {
this.clientsData = data.pageItems;
});
this.clientsService.getFilteredClients('displayName', 'ASC', true, value).subscribe((data: any) => {
this.clientsData = data.pageItems;
});
}
});
}
@@ -155,7 +158,9 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
const dateFormat = this.settingsService.dateFormat;
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;
const data = {
...newGuarantorFormData,
locale,
@@ -174,10 +179,8 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
delete data.existingClient;
delete data.name;
this.loanService.createNewGuarantor(this.loanId, data)
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
this.loanService.createNewGuarantor(this.loanId, data).subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('DisburseToSavingsAccountComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ DisburseToSavingsAccountComponent ]
})
.compileComponents();
declarations: [DisburseToSavingsAccountComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -12,7 +12,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./disburse-to-savings-account.component.scss']
})
export class DisburseToSavingsAccountComponent implements OnInit {
@Input() dataObject: any;
/** Minimum Date allowed. */
@@ -31,13 +30,14 @@ export class DisburseToSavingsAccountComponent implements OnInit {
* @param {LoansService} loanService Loan Service.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private loanService: LoansService,
private settingsService: SettingsService) {
}
private settingsService: SettingsService
) {}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
@@ -52,12 +52,21 @@ export class DisburseToSavingsAccountComponent implements OnInit {
*/
setDisbursementToSavingsForm() {
this.disbursementForm = this.formBuilder.group({
'actualDisbursementDate': [new Date(), Validators.required],
'transactionAmount': [this.dataObject.amount, Validators.required],
'note': ['']
actualDisbursementDate: [
new Date(),
Validators.required
],
transactionAmount: [
this.dataObject.amount,
Validators.required
],
note: ['']
});
if (this.dataObject.fixedEmiAmount) {
this.disbursementForm.addControl('fixedEmiAmount', new UntypedFormControl(this.dataObject.fixedEmiAmount, [Validators.required]));
this.disbursementForm.addControl(
'fixedEmiAmount',
new UntypedFormControl(this.dataObject.fixedEmiAmount, [Validators.required])
);
}
}
@@ -70,7 +79,10 @@ export class DisburseToSavingsAccountComponent implements OnInit {
const dateFormat = this.settingsService.dateFormat;
const prevActualDisbursementDate: Date = this.disbursementForm.value.actualDisbursementDate;
if (disbursementLoanFormData.actualDisbursementDate instanceof Date) {
disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate(prevActualDisbursementDate, dateFormat);
disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate(
prevActualDisbursementDate,
dateFormat
);
}
const data = {
...disbursementLoanFormData,
@@ -83,5 +95,4 @@ export class DisburseToSavingsAccountComponent implements OnInit {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('DisburseComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ DisburseComponent ]
})
.compileComponents();
declarations: [DisburseComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./disburse.component.scss']
})
export class DisburseComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -41,16 +40,17 @@ export class DisburseComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the disbursement loan form
* and initialize with the required values
@@ -69,18 +69,24 @@ export class DisburseComponent implements OnInit {
*/
createDisbursementLoanForm() {
this.disbursementLoanForm = this.formBuilder.group({
'actualDisbursementDate': [this.settingsService.businessDate, Validators.required],
'transactionAmount': ['', Validators.required],
'externalId': '',
'paymentTypeId': '',
'note': ''
actualDisbursementDate: [
this.settingsService.businessDate,
Validators.required
],
transactionAmount: [
'',
Validators.required
],
externalId: '',
paymentTypeId: '',
note: ''
});
}
setDisbursementLoanDetails() {
this.paymentTypes = this.dataObject.paymentTypeOptions;
this.disbursementLoanForm.patchValue({
transactionAmount: this.dataObject.amount,
transactionAmount: this.dataObject.amount
// actualDisbursementDate: new Date(this.dataObject.date)
});
}
@@ -112,7 +118,10 @@ export class DisburseComponent implements OnInit {
const dateFormat = this.settingsService.dateFormat;
const prevActualDisbursementDate: Date = this.disbursementLoanForm.value.actualDisbursementDate;
if (disbursementLoanFormData.actualDisbursementDate instanceof Date) {
disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate(prevActualDisbursementDate, dateFormat);
disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate(
prevActualDisbursementDate,
dateFormat
);
}
const data = {
...disbursementLoanFormData,
@@ -120,10 +129,8 @@ export class DisburseComponent implements OnInit {
locale
};
data['transactionAmount'] = data['transactionAmount'] * 1;
this.loanService.loanActionButtons(this.loanId, 'disburse', data )
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
this.loanService.loanActionButtons(this.loanId, 'disburse', data).subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('EditRepaymentScheduleComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ EditRepaymentScheduleComponent ]
})
.compileComponents();
declarations: [EditRepaymentScheduleComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SelectBase } from 'app/shared/form-dialog/formfield/model/select-base';
styleUrls: ['./edit-repayment-schedule.component.scss']
})
export class EditRepaymentScheduleComponent implements OnInit {
/** Loan ID. */
loanId: string;
/** Indicates If the Schedule has been changed */
@@ -37,13 +36,15 @@ export class EditRepaymentScheduleComponent implements OnInit {
* @param {Dates} dateUtils Dates Utils.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private loansService: LoansService,
constructor(
private loansService: LoansService,
private router: Router,
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private translateService: TranslateService,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
this.getRepaymentSchedule();
}
@@ -62,7 +63,10 @@ export class EditRepaymentScheduleComponent implements OnInit {
const periods: any = [];
this.repaymentScheduleDetails['periods'].forEach((period: any) => {
if (period.period) {
periods.push({ idx: period.period, dueDate: this.dateUtils.formatDate(period.dueDate, this.settingsService.dateFormat) });
periods.push({
idx: period.period,
dueDate: this.dateUtils.formatDate(period.dueDate, this.settingsService.dateFormat)
});
}
});
const formfields: FormfieldBase[] = [
@@ -86,7 +90,8 @@ export class EditRepaymentScheduleComponent implements OnInit {
value: '',
type: 'number',
required: true
}),
})
];
const data = {
title: 'Pattern Update',
@@ -118,34 +123,45 @@ export class EditRepaymentScheduleComponent implements OnInit {
reset(): void {
const recoverScheduleDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Recover Original Schedule'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want recover the Original Schedule') }
data: {
heading: this.translateService.instant('labels.heading.Recover Original Schedule'),
dialogContext: this.translateService.instant(
'labels.dialogContext.Are you sure you want recover the Original Schedule'
)
}
});
recoverScheduleDialogRef.afterClosed().subscribe((responseConfirmation: any) => {
if (responseConfirmation.confirm) {
this.loansService.applyCommandLoanScheduleVariations(this.loanId, 'deleteVariations', {}).subscribe((response: any) => {
this.getRepaymentSchedule();
this.wasChanged = false;
this.wasValidated = false;
});
this.loansService
.applyCommandLoanScheduleVariations(this.loanId, 'deleteVariations', {})
.subscribe((response: any) => {
this.getRepaymentSchedule();
this.wasChanged = false;
this.wasValidated = false;
});
}
});
}
validate(): void {
this.loansService.applyCommandLoanScheduleVariations(this.loanId, 'calculateLoanSchedule', this.getPayload()).subscribe((response: any) => {
this.repaymentScheduleDetails['periods'] = [];
response['periods'].forEach((period: any) => {
period['changed'] = true;
this.repaymentScheduleDetails['periods'].push(period);
this.wasValidated = true;
this.loansService
.applyCommandLoanScheduleVariations(this.loanId, 'calculateLoanSchedule', this.getPayload())
.subscribe((response: any) => {
this.repaymentScheduleDetails['periods'] = [];
response['periods'].forEach((period: any) => {
period['changed'] = true;
this.repaymentScheduleDetails['periods'].push(period);
this.wasValidated = true;
});
});
});
}
submit(): void {
this.loansService.applyCommandLoanScheduleVariations(this.loanId, 'addVariations', this.getPayload()).subscribe((response: any) => {
this.router.navigate(['../../repayment-schedule'], { relativeTo: this.route });
});
this.loansService
.applyCommandLoanScheduleVariations(this.loanId, 'addVariations', this.getPayload())
.subscribe((response: any) => {
this.router.navigate(['../../repayment-schedule'], { relativeTo: this.route });
});
}
private getPayload(): any {
@@ -163,5 +179,4 @@ export class EditRepaymentScheduleComponent implements OnInit {
locale
};
}
}
@@ -8,9 +8,8 @@ describe('ForeclosureComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ForeclosureComponent ]
})
.compileComponents();
declarations: [ForeclosureComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -30,14 +30,16 @@ export class ForeclosureComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
@@ -47,21 +49,26 @@ export class ForeclosureComponent implements OnInit {
createforeclosureForm() {
this.foreclosureForm = this.formBuilder.group({
'transactionDate': [this.dataObject.date && new Date(this.dataObject.date), Validators.required],
'outstandingPrincipalPortion': [{value: this.dataObject.principalPortion || 0, disabled: true}],
'outstandingInterestPortion': [{value: this.dataObject.interestPortion || 0, disabled: true}],
'outstandingFeeChargesPortion': [{value: this.dataObject.feeChargesPortion || 0, disabled: true}],
'outstandingPenaltyChargesPortion': [{value: this.dataObject.penaltyChargesPortion || 0, disabled: true}],
'transactionAmount': [{value: this.dataObject.amount, disabled: true}],
'note': ['', Validators.required]
transactionDate: [
this.dataObject.date && new Date(this.dataObject.date),
Validators.required
],
outstandingPrincipalPortion: [{ value: this.dataObject.principalPortion || 0, disabled: true }],
outstandingInterestPortion: [{ value: this.dataObject.interestPortion || 0, disabled: true }],
outstandingFeeChargesPortion: [{ value: this.dataObject.feeChargesPortion || 0, disabled: true }],
outstandingPenaltyChargesPortion: [{ value: this.dataObject.penaltyChargesPortion || 0, disabled: true }],
transactionAmount: [{ value: this.dataObject.amount, disabled: true }],
note: [
'',
Validators.required
]
});
}
onChanges(): void {
this.foreclosureForm.get('transactionDate').valueChanges.subscribe(val => {
this.foreclosureForm.get('transactionDate').valueChanges.subscribe((val) => {
this.retrieveLoanForeclosureTemplate(val);
});
}
retrieveLoanForeclosureTemplate(val: any) {
@@ -73,15 +80,14 @@ export class ForeclosureComponent implements OnInit {
locale: this.settingsService.language.code,
transactionDate: transactionDateFormatted
};
this.loanService.getForeclosureData(this.loanId, data)
.subscribe((response: any) => {
this.loanService.getForeclosureData(this.loanId, data).subscribe((response: any) => {
this.foreclosuredata = response;
this.foreclosureForm.patchValue({
outstandingPrincipalPortion: this.foreclosuredata.principalPortion,
outstandingInterestPortion: this.foreclosuredata.interestPortion,
outstandingFeeChargesPortion: this.foreclosuredata.feeChargesPortion,
outstandingPenaltyChargesPortion: this.foreclosuredata.penaltyChargesPortion,
outstandingPenaltyChargesPortion: this.foreclosuredata.penaltyChargesPortion
});
});
}
@@ -100,10 +106,8 @@ export class ForeclosureComponent implements OnInit {
locale
};
this.loanService.loanForclosureData(this.loanId, data)
.subscribe((response: any) => {
this.router.navigate([`../../general`], { relativeTo: this.route });
});
}
this.loanService.loanForclosureData(this.loanId, data).subscribe((response: any) => {
this.router.navigate([`../../general`], { relativeTo: this.route });
});
}
}
@@ -57,4 +57,7 @@
<mifosx-asset-transfer-loan *ngIf="actions['Sell Loan'] || actions['Buy Back Loan']"></mifosx-asset-transfer-loan>
<mifosx-loan-reaging [dataObject]="actionButtonData" *ngIf="actions['Re-Age']"></mifosx-loan-reaging>
<mifosx-loan-reamortize [dataObject]="actionButtonData" *ngIf="actions['Re-Amortize']"></mifosx-loan-reamortize>
<mifosx-add-interest-pause [dataObject]="navigationData" *ngIf="actions['Add Interest Pause']"></mifosx-add-interest-pause>
<mifosx-add-interest-pause
[dataObject]="navigationData"
*ngIf="actions['Add Interest Pause']"
></mifosx-add-interest-pause>
@@ -8,9 +8,8 @@ describe('LoanAccountActionsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanAccountActionsComponent ]
})
.compileComponents();
declarations: [LoanAccountActionsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -11,84 +11,83 @@ import { ActivatedRoute, Router } from '@angular/router';
styleUrls: ['./loan-account-actions.component.scss']
})
export class LoanAccountActionsComponent {
/** Loan Details Data */
navigationData: any;
/** flag object to store possible actions and render appropriate UI to the user */
actions: {
'Close': boolean,
'Undo Approval': boolean,
'Write Off': boolean,
'Add Collateral': boolean,
'Assign Loan Officer': boolean,
'Foreclosure': boolean,
'Prepay Loan': boolean,
'Reject': boolean,
'Disburse to Savings': boolean,
'Make Repayment': boolean,
'Waive Interest': boolean,
'Close (as Rescheduled)': boolean,
'Reschedule': boolean,
'Recovery Payment': boolean,
'View Guarantors': boolean,
'Create Guarantor': boolean,
'Disburse': boolean,
'Withdrawn by Client': boolean,
'Undo Disbursal': boolean,
'Undo Last Disbursal': boolean,
'Loan Screen Reports': boolean,
'Approve': boolean,
'Add Loan Charge': boolean,
'Goodwill Credit': boolean,
'Merchant Issued Refund': boolean,
'Payout Refund': boolean,
'Credit Balance Refund': boolean,
'Edit Repayment Schedule': boolean,
'Charge-Off': boolean,
'Sell Loan': boolean,
'Buy Back Loan': boolean,
'Re-Age': boolean,
'Re-Amortize': boolean,
'Interest Payment Waiver': boolean,
'Add Interest Pause': boolean
Close: boolean;
'Undo Approval': boolean;
'Write Off': boolean;
'Add Collateral': boolean;
'Assign Loan Officer': boolean;
Foreclosure: boolean;
'Prepay Loan': boolean;
Reject: boolean;
'Disburse to Savings': boolean;
'Make Repayment': boolean;
'Waive Interest': boolean;
'Close (as Rescheduled)': boolean;
Reschedule: boolean;
'Recovery Payment': boolean;
'View Guarantors': boolean;
'Create Guarantor': boolean;
Disburse: boolean;
'Withdrawn by Client': boolean;
'Undo Disbursal': boolean;
'Undo Last Disbursal': boolean;
'Loan Screen Reports': boolean;
Approve: boolean;
'Add Loan Charge': boolean;
'Goodwill Credit': boolean;
'Merchant Issued Refund': boolean;
'Payout Refund': boolean;
'Credit Balance Refund': boolean;
'Edit Repayment Schedule': boolean;
'Charge-Off': boolean;
'Sell Loan': boolean;
'Buy Back Loan': boolean;
'Re-Age': boolean;
'Re-Amortize': boolean;
'Interest Payment Waiver': boolean;
'Add Interest Pause': boolean;
} = {
'Close': false,
'Undo Approval': false,
'Write Off': false,
'Add Collateral': false,
'Assign Loan Officer': false,
'Foreclosure': false,
'Prepay Loan': false,
'Reject': false,
'Disburse to Savings': false,
'Make Repayment': false,
'Waive Interest': false,
'Close (as Rescheduled)': false,
'Reschedule': false,
'Recovery Payment': false,
'View Guarantors': false,
'Create Guarantor': false,
'Disburse': false,
'Withdrawn by Client': false,
'Undo Disbursal': false,
'Undo Last Disbursal': false,
'Loan Screen Reports': false,
'Approve': false,
'Add Loan Charge': false,
'Goodwill Credit': false,
'Merchant Issued Refund': false,
'Payout Refund': false,
'Credit Balance Refund': false,
'Edit Repayment Schedule': false,
'Charge-Off': false,
'Sell Loan': false,
'Buy Back Loan': false,
'Re-Age': false,
'Re-Amortize': false,
'Interest Payment Waiver': false,
'Add Interest Pause': false
};
Close: false,
'Undo Approval': false,
'Write Off': false,
'Add Collateral': false,
'Assign Loan Officer': false,
Foreclosure: false,
'Prepay Loan': false,
Reject: false,
'Disburse to Savings': false,
'Make Repayment': false,
'Waive Interest': false,
'Close (as Rescheduled)': false,
Reschedule: false,
'Recovery Payment': false,
'View Guarantors': false,
'Create Guarantor': false,
Disburse: false,
'Withdrawn by Client': false,
'Undo Disbursal': false,
'Undo Last Disbursal': false,
'Loan Screen Reports': false,
Approve: false,
'Add Loan Charge': false,
'Goodwill Credit': false,
'Merchant Issued Refund': false,
'Payout Refund': false,
'Credit Balance Refund': false,
'Edit Repayment Schedule': false,
'Charge-Off': false,
'Sell Loan': false,
'Buy Back Loan': false,
'Re-Age': false,
'Re-Amortize': false,
'Interest Payment Waiver': false,
'Add Interest Pause': false
};
actionButtonData: any;
actionName: any;
@@ -96,7 +95,8 @@ export class LoanAccountActionsComponent {
/**
* @param route Activated Route.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private router: Router
) {
this.navigationData = this.router.getCurrentNavigation().extras.state.data;
@@ -104,7 +104,7 @@ export class LoanAccountActionsComponent {
this.actionButtonData = data.actionButtonData;
});
this.route.params.subscribe(params => {
this.route.params.subscribe((params) => {
this.actionName = params['action'];
if (this.actionName === 'Change Loan Officer') {
this.actionName = 'Assign Loan Officer';
@@ -115,5 +115,4 @@ export class LoanAccountActionsComponent {
this.actions[this.actionName] = true;
});
}
}
@@ -8,9 +8,8 @@ describe('LoanCreditBalanceRefundComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoanCreditBalanceRefundComponent ]
})
.compileComponents();
declarations: [LoanCreditBalanceRefundComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -12,7 +12,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./loan-credit-balance-refund.component.scss']
})
export class LoanCreditBalanceRefundComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -31,14 +30,16 @@ export class LoanCreditBalanceRefundComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the Credit Balance loan form
@@ -58,10 +59,16 @@ export class LoanCreditBalanceRefundComponent implements OnInit {
*/
createCreditBalanceLoanForm() {
this.creditBalanceLoanForm = this.formBuilder.group({
'transactionDate': [new Date(), Validators.required],
'transactionAmount': ['', Validators.required],
'externalId': '',
'note': ''
transactionDate: [
new Date(),
Validators.required
],
transactionAmount: [
'',
Validators.required
],
externalId: '',
note: ''
});
}
@@ -87,10 +94,8 @@ export class LoanCreditBalanceRefundComponent implements OnInit {
};
const command = this.dataObject.type.code.split('.')[1];
data['transactionAmount'] = data['transactionAmount'] * 1;
this.loanService.submitLoanActionButton(this.loanId, data, command)
.subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
this.loanService.submitLoanActionButton(this.loanId, data, command).subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('LoanReagingComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoanReagingComponent ]
})
.compileComponents();
declarations: [LoanReagingComponent]
}).compileComponents();
fixture = TestBed.createComponent(LoanReagingComponent);
component = fixture.componentInstance;
@@ -26,13 +26,15 @@ export class LoanReagingComponent implements OnInit {
/** Maximum Date allowed. */
maxDate = new Date();
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService,
private dropdownOptions: DropdownOptions,
private loanService: LoansService,
private dateUtils: Dates) {
private dateUtils: Dates
) {
this.loanId = this.route.snapshot.params['loanId'];
this.frequencyOptions = this.dropdownOptions.retrievePeriodFrequencyTypeOptions(false);
}
@@ -44,12 +46,24 @@ export class LoanReagingComponent implements OnInit {
createReagingLoanForm() {
this.reagingLoanForm = this.formBuilder.group({
'numberOfInstallments': [1, Validators.required],
'startDate': [this.settingsService.businessDate, Validators.required],
'frequencyNumber': [1, Validators.required],
'frequencyType': [, Validators.required],
'note': '',
'externalId': ''
numberOfInstallments: [
1,
Validators.required
],
startDate: [
this.settingsService.businessDate,
Validators.required
],
frequencyNumber: [
1,
Validators.required
],
frequencyType: [
,
Validators.required
],
note: '',
externalId: ''
});
}
@@ -66,10 +80,8 @@ export class LoanReagingComponent implements OnInit {
dateFormat,
locale
};
this.loanService.submitLoanActionButton(this.loanId, data, 'reAge')
.subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
this.loanService.submitLoanActionButton(this.loanId, data, 'reAge').subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('LoanReamortizeComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoanReamortizeComponent ]
})
.compileComponents();
declarations: [LoanReamortizeComponent]
}).compileComponents();
fixture = TestBed.createComponent(LoanReamortizeComponent);
component = fixture.componentInstance;
@@ -15,11 +15,13 @@ export class LoanReamortizeComponent implements OnInit {
/** ReAmortize Loan Form */
reamortizeLoanForm: UntypedFormGroup;
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private loanService: LoansService) {
this.loanId = this.route.snapshot.params['loanId'];
private loanService: LoansService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
ngOnInit(): void {
@@ -28,19 +30,15 @@ export class LoanReamortizeComponent implements OnInit {
createReAmortizeLoanForm() {
this.reamortizeLoanForm = this.formBuilder.group({
'note': '',
'externalId': ''
note: '',
externalId: ''
});
}
submit(): void {
const data = this.reamortizeLoanForm.value;
this.loanService.submitLoanActionButton(this.loanId, data, 'reAmortize')
.subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
this.loanService.submitLoanActionButton(this.loanId, data, 'reAmortize').subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('LoanRescheduleComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanRescheduleComponent ]
})
.compileComponents();
declarations: [LoanRescheduleComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,7 +13,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./loan-reschedule.component.scss']
})
export class LoanRescheduleComponent implements OnInit {
@Input() dataObject: any;
loanId: any;
rescheduleLoanForm: UntypedFormGroup;
@@ -36,14 +35,16 @@ export class LoanRescheduleComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
@@ -53,17 +54,25 @@ export class LoanRescheduleComponent implements OnInit {
setRescheduleLoanForm() {
this.rescheduleLoanForm = this.formBuilder.group({
'rescheduleFromDate': [new Date(), Validators.required],
'rescheduleReasonId': ['', Validators.required],
'submittedOnDate': [new Date(), Validators.required],
'rescheduleReasonComment': [''],
'adjustedDueDate': [''],
'graceOnPrincipal': [''],
'graceOnInterest': [''],
'extraTerms': [''],
'newInterestRate': ['']
rescheduleFromDate: [
new Date(),
Validators.required
],
rescheduleReasonId: [
'',
Validators.required
],
submittedOnDate: [
new Date(),
Validators.required
],
rescheduleReasonComment: [''],
adjustedDueDate: [''],
graceOnPrincipal: [''],
graceOnInterest: [''],
extraTerms: [''],
newInterestRate: ['']
});
}
submit() {
@@ -89,12 +98,10 @@ export class LoanRescheduleComponent implements OnInit {
};
data.loanId = this.loanId;
this.loanService.submitRescheduleData(data).subscribe((response: any) => {
// TODO: needs to be updated
// mentioned in Community App:
// location.path('/loans-accounts/' + scope.loanId + '/viewreschedulerequest/'+ data.resourceId);
this.router.navigate(['../../general'], { relativeTo: this.route });
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('LoanScreenReportsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanScreenReportsComponent ]
})
.compileComponents();
declarations: [LoanScreenReportsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -16,7 +16,6 @@ import { DomSanitizer } from '@angular/platform-browser';
styleUrls: ['./loan-screen-reports.component.scss']
})
export class LoanScreenReportsComponent implements OnInit {
@Input() dataObject: any;
/** Loan Screen Reportform. */
loanScreenReportForm: UntypedFormGroup;
@@ -38,11 +37,13 @@ export class LoanScreenReportsComponent implements OnInit {
* @param {DomSanitizer} sanitizer DOM Sanitizer
* @param {Renderer2} renderer Renderer 2
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loansService: LoansService,
private route: ActivatedRoute,
private sanitizer: DomSanitizer,
private renderer: Renderer2) {
private renderer: Renderer2
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -59,7 +60,7 @@ export class LoanScreenReportsComponent implements OnInit {
*/
createLoanScreenReportForm() {
this.loanScreenReportForm = this.formBuilder.group({
'templateId': ['']
templateId: ['']
});
}
@@ -86,5 +87,4 @@ export class LoanScreenReportsComponent implements OnInit {
this.renderer.setProperty(this.screenReportRef.nativeElement, 'innerHTML', this.template);
});
}
}
@@ -8,9 +8,8 @@ describe('LoansAccountCloseComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoansAccountCloseComponent ]
})
.compileComponents();
declarations: [LoansAccountCloseComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -14,7 +14,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./loans-account-close.component.scss']
})
export class LoansAccountCloseComponent implements OnInit {
@Input() dataObject: any;
/** Close form. */
@@ -33,14 +32,16 @@ export class LoansAccountCloseComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the close form.
@@ -55,8 +56,11 @@ export class LoansAccountCloseComponent implements OnInit {
*/
createCloseForm() {
this.closeLoanForm = this.formBuilder.group({
'transactionDate': [new Date(this.dataObject.date) || new Date(), Validators.required],
'note': []
transactionDate: [
new Date(this.dataObject.date) || new Date(),
Validators.required
],
note: []
});
}
@@ -77,10 +81,8 @@ export class LoansAccountCloseComponent implements OnInit {
dateFormat,
locale
};
this.loanService.submitLoanActionButton(this.loanId, data, 'close')
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
this.loanService.submitLoanActionButton(this.loanId, data, 'close').subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('MakeRepaymentComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ MakeRepaymentComponent ]
})
.compileComponents();
declarations: [MakeRepaymentComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./make-repayment.component.scss']
})
export class MakeRepaymentComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -41,14 +40,16 @@ export class MakeRepaymentComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the repayment loan form
@@ -68,11 +69,17 @@ export class MakeRepaymentComponent implements OnInit {
*/
createRepaymentLoanForm() {
this.repaymentLoanForm = this.formBuilder.group({
'transactionDate': [this.settingsService.businessDate, Validators.required],
'transactionAmount': ['', Validators.required],
'externalId': '',
'paymentTypeId': '',
'note': ''
transactionDate: [
this.settingsService.businessDate,
Validators.required
],
transactionAmount: [
'',
Validators.required
],
externalId: '',
paymentTypeId: '',
note: ''
});
}
@@ -119,10 +126,8 @@ export class MakeRepaymentComponent implements OnInit {
};
const command = this.dataObject.type.code.split('.')[1];
data['transactionAmount'] = data['transactionAmount'] * 1;
this.loanService.submitLoanActionButton(this.loanId, data, command)
.subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
this.loanService.submitLoanActionButton(this.loanId, data, command).subscribe((response: any) => {
this.router.navigate(['../../transactions'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('PrepayLoanComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ PrepayLoanComponent ]
})
.compileComponents();
declarations: [PrepayLoanComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -9,7 +9,6 @@ import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { Currency } from 'app/shared/models/general.model';
/**
* Loan Prepay Loan Option
*/
@@ -19,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./prepay-loan.component.scss']
})
export class PrepayLoanComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -48,14 +46,16 @@ export class PrepayLoanComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
}
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the prepay loan form
@@ -76,11 +76,17 @@ export class PrepayLoanComponent implements OnInit {
*/
createprepayLoanForm() {
this.prepayLoanForm = this.formBuilder.group({
'transactionDate': [new Date(), Validators.required],
'transactionAmount': ['', Validators.required],
'externalId': [''],
'paymentTypeId': [''],
'note': ['']
transactionDate: [
new Date(),
Validators.required
],
transactionAmount: [
'',
Validators.required
],
externalId: [''],
paymentTypeId: [''],
note: ['']
});
}
@@ -95,8 +101,7 @@ export class PrepayLoanComponent implements OnInit {
this.prepayLoanForm.get('transactionDate').valueChanges.subscribe((transactionDate: string) => {
const prepayDate = this.dateUtils.formatDate(transactionDate, this.settingsService.dateFormat);
this.loanService.getLoanPrepayLoanActionTemplate(this.loanId, prepayDate)
.subscribe((response: any) => {
this.loanService.getLoanPrepayLoanActionTemplate(this.loanId, prepayDate).subscribe((response: any) => {
this.prepayData = response;
this.prepayLoanForm.patchValue({
transactionAmount: this.prepayData.amount
@@ -142,10 +147,8 @@ export class PrepayLoanComponent implements OnInit {
locale
};
data['transactionAmount'] = data['transactionAmount'] * 1;
this.loanService.submitLoanActionButton(this.loanId, data, 'repayment')
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
this.loanService.submitLoanActionButton(this.loanId, data, 'repayment').subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('RecoveryRepaymentComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RecoveryRepaymentComponent ]
})
.compileComponents();
declarations: [RecoveryRepaymentComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./recovery-repayment.component.scss']
})
export class RecoveryRepaymentComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -41,12 +40,14 @@ export class RecoveryRepaymentComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -68,11 +69,17 @@ export class RecoveryRepaymentComponent implements OnInit {
*/
createRecoveryRepaymentLoanForm() {
this.recoveryRepaymentLoanForm = this.formBuilder.group({
'transactionDate': [new Date(), Validators.required],
'transactionAmount': ['', Validators.required],
'externalId': [''],
'paymentTypeId': [''],
'note': ['']
transactionDate: [
new Date(),
Validators.required
],
transactionAmount: [
'',
Validators.required
],
externalId: [''],
paymentTypeId: [''],
note: ['']
});
}
@@ -120,10 +127,8 @@ export class RecoveryRepaymentComponent implements OnInit {
locale
};
data['transactionAmount'] = data['transactionAmount'] * 1;
this.loanService.submitLoanActionButton(this.loanId, data, 'recoverypayment')
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
this.loanService.submitLoanActionButton(this.loanId, data, 'recoverypayment').subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('RejectLoanComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RejectLoanComponent ]
})
.compileComponents();
declarations: [RejectLoanComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./reject-loan.component.scss']
})
export class RejectLoanComponent implements OnInit {
/** Loan Id. */
loanId: any;
/** Reject Loan form. */
@@ -34,12 +33,14 @@ export class RejectLoanComponent implements OnInit {
* @param route Activated Route.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute,
private loanService: LoansService,
private dateUtils: Dates,
private settingsService: SettingsService ) {
constructor(
private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute,
private loanService: LoansService,
private dateUtils: Dates,
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -53,8 +54,11 @@ export class RejectLoanComponent implements OnInit {
*/
setRejectLoanForm() {
this.rejectLoanForm = this.formBuilder.group({
'rejectedOnDate': [new Date(), Validators.required],
'note': ['']
rejectedOnDate: [
new Date(),
Validators.required
],
note: ['']
});
}
@@ -78,5 +82,4 @@ export class RejectLoanComponent implements OnInit {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('UndoApprovalComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UndoApprovalComponent ]
})
.compileComponents();
declarations: [UndoApprovalComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -14,7 +14,6 @@ import { LoansService } from 'app/loans/loans.service';
styleUrls: ['./undo-approval.component.scss']
})
export class UndoApprovalComponent implements OnInit {
/** Form Controller. */
note: UntypedFormControl;
@@ -23,10 +22,12 @@ export class UndoApprovalComponent implements OnInit {
* @param route Activated Route.
* @param router Router.
*/
constructor(private loanService: LoansService,
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router) { }
constructor(
private loanService: LoansService,
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router
) {}
ngOnInit() {
this.note = this.formBuilder.control('');
@@ -37,9 +38,8 @@ export class UndoApprovalComponent implements OnInit {
*/
submit() {
const loanId = this.route.snapshot.params['loanId'];
this.loanService.loanActionButtons(loanId, 'undoapproval', { 'note': this.note.value }).subscribe((response: any) => {
this.router.navigate(['../../general'], {relativeTo: this.route});
this.loanService.loanActionButtons(loanId, 'undoapproval', { note: this.note.value }).subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('UndoDisbursalComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ UndoDisbursalComponent ]
})
.compileComponents();
declarations: [UndoDisbursalComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -15,7 +15,6 @@ import { LoansService } from '../../../loans.service';
styleUrls: ['./undo-disbursal.component.scss']
})
export class UndoDisbursalComponent implements OnInit {
@Input() actionName: string;
/** Loan ID. */
@@ -29,10 +28,12 @@ export class UndoDisbursalComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
*/
constructor(private formBuilder: UntypedFormBuilder,
private loansService: LoansService,
private router: Router,
private route: ActivatedRoute) {
constructor(
private formBuilder: UntypedFormBuilder,
private loansService: LoansService,
private router: Router,
private route: ActivatedRoute
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -51,9 +52,8 @@ export class UndoDisbursalComponent implements OnInit {
if (this.actionName === 'Undo Last Disbursal') {
command = 'undolastdisbursal';
}
this.loansService.loanActionButtons(this.loanId, command, {'note': this.note.value}).subscribe((response: any) => {
this.loansService.loanActionButtons(this.loanId, command, { note: this.note.value }).subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('ViewGuarantorsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewGuarantorsComponent ]
})
.compileComponents();
declarations: [ViewGuarantorsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -20,12 +20,20 @@ import { LoansAccountViewGuarantorDetailsDialogComponent } from 'app/loans/custo
styleUrls: ['./view-guarantors.component.scss']
})
export class ViewGuarantorsComponent implements OnInit {
@Input() dataObject: any;
guarantorDetails: any;
showDeletedGuarantorsAccounts = false;
loanId: any;
guarantorsDisplayedColumns: string[] = ['fullname', 'relationship', 'guarantortype', 'depositAccount', 'amount', 'remainingAmount', 'status', 'action'];
guarantorsDisplayedColumns: string[] = [
'fullname',
'relationship',
'guarantortype',
'depositAccount',
'amount',
'remainingAmount',
'status',
'action'
];
/** View and perform various action on existing list of guarantors
* @param {MatDialog} dialog Dialog
@@ -33,10 +41,12 @@ export class ViewGuarantorsComponent implements OnInit {
* @param {route} Route Route
* @param {router} Router Router
*/
constructor(public dialog: MatDialog,
public loansService: LoansService,
private route: ActivatedRoute,
private router: Router) {
constructor(
public dialog: MatDialog,
public loansService: LoansService,
private route: ActivatedRoute,
private router: Router
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -75,8 +85,8 @@ export class ViewGuarantorsComponent implements OnInit {
private reload() {
const clientId = this.dataObject.clientId;
const url: string = this.router.url;
this.router.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true })
this.router
.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('WaiveInterestComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WaiveInterestComponent ]
})
.compileComponents();
declarations: [WaiveInterestComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./waive-interest.component.scss']
})
export class WaiveInterestComponent implements OnInit {
@Input() dataObject: any;
/** Loan Interest form. */
@@ -36,12 +35,14 @@ export class WaiveInterestComponent implements OnInit {
* @param {LoansService} loanService Loan Service.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private formBuilder: UntypedFormBuilder,
private router: Router,
private settingsService: SettingsService,
private dateUtils: Dates,
private loanService: LoansService,
private route: ActivatedRoute) { }
constructor(
private formBuilder: UntypedFormBuilder,
private router: Router,
private settingsService: SettingsService,
private dateUtils: Dates,
private loanService: LoansService,
private route: ActivatedRoute
) {}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
@@ -56,9 +57,15 @@ export class WaiveInterestComponent implements OnInit {
*/
setLoanInterestForm() {
this.loanInterestForm = this.formBuilder.group({
'transactionAmount': [this.dataObject.amount, Validators.required],
'transactionDate': [this.dataObject.date && new Date(this.dataObject.date), Validators.required],
'note': ['']
transactionAmount: [
this.dataObject.amount,
Validators.required
],
transactionDate: [
this.dataObject.date && new Date(this.dataObject.date),
Validators.required
],
note: ['']
});
}
@@ -81,8 +88,7 @@ export class WaiveInterestComponent implements OnInit {
data['transactionAmount'] = data['transactionAmount'] * 1;
const loanId = this.route.snapshot.params['loanId'];
this.loanService.submitLoanActionButton(loanId, data, 'waiveinterest').subscribe((response: any) => {
this.router.navigate(['../../general'], {relativeTo: this.route});
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('WithdrawnByClientComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WithdrawnByClientComponent ]
})
.compileComponents();
declarations: [WithdrawnByClientComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./withdrawn-by-client.component.scss']
})
export class WithdrawnByClientComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -35,12 +34,14 @@ export class WithdrawnByClientComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -58,8 +59,11 @@ export class WithdrawnByClientComponent implements OnInit {
*/
createWithdrawnByClientLoanForm() {
this.withdrawnByClientLoanForm = this.formBuilder.group({
'withdrawnOnDate': [new Date(), Validators.required],
'note': ''
withdrawnOnDate: [
new Date(),
Validators.required
],
note: ''
});
}
@@ -77,10 +81,8 @@ export class WithdrawnByClientComponent implements OnInit {
dateFormat,
locale
};
this.loanService.loanActionButtons(this.loanId, 'withdrawnByApplicant', data)
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
this.loanService.loanActionButtons(this.loanId, 'withdrawnByApplicant', data).subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('WriteOffPageComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ WriteOffPageComponent ]
})
.compileComponents();
declarations: [WriteOffPageComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./write-off-page.component.scss']
})
export class WriteOffPageComponent implements OnInit {
@Input() dataObject: any;
/** Minimum Date allowed. */
@@ -37,12 +36,14 @@ export class WriteOffPageComponent implements OnInit {
* @param {Router} router Router.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private loanService: LoansService,
private dateUtils: Dates,
private router: Router,
private settingsService: SettingsService) { }
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private loanService: LoansService,
private dateUtils: Dates,
private router: Router,
private settingsService: SettingsService
) {}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
@@ -54,9 +55,12 @@ export class WriteOffPageComponent implements OnInit {
*/
setWriteOffForm() {
this.writeOffForm = this.formBuilder.group({
'transactionDate': [this.dataObject.date && new Date(this.dataObject.date), Validators.required],
'amount': [{value: this.dataObject.amount, disabled: true}],
'note': ['']
transactionDate: [
this.dataObject.date && new Date(this.dataObject.date),
Validators.required
],
amount: [{ value: this.dataObject.amount, disabled: true }],
note: ['']
});
}
@@ -79,8 +83,7 @@ export class WriteOffPageComponent implements OnInit {
const loanId = this.route.snapshot.params['loanId'];
delete data.amount;
this.loanService.submitLoanActionButton(loanId, data, 'writeoff').subscribe((response: any) => {
this.router.navigate(['../../general'], {relativeTo: this.route});
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}
@@ -1,20 +1,19 @@
/** Recurring Deposits Account Buttons Configuration */
export class LoansAccountButtonConfiguration {
optionArray: {
name: string,
taskPermissionName?: string,
name: string;
taskPermissionName?: string;
}[];
optionPaymentArray: {
name: string,
taskPermissionName?: string,
name: string;
taskPermissionName?: string;
}[];
buttonsArray: {
name: string,
icon: string,
taskPermissionName?: string,
name: string;
icon: string;
taskPermissionName?: string;
}[];
constructor(status: string) {
@@ -41,22 +40,22 @@ export class LoansAccountButtonConfiguration {
{
name: 'Add Loan Charge',
icon: 'plus',
taskPermissionName: 'CREATE_LOANCHARGE',
taskPermissionName: 'CREATE_LOANCHARGE'
},
{
name: 'Foreclosure',
icon: 'heart-broken',
taskPermissionName: 'FORECLOSURE_LOAN',
taskPermissionName: 'FORECLOSURE_LOAN'
},
{
name: 'Make Repayment',
icon: 'coins',
taskPermissionName: 'REPAYMENT_LOAN',
taskPermissionName: 'REPAYMENT_LOAN'
},
{
name: 'Undo Disbursal',
icon: 'undo',
taskPermissionName: 'DISBURSALUNDO_LOAN',
taskPermissionName: 'DISBURSALUNDO_LOAN'
}
];
break;
@@ -65,23 +64,23 @@ export class LoansAccountButtonConfiguration {
{
name: 'Add Loan Charge',
icon: 'plus',
taskPermissionName: 'CREATE_LOANCHARGE',
taskPermissionName: 'CREATE_LOANCHARGE'
},
{
name: 'Approve',
icon: 'check',
taskPermissionName: 'APPROVE_LOAN',
taskPermissionName: 'APPROVE_LOAN'
},
{
name: 'Modify Application',
icon: 'edit',
taskPermissionName: 'UPDATE_LOAN',
taskPermissionName: 'UPDATE_LOAN'
},
{
name: 'Reject',
icon: 'times',
taskPermissionName: 'REJECT_LOAN',
},
taskPermissionName: 'REJECT_LOAN'
}
];
break;
case 'Approved':
@@ -89,18 +88,18 @@ export class LoansAccountButtonConfiguration {
{
name: 'Disburse',
icon: 'hand-holding-usd',
taskPermissionName: 'DISBURSE_LOAN',
taskPermissionName: 'DISBURSE_LOAN'
},
{
name: 'Disburse to Savings',
icon: 'piggy-bank',
taskPermissionName: 'DISBURSETOSAVINGS_LOAN',
taskPermissionName: 'DISBURSETOSAVINGS_LOAN'
},
{
name: 'Undo Approval',
icon: 'undo',
taskPermissionName: 'APPROVALUNDO_LOAN',
},
taskPermissionName: 'APPROVALUNDO_LOAN'
}
];
break;
case 'Overpaid':
@@ -108,12 +107,12 @@ export class LoansAccountButtonConfiguration {
{
name: 'Transfer Funds',
icon: 'exchange',
taskPermissionName: 'CREATE_ACCOUNTTRANSFER',
taskPermissionName: 'CREATE_ACCOUNTTRANSFER'
},
{
name: 'Credit Balance Refund',
icon: 'coins',
taskPermissionName: 'CREATE_CREDIT_BALANCE_REFUND',
taskPermissionName: 'CREATE_CREDIT_BALANCE_REFUND'
}
];
break;
@@ -122,8 +121,8 @@ export class LoansAccountButtonConfiguration {
{
name: 'Recovery Payment',
icon: 'briefcase',
taskPermissionName: 'RECOVERYPAYMENT_LOAN',
},
taskPermissionName: 'RECOVERYPAYMENT_LOAN'
}
];
break;
case 'Closed (obligations met)':
@@ -131,22 +130,22 @@ export class LoansAccountButtonConfiguration {
{
name: 'Goodwill Credit',
icon: 'coins',
taskPermissionName: 'CREATE_GOODWILL_TRANSACTION',
taskPermissionName: 'CREATE_GOODWILL_TRANSACTION'
},
{
name: 'Interest Payment Waiver',
icon: 'coins',
taskPermissionName: 'CREATE_INTERESTPAYMENTWAIVER_TRANSACTION',
taskPermissionName: 'CREATE_INTERESTPAYMENTWAIVER_TRANSACTION'
},
{
name: 'Payout Refund',
icon: 'coins',
taskPermissionName: 'CREATE_PAYOUT_REFUND',
taskPermissionName: 'CREATE_PAYOUT_REFUND'
},
{
name: 'Merchant Issued Refund',
icon: 'coins',
taskPermissionName: 'CREATE_MERCHANT_ISSUED_REFUND',
taskPermissionName: 'CREATE_MERCHANT_ISSUED_REFUND'
}
];
break;
@@ -161,61 +160,61 @@ export class LoansAccountButtonConfiguration {
this.optionArray = [
{
name: 'Waive Interest',
taskPermissionName: 'WAIVEINTERESTPORTION_LOAN',
taskPermissionName: 'WAIVEINTERESTPORTION_LOAN'
},
{
name: 'Reschedule',
taskPermissionName: 'CREATE_RESCHEDULELOAN',
taskPermissionName: 'CREATE_RESCHEDULELOAN'
},
{
name: 'Write Off',
taskPermissionName: 'WRITEOFF_LOAN',
taskPermissionName: 'WRITEOFF_LOAN'
},
{
name: 'Close (as Rescheduled)',
taskPermissionName: 'CLOSEASRESCHEDULED_LOAN',
taskPermissionName: 'CLOSEASRESCHEDULED_LOAN'
},
{
name: 'Close',
taskPermissionName: 'CLOSE_LOAN',
taskPermissionName: 'CLOSE_LOAN'
},
{
name: 'Loan Screen Report',
taskPermissionName: 'READ_LOAN',
taskPermissionName: 'READ_LOAN'
},
{
name: 'View Guarantors',
taskPermissionName: 'READ_GUARANTOR',
taskPermissionName: 'READ_GUARANTOR'
},
{
name: 'Create Guarantor',
taskPermissionName: 'CREATE_GUARANTOR',
taskPermissionName: 'CREATE_GUARANTOR'
},
{
name: 'Recover From Guarantor',
taskPermissionName: 'RECOVERGUARANTEES_LOAN',
taskPermissionName: 'RECOVERGUARANTEES_LOAN'
},
{
name: 'Sell Loan',
taskPermissionName: 'SALE_LOAN',
taskPermissionName: 'SALE_LOAN'
}
];
this.optionPaymentArray = [
{
name: 'Goodwill Credit',
taskPermissionName: 'CREATE_GOODWILL_TRANSACTION',
taskPermissionName: 'CREATE_GOODWILL_TRANSACTION'
},
{
name: 'Interest Payment Waiver',
taskPermissionName: 'CREATE_INTERESTPAYMENTWAIVER_TRANSACTION',
taskPermissionName: 'CREATE_INTERESTPAYMENTWAIVER_TRANSACTION'
},
{
name: 'Payout Refund',
taskPermissionName: 'CREATE_PAYOUT_REFUND',
taskPermissionName: 'CREATE_PAYOUT_REFUND'
},
{
name: 'Merchant Issued Refund',
taskPermissionName: 'CREATE_MERCHANT_ISSUED_REFUND',
taskPermissionName: 'CREATE_MERCHANT_ISSUED_REFUND'
}
];
break;
@@ -223,28 +222,28 @@ export class LoansAccountButtonConfiguration {
this.optionArray = [
{
name: 'Withdrawn by Client',
taskPermissionName: 'WITHDRAW_LOAN',
taskPermissionName: 'WITHDRAW_LOAN'
},
{
name: 'Delete',
taskPermissionName: 'DELETE_LOAN',
taskPermissionName: 'DELETE_LOAN'
},
{
name: 'Add Collateral',
taskPermissionName: 'CREATE_COLLATERAL',
taskPermissionName: 'CREATE_COLLATERAL'
},
{
name: 'View Guarantors',
taskPermissionName: 'READ_GUARANTOR',
taskPermissionName: 'READ_GUARANTOR'
},
{
name: 'Create Guarantor',
taskPermissionName: 'CREATE_GUARANTOR',
taskPermissionName: 'CREATE_GUARANTOR'
},
{
name: 'Loan Screen Reports',
taskPermissionName: 'READ_LOAN',
},
taskPermissionName: 'READ_LOAN'
}
];
this.optionPaymentArray = [];
break;
@@ -252,20 +251,20 @@ export class LoansAccountButtonConfiguration {
this.optionArray = [
{
name: 'Add Loan Charge',
taskPermissionName: 'CREATE_LOANCHARGE',
taskPermissionName: 'CREATE_LOANCHARGE'
},
{
name: 'View Guarantors',
taskPermissionName: 'READ_GUARANTOR',
taskPermissionName: 'READ_GUARANTOR'
},
{
name: 'Create Guarantor',
taskPermissionName: 'CREATE_GUARANTOR',
taskPermissionName: 'CREATE_GUARANTOR'
},
{
name: 'Loan Screen Report',
taskPermissionName: 'READ_LOAN',
},
taskPermissionName: 'READ_LOAN'
}
];
this.optionPaymentArray = [];
break;
@@ -275,12 +274,11 @@ export class LoansAccountButtonConfiguration {
}
}
addOption(option: { name: string, icon?: string, taskPermissionName?: string }) {
addOption(option: { name: string; icon?: string; taskPermissionName?: string }) {
this.optionArray.push(option);
}
addButton(option: { name: string, icon: string, taskPermissionName?: string }) {
addButton(option: { name: string; icon: string; taskPermissionName?: string }) {
this.buttonsArray.push(option);
}
}
@@ -8,9 +8,8 @@ describe('LoanCollateralTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanCollateralTabComponent ]
})
.compileComponents();
declarations: [LoanCollateralTabComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -7,11 +7,15 @@ import { ActivatedRoute } from '@angular/router';
styleUrls: ['./loan-collateral-tab.component.scss']
})
export class LoanCollateralTabComponent implements OnInit {
/** Loan Collateral Details */
loanCollaterals: any[] = [];
/** Columns to be displayed in collateral table. */
displayedColumns: string[] = ['id', 'currency', 'description', 'total'];
displayedColumns: string[] = [
'id',
'currency',
'description',
'total'
];
totalAmount: number;
@@ -31,5 +35,4 @@ export class LoanCollateralTabComponent implements OnInit {
this.totalAmount = this.totalAmount + collateral.value;
});
}
}
@@ -8,9 +8,8 @@ describe('LoanDelinquencyTagsTabComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoanDelinquencyTagsTabComponent ]
})
.compileComponents();
declarations: [LoanDelinquencyTagsTabComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -5,7 +5,12 @@ import { TranslateService } from '@ngx-translate/core';
import { Dates } from 'app/core/utils/dates';
import { LoanDelinquencyActionDialogComponent } from 'app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component';
import { LoansService } from 'app/loans/loans.service';
import { DelinquentData, InstallmentLevelDelinquency, LoanDelinquencyAction, LoanDelinquencyTags } from 'app/loans/models/loan-account.model';
import {
DelinquentData,
InstallmentLevelDelinquency,
LoanDelinquencyAction,
LoanDelinquencyTags
} from 'app/loans/models/loan-account.model';
import { SettingsService } from 'app/settings/settings.service';
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
import { Currency } from 'app/shared/models/general.model';
@@ -16,15 +21,28 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./loan-delinquency-tags-tab.component.scss']
})
export class LoanDelinquencyTagsTabComponent implements OnInit {
loanDelinquencyTags: LoanDelinquencyTags[] = [];
loanDelinquencyActions: LoanDelinquencyAction[] = [];
currentLoanDelinquencyAction: LoanDelinquencyAction | null;
currency: Currency;
installmentLevelDelinquency: InstallmentLevelDelinquency[] = [];
loanDelinquencyTagsColumns: string[] = ['classification', 'addedOn', 'liftedOn'];
loanDelinquencyActionsColumns: string[] = ['action', 'startDate', 'endDate', 'createdOn', 'actions'];
installmentDelinquencyTagsColumns: string[] = ['classification', 'minimumAgeDays', 'amount'];
loanDelinquencyTagsColumns: string[] = [
'classification',
'addedOn',
'liftedOn'
];
loanDelinquencyActionsColumns: string[] = [
'action',
'startDate',
'endDate',
'createdOn',
'actions'
];
installmentDelinquencyTagsColumns: string[] = [
'classification',
'minimumAgeDays',
'amount'
];
allowPause = true;
loanId: any;
@@ -32,29 +50,33 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
locale: string;
dateFormat: string;
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private loansServices: LoansService,
private dateUtils: Dates,
private settingsService: SettingsService,
private translateService: TranslateService,
public dialog: MatDialog) {
public dialog: MatDialog
) {
this.loanId = this.route.parent.parent.snapshot.params['loanId'];
this.route.parent.data.subscribe((data: {
loanDelinquencyTagsData: LoanDelinquencyTags[],
loanDelinquencyData: any,
loanDelinquencyActions: LoanDelinquencyAction[]
}) => {
this.loanDelinquencyTags = data.loanDelinquencyTagsData;
this.loanDelinquencyActions = data.loanDelinquencyActions || [];
this.validateDelinquencyActions();
const loanDelinquencyData: DelinquentData | null = data.loanDelinquencyData.delinquent || null;
this.currency = data.loanDelinquencyData.currency;
this.installmentLevelDelinquency = [];
if (loanDelinquencyData != null) {
this.installmentLevelDelinquency = loanDelinquencyData.installmentLevelDelinquency || [];
this.route.parent.data.subscribe(
(data: {
loanDelinquencyTagsData: LoanDelinquencyTags[];
loanDelinquencyData: any;
loanDelinquencyActions: LoanDelinquencyAction[];
}) => {
this.loanDelinquencyTags = data.loanDelinquencyTagsData;
this.loanDelinquencyActions = data.loanDelinquencyActions || [];
this.validateDelinquencyActions();
const loanDelinquencyData: DelinquentData | null = data.loanDelinquencyData.delinquent || null;
this.currency = data.loanDelinquencyData.currency;
this.installmentLevelDelinquency = [];
if (loanDelinquencyData != null) {
this.installmentLevelDelinquency = loanDelinquencyData.installmentLevelDelinquency || [];
}
}
});
);
}
ngOnInit(): void {
@@ -68,7 +90,7 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
if (this.loanDelinquencyActions.length > 0) {
const businessDate: Date = this.settingsService.businessDate;
this.currentLoanDelinquencyAction = this.loanDelinquencyActions[this.loanDelinquencyActions.length - 1];
this.allowPause = (this.currentLoanDelinquencyAction.action === 'RESUME');
this.allowPause = this.currentLoanDelinquencyAction.action === 'RESUME';
}
}
@@ -77,7 +99,7 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
const loanDelinquencyActionDialogRef = this.dialog.open(LoanDelinquencyActionDialogComponent, {
data: {
action: action
},
}
});
loanDelinquencyActionDialogRef.afterClosed().subscribe((response: { data: any }) => {
const startDate: Date = response.data.value.startDate;
@@ -91,7 +113,10 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
const removePauseDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: {
heading: this.translateService.instant('labels.heading.Loan Delinquency Classification'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want resume the Delinquency Classification for Loan') + this.loanId,
dialogContext:
this.translateService.instant(
'labels.dialogContext.Are you sure you want resume the Delinquency Classification for Loan'
) + this.loanId,
type: 'Mild'
}
});
@@ -120,10 +145,12 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
}
this.loansServices.createDelinquencyActions(this.loanId, payload).subscribe((result: any) => {
this.loansServices.getDelinquencyActions(this.loanId).subscribe((loanDelinquencyActions: LoanDelinquencyAction[]) => {
this.loanDelinquencyActions = loanDelinquencyActions;
this.validateDelinquencyActions();
});
this.loansServices
.getDelinquencyActions(this.loanId)
.subscribe((loanDelinquencyActions: LoanDelinquencyAction[]) => {
this.loanDelinquencyActions = loanDelinquencyActions;
this.validateDelinquencyActions();
});
});
}
@@ -157,5 +184,4 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
}
return 'status-active';
}
}
@@ -8,9 +8,8 @@ describe('LoanDocumentsTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanDocumentsTabComponent ]
})
.compileComponents();
declarations: [LoanDocumentsTabComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -16,7 +16,6 @@ import { SettingsService } from 'app/settings/settings.service';
styleUrls: ['./loan-documents-tab.component.scss']
})
export class LoanDocumentsTabComponent {
/** Stores the resolved loan documents data */
entityDocuments: any;
/** Loan account Id */
@@ -27,21 +26,34 @@ export class LoanDocumentsTabComponent {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private loansService: LoansService,
private settingsService: SettingsService) {
this.entityId = this.route.parent.snapshot.params['loanId'];
private settingsService: SettingsService
) {
this.entityId = this.route.parent.snapshot.params['loanId'];
this.route.data.subscribe((data: { loanDocuments: any }) => {
this.getLoanDocumentsData(data.loanDocuments);
});
this.route.data.subscribe((data: { loanDocuments: any }) => {
this.getLoanDocumentsData(data.loanDocuments);
});
}
getLoanDocumentsData(data: any) {
data.forEach((ele: any) => {
ele.docUrl = this.settingsService.serverUrl + '/loans/' + ele.parentEntityId + '/documents/' + ele.id + '/attachment?tenantIdentifier=' + environment.fineractPlatformTenantId;
ele.docUrl =
this.settingsService.serverUrl +
'/loans/' +
ele.parentEntityId +
'/documents/' +
ele.id +
'/attachment?tenantIdentifier=' +
environment.fineractPlatformTenantId;
if (ele.fileName) {
if (ele.fileName.toLowerCase().indexOf('.jpg') !== -1 || ele.fileName.toLowerCase().indexOf('.jpeg') !== -1 || ele.fileName.toLowerCase().indexOf('.png') !== -1) {
if (
ele.fileName.toLowerCase().indexOf('.jpg') !== -1 ||
ele.fileName.toLowerCase().indexOf('.jpeg') !== -1 ||
ele.fileName.toLowerCase().indexOf('.png') !== -1
) {
ele.fileIsImage = true;
}
}
@@ -55,7 +67,7 @@ export class LoanDocumentsTabComponent {
}
downloadDocument(documentId: string) {
this.loansService.downloadLoanDocument(this.entityId, documentId).subscribe(res => {
this.loansService.downloadLoanDocument(this.entityId, documentId).subscribe((res) => {
const url = window.URL.createObjectURL(res);
window.open(url);
});
@@ -68,5 +80,4 @@ export class LoanDocumentsTabComponent {
deleteDocument(documentId: any) {
this.loansService.deleteLoanDocument(this.entityId, documentId).subscribe((res: any) => {});
}
}
@@ -1,26 +1,26 @@
<div class="container">
<h3>{{ 'labels.heading.Term Variations' | translate }}</h3>
<table mat-table [dataSource]="loanTermVariationsData" *ngIf="loanTermVariationsData.length>0">
<table mat-table [dataSource]="loanTermVariationsData" *ngIf="loanTermVariationsData.length > 0">
<ng-container matColumnDef="termType">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Type" | translate}} </th>
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Type' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.termType.value | translate }}</td>
</ng-container>
<ng-container matColumnDef="applicableFrom">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Added On" | translate}} </th>
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Added On' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.termVariationApplicableFrom | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="value">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Value" | translate}} </th>
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Value' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.decimalValue | formatNumber }}</td>
</ng-container>
<ng-container matColumnDef="specificToInstallment">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Specific to Installment" | translate}} </th>
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Specific to Installment' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.isSpecificToInstallment | yesNo }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanDTermVariationsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanDTermVariationsColumns;"></tr>
<tr mat-row *matRowDef="let row; columns: loanDTermVariationsColumns"></tr>
</table>
<h3 class="m-t-20" *ngIf="interestPausesData?.length > 0">{{ 'labels.heading.Interest Pauses' | translate }}</h3>
@@ -48,16 +48,26 @@
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let item">
<button class="button" mat-icon-button color="primary"
matTooltip="{{ 'tooltips.Edit' | translate }}" matTooltipPosition="right"
(click)="manageRequest(item, 'Edit')">
<button
class="button"
mat-icon-button
color="primary"
matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="right"
(click)="manageRequest(item, 'Edit')"
>
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
<button class="button" mat-icon-button color="warn"
matTooltip="{{ 'tooltips.Delete' | translate }}" matTooltipPosition="left"
(click)="manageRequest(item, 'Delete')">
<fa-icon icon="trash" size="lg"></fa-icon>
</button>
<button
class="button"
mat-icon-button
color="warn"
matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="left"
(click)="manageRequest(item, 'Delete')"
>
<fa-icon icon="trash" size="lg"></fa-icon>
</button>
</td>
</ng-container>
@@ -71,4 +81,4 @@
{{ 'labels.text.No data found' | translate }}
</div>
</div>
</div>
</div>
@@ -8,9 +8,8 @@ describe('LoanTermVariationsTabComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoanTermVariationsTabComponent ]
})
.compileComponents();
declarations: [LoanTermVariationsTabComponent]
}).compileComponents();
fixture = TestBed.createComponent(LoanTermVariationsTabComponent);
component = fixture.componentInstance;
@@ -16,18 +16,29 @@ import { AnyKindOfDictionary } from 'cypress/types/lodash';
styleUrls: ['./loan-term-variations-tab.component.scss']
})
export class LoanTermVariationsTabComponent {
/** Loan Term Variation Data */
loanTermVariationsData: any[] = [];
loanDTermVariationsColumns: string[] = ['termType', 'applicableFrom', 'value', 'specificToInstallment'];
loanDTermVariationsColumns: string[] = [
'termType',
'applicableFrom',
'value',
'specificToInstallment'
];
/** Interest Pauses Data */
interestPausesData: any[] = [];
interestPausesColumns: string[] = ['row', 'startDate', 'endDate', 'days', 'actions'];
interestPausesColumns: string[] = [
'row',
'startDate',
'endDate',
'days',
'actions'
];
loanId: number;
clientId: AnyKindOfDictionary;
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private router: Router,
private dates: Dates,
private settingsService: SettingsService,
@@ -36,7 +47,7 @@ export class LoanTermVariationsTabComponent {
) {
this.interestPausesData = [];
this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId');
this.route.data.subscribe((data: { loanDetailsData: any, interestPausesData: any }) => {
this.route.data.subscribe((data: { loanDetailsData: any; interestPausesData: any }) => {
this.loanId = data.loanDetailsData.id;
this.loanTermVariationsData = data.loanDetailsData.loanTermVariations;
this.interestPausesData = [];
@@ -85,7 +96,8 @@ export class LoanTermVariationsTabComponent {
value: endDate,
maxDate: this.settingsService.maxFutureDate,
required: true
}),
})
];
const data = {
@@ -104,7 +116,7 @@ export class LoanTermVariationsTabComponent {
endDate: this.dates.formatDate(response.data.value.endDate, dateFormat),
locale,
dateFormat
}
};
this.loansService.updateInterestPause(this.loanId, variation.id, payload).subscribe((response: any) => {
this.reload();
});
@@ -115,7 +127,8 @@ export class LoanTermVariationsTabComponent {
private reload() {
const url: string = this.router.url;
this.router.navigateByUrl(`/clients/${this.clientId}/loans-accounts`, { skipLocationChange: true })
this.router
.navigateByUrl(`/clients/${this.clientId}/loans-accounts`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('LoanTrancheDetailsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanTrancheDetailsComponent ]
})
.compileComponents();
declarations: [LoanTrancheDetailsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,15 +13,23 @@ import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
@Component({
selector: 'mifosx-loan-tranche-details',
templateUrl: './loan-tranche-details.component.html',
styleUrls: ['./loan-tranche-details.component.scss'],
styleUrls: ['./loan-tranche-details.component.scss']
})
export class LoanTrancheDetailsComponent implements OnInit {
loanDetails: any;
return: any;
status: any;
count: number;
expectedDisbursementColumns: string[] = ['expected disbursement on', 'disbursed on', 'principal', 'action'];
emivariationColumns: string[] = ['emi amount variation from', 'fixed emi amount'];
expectedDisbursementColumns: string[] = [
'expected disbursement on',
'disbursed on',
'principal',
'action'
];
emivariationColumns: string[] = [
'emi amount variation from',
'fixed emi amount'
];
loanId: number;
currentPrincipalAmount: number;
@@ -36,11 +44,13 @@ export class LoanTrancheDetailsComponent implements OnInit {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
public dialog: MatDialog,
private loanServices: LoansService,
private settingsService: SettingsService,
private dateUtils: Dates) {
private dateUtils: Dates
) {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanId = data.loanDetailsData.id;
this.loanDetails = data.loanDetailsData;
@@ -99,7 +109,7 @@ export class LoanTrancheDetailsComponent implements OnInit {
this.totalMultiDisbursed = 0;
this.count = 0;
this.disbursementDataSource.forEach((item: any) => {
this.totalMultiDisbursed += (item.principal * 1);
this.totalMultiDisbursed += item.principal * 1;
this.count += 1;
});
}
@@ -124,6 +134,7 @@ export class LoanTrancheDetailsComponent implements OnInit {
required: true,
order: 2
})
];
return formBase;
}
@@ -137,13 +148,13 @@ export class LoanTrancheDetailsComponent implements OnInit {
const data = {
title: 'Add Disbursement Details',
layout: { addButtonText: 'Add' },
formfields: this.buildForm(new Date(), (this.currentPrincipalAmount - this.totalMultiDisbursed))
formfields: this.buildForm(new Date(), this.currentPrincipalAmount - this.totalMultiDisbursed)
};
const disbursementDialogRef = this.dialog.open(FormDialogComponent, { data });
disbursementDialogRef.afterClosed().subscribe((response: any) => {
if (response.data) {
const principal = response.data.value.principal * 1;
if ((this.totalMultiDisbursed + principal) <= this.currentPrincipalAmount) {
if (this.totalMultiDisbursed + principal <= this.currentPrincipalAmount) {
this.disbursementDataSource = this.disbursementDataSource.concat(response.data.value);
this.pristine = false;
}
@@ -156,7 +167,9 @@ export class LoanTrancheDetailsComponent implements OnInit {
*/
editDisbursementDataEntry(index: number) {
const principal: number = this.disbursementDataSource[index]['principal'] * 1;
const expectedDisbursementDate: Date = this.dateUtils.parseDate(this.disbursementDataSource[index]['expectedDisbursementDate']);
const expectedDisbursementDate: Date = this.dateUtils.parseDate(
this.disbursementDataSource[index]['expectedDisbursementDate']
);
const data = {
title: 'Edit Disbursement Details',
@@ -167,7 +180,7 @@ export class LoanTrancheDetailsComponent implements OnInit {
disbursementDialogRef.afterClosed().subscribe((response: any) => {
if (response.data) {
const newPrincipal = response.data.value.principal * 1;
if ((this.totalMultiDisbursed - principal + newPrincipal) <= this.currentPrincipalAmount) {
if (this.totalMultiDisbursed - principal + newPrincipal <= this.currentPrincipalAmount) {
this.disbursementDataSource[index]['principal'] = newPrincipal;
this.disbursementDataSource[index]['expectedDisbursementDate'] = response.data.value.expectedDisbursementDate;
this.pristine = false;
@@ -195,7 +208,10 @@ export class LoanTrancheDetailsComponent implements OnInit {
const disbursementData: any = [];
this.disbursementDataSource.forEach((item: any) => {
disbursementData.push({
expectedDisbursementDate: this.dateUtils.formatDate(item.expectedDisbursementDate, this.settingsService.dateFormat),
expectedDisbursementDate: this.dateUtils.formatDate(
item.expectedDisbursementDate,
this.settingsService.dateFormat
),
principal: item.principal
});
});
@@ -205,10 +221,11 @@ export class LoanTrancheDetailsComponent implements OnInit {
dateFormat: this.settingsService.dateFormat,
locale: this.settingsService.language.code
};
this.loanServices.editDisbursements(this.loanId, payload).toPromise()
.then(result => {
this.pristine = true;
});
this.loanServices
.editDisbursements(this.loanId, payload)
.toPromise()
.then((result) => {
this.pristine = true;
});
}
}
@@ -8,9 +8,8 @@ describe('LoansViewComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoansViewComponent ]
})
.compileComponents();
declarations: [LoansViewComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -24,7 +24,6 @@ import { LoanTransaction } from 'app/products/loan-products/models/loan-account.
styleUrls: ['./loans-view.component.scss']
})
export class LoansViewComponent implements OnInit {
/** Loan Details Data */
loanDetailsData: any;
/** Loan Datatables */
@@ -51,29 +50,33 @@ export class LoansViewComponent implements OnInit {
loanReAged = false;
loanReAmortized = false;
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private router: Router,
public loansService: LoansService,
private translateService: TranslateService,
public dialog: MatDialog) {
this.route.data.subscribe((data: { loanDetailsData: any, loanDatatables: any, loanArrearsDelinquencyConfig: any }) => {
this.loanDetailsData = data.loanDetailsData;
this.loanDatatables = data.loanDatatables;
this.loanDisplayArrearsDelinquency = data.loanArrearsDelinquencyConfig.value || 0;
this.loanStatus = this.loanDetailsData.status;
this.currency = this.loanDetailsData.currency;
if (this.loanStatus.active) {
this.loanDetailsData.transactions.forEach((lt: LoanTransaction) => {
if (!lt.manuallyReversed) {
if (lt.type.reAge) {
this.loanReAged = true;
} else if (lt.type.reAmortize) {
this.loanReAmortized = true;
public dialog: MatDialog
) {
this.route.data.subscribe(
(data: { loanDetailsData: any; loanDatatables: any; loanArrearsDelinquencyConfig: any }) => {
this.loanDetailsData = data.loanDetailsData;
this.loanDatatables = data.loanDatatables;
this.loanDisplayArrearsDelinquency = data.loanArrearsDelinquencyConfig.value || 0;
this.loanStatus = this.loanDetailsData.status;
this.currency = this.loanDetailsData.currency;
if (this.loanStatus.active) {
this.loanDetailsData.transactions.forEach((lt: LoanTransaction) => {
if (!lt.manuallyReversed) {
if (lt.type.reAge) {
this.loanReAged = true;
} else if (lt.type.reAmortize) {
this.loanReAmortized = true;
}
}
}
});
});
}
}
});
);
this.loanId = this.route.snapshot.params['loanId'];
this.clientId = this.loanDetailsData.clientId;
}
@@ -106,9 +109,8 @@ export class LoansViewComponent implements OnInit {
this.buttonConfig = new LoansAccountButtonConfiguration(this.status);
if (this.status === 'Submitted and pending approval') {
this.buttonConfig.addOption({
name: (this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer'),
name: this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer',
icon: 'user-tie',
taskPermissionName: 'DISBURSE_LOAN'
});
@@ -120,15 +122,12 @@ export class LoansViewComponent implements OnInit {
taskPermissionName: 'ADJUST_REPAYMENT_SCHEDULE'
});
}
} else if (this.status === 'Approved') {
this.buttonConfig.addButton({
name: (this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer'),
name: this.loanDetailsData.loanOfficerName ? 'Change Loan Officer' : 'Assign Loan Officer',
icon: 'user-tie',
taskPermissionName: 'DISBURSE_LOAN'
});
} else if (this.status === 'Active') {
if (this.loanDetailsData.canDisburse || this.loanDetailsData.multiDisburseLoan) {
this.buttonConfig.addButton({
@@ -196,13 +195,13 @@ export class LoansViewComponent implements OnInit {
this.buttonConfig.addButton({
name: 'Re-Age',
icon: 'calendar',
taskPermissionName: 'REAGE_LOAN',
taskPermissionName: 'REAGE_LOAN'
});
} else {
this.buttonConfig.addButton({
name: 'Undo Re-Age',
icon: 'undo',
taskPermissionName: 'UNDO_REAGE_LOAN',
taskPermissionName: 'UNDO_REAGE_LOAN'
});
}
@@ -210,13 +209,13 @@ export class LoansViewComponent implements OnInit {
this.buttonConfig.addButton({
name: 'Re-Amortize',
icon: 'calendar-alt',
taskPermissionName: 'REAMORTIZE_LOAN',
taskPermissionName: 'REAMORTIZE_LOAN'
});
} else {
this.buttonConfig.addButton({
name: 'Undo Re-Amortize',
icon: 'undo',
taskPermissionName: 'UNDO_REAMORTIZE_LOAN',
taskPermissionName: 'UNDO_REAMORTIZE_LOAN'
});
}
}
@@ -235,7 +234,10 @@ export class LoansViewComponent implements OnInit {
break;
case 'Transfer Funds':
const queryParams: any = { loanId: this.loanId, accountType: 'fromloans' };
this.router.navigate(['transfer-funds/make-account-transfer'], { relativeTo: this.route, queryParams: queryParams });
this.router.navigate(['transfer-funds/make-account-transfer'], {
relativeTo: this.route,
queryParams: queryParams
});
break;
case 'Undo Re-Age':
case 'Undo Re-Amortize':
@@ -249,7 +251,13 @@ export class LoansViewComponent implements OnInit {
data: this.loanDetailsData
}
};
this.router.navigate(['actions', actionName], navigationExtras);
this.router.navigate(
[
'actions',
actionName
],
navigationExtras
);
break;
}
}
@@ -259,7 +267,13 @@ export class LoansViewComponent implements OnInit {
*/
private recoverFromGuarantor() {
const recoverFromGuarantorDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Recover from Guarantor'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want recover from Guarantor'), type: 'Mild' }
data: {
heading: this.translateService.instant('labels.heading.Recover from Guarantor'),
dialogContext: this.translateService.instant(
'labels.dialogContext.Are you sure you want recover from Guarantor'
),
type: 'Mild'
}
});
recoverFromGuarantorDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -286,7 +300,10 @@ export class LoansViewComponent implements OnInit {
const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: {
heading: this.translateService.instant('labels.heading.Undo Transaction'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + ' ' + this.translateService.instant('labels.menus.' + actionName)
dialogContext:
this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') +
' ' +
this.translateService.instant('labels.menus.' + actionName)
}
});
undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => {
@@ -340,8 +357,8 @@ export class LoansViewComponent implements OnInit {
private reload() {
const clientId = this.clientId;
const url: string = this.router.url;
this.router.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true })
this.router
.navigateByUrl(`/clients/${clientId}/loans-accounts`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('NotesTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ NotesTabComponent ]
})
.compileComponents();
declarations: [NotesTabComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -13,14 +13,15 @@ import { AuthenticationService } from '../../../core/authentication/authenticati
styleUrls: ['./notes-tab.component.scss']
})
export class NotesTabComponent {
entityId: string;
username: string;
entityNotes: any;
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private loansService: LoansService,
private authenticationService: AuthenticationService) {
private authenticationService: AuthenticationService
) {
const savedCredentials = this.authenticationService.getCredentials();
this.username = savedCredentials.username;
this.entityId = this.route.parent.snapshot.params['loanId'];
@@ -47,10 +48,8 @@ export class NotesTabComponent {
}
deleteNote(noteId: string, index: number) {
this.loansService.deleteLoanNote(this.entityId, noteId)
.subscribe(() => {
this.entityNotes.splice(index, 1);
this.loansService.deleteLoanNote(this.entityId, noteId).subscribe(() => {
this.entityNotes.splice(index, 1);
});
}
}
@@ -8,9 +8,8 @@ describe('OriginalScheduleTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OriginalScheduleTabComponent ]
})
.compileComponents();
declarations: [OriginalScheduleTabComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -8,11 +8,19 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./original-schedule-tab.component.scss']
})
export class OriginalScheduleTabComponent {
/** Loan Details Data */
originalScheduleDetails: any;
/** Columns to be displayed in original schedule table. */
displayedColumns: string[] = ['number', 'date', 'balanceOfLoan', 'principalDue', 'interest', 'fees', 'penalties', 'outstanding'];
displayedColumns: string[] = [
'number',
'date',
'balanceOfLoan',
'principalDue',
'interest',
'fees',
'penalties',
'outstanding'
];
currency: Currency | null = null;
@@ -26,5 +34,4 @@ export class OriginalScheduleTabComponent {
this.originalScheduleDetails = data.loanDetailsData.originalSchedule;
});
}
}
@@ -8,9 +8,8 @@ describe('OverdueChargesTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ OverdueChargesTabComponent ]
})
.compileComponents();
declarations: [OverdueChargesTabComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -14,14 +14,18 @@ import { ActivatedRoute } from '@angular/router';
styleUrls: ['./overdue-charges-tab.component.scss']
})
export class OverdueChargesTabComponent implements OnInit {
/** Stores the resolved loan data */
loanDetails: any;
/** Stores the overdue data */
overdueCharges: any;
/** Columns to be displayed in overdue charges table. */
displayedColumns: string[] = ['name', 'type', 'amount', 'collectedon'];
displayedColumns: string[] = [
'name',
'type',
'amount',
'collectedon'
];
/** Data source for codes table. */
dataSource: MatTableDataSource<any>;
@@ -35,7 +39,7 @@ export class OverdueChargesTabComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
this.route.parent.data.subscribe(( data: { loanDetailsData: any }) => {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
}
@@ -46,5 +50,4 @@ export class OverdueChargesTabComponent implements OnInit {
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
}
@@ -8,9 +8,8 @@ describe('RepaymentScheduleTabComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RepaymentScheduleTabComponent ]
})
.compileComponents();
declarations: [RepaymentScheduleTabComponent]
}).compileComponents();
}));
beforeEach(() => {

Some files were not shown because too many files have changed in this diff Show More