feat: add view loan page (repayment schedule tab) (#838)

Fixes: #813
This commit is contained in:
Muskan Khedia
2020-06-03 11:29:08 +05:30
committed by GitHub
parent 02cdc801fc
commit 5cea533c16
7 changed files with 224 additions and 1 deletions
@@ -0,0 +1,34 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'mifosx-repayment-schedule-tab',
templateUrl: './repayment-schedule-tab.component.html',
styleUrls: ['./repayment-schedule-tab.component.scss']
})
export class RepaymentScheduleTabComponent implements OnInit {
/** Loan Repayment Schedule Details Data */
repaymentScheduleDetails: any;
/** Stores if there is any waived amount */
isWaived: boolean;
/** Columns to be displayed in original schedule table. */
displayedColumns: string[] = ['number', 'days', 'date', 'paiddate', 'check', 'principalDue', 'balanceOfLoan', 'interest', 'fees', 'penalties', 'due', 'paid', 'inadvance', 'late', 'waived', 'outstanding'];
/**
* Retrieves the loans with associations data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
this.route.data.subscribe(( data: { loanDetailsAssociationData: any }) => {
this.repaymentScheduleDetails = data.loanDetailsAssociationData.repaymentSchedule;
console.log(this.repaymentScheduleDetails);
});
}
ngOnInit() {
this.isWaived = this.repaymentScheduleDetails.totalWaived > 0;
}
}