Skip to content

Commit

Permalink
Loan account with Term variations details tab
Browse files Browse the repository at this point in the history
  • Loading branch information
Jose Alberto Hernandez committed Nov 14, 2024
1 parent 9034ce2 commit 9567452
Show file tree
Hide file tree
Showing 19 changed files with 146 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/app/loans/loans-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ import { ExternalAssetOwnerActiveTransferResolver } from './common-resolvers/ext
import { LoanCollateralsResolver } from './common-resolvers/loan-collaterals.resolver';
import { LoanDelinquencyDataResolver } from './common-resolvers/loan-delinquency-data.resolver';
import { LoanDelinquencyActionsResolver } from './common-resolvers/loan-delinquency-actions.resolver';
import { LoanTermVariationsTabComponent } from './loans-view/loan-term-variations-tab/loan-term-variations-tab.component';

/** Loans Route. */
const routes: Routes = [
Expand Down Expand Up @@ -165,6 +166,14 @@ const routes: Routes = [
loanCollaterals: LoanCollateralsResolver
}
},
{
path: 'term-variations',
component: LoanTermVariationsTabComponent,
data: { title: 'Loan Term Variations', breadcrumb: 'Loan Term Variations', routeParamBreadcrumb: false },
resolve: {
loanDetailsData: LoanDetailsResolver
},
},
{
path: 'loan-tranche-details',
component: LoanTrancheDetailsComponent,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<div class="container">

<h3>{{"labels.heading.Term Variations" | translate}}</h3>
<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>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
table {
width: 100%;
}

.container {
padding-top: 1%;
padding-bottom: 2%;

.delete-button {
margin-left: 1%;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { LoanTermVariationsTabComponent } from './loan-term-variations-tab.component';

describe('LoanTermVariationsTabComponent', () => {
let component: LoanTermVariationsTabComponent;
let fixture: ComponentFixture<LoanTermVariationsTabComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ LoanTermVariationsTabComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(LoanTermVariationsTabComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';

@Component({
selector: 'mifosx-loan-term-variations-tab',
templateUrl: './loan-term-variations-tab.component.html',
styleUrls: ['./loan-term-variations-tab.component.scss']
})
export class LoanTermVariationsTabComponent implements OnInit {

/** Loan Details Data */
loanTermVariationsData: any[] = [];

loanId: number;

loanDTermVariationsColumns: string[] = ['termType', 'applicableFrom', 'value', 'specificToInstallment'];

constructor(private route: ActivatedRoute) {
this.route.parent.data.subscribe((data: { loanDetailsData: any, }) => {
this.loanTermVariationsData = data.loanDetailsData.loanTermVariations;
});
this.loanId = this.route.parent.parent.snapshot.params['loanId'];
}

ngOnInit(): void {

Check failure on line 25 in src/app/loans/loans-view/loan-term-variations-tab/loan-term-variations-tab.component.ts

View workflow job for this annotation

GitHub Actions / Run Lint and Deploy

Lifecycle methods should not be empty
}

}
6 changes: 6 additions & 0 deletions src/app/loans/loans-view/loans-view.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ <h3> {{"labels.heading.Account Overview" | translate}} </h3>
{{"labels.inputs.Loan Tranche Details" | translate}}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.loanTermVariations">
<a mat-tab-link [routerLink]="['./term-variations']" routerLinkActive #termVariations="routerLinkActive"
[active]="termVariations.isActive">
{{"labels.inputs.Term Variations" | translate}}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.overdueCharges.length > 0">
<a mat-tab-link [routerLink]="['./overdue-charges']" routerLinkActive #overduecharges="routerLinkActive"
[active]="overduecharges.isActive">
Expand Down
4 changes: 3 additions & 1 deletion src/app/loans/loans.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ import { TranslateModule } from '@ngx-translate/core';
import { LoanDelinquencyActionDialogComponent } from './custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component';
import { LoanReagingComponent } from './loans-view/loan-account-actions/loan-reaging/loan-reaging.component';
import { LoanReamortizeComponent } from './loans-view/loan-account-actions/loan-reamortize/loan-reamortize.component';
import { LoanTermVariationsTabComponent } from './loans-view/loan-term-variations-tab/loan-term-variations-tab.component';

/**
* Loans Module
Expand Down Expand Up @@ -167,7 +168,8 @@ import { LoanReamortizeComponent } from './loans-view/loan-account-actions/loan-
ExternalAssetTransferComponent,
LoanDelinquencyActionDialogComponent,
LoanReagingComponent,
LoanReamortizeComponent
LoanReamortizeComponent,
LoanTermVariationsTabComponent
],
providers: [ ],
})
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/cs-CS.json
Original file line number Diff line number Diff line change
Expand Up @@ -1103,6 +1103,7 @@
"Template Parameters": "Parametry šablony",
"Term Options": "Možnosti období",
"Terms": "Podmínky",
"Term Variations": "Termínové variace",
"Total Withdrawals": "Celkové výběry",
"Transaction Details": "Detaily transakce",
"Transaction Reverted": "Transakce vrácena",
Expand Down Expand Up @@ -2224,6 +2225,7 @@
"Show Closed Centers": "Zobrazit uzavřená centra",
"Show Closed Groups": "Zobrazit uzavřené skupiny",
"Show Payment Details": "Zobrazit podrobnosti o platbě",
"Specific to Installment": "Specifické pro splátky",
"Staff": "Personál",
"Standing Instruction": "Stálý pokyn",
"Standing Instruction Type": "Typ trvalého pokynu",
Expand Down Expand Up @@ -2268,6 +2270,7 @@
"Tenant": "Nájemce",
"Tenant App Key": "Klíč aplikace nájemce",
"Tenant Id": "Id nájemce",
"Term Variations": "Termínové variace",
"Terms vary based on loan cycle": "Podmínky se liší v závislosti na cyklu půjčky",
"Text": "Text",
"Theme": "Téma",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@
"Template Parameters": "Vorlagenparameter",
"Term Options": "Laufzeitoptionen",
"Terms": "Bedingungen",
"Term Variations": "Begriffsvariationen",
"Total Withdrawals": "Gesamtabhebungen",
"Transaction Details": "Transaktionsdetails",
"Transaction Reverted": "Transaktion rückgängig gemacht",
Expand Down Expand Up @@ -2224,6 +2225,7 @@
"Show Closed Centers": "Geschlossene Zentren anzeigen",
"Show Closed Groups": "Geschlossene Gruppen anzeigen",
"Show Payment Details": "Zahlungsdetails anzeigen",
"Specific to Installment": "Speziell für Ratenzahlung",
"Staff": "Personal",
"Standing Instruction": "Ständiger Unterricht",
"Standing Instruction Type": "Ständiger Instruktionstyp",
Expand Down Expand Up @@ -2268,6 +2270,7 @@
"Tenant": "Mieter",
"Tenant App Key": "Mieter-App-Schlüssel",
"Tenant Id": "Mieter-ID",
"Term Variations": "Begriffsvariationen",
"Terms vary based on loan cycle": "Die Laufzeiten variieren je nach Kreditzyklus",
"Text": "Text",
"Theme": "Thema",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@
"Template Parameters": "Template Parameters",
"Term Options": "Term Options",
"Terms": "Terms",
"Term Variations": "Term Variations",
"Total Withdrawals": "Total Withdrawals",
"Transaction Details": "Transaction Details",
"Transaction Reverted": "Transaction Reverted",
Expand Down Expand Up @@ -2225,6 +2226,7 @@
"Show Closed Centers": "Show Closed Centers",
"Show Closed Groups": "Show Closed Groups",
"Show Payment Details": "Show Payment Details",
"Specific to Installment": "Specific to Installment",
"Staff": "Staff",
"Standing Instruction": "Standing Instruction",
"Standing Instruction Type": "Standing Instruction Type",
Expand Down Expand Up @@ -2269,6 +2271,7 @@
"Tenant": "Tenant",
"Tenant App Key": "Tenant App Key",
"Tenant Id": "Tenant Id",
"Term Variations": "Term Variations",
"Terms vary based on loan cycle": "Terms vary based on loan cycle",
"Text": "Text",
"Theme": "Theme",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/es-MX.json
Original file line number Diff line number Diff line change
Expand Up @@ -1102,6 +1102,7 @@
"Template Parameters": "Parámetros de plantilla",
"Term Options": "Opciones de plazo",
"Terms": "Términos",
"Term Variations": "Variaciones de términos",
"Total Withdrawals": "Retiros totales",
"Transaction Details": "Detalles de la transacción",
"Transaction Reverted": "Transacción revertida",
Expand Down Expand Up @@ -2223,6 +2224,7 @@
"Show Closed Centers": "Mostrar Centros Cerrados",
"Show Closed Groups": "Mostrar grupos cerrados",
"Show Payment Details": "Mostrar detalles de pago",
"Specific to Installment": "Específico para la cuota",
"Staff": "Asesor",
"Standing Instruction": "Instrucción permanente",
"Standing Instruction Type": "Tipo de instrucción permanente",
Expand Down Expand Up @@ -2267,6 +2269,7 @@
"Tenant": "Entidad",
"Tenant App Key": "Clave de aplicación para la entidad",
"Tenant Id": "Id de la entidad",
"Term Variations": "Variaciones de Condiciones",
"Terms vary based on loan cycle": "Los términos varían según el ciclo del Crédito.",
"Text": "Texto",
"Theme": "Tema",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@
"Template Parameters": "Paramètres du modèle",
"Term Options": "Options de durée",
"Terms": "Termes",
"Term Variations": "Variations de durée",
"Total Withdrawals": "Retraits totaux",
"Transaction Details": "détails de la transaction",
"Transaction Reverted": "Transaction annulée",
Expand Down Expand Up @@ -2224,6 +2225,7 @@
"Show Closed Centers": "Afficher les centres fermés",
"Show Closed Groups": "Afficher les groupes fermés",
"Show Payment Details": "Afficher les détails du paiement",
"Specific to Installment": "Spécifique au versement",
"Staff": "Personnel",
"Standing Instruction": "Instruction permanente",
"Standing Instruction Type": "Type d'instruction permanente",
Expand Down Expand Up @@ -2268,6 +2270,7 @@
"Tenant": "Locataire",
"Tenant App Key": "Clé d'application du locataire",
"Tenant Id": "Identifiant du locataire",
"Term Variations": "Variations de durée",
"Terms vary based on loan cycle": "Les conditions varient en fonction du cycle de prêt",
"Text": "Texte",
"Theme": "Thème",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@
"Template Parameters": "Parametri del modello",
"Term Options": "Opzioni dei termini",
"Terms": "Termini",
"Term Variations": "Variazioni dei termini",
"Total Withdrawals": "Prelievi totali",
"Transaction Details": "Dettagli di Transazione",
"Transaction Reverted": "Transazione annullata",
Expand Down Expand Up @@ -2224,6 +2225,7 @@
"Show Closed Centers": "Mostra centri chiusi",
"Show Closed Groups": "Mostra gruppi chiusi",
"Show Payment Details": "Mostra i dettagli del pagamento",
"Specific to Installment": "Specifico per la rata",
"Staff": "Personale",
"Standing Instruction": "Istruzioni permanenti",
"Standing Instruction Type": "Tipo di istruzione permanente",
Expand Down Expand Up @@ -2268,6 +2270,7 @@
"Tenant": "Inquilino",
"Tenant App Key": "Chiave dell'app del tenant",
"Tenant Id": "ID inquilino",
"Term Variations": "Variazioni dei termini",
"Terms vary based on loan cycle": "I termini variano in base al ciclo di prestito",
"Text": "Testo",
"Theme": "Tema",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/ko-KO.json
Original file line number Diff line number Diff line change
Expand Up @@ -1105,6 +1105,7 @@
"Template Parameters": "템플릿 매개변수",
"Term Options": "기간 옵션",
"Terms": "자귀",
"Term Variations": "용어 변형",
"Total Withdrawals": "총 출금",
"Transaction Details": "상세 거래 내역",
"Transaction Reverted": "거래가 되돌려졌습니다.",
Expand Down Expand Up @@ -2225,6 +2226,7 @@
"Show Closed Centers": "닫힌 센터 표시",
"Show Closed Groups": "닫힌 그룹 표시",
"Show Payment Details": "결제 세부정보 표시",
"Specific to Installment": "할부에만 해당",
"Staff": "직원",
"Standing Instruction": "상임지도",
"Standing Instruction Type": "상임 지시 유형",
Expand Down Expand Up @@ -2269,6 +2271,7 @@
"Tenant": "거주자",
"Tenant App Key": "테넌트 앱 키",
"Tenant Id": "테넌트 ID",
"Term Variations": "용어 변형",
"Terms vary based on loan cycle": "대출 주기에 따라 조건이 달라집니다.",
"Text": "텍스트",
"Theme": "주제",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/lt-LT.json
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@
"Template Parameters": "Šablono parametrai",
"Term Options": "Termino parinktys",
"Terms": "Sąlygos",
"Term Variations": "Terminų variacijos",
"Total Withdrawals": "Bendras išėmimas",
"Transaction Details": "Pervedimo duomenys",
"Transaction Reverted": "Sandoris grąžintas",
Expand Down Expand Up @@ -2224,6 +2225,7 @@
"Show Closed Centers": "Rodyti uždarus centrus",
"Show Closed Groups": "Rodyti uždaras grupes",
"Show Payment Details": "Rodyti išsamią mokėjimo informaciją",
"Specific to Installment": "Specifinis išsimokėtinai",
"Staff": "Personalas",
"Standing Instruction": "Stovėjimo instrukcija",
"Standing Instruction Type": "Stovimos instrukcijos tipas",
Expand Down Expand Up @@ -2268,6 +2270,7 @@
"Tenant": "Nuomininkas",
"Tenant App Key": "Nuomininko programos raktas",
"Tenant Id": "Nuomininko ID",
"Term Variations": "Terminų variacijos",
"Terms vary based on loan cycle": "Sąlygos skiriasi priklausomai nuo paskolos ciklo",
"Text": "Tekstas",
"Theme": "tema",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/lv-LV.json
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@
"Template Parameters": "Veidnes parametri",
"Term Options": "Termiņa opcijas",
"Terms": "Noteikumi",
"Term Variations": "Terminu variācijas",
"Total Withdrawals": "Kopējā izņemšana",
"Transaction Details": "Darījuma informācija",
"Transaction Reverted": "Darījums ir atsaukts",
Expand Down Expand Up @@ -2224,6 +2225,7 @@
"Show Closed Centers": "Rādīt slēgtos centrus",
"Show Closed Groups": "Rādīt slēgtās grupas",
"Show Payment Details": "Rādīt maksājuma informāciju",
"Specific to Installment": "Īpaši uz nomaksu",
"Staff": "Personāls",
"Standing Instruction": "Pastāvīga instrukcija",
"Standing Instruction Type": "Pastāvīgās instrukcijas veids",
Expand Down Expand Up @@ -2268,6 +2270,7 @@
"Tenant": "Īrnieks",
"Tenant App Key": "Īrnieka lietotnes atslēga",
"Tenant Id": "Īrnieka ID",
"Term Variations": "Terminu variācijas",
"Terms vary based on loan cycle": "Noteikumi atšķiras atkarībā no aizdevuma cikla",
"Text": "Teksts",
"Theme": "Tēma",
Expand Down
3 changes: 3 additions & 0 deletions src/assets/translations/ne-NE.json
Original file line number Diff line number Diff line change
Expand Up @@ -1104,6 +1104,7 @@
"Template Parameters": "टेम्प्लेट प्यारामिटरहरू",
"Term Options": "टर्म विकल्प",
"Terms": "सर्तहरू",
"Term Variations": "अवधि भिन्नताहरू",
"Total Withdrawals": "कुल निकासी",
"Transaction Details": "लेनदेन विवरण",
"Transaction Reverted": "कारोबार फिर्ता गरियो",
Expand Down Expand Up @@ -2224,6 +2225,7 @@
"Show Closed Centers": "बन्द केन्द्रहरू देखाउनुहोस्",
"Show Closed Groups": "बन्द समूहहरू देखाउनुहोस्",
"Show Payment Details": "भुक्तानी विवरणहरू देखाउनुहोस्",
"Specific to Installment": "किस्ताको लागि विशिष्ट",
"Staff": "कर्मचारी",
"Standing Instruction": "स्थायी निर्देशन",
"Standing Instruction Type": "स्थायी निर्देशन प्रकार",
Expand Down Expand Up @@ -2268,6 +2270,7 @@
"Tenant": "भाँडादार",
"Tenant App Key": "टेनेन्ट एप कुञ्जी",
"Tenant Id": "टेनेन्ट आईडी",
"Term Variations": "अवधि भिन्नताहरू",
"Terms vary based on loan cycle": "ऋण चक्रको आधारमा सर्तहरू भिन्न हुन्छन्",
"Text": "पाठ",
"Theme": "विषयवस्तु",
Expand Down
Loading

0 comments on commit 9567452

Please sign in to comment.