Display installment level delinquency (#1907)

Co-authored-by: Jose Alberto Hernandez <alberto@blue-daemon.local>
This commit is contained in:
José Alberto Hernández
2023-11-21 22:45:44 -06:00
committed by GitHub
co-authored by Jose Alberto Hernandez
parent df8c90d9e6
commit 7c53b82965
21 changed files with 150 additions and 22 deletions
@@ -134,7 +134,7 @@
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../..']">{{"labels.buttons.Cancel" | translate}}</button>
<button mat-raised-button color="primary" [disabled]="!makeAccountTransferForm.valid"
*mifosxHasPermission="'CREATE_ACCOUNTTRANSFER'" (click)="submit()">{{"labels.buttons.Submit | translate}}</button>
*mifosxHasPermission="'CREATE_ACCOUNTTRANSFER'" (click)="submit()">{{"labels.buttons.Submit" | translate}}</button>
</mat-card-actions>
</mat-card>
@@ -0,0 +1,31 @@
/** Angular Imports */
import { Injectable } from '@angular/core';
import { Resolve, ActivatedRouteSnapshot } from '@angular/router';
/** rxjs Imports */
import { Observable } from 'rxjs';
/** Custom Services */
import { LoansService } from '../loans.service';
/**
* Loan Delinquency data resolver.
*/
@Injectable()
export class LoanDelinquencyDataResolver implements Resolve<Object> {
/**
* @param {LoansService} LoansService Loans service.
*/
constructor(private loansService: LoansService) { }
/**
* Returns the Loans with Association data.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const loanId = route.paramMap.get('loanId') || route.parent.paramMap.get('loanId');
return this.loansService.getDelinquencyData(loanId);
}
}
@@ -10,7 +10,7 @@
</mat-error>
</mat-form-field>
<h4 fxFlex="98%" class="mat-h4">{{"labels.heading.Term Options <i class="fas fa-question" matTooltip="The loan term parameter in loan accounts
<h4 fxFlex="98%" class="mat-h4">{{"labels.heading.Term Options" | translate}} <i class="fas fa-question" matTooltip="The loan term parameter in loan accounts
is the default-calculated field based on the number of repayments and repaid every value entered by the user"></i>" | translate}}</h4>
<mat-form-field fxFlex="48%">
@@ -173,7 +173,7 @@
</mat-checkbox>
<mat-form-field fxFlex="48%">
<mat-label>{{"labels.inputs.Arrears tolerance" | translate}} {{currencyDisplaySymbol}}</mat-label>
<mat-label>{{"labels.inputs.Arrears tolerance" | translate}} </mat-label>
<input matInput type="number" formControlName="inArrearsTolerance" matTooltip="{{ 'tooltips.With Arrears tolerance' | translate}}">
</mat-form-field>
+5 -2
View File
@@ -58,6 +58,7 @@ import { ExternalAssetOwnerTabComponent } from './loans-view/external-asset-owne
import { ExternalAssetOwnerResolver } from './common-resolvers/external-asset-owner.resolver';
import { ExternalAssetOwnerActiveTransferResolver } from './common-resolvers/external-asset-owner-active-transfer.resolver';
import { LoanCollateralsResolver } from './common-resolvers/loan-collaterals.resolver';
import { LoanDelinquencyDataResolver } from './common-resolvers/loan-delinquency-data.resolver';
/** Loans Route. */
const routes: Routes = [
@@ -131,7 +132,8 @@ const routes: Routes = [
path: 'delinquencytags',
data: { title: 'Loans Delinquency Tags', breadcrumb: 'Delinquency Tags', routeParamBreadcrumb: false },
resolve: {
loanDelinquencyTagsData: LoanDelinquencyTagsResolver
loanDelinquencyTagsData: LoanDelinquencyTagsResolver,
loanDelinquencyData: LoanDelinquencyDataResolver
},
children: [
{
@@ -363,7 +365,8 @@ const routes: Routes = [
GLIMViewResolver,
GSIMAccountsResolver,
GLIMLoanTemplateResolver,
ExternalAssetOwnerResolver
ExternalAssetOwnerResolver,
LoanDelinquencyDataResolver
]
})
@@ -33,4 +33,31 @@
<tr mat-header-row *matHeaderRowDef="loanDelinquencyTagsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanDelinquencyTagsColumns;"></tr>
</table>
<div *ngIf="installmentLevelDelinquency.length > 0">
<h3>{{"labels.heading.Loan Delinquency Installment Tags" | translate}}</h3>
<table mat-table [dataSource]="installmentLevelDelinquency">
<ng-container matColumnDef="classification">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Delinquency Classification" | translate}} </th>
<td mat-cell *matCellDef="let item"> {{ item.classification }} </td>
</ng-container>
<ng-container matColumnDef="minimumAgeDays">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Days" | translate}} </th>
<td mat-cell *matCellDef="let item"> {{ item.minimumAgeDays | formatNumber }} </td>
</ng-container>
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Amount" | translate}} </th>
<td mat-cell *matCellDef="let item"> {{ item.delinquentAmount | currency:currency.code:'symbol-narrow':'1.2-2' }} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="installmentDelinquencyTagsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: installmentDelinquencyTagsColumns;"></tr>
</table>
</div>
</div>
@@ -1,5 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { DelinquentData, InstallmentLevelDelinquency } from 'app/loans/models/loan-account.model';
import { Currency } from 'app/shared/models/general.model';
@Component({
selector: 'mifosx-loan-delinquency-tags-tab',
@@ -9,11 +11,20 @@ import { ActivatedRoute } from '@angular/router';
export class LoanDelinquencyTagsTabComponent implements OnInit {
loanDelinquencyTags: any;
currency: Currency;
installmentLevelDelinquency: InstallmentLevelDelinquency[] = [];
loanDelinquencyTagsColumns: string[] = ['classification', 'addedOn', 'liftedOn'];
installmentDelinquencyTagsColumns: string[] = ['classification', 'minimumAgeDays', 'amount'];
constructor(private route: ActivatedRoute) {
this.route.parent.data.subscribe((data: { loanDelinquencyTagsData: any }) => {
this.route.parent.data.subscribe((data: { loanDelinquencyTagsData: any, loanDelinquencyData: any }) => {
this.loanDelinquencyTags = data.loanDelinquencyTagsData;
const loanDelinquencyData: DelinquentData | null = data.loanDelinquencyData.delinquent || null;
this.currency = data.loanDelinquencyData.currency;
this.installmentLevelDelinquency = [];
if (loanDelinquencyData != null) {
this.installmentLevelDelinquency = loanDelinquencyData.installmentLevelDelinquency || [];
}
});
}
+7
View File
@@ -75,6 +75,13 @@ export class LoansService {
return this.http.get(`/loans/${loanId}/delinquencytags`);
}
getDelinquencyData(loanId: string) {
const httpParams = new HttpParams()
.set('associations', 'collection')
.set('exclude', 'guarantors,futureSchedule');
return this.http.get(`/loans/${loanId}`, { params: httpParams });
}
/**
* Returns the loan template data with specific condition
* @param loanId Loan Id
@@ -0,0 +1,26 @@
export interface DelinquencyRange {
id: number;
classification: string;
minimumAgeDays: number;
}
export interface DelinquentData {
availableDisbursementAmount: number;
pastDueDays: number;
nextPaymentDueDate: number[];
delinquentDays: number;
delinquentDate: number[];
delinquentAmount: number;
lastPaymentAmount: number;
lastRepaymentAmount: number;
delinquencyCalculationPaused: boolean;
installmentLevelDelinquency?: InstallmentLevelDelinquency[];
}
export interface InstallmentLevelDelinquency {
rangeId: number;
classification: string;
minimumAgeDays: number;
delinquentAmount: number;
}
@@ -110,7 +110,7 @@
</mat-checkbox>
</div>
<h3 fxFlex="23%" class="mat-h3">Down Payment</h3>
<h3 fxFlex="96%" class="mat-h3">Down Payment</h3>
<mat-checkbox fxFlex="73%" labelPosition="before" formControlName="enableDownPayment" matTooltip="Leave this checkbox checked if the loan has Down Payment, A Down Payment is
a sum a buyer pays upfront when purchasing a good. It represents a percentage of the total purchase price, and the balance is usually financed" class="margin-b">
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Přehled úvěrového účtu",
"Loan Accounts": "Úvěrové účty",
"Loan Delinquency Tags": "Značky proplácení úvěrů",
"Loan Delinquency Installment Tags": "Značky delikvenční splátky půjčky",
"Loan Details": "Podrobnosti o půjčce",
"Loan Product": "Úvěrový produkt",
"Loan Products": "Úvěrové produkty",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "Toto bude použito k výběru tématu podle vůle organizace.",
"Click (Define Working Days)": "Klepnutím na (Definovat pracovní dny) definujte pracovní dny. Pro více podrobností klikněte",
"Click Here To Generate Cron Expression": "Kliknutím sem vygenerujete Cron Expression",
"Client": "klienti",
"Client Actions": "Klientské akce",
"Client Approval }": "Schválení klienta }",
"Client Approval": "Schválení klienta",
"Client Signature is not provided.": "Podpis klienta není poskytnut.",
"Clients": "klienti",
"Clients View": "Zobrazení klientů",
+1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Kreditkontoübersicht",
"Loan Accounts": "Kreditkonten",
"Loan Delinquency Tags": "Tags für Kreditausfälle",
"Loan Delinquency Installment Tags": "Kredit -Delinquenz -Ratenmarke",
"Loan Details": "Kreditdetails",
"Loan Product": "Darlehensprodukt",
"Loan Products": "Kreditprodukte",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Loan Account OverView",
"Loan Accounts": "Loan Accounts",
"Loan Delinquency Tags": "Loan Delinquency Tags",
"Loan Delinquency Installment Tags": "Loan Delinquency Installment Tags",
"Loan Details": "Loan Details",
"Loan Product": "Loan Product",
"Loan Products": "Loan Products",
@@ -2203,8 +2204,9 @@
"Choose a theme as per organization will": "This will be used to choose a theme as per organization will.",
"Click (Define Working Days)": "Click (Define Working Days) to define working days. For more details click",
"Click Here To Generate Cron Expression": "Click Here To Generate Cron Expression",
"Client": "Client",
"Client Actions": "Client Actions",
"Client Approval }": "Client Approval }",
"Client Approval": "Client Approval",
"Client Signature is not provided.": "Client Signature is not provided.",
"Clients": "Clients",
"Clients View": "Clients View",
+7 -5
View File
@@ -581,7 +581,7 @@
"Client Collateral Details": "Detalles de la garantía del cliente",
"Client Members": "Miembros clientes",
"Client Type": "Tipo de cliente",
"Clients": "Clientela",
"Clients": "Clientes",
"Closing Entries": "Entradas de cierre",
"Collateral Data": "Datos colaterales",
"Collateral Management": "Administracion colateral",
@@ -704,6 +704,7 @@
"Loan Account OverView": "Descripción general de la cuenta de Crédito",
"Loan Accounts": "Cuentas de Crédito",
"Loan Delinquency Tags": "Etiquetas de morosidad de Créditos",
"Loan Delinquency Installment Tags": "Etiquetas de morosidad de cuotas",
"Loan Details": "Detalles del Crédito",
"Loan Product": "Producto de Crédito",
"Loan Products": "Productos de Crédito",
@@ -1040,7 +1041,7 @@
"Client last name": "Apellido del cliente",
"Client middle name": "segundo nombre del cliente",
"Client name": "Nombre del cliente",
"Clients": "Clientela",
"Clients": "Clientes",
"Closed (obligations met)": "Cerrado (obligaciones cumplidas)",
"Closed (written-off)": "Cerrado (amortizado)",
"Closed By": "Cerrado por",
@@ -2052,7 +2053,7 @@
"Charge-Off": "Cancelación",
"Chart of Accounts": "Catálogo de cuentas",
"Checker Inbox and Tasks": "Bandeja de entrada y tareas de Checker",
"Clients": "Clientela",
"Clients": "Clientes",
"Close": "Cerca",
"Close (as Rescheduled)": "Cerrar (según reprogramado)",
"Configuration Wizard": "Asistente de configuración",
@@ -2201,10 +2202,11 @@
"Choose a theme as per organization will": "Esto se utilizará para elegir un tema según lo desee la organización.",
"Click (Define Working Days)": "Haga clic en (Definir días laborables) para definir los días laborables. Para más detalles haga clic",
"Click Here To Generate Cron Expression": "Haga clic aquí para generar una expresión cron",
"Client": "Cliente",
"Client Actions": "Acciones del cliente",
"Client Approval }": "Aprobación del cliente }",
"Client Approval": "Aprobación del cliente",
"Client Signature is not provided.": "No se proporciona la firma del cliente.",
"Clients": "Clientela",
"Clients": "Clientes",
"Clients View": "Vista de clientes",
"Codes are used to define drop down values": "Los códigos se utilizan para definir valores desplegables.",
"Collateral": "Colateral",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Aperçu du compte de prêt",
"Loan Accounts": "Comptes de prêt",
"Loan Delinquency Tags": "Étiquettes de délinquance de prêt",
"Loan Delinquency Installment Tags": "Étiquettes de versement de délinquance de prêt",
"Loan Details": "Détails du prêt",
"Loan Product": "Produit de prêt",
"Loan Products": "Produits de prêt",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "Cela servira à choisir un thème selon la volonté de l’organisation.",
"Click (Define Working Days)": "Cliquez sur (Définir les jours ouvrables) pour définir les jours ouvrables. Pour plus de détails cliquez",
"Click Here To Generate Cron Expression": "Cliquez ici pour générer une expression Cron",
"Client": "Clientè",
"Client Actions": "Actions des clients",
"Client Approval }": "Approbation du client }",
"Client Approval": "Approbation du client",
"Client Signature is not provided.": "La signature du client n'est pas fournie.",
"Clients": "Clientèle",
"Clients View": "Vue Clients",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Panoramica del conto di prestito",
"Loan Accounts": "Conti di prestito",
"Loan Delinquency Tags": "Tag di insolvenza del prestito",
"Loan Delinquency Installment Tags": "Prestito tag di rata delinquenza",
"Loan Details": "Dettagli del prestito",
"Loan Product": "Prodotto di prestito",
"Loan Products": "Prodotti di prestito",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "Questo verrà utilizzato per scegliere un tema secondo la volontà dell'organizzazione.",
"Click (Define Working Days)": "Fare clic su (Definisci giorni lavorativi) per definire i giorni lavorativi. Per maggiori dettagli clicca",
"Click Here To Generate Cron Expression": "Fare clic qui per generare l'espressione Cron",
"Client": "Clienti",
"Client Actions": "Azioni del cliente",
"Client Approval }": "Approvazione del cliente }",
"Client Approval": "Approvazione del cliente",
"Client Signature is not provided.": "La firma del cliente non è fornita.",
"Clients": "Clienti",
"Clients View": "Visualizzazione dei clienti",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "대출계좌 개요",
"Loan Accounts": "대출 계좌",
"Loan Delinquency Tags": "대출 연체 태그",
"Loan Delinquency Installment Tags": "대출 연체 설치 태그",
"Loan Details": "대출내역",
"Loan Product": "대출상품",
"Loan Products": "대출상품",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "이는 조직별로 테마를 선택하는 데 사용됩니다.",
"Click (Define Working Days)": "(작업일 정의)를 클릭하여 작업일을 정의합니다. 자세한 내용을 보려면 클릭하세요.",
"Click Here To Generate Cron Expression": "Cron 표현식을 생성하려면 여기를 클릭하세요.",
"Client": "클라이언트",
"Client Actions": "클라이언트 작업",
"Client Approval }": "클라이언트 승인 }",
"Client Approval": "클라이언트 승인",
"Client Signature is not provided.": "클라이언트 서명이 제공되지 않습니다.",
"Clients": "클라이언트",
"Clients View": "클라이언트 보기",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Paskolos sąskaitos apžvalga",
"Loan Accounts": "Paskolų sąskaitos",
"Loan Delinquency Tags": "Paskolų vėlavimo žymos",
"Loan Delinquency Installment Tags": "Paskolos nusikalstamumo įmokos žymos",
"Loan Details": "Paskolos informacija",
"Loan Product": "Paskolos produktas",
"Loan Products": "Paskolos produktai",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "Tai bus naudojama renkantis temą pagal organizacijos valią.",
"Click (Define Working Days)": "Spustelėkite (Nustatyti darbo dienas), kad nustatytumėte darbo dienas. Norėdami gauti daugiau informacijos, spustelėkite",
"Click Here To Generate Cron Expression": "Spustelėkite čia, kad sukurtumėte Cron išraišką",
"Client": "Kliento",
"Client Actions": "Kliento veiksmai",
"Client Approval }": "Kliento patvirtinimas }",
"Client Approval": "Kliento patvirtinimas",
"Client Signature is not provided.": "Kliento parašas nepateikiamas.",
"Clients": "Klientai",
"Clients View": "Klientų peržiūra",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Aizdevuma konta pārskats",
"Loan Accounts": "Aizdevuma konti",
"Loan Delinquency Tags": "Aizdevuma kavējuma birkas",
"Loan Delinquency Installment Tags": "Aizdevuma likumpārkāpumu iemaksas tagi",
"Loan Details": "Aizdevuma detaļas",
"Loan Product": "Aizdevuma produkts",
"Loan Products": "Aizdevuma produkti",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "Tas tiks izmantots, lai izvēlētos tēmu atbilstoši organizācijas prasībām.",
"Click (Define Working Days)": "Noklikšķiniet uz (Definēt darba dienas), lai definētu darba dienas. Lai iegūtu sīkāku informāciju, noklikšķiniet",
"Click Here To Generate Cron Expression": "Noklikšķiniet šeit, lai ģenerētu Cron izteiksmi",
"Client": "Klientu",
"Client Actions": "Klientu darbības",
"Client Approval }": "Klienta apstiprinājums }",
"Client Approval": "Klienta apstiprinājums",
"Client Signature is not provided.": "Klienta paraksts netiek nodrošināts.",
"Clients": "Klienti",
"Clients View": "Klientu skats",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "ऋण खाता अवलोकन",
"Loan Accounts": "ऋण खाताहरू",
"Loan Delinquency Tags": "ऋण अपराध ट्यागहरू",
"Loan Delinquency Installment Tags": "ण दिक्विर्याज किग ट्यागहरू",
"Loan Details": "ऋण विवरण",
"Loan Product": "ऋण उत्पादन",
"Loan Products": "ऋण उत्पादनहरू",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "यो संस्थाको इच्छा अनुसार विषयवस्तु छनोट गर्न प्रयोग गरिनेछ।",
"Click (Define Working Days)": "कामका दिनहरू परिभाषित गर्न क्लिक गर्नुहोस् (कार्य दिनहरू परिभाषित गर्नुहोस्)। थप विवरणहरूको लागि क्लिक गर्नुहोस्",
"Click Here To Generate Cron Expression": "क्रोन अभिव्यक्ति उत्पन्न गर्न यहाँ क्लिक गर्नुहोस्",
"Client": "ग्ग्राहक",
"Client Actions": "ग्राहक कार्यहरू",
"Client Approval }": "ग्राहक स्वीकृति }",
"Client Approval": "ग्राहक स्वीकृति",
"Client Signature is not provided.": "ग्राहकको हस्ताक्षर प्रदान गरिएको छैन।",
"Clients": "ग्राहकहरु",
"Clients View": "ग्राहक दृश्य",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Visão geral da conta de empréstimo",
"Loan Accounts": "Contas de empréstimo",
"Loan Delinquency Tags": "Inadimplência de Empréstimo Tags",
"Loan Delinquency Installment Tags": "Tags de parcelamento de inadimplência de empréstimo",
"Loan Details": "Detalhes do empréstimo",
"Loan Product": "Produto de empréstimo",
"Loan Products": "Produtos de empréstimo",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "Isso será usado para escolher um tema de acordo com a vontade da organização.",
"Click (Define Working Days)": "Clique em (Definir Dias Úteis) para definir os dias úteis. Para mais detalhes clique",
"Click Here To Generate Cron Expression": "Clique aqui para gerar expressão Cron",
"Client": "Cliente",
"Client Actions": "Ações do cliente",
"Client Approval }": "Aprovação do cliente }",
"Client Approval": "Aprovação do cliente",
"Client Signature is not provided.": "A assinatura do cliente não é fornecida.",
"Clients": "Clientes",
"Clients View": "Visualização de clientes",
+3 -1
View File
@@ -704,6 +704,7 @@
"Loan Account OverView": "Muhtasari wa Akaunti ya Mkopo",
"Loan Accounts": "Hesabu za Mikopo",
"Loan Delinquency Tags": "Lebo za Uhalifu wa Mkopo",
"Loan Delinquency Installment Tags": "Vitambulisho vya Usanidi wa Mikopo ya Mkopo",
"Loan Details": "Maelezo ya Mkopo",
"Loan Product": "Bidhaa ya Mkopo",
"Loan Products": "Bidhaa za Mkopo",
@@ -2201,8 +2202,9 @@
"Choose a theme as per organization will": "Hii itatumika kuchagua mada kulingana na shirika litakavyofanya.",
"Click (Define Working Days)": "Bofya (Fafanua Siku za Kazi) ili kufafanua siku za kazi. Kwa maelezo zaidi bofya",
"Click Here To Generate Cron Expression": "Bofya Hapa Ili Kuzalisha Maonyesho ya Cron",
"Client": "Mteja",
"Client Actions": "Vitendo vya Mteja",
"Client Approval }": "Idhini ya Mteja }",
"Client Approval": "Idhini ya Mteja",
"Client Signature is not provided.": "Sahihi ya Mteja haijatolewa.",
"Clients": "Wateja",
"Clients View": "Mtazamo wa Wateja",