Loan Term variations including Interest Pauses
This commit is contained in:
committed by
Jose Alberto Hernandez
parent
3bdeeb8201
commit
b729898147
@@ -48,4 +48,8 @@ export class Dates {
|
||||
return JSON.parse(localStorage.getItem('mifosXLanguage'));
|
||||
}
|
||||
|
||||
calculateDiff(date1: Date, date2: Date){
|
||||
return Math.floor((Date.UTC(date2.getFullYear(), date2.getMonth(), date2.getDate()) - Date.UTC(date1.getFullYear(), date1.getMonth(), date1.getDate()) ) /(1000 * 60 * 60 * 24));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -172,7 +172,8 @@ const routes: Routes = [
|
||||
component: LoanTermVariationsTabComponent,
|
||||
data: { title: 'Loan Term Variations', breadcrumb: 'Loan Term Variations', routeParamBreadcrumb: false },
|
||||
resolve: {
|
||||
loanTermVariationsData: LoanTermVariationsResolver
|
||||
loanDetailsData: LoanDetailsResolver,
|
||||
interestPausesData: LoanTermVariationsResolver
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
+34
-10
@@ -1,16 +1,35 @@
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
<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>
|
||||
</table>
|
||||
|
||||
<h3 class="m-t-20">{{ 'labels.heading.Interest Pauses' | translate }}</h3>
|
||||
<table mat-table class="m-t-20" [dataSource]="interestPausesData" *ngIf="interestPausesData?.length > 0">
|
||||
<ng-container matColumnDef="row">
|
||||
<th mat-header-cell *matHeaderCellDef>#</th>
|
||||
<td mat-cell *matCellDef="let item; let idx = index">{{ idx + 1 }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="id">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Id' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let item">{{ item.id }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="startDate">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Start Date' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let item">{{ item.startDate | dateFormat }}</td>
|
||||
@@ -21,14 +40,19 @@
|
||||
<td mat-cell *matCellDef="let item">{{ item.endDate | dateFormat }}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="loanTermVariationsColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: loanTermVariationsColumns"></tr>
|
||||
<ng-container matColumnDef="days">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Days' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let item">{{ item.days | formatNumber }}</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="interestPausesColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: interestPausesColumns"></tr>
|
||||
</table>
|
||||
|
||||
<div class="alert" [hidden]="loanTermVariationsData?.length > 0">
|
||||
<div class="alert" [hidden]="interestPausesData?.length > 0">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.No data found' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+17
-6
@@ -1,5 +1,6 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { Component } from '@angular/core';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Dates } from 'app/core/utils/dates';
|
||||
|
||||
@Component({
|
||||
selector: 'mifosx-loan-term-variations-tab',
|
||||
@@ -10,12 +11,22 @@ export class LoanTermVariationsTabComponent {
|
||||
|
||||
/** Loan Term Variation Data */
|
||||
loanTermVariationsData: any[] = [];
|
||||
loanTermVariationsColumns: string[] = ['row', 'id', 'startDate', 'endDate'];
|
||||
loanDTermVariationsColumns: string[] = ['termType', 'applicableFrom', 'value', 'specificToInstallment'];
|
||||
/** Interest Pauses Data */
|
||||
interestPausesData: any[] = [];
|
||||
interestPausesColumns: string[] = ['row', 'startDate', 'endDate', 'days'];
|
||||
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.loanTermVariationsData = [];
|
||||
this.route.data.subscribe((data: { loanTermVariationsData: any, }) => {
|
||||
this.loanTermVariationsData = data.loanTermVariationsData;
|
||||
constructor(private route: ActivatedRoute,
|
||||
private dates: Dates
|
||||
) {
|
||||
this.interestPausesData = [];
|
||||
this.route.data.subscribe((data: { loanDetailsData: any, interestPausesData: any }) => {
|
||||
this.loanTermVariationsData = data.loanDetailsData.loanTermVariations;
|
||||
this.interestPausesData = [];
|
||||
data.interestPausesData?.forEach((item: any) => {
|
||||
item.days = dates.calculateDiff(new Date(item.startDate), new Date(item.endDate));
|
||||
this.interestPausesData.push(item);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -944,6 +944,7 @@
|
||||
"Installment Amount Variations": "Variace výše splátek",
|
||||
"Interest Calculations": "Výpočty úroků",
|
||||
"Interest Details": "Podrobnosti o zájmu",
|
||||
"Interest Pauses": "Úrokové pauzy",
|
||||
"Interest Rate Chart": "Graf úrokových sazeb",
|
||||
"Interest Rate Charts": "Grafy úrokových sazeb",
|
||||
"Interest Recalculation": "Přepočet úroků",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "Variationen der Ratenbeträge",
|
||||
"Interest Calculations": "Zinsberechnungen",
|
||||
"Interest Details": "Interessendetails",
|
||||
"Interest Pauses": "Zinspausen",
|
||||
"Interest Rate Chart": "Zinsdiagramm",
|
||||
"Interest Rate Charts": "Zinsdiagramme",
|
||||
"Interest Recalculation": "Neuberechnung der Zinsen",
|
||||
|
||||
@@ -947,6 +947,7 @@
|
||||
"Installment Amount Variations": "Installment Amount Variations",
|
||||
"Interest Calculations": "Interest Calculations",
|
||||
"Interest Details": "Interest Details",
|
||||
"Interest Pauses": "Interest Pauses",
|
||||
"Interest Rate Chart": "Interest Rate Chart",
|
||||
"Interest Rate Charts": "Interest Rate Charts",
|
||||
"Interest Recalculation": "Interest Recalculation",
|
||||
|
||||
@@ -944,6 +944,7 @@
|
||||
"Installment Amount Variations": "Variaciones en el monto de la cuota",
|
||||
"Interest Calculations": "Cálculos de intereses",
|
||||
"Interest Details": "Detalles de interés",
|
||||
"Interest Pauses": "Pausa de interés",
|
||||
"Interest Rate Chart": "Gráfico de tasas de interés",
|
||||
"Interest Rate Charts": "Gráficos de tasas de interés",
|
||||
"Interest Recalculation": "Recálculo de intereses",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "Variations du montant des versements",
|
||||
"Interest Calculations": "Calculs d'intérêts",
|
||||
"Interest Details": "Détails des intérêts",
|
||||
"Interest Pauses": "Pauses d'intérêt",
|
||||
"Interest Rate Chart": "Graphique des taux d'intérêt",
|
||||
"Interest Rate Charts": "Graphiques des taux d'intérêt",
|
||||
"Interest Recalculation": "Recalcul des intérêts",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "Variazioni dell'importo della rata",
|
||||
"Interest Calculations": "Calcoli degli interessi",
|
||||
"Interest Details": "Dettagli sugli interessi",
|
||||
"Interest Pauses": "Pause di interesse",
|
||||
"Interest Rate Chart": "Grafico dei tassi di interesse",
|
||||
"Interest Rate Charts": "Grafici dei tassi di interesse",
|
||||
"Interest Recalculation": "Ricalcolo degli interessi",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "할부금액 변동",
|
||||
"Interest Calculations": "이자 계산",
|
||||
"Interest Details": "이자 세부정보",
|
||||
"Interest Pauses": "관심 일시중지",
|
||||
"Interest Rate Chart": "금리 차트",
|
||||
"Interest Rate Charts": "금리 차트",
|
||||
"Interest Recalculation": "이자 재계산",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "Įmokos dydžio svyravimai",
|
||||
"Interest Calculations": "Palūkanų skaičiavimas",
|
||||
"Interest Details": "Susidomėjimo detalės",
|
||||
"Interest Pauses": "Susidomėjimo pauzės",
|
||||
"Interest Rate Chart": "Palūkanų normų diagrama",
|
||||
"Interest Rate Charts": "Palūkanų normų diagramos",
|
||||
"Interest Recalculation": "Palūkanų perskaičiavimas",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "Iemaksas summas variācijas",
|
||||
"Interest Calculations": "Procentu aprēķini",
|
||||
"Interest Details": "Sīkāka informācija par interesēm",
|
||||
"Interest Pauses": "Interešu pauzes",
|
||||
"Interest Rate Chart": "Procentu likmju diagramma",
|
||||
"Interest Rate Charts": "Procentu likmju diagrammas",
|
||||
"Interest Recalculation": "Procentu pārrēķins",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "किस्ता रकम भिन्नताहरू",
|
||||
"Interest Calculations": "ब्याज गणना",
|
||||
"Interest Details": "ब्याज विवरण",
|
||||
"Interest Pauses": "ब्याज रोकिन्छ",
|
||||
"Interest Rate Chart": "ब्याज दर चार्ट",
|
||||
"Interest Rate Charts": "ब्याज दर चार्टहरू",
|
||||
"Interest Recalculation": "ब्याज पुन: गणना",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "Variações no valor da parcela",
|
||||
"Interest Calculations": "Cálculos de juros",
|
||||
"Interest Details": "Detalhes de interesse",
|
||||
"Interest Pauses": "Pausas de interesse",
|
||||
"Interest Rate Chart": "Gráfico de taxas de juros",
|
||||
"Interest Rate Charts": "Gráficos de taxas de juros",
|
||||
"Interest Recalculation": "Recálculo de juros",
|
||||
|
||||
@@ -945,6 +945,7 @@
|
||||
"Installment Amount Variations": "Tofauti za Kiasi cha Ufungaji",
|
||||
"Interest Calculations": "Mahesabu ya riba",
|
||||
"Interest Details": "Maelezo ya Maslahi",
|
||||
"Interest Pauses": "Maslahi Yasitisha",
|
||||
"Interest Rate Chart": "Chati ya Kiwango cha Riba",
|
||||
"Interest Rate Charts": "Chati za Kiwango cha Riba",
|
||||
"Interest Recalculation": "Uhesabuji wa Maslahi",
|
||||
|
||||
Reference in New Issue
Block a user