Merge pull request #1405 from josehernandezfintecheandomx/fix/loan_repayment
Fix for Loan repayment issues
This commit is contained in:
@@ -0,0 +1,7 @@
|
|||||||
|
import { Dates } from './dates';
|
||||||
|
|
||||||
|
describe('Dates', () => {
|
||||||
|
it('should create an instance', () => {
|
||||||
|
expect(new Dates()).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
import { DatePipe } from '@angular/common';
|
||||||
|
import { Injectable } from '@angular/core';
|
||||||
|
import { SettingsService } from 'app/settings/settings.service';
|
||||||
|
|
||||||
|
@Injectable({
|
||||||
|
providedIn: 'root'
|
||||||
|
})
|
||||||
|
export class Dates {
|
||||||
|
|
||||||
|
constructor(private settingsService: SettingsService,
|
||||||
|
private datePipe: DatePipe) {}
|
||||||
|
|
||||||
|
public getDate(timestamp: any) {
|
||||||
|
const dateFormat = this.settingsService.dateFormat;
|
||||||
|
return this.datePipe.transform(timestamp, dateFormat);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,8 +28,8 @@ export class LoanActionButtonResolver implements Resolve<Object> {
|
|||||||
const loanActionButton = route.paramMap.get('action');
|
const loanActionButton = route.paramMap.get('action');
|
||||||
if (loanActionButton === 'Assign Loan Officer' || loanActionButton === 'Change Loan Officer') {
|
if (loanActionButton === 'Assign Loan Officer' || loanActionButton === 'Change Loan Officer') {
|
||||||
return this.loansService.getLoanTemplate(loanId);
|
return this.loansService.getLoanTemplate(loanId);
|
||||||
// } else if (loanActionButton === 'make-repayment') {
|
} else if (loanActionButton === 'Make Repayment') {
|
||||||
// return this.loansService.getLoanActionTemplate(loanId, 'repayment');
|
return this.loansService.getLoanActionTemplate(loanId, 'repayment');
|
||||||
} else if (loanActionButton === 'Waive Interest') {
|
} else if (loanActionButton === 'Waive Interest') {
|
||||||
return this.loansService.getLoanActionTemplate(loanId, 'waiveinterest');
|
return this.loansService.getLoanActionTemplate(loanId, 'waiveinterest');
|
||||||
} else if (loanActionButton === 'Write Off') {
|
} else if (loanActionButton === 'Write Off') {
|
||||||
|
|||||||
+1
-1
@@ -83,7 +83,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||||
<button type="button" mat-raised-button [routerLink]="['../../../general']">Cancel</button>
|
<button type="button" mat-raised-button [routerLink]="['../../general']">Cancel</button>
|
||||||
<button mat-raised-button color="primary" [disabled]="!repaymentLoanForm.valid"
|
<button mat-raised-button color="primary" [disabled]="!repaymentLoanForm.valid"
|
||||||
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
|
*mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
|
||||||
</mat-card-actions>
|
</mat-card-actions>
|
||||||
|
|||||||
+1
-1
@@ -55,7 +55,7 @@ export class MakeRepaymentComponent implements OnInit {
|
|||||||
*/
|
*/
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.createRepaymentLoanForm();
|
this.createRepaymentLoanForm();
|
||||||
// this.setRepaymentLoanDetails();
|
this.setRepaymentLoanDetails();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user