Upgrading to Angular 20:

Replaced checked in package-lock.json by regenerated one.
Ran ng update @angular/core@20 @angular/cli@20
Ran npm install @angular-builders/jest@^20.0.0 @fortawesome/angular-fontawesome@^3.0.0 @swimlane/ngx-graph@^11
Ran npm install ngx-mat-select-search@^8.0.2.
Ran ng update @angular/material@20.
Updated all eslint and typescript to the latest versions.
Removed @angular-devkit/schematics.
Updated fontawesome.
Updated rxjs and tslib.
Moved required node version from 16 to 20.
Updated jest-preset-angular.
Set preserveWhitespaces to false.
Corrected two type declarations in two typescript files to make ng serve run without errors.
Removed unused angular-devkit/schematics from view-user.component.ts .
Updated list of supported browsers.
Upgraded prettier.
Ran prettier . --write the first time.
Ran prettier . --write the second time.
Ran ng generate @angular/core:inject with defaults, excepted a handful of files.
Fixed remaining eslint problems.
Added dist directory to ignores in eslint.config.js.
Let prettier fix formatting, almost everything is just line breaks.
Made htmlhint ignore @if and @for Angular constructs.
Updated node version in Github workflow to 22.12.0 (build.yml).
Updated .env.ts.
Updated Angular datetime format strings from YYYY-MM-DD to yyyy-MM-dd.
Merged changes from dev into angular20 branch.
This commit is contained in:
Felix van Hove
2025-12-08 11:01:01 +01:00
parent f1b4ec2cf2
commit 7fd1486c08
1516 changed files with 39367 additions and 36037 deletions
@@ -13,41 +13,46 @@
>{{ loanDetails.numberOfRepayments }} every {{ loanDetails.repaymentEvery }} {{
loanDetails.repaymentFrequencyType.value | translateKey: 'catalogs'
}}
<span
*ngIf="
loanDetails.repaymentFrequencyType?.id === 2 &&
loanDetails.repaymentFrequencyNthDayType?.id !== 0 &&
loanDetails.repaymentFrequencyDayOfWeekType?.id !== 0
"
class="m-l-10"
>
<span *ngIf="loanDetails.repaymentFrequencyDayOfWeekType">
<span class="m-l-10">{{ 'labels.commons.on' | translate }}</span
>{{ loanDetails.repaymentFrequencyNthDayType?.value }}
<span class="m-l-10">{{
loanDetails.repaymentFrequencyDayOfWeekType?.value | translateKey: 'catalogs'
}}</span>
@if (
loanDetails.repaymentFrequencyType?.id === 2 &&
loanDetails.repaymentFrequencyNthDayType?.id !== 0 &&
loanDetails.repaymentFrequencyDayOfWeekType?.id !== 0
) {
<span class="m-l-10">
@if (loanDetails.repaymentFrequencyDayOfWeekType) {
<span>
<span class="m-l-10">{{ 'labels.commons.on' | translate }}</span
>{{ loanDetails.repaymentFrequencyNthDayType?.value }}
<span class="m-l-10">{{
loanDetails.repaymentFrequencyDayOfWeekType?.value | translateKey: 'catalogs'
}}</span>
</span>
}
</span>
</span>
}
</span>
</div>
<div class="flex-fill layout-row" *ngIf="loanDetails.fixedLength">
<span class="flex-50"> {{ 'labels.inputs.Fixed Length' | translate }} </span>
<span class="flex-50">
{{ loanDetails.fixedLength }} {{ loanDetails.repaymentFrequencyType.value | translateKey: 'catalogs' }}</span
>
</div>
@if (loanDetails.fixedLength) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Fixed Length' | translate }} </span>
<span class="flex-50">
{{ loanDetails.fixedLength }} {{ loanDetails.repaymentFrequencyType.value | translateKey: 'catalogs' }}</span
>
</div>
}
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Amortization' | translate }} </span>
<span class="flex-50"> {{ loanDetails.amortizationType.value | translateKey: 'catalogs' }} </span>
</div>
<div class="flex-fill layout-row" *ngIf="loanDetails.fixedPrincipalPercentagePerInstallment">
<span class="flex-50"> {{ 'labels.inputs.Principal Percentage Per Installment' | translate }} </span>
<span class="flex-50"> {{ loanDetails.fixedPrincipalPercentagePerInstallment | formatNumber }} %</span>
</div>
@if (loanDetails.fixedPrincipalPercentagePerInstallment) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Principal Percentage Per Installment' | translate }} </span>
<span class="flex-50"> {{ loanDetails.fixedPrincipalPercentagePerInstallment | formatNumber }} %</span>
</div>
}
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Equal Amortization' | translate }} </span>
@@ -84,49 +89,63 @@
<span class="flex-50"> {{ loanDetails.enableIncomeCapitalization | yesNo }} </span>
</div>
<div class="flex-fill layout-row" *ngIf="loanDetails.enableIncomeCapitalization">
<span class="flex-50"> {{ 'labels.inputs.Income capitalization calculation type' | translate }}</span>
<span class="flex-50">
{{ loanDetails.capitalizedIncomeCalculationType?.value | translateKey: 'catalogs' }}
</span>
</div>
@if (loanDetails.enableIncomeCapitalization) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Income capitalization calculation type' | translate }}</span>
<span class="flex-50">
{{ loanDetails.capitalizedIncomeCalculationType?.value | translateKey: 'catalogs' }}
</span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.enableIncomeCapitalization">
<span class="flex-50"> {{ 'labels.inputs.Income capitalization strategy' | translate }}</span>
<span class="flex-50"> {{ loanDetails.capitalizedIncomeStrategy?.value | translateKey: 'catalogs' }} </span>
</div>
@if (loanDetails.enableIncomeCapitalization) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Income capitalization strategy' | translate }}</span>
<span class="flex-50"> {{ loanDetails.capitalizedIncomeStrategy?.value | translateKey: 'catalogs' }} </span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.enableIncomeCapitalization">
<span class="flex-50"> {{ 'labels.inputs.Income capitalization type' | translate }}</span>
<span class="flex-50"> {{ loanDetails.capitalizedIncomeType?.value | translateKey: 'catalogs' }} </span>
</div>
@if (loanDetails.enableIncomeCapitalization) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Income capitalization type' | translate }}</span>
<span class="flex-50"> {{ loanDetails.capitalizedIncomeType?.value | translateKey: 'catalogs' }} </span>
</div>
}
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Enable Buy down fee' | translate }}</span>
<span class="flex-50"> {{ loanDetails.enableBuyDownFee | yesNo }} </span>
</div>
<div class="flex-fill layout-row" *ngIf="loanDetails.enableBuyDownFee">
<span class="flex-50"> {{ 'labels.inputs.Buy down fee calculation type' | translate }}</span>
<span class="flex-50">
{{ loanDetails.buyDownFeeCalculationType?.value | translateKey: 'catalogs' }}
</span>
</div>
@if (loanDetails.enableBuyDownFee) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Buy down fee calculation type' | translate }}</span>
<span class="flex-50">
{{ loanDetails.buyDownFeeCalculationType?.value | translateKey: 'catalogs' }}
</span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.enableBuyDownFee">
<span class="flex-50"> {{ 'labels.inputs.Buy down fee strategy' | translate }}</span>
<span class="flex-50"> {{ loanDetails.buyDownFeeStrategy?.value | translateKey: 'catalogs' }} </span>
</div>
@if (loanDetails.enableBuyDownFee) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Buy down fee strategy' | translate }}</span>
<span class="flex-50"> {{ loanDetails.buyDownFeeStrategy?.value | translateKey: 'catalogs' }} </span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.enableBuyDownFee">
<span class="flex-50"> {{ 'labels.inputs.Buy down fee income type' | translate }}</span>
<span class="flex-50"> {{ loanDetails.buyDownFeeIncomeType?.value | translateKey: 'catalogs' }} </span>
</div>
@if (loanDetails.enableBuyDownFee) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Buy down fee income type' | translate }}</span>
<span class="flex-50"> {{ loanDetails.buyDownFeeIncomeType?.value | translateKey: 'catalogs' }} </span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.enableBuyDownFee">
<span class="flex-50"> {{ 'labels.inputs.Merchant Buy down fee' | translate }}</span>
<span class="flex-50"> {{ loanDetails.merchantBuyDownFee | yesNo }} </span>
</div>
@if (loanDetails.enableBuyDownFee) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Merchant Buy down fee' | translate }}</span>
<span class="flex-50"> {{ loanDetails.merchantBuyDownFee | yesNo }} </span>
</div>
}
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Grace: On Principal Payment' | translate }}</span>
@@ -150,8 +169,12 @@
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Fund Source' | translate }} </span>
<span class="flex-50" *ngIf="loanDetails.fundName"> {{ loanDetails.fundName }} </span>
<span class="flex-50" *ngIf="!loanDetails.fundName"> {{ 'labels.inputs.Unassigned' | translate }} </span>
@if (loanDetails.fundName) {
<span class="flex-50"> {{ loanDetails.fundName }} </span>
}
@if (!loanDetails.fundName) {
<span class="flex-50"> {{ 'labels.inputs.Unassigned' | translate }} </span>
}
</div>
<div class="flex-fill layout-row">
@@ -196,27 +219,35 @@
<span class="flex-50"> {{ loanDetails.timeline.expectedMaturityDate | dateFormat }} </span>
</div>
<div class="flex-fill layout-row" *ngIf="loanDetails.canDefineInstallmentAmount">
<span class="flex-50"> {{ 'labels.inputs.Fixed EMI amount' | translate }}</span>
<span class="flex-50"> {{ loanDetails.fixedEmiAmount | formatNumber }} </span>
</div>
@if (loanDetails.canDefineInstallmentAmount) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Fixed EMI amount' | translate }}</span>
<span class="flex-50"> {{ loanDetails.fixedEmiAmount | formatNumber }} </span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.isTopup">
<span class="flex-50"> {{ 'labels.inputs.Is Topup Loan' | translate }}?</span>
<span class="flex-50"> {{ loanDetails.isTopup | yesNo }} </span>
</div>
@if (loanDetails.isTopup) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Is Topup Loan' | translate }}?</span>
<span class="flex-50"> {{ loanDetails.isTopup | yesNo }} </span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.isTopup">
<span class="flex-50"> {{ 'labels.inputs.Loan closed with Topup' | translate }} </span>
<span class="flex-50">
<a href="#">{{ loanDetails.closureLoanAccountNo }}</a>
</span>
</div>
@if (loanDetails.isTopup) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Loan closed with Topup' | translate }} </span>
<span class="flex-50">
<a href="#">{{ loanDetails.closureLoanAccountNo }}</a>
</span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.isTopup">
<span class="flex-50"> {{ 'labels.inputs.Topup closure amount' | translate }}</span>
<span class="flex-50"> {{ loanDetails.topupAmount | formatNumber }} </span>
</div>
@if (loanDetails.isTopup) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Topup closure amount' | translate }}</span>
<span class="flex-50"> {{ loanDetails.topupAmount | formatNumber }} </span>
</div>
}
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Recalculate Interest based on new terms' | translate }}</span>
@@ -233,64 +264,72 @@
<span class="flex-50"> {{ loanDetails.daysInMonthType.value | translateKey: 'catalogs' }} </span>
</div>
<div class="flex-fill layout-row" *ngIf="loanDetails.isInterestRecalculationEnabled">
<span class="flex-50"> {{ 'labels.inputs.Interest recalculation compounding on' | translate }}</span>
<span class="flex-50">
{{
loanDetails.interestRecalculationData.interestRecalculationCompoundingType.value | translateKey: 'catalogs'
}}
</span>
</div>
@if (loanDetails.isInterestRecalculationEnabled) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Interest recalculation compounding on' | translate }}</span>
<span class="flex-50">
{{
loanDetails.interestRecalculationData.interestRecalculationCompoundingType.value | translateKey: 'catalogs'
}}
</span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.isInterestRecalculationEnabled">
<span class="flex-50"> {{ 'labels.inputs.Advance payments adjustment type' | translate }}</span>
<span class="flex-50">
{{ loanDetails.interestRecalculationData.rescheduleStrategyType.value | translateKey: 'catalogs' }}
</span>
</div>
@if (loanDetails.isInterestRecalculationEnabled) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Advance payments adjustment type' | translate }}</span>
<span class="flex-50">
{{ loanDetails.interestRecalculationData.rescheduleStrategyType.value | translateKey: 'catalogs' }}
</span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.isInterestRecalculationEnabled">
<span class="flex-50"> {{ 'labels.inputs.Frequency for recalculate Outstanding Principal' | translate }}</span>
<span class="flex-50"> {{ loanDetails.interestRecalculationData.calendarData.humanReadable }} </span>
</div>
@if (loanDetails.isInterestRecalculationEnabled) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Frequency for recalculate Outstanding Principal' | translate }}</span>
<span class="flex-50"> {{ loanDetails.interestRecalculationData.calendarData.humanReadable }} </span>
</div>
}
<div
class="flex-fill layout-row"
*ngIf="
loanDetails.isInterestRecalculationEnabled &&
loanDetails.interestRecalculationData.interestRecalculationCompoundingType.id !== 0
"
>
<span class="flex-50"> {{ 'labels.inputs.Frequency for compounding' | translate }}</span>
<span class="flex-50"> {{ loanDetails.interestRecalculationData.compoundingCalendarData.humanReadable }} </span>
</div>
@if (
loanDetails.isInterestRecalculationEnabled &&
loanDetails.interestRecalculationData.interestRecalculationCompoundingType.id !== 0
) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Frequency for compounding' | translate }}</span>
<span class="flex-50"> {{ loanDetails.interestRecalculationData.compoundingCalendarData.humanReadable }} </span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.isVariableInstallmentsAllowed">
<span class="flex-50"> {{ 'labels.inputs.Variable Installments Allowed' | translate }}</span>
<span class="flex-50"> {{ loanDetails.isVariableInstallmentsAllowed | yesNo }} </span>
</div>
@if (loanDetails.isVariableInstallmentsAllowed) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Variable Installments Allowed' | translate }}</span>
<span class="flex-50"> {{ loanDetails.isVariableInstallmentsAllowed | yesNo }} </span>
</div>
}
<div class="flex-fill layout-row" *ngIf="loanDetails.isVariableInstallmentsAllowed">
<span class="flex-50"> {{ 'labels.inputs.Gap between Installments' | translate }}</span>
<span class="flex-50">
{{ loanDetails.minimumGap | formatNumber }}&nbsp;{{ 'labels.text.Days' | translate }}&nbsp;, Max:{{
loanDetails.maximumGap | formatNumber
}}&nbsp;{{ 'labels.text.Days' | translate }}
</span>
</div>
@if (loanDetails.isVariableInstallmentsAllowed) {
<div class="flex-fill layout-row">
<span class="flex-50"> {{ 'labels.inputs.Gap between Installments' | translate }}</span>
<span class="flex-50">
{{ loanDetails.minimumGap | formatNumber }}&nbsp;{{ 'labels.text.Days' | translate }}&nbsp;, Max:{{
loanDetails.maximumGap | formatNumber
}}&nbsp;{{ 'labels.text.Days' | translate }}
</span>
</div>
}
<div
class="flex-fill layout-row"
*ngIf="
loanDetails &&
loanDetails.delinquent &&
loanDetails.delinquent.availableDisbursementAmountWithOverApplied !== undefined
"
>
<span class="flex-50">{{ 'labels.inputs.Available Disbursement Amount (with Over Applied)' | translate }}</span>
<span class="flex-50">{{
loanDetails.delinquent.availableDisbursementAmountWithOverApplied | formatNumber
}}</span>
</div>
@if (
loanDetails &&
loanDetails.delinquent &&
loanDetails.delinquent.availableDisbursementAmountWithOverApplied !== undefined
) {
<div class="flex-fill layout-row">
<span class="flex-50">{{ 'labels.inputs.Available Disbursement Amount (with Over Applied)' | translate }}</span>
<span class="flex-50">{{
loanDetails.delinquent.availableDisbursementAmountWithOverApplied | formatNumber
}}</span>
</div>
}
</div>
</div>
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
import { FormatNumberPipe } from '../../../pipes/format-number.pipe';
@@ -17,13 +17,15 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class AccountDetailsComponent {
private route = inject(ActivatedRoute);
loanDetails: any;
dataObject: {
property: string;
value: string;
}[];
constructor(private route: ActivatedRoute) {
constructor() {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
@@ -8,8 +8,12 @@
<ng-container matColumnDef="feepenalty">
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Fee/Penalty' | translate }}</th>
<td mat-cell *matCellDef="let charge">
<span *ngIf="charge.penalty">{{ 'labels.inputs.Penalty' | translate }}</span>
<span *ngIf="!charge.penalty">{{ 'labels.inputs.Fee' | translate }}</span>
@if (charge.penalty) {
<span>{{ 'labels.inputs.Penalty' | translate }}</span>
}
@if (!charge.penalty) {
<span>{{ 'labels.inputs.Fee' | translate }}</span>
}
</td>
</ng-container>
@@ -25,12 +29,20 @@
<ng-container matColumnDef="dueDate">
<th mat-header-cell *matHeaderCellDef mat-sort-header [hide]="useDueDate">
<span *ngIf="useDueDate"> {{ 'labels.inputs.Due As Of' | translate }} </span>
<span *ngIf="!useDueDate"> {{ 'labels.inputs.Submitted On' | translate }} </span>
@if (useDueDate) {
<span> {{ 'labels.inputs.Due As Of' | translate }} </span>
}
@if (!useDueDate) {
<span> {{ 'labels.inputs.Submitted On' | translate }} </span>
}
</th>
<td mat-cell *matCellDef="let charge">
<span *ngIf="useDueDate">{{ charge.dueDate | dateFormat }}</span>
<span *ngIf="!useDueDate">{{ charge.submittedOnDate | dateFormat }}</span>
@if (useDueDate) {
<span>{{ charge.dueDate | dateFormat }}</span>
}
@if (!useDueDate) {
<span>{{ charge.submittedOnDate | dateFormat }}</span>
}
</td>
</ng-container>
@@ -76,56 +88,61 @@
{{ 'labels.inputs.Actions' | translate }}
</th>
<td mat-cell class="center" *matCellDef="let charge">
<span *ngIf="status === 'Submitted and pending approval'">
@if (status === 'Submitted and pending approval') {
<span>
<button
class="account-action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.Edit Charge' | translate }}"
(click)="routeEdit($event); editCharge(charge)"
>
<i class="fa fa-pencil"></i>
</button>
<button
class="account-action-button"
mat-raised-button
color="warn"
matTooltip="{{ 'tooltips.Delete Charge' | translate }}"
(click)="routeEdit($event); deleteCharge(charge.id)"
>
<i class="fa fa-trash"></i>
</button>
</span>
}
@if (!charge.paid && status === 'Active') {
<button
class="account-action-button"
mat-raised-button
color="accent"
matTooltip="{{ 'tooltips.Adjust Charge' | translate }}"
(click)="routeEdit($event); adjustCharge(charge.id)"
>
<i class="fa fa-pencil"></i>
</button>
}
@if (charge.chargePayable && !charge.paid && status === 'Active') {
<button
class="account-action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.Edit Charge' | translate }}"
(click)="routeEdit($event); editCharge(charge)"
matTooltip="{{ 'tooltips.Pay Charge' | translate }}"
(click)="routeEdit($event); payCharge(charge.id)"
>
<i class="fa fa-pencil"></i>
<i class="fa fa-dollar"></i>
</button>
}
@if (!charge.actionFlag) {
<button
class="account-action-button"
mat-raised-button
color="warn"
matTooltip="{{ 'tooltips.Delete Charge' | translate }}"
(click)="routeEdit($event); deleteCharge(charge.id)"
color="primary"
matTooltip="{{ 'tooltips.Waive Charge' | translate }}"
(click)="routeEdit($event); waiveCharge(charge.id)"
>
<i class="fa fa-trash"></i>
<i class="fa fa-flag"></i>
</button>
</span>
<button
class="account-action-button"
mat-raised-button
color="accent"
matTooltip="{{ 'tooltips.Adjust Charge' | translate }}"
*ngIf="!charge.paid && status === 'Active'"
(click)="routeEdit($event); adjustCharge(charge.id)"
>
<i class="fa fa-pencil"></i>
</button>
<button
class="account-action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.Pay Charge' | translate }}"
*ngIf="charge.chargePayable && !charge.paid && status === 'Active'"
(click)="routeEdit($event); payCharge(charge.id)"
>
<i class="fa fa-dollar"></i>
</button>
<button
class="account-action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.Waive Charge' | translate }}"
*ngIf="!charge.actionFlag"
(click)="routeEdit($event); waiveCharge(charge.id)"
>
<i class="fa fa-flag"></i>
</button>
}
</td>
</ng-container>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { MatPaginator } from '@angular/material/paginator';
@@ -35,7 +35,7 @@ import { Dates } from 'app/core/utils/dates';
import { SystemService } from 'app/system/system.service';
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
import { TranslateService } from '@ngx-translate/core';
import { NgIf, CurrencyPipe } from '@angular/common';
import { CurrencyPipe } from '@angular/common';
import { MatTooltip } from '@angular/material/tooltip';
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@@ -65,6 +65,15 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class ChargesTabComponent implements OnInit {
private loansService = inject(LoansService);
private route = inject(ActivatedRoute);
private dateUtils = inject(Dates);
private router = inject(Router);
private translateService = inject(TranslateService);
dialog = inject(MatDialog);
private settingsService = inject(SettingsService);
private systemService = inject(SystemService);
/** Loan Details Data */
loanDetails: any;
/** Charges Data */
@@ -99,16 +108,7 @@ export class ChargesTabComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private loansService: LoansService,
private route: ActivatedRoute,
private dateUtils: Dates,
private router: Router,
private translateService: TranslateService,
public dialog: MatDialog,
private settingsService: SettingsService,
private systemService: SystemService
) {
constructor() {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
@@ -164,7 +164,6 @@ export class ChargesTabComponent implements OnInit {
type: 'date',
required: true
})
];
const data = {
title: `Pay Charge ${chargeId}`,
@@ -229,7 +228,6 @@ export class ChargesTabComponent implements OnInit {
type: 'number',
required: true
})
];
const data = {
title: `Edit Charge ${charge.id}`,
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { EntityDatatableTabComponent } from '../../../shared/tabs/entity-datatable-tab/entity-datatable-tab.component';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@@ -13,6 +13,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class DatatableTabComponent implements OnInit {
private route = inject(ActivatedRoute);
entityId: string;
/** Loan Datatable */
entityDatatable: any = null;
@@ -23,7 +25,7 @@ export class DatatableTabComponent implements OnInit {
* Fetches data table data from `resolve`
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
constructor() {
this.entityId = this.route.parent.parent.snapshot.paramMap.get('loanId');
this.entityDatatable = null;
this.route.data.subscribe((data: { loanDatatable: any }) => {
@@ -1,200 +1,210 @@
<div class="tab-container mat-typography">
<div class="flex-fill" *ngIf="existActiveTransfer">
<h3>{{ 'labels.heading.Active Asset Transfer' | translate }}</h3>
<div class="layout-row gap-32px asset-transfer-container">
<table>
<tbody>
<tr>
<td class="flex-25">
<b>{{ 'labels.inputs.Status' | translate }} :</b>
</td>
<td class="flex-25 left">
<div [ngClass]="itemStatus(activeTransferData.status)">
<fa-icon icon="stop"></fa-icon>
<span class="m-l-10 external-asset-owner-status">{{ activeTransferData.status }}</span>
</div>
</td>
<td class="flex-25">
<b>{{ 'labels.inputs.Owner External Id' | translate }} :</b>
</td>
<td class="flex-25 left">
<mifosx-external-identifier
externalId="{{ activeTransferData.owner.externalId }}"
completed="true"
></mifosx-external-identifier>
</td>
</tr>
<tr>
<td class="flex-25">
<b>{{ 'labels.inputs.Settlement Date' | translate }} :</b>
</td>
<td class="flex-25 left">
{{ activeTransferData.settlementDate | dateFormat }}
</td>
<td class="flex-25">
<b>{{ 'labels.inputs.Effective Date' | translate }} :</b>
</td>
<td class="flex-25 left">
{{ activeTransferData.effectiveFrom | dateFormat }}
</td>
</tr>
<tr>
<td class="flex-25">
<b>{{ 'labels.inputs.Details' | translate }} :</b>
</td>
<td class="flex-75 left">
<table>
<tbody>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Principal Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalPrincipalOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Interest Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalInterestOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Fees Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalFeeChargesOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Penalties Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalPenaltyChargesOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Overpaid' | translate }} :</b>
</td>
<td class="flex-50 r-amount">{{ activeTransferData.details.totalOverpaid | formatNumber }}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
@if (existActiveTransfer) {
<div class="flex-fill">
<h3>{{ 'labels.heading.Active Asset Transfer' | translate }}</h3>
<div class="layout-row gap-32px asset-transfer-container">
<table>
<tbody>
<tr>
<td class="flex-25">
<b>{{ 'labels.inputs.Status' | translate }} :</b>
</td>
<td class="flex-25 left">
<div [ngClass]="itemStatus(activeTransferData.status)">
<fa-icon icon="stop"></fa-icon>
<span class="m-l-10 external-asset-owner-status">{{ activeTransferData.status }}</span>
</div>
</td>
<td class="flex-25">
<b>{{ 'labels.inputs.Owner External Id' | translate }} :</b>
</td>
<td class="flex-25 left">
<mifosx-external-identifier
externalId="{{ activeTransferData.owner.externalId }}"
completed="true"
></mifosx-external-identifier>
</td>
</tr>
<tr>
<td class="flex-25">
<b>{{ 'labels.inputs.Settlement Date' | translate }} :</b>
</td>
<td class="flex-25 left">
{{ activeTransferData.settlementDate | dateFormat }}
</td>
<td class="flex-25">
<b>{{ 'labels.inputs.Effective Date' | translate }} :</b>
</td>
<td class="flex-25 left">
{{ activeTransferData.effectiveFrom | dateFormat }}
</td>
</tr>
<tr>
<td class="flex-25">
<b>{{ 'labels.inputs.Details' | translate }} :</b>
</td>
<td class="flex-75 left">
<table>
<tbody>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Principal Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalPrincipalOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Interest Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalInterestOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Fees Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalFeeChargesOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Penalties Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalPenaltyChargesOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Outstanding' | translate }} :</b>
</td>
<td class="flex-50 r-amount">
{{ activeTransferData.details.totalOutstanding | formatNumber }}
</td>
</tr>
<tr>
<td class="flex-50">
<b>{{ 'labels.inputs.Overpaid' | translate }} :</b>
</td>
<td class="flex-50 r-amount">{{ activeTransferData.details.totalOverpaid | formatNumber }}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
}
<div class="layout-row align-start-center">
<h3 class="flex-90">{{ 'labels.heading.External Asset Owner' | translate }}</h3>
<div class="flex-10" *ngIf="canBeSold()">
<button mat-raised-button class="f-right" color="primary" (click)="saleLoan()" *mifosxHasPermission="'SALE_LOAN'">
<fa-icon icon="dollar-sign" class="m-r-10"></fa-icon>{{ 'labels.buttons.Sell Loan' | translate }}
</button>
</div>
@if (canBeSold()) {
<div class="flex-10">
<button
mat-raised-button
class="f-right"
color="primary"
(click)="saleLoan()"
*mifosxHasPermission="'SALE_LOAN'"
>
<fa-icon icon="dollar-sign" class="m-r-10"></fa-icon>{{ 'labels.buttons.Sell Loan' | translate }}
</button>
</div>
}
<div class="flex-10" *ngIf="canBeCancelled()">
<button
mat-raised-button
class="f-right"
color="warn"
(click)="cancelSaleLoan()"
*mifosxHasPermission="'SALE_LOAN'"
>
<fa-icon icon="trash" class="m-r-10"></fa-icon>{{ 'labels.buttons.Cancel Sell Loan' | translate }}
</button>
</div>
@if (canBeCancelled()) {
<div class="flex-10">
<button
mat-raised-button
class="f-right"
color="warn"
(click)="cancelSaleLoan()"
*mifosxHasPermission="'SALE_LOAN'"
>
<fa-icon icon="trash" class="m-r-10"></fa-icon>{{ 'labels.buttons.Cancel Sell Loan' | translate }}
</button>
</div>
}
<div class="flex-10" *ngIf="canBeBuyed()">
<button
mat-raised-button
class="f-right"
color="primary"
(click)="buyBackLoan()"
*mifosxHasPermission="'SALE_LOAN'"
>
<fa-icon icon="dollar-sign" class="m-r-10"></fa-icon>{{ 'labels.buttons.Buy Back Loan' | translate }}
</button>
</div>
@if (canBeBuyed()) {
<div class="flex-10">
<button
mat-raised-button
class="f-right"
color="primary"
(click)="buyBackLoan()"
*mifosxHasPermission="'SALE_LOAN'"
>
<fa-icon icon="dollar-sign" class="m-r-10"></fa-icon>{{ 'labels.buttons.Buy Back Loan' | translate }}
</button>
</div>
}
</div>
<table mat-table mat-sort [dataSource]="loanTransfersData" *ngIf="loanTransfersData.length > 0">
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Status' | translate }}</th>
<td mat-cell *matCellDef="let item">
<div [ngClass]="itemStatus(item.status)">
<fa-icon icon="stop"></fa-icon>
<span class="m-l-10 status">
{{ itemCurrentStatus(item) | translate }}
</span>
</div>
</td>
</ng-container>
<ng-container matColumnDef="effectiveFrom">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Effective From' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.effectiveFrom | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="ownerExternalId">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Owner External Id' | translate }}</th>
<td mat-cell *matCellDef="let item">
<mifosx-external-identifier externalId="{{ item.owner.externalId }}"></mifosx-external-identifier>
</td>
</ng-container>
<ng-container matColumnDef="transferExternalId">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Transfer External Id' | translate }}</th>
<td mat-cell *matCellDef="let item">
<mifosx-external-identifier externalId="{{ item.transferExternalId }}"></mifosx-external-identifier>
</td>
</ng-container>
<ng-container matColumnDef="settlementDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Settlement Date' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.settlementDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="purchasePriceRatio">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Purchase Price Ratio' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.purchasePriceRatio | number }}</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let item" class="center td-min-space">
<button
class="account-action-button"
*ngIf="!isPendingOrCanceled(item)"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.View Journal Entries' | translate }}"
matTooltipPosition="left"
(click)="routeJournalEntry($event)"
[routerLink]="['/', 'journal-entry', 'view-transfer', item.transferId]"
>
<i class="fa fa-arrow-circle-right"></i>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanTransferColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanTransferColumns"></tr>
</table>
@if (loanTransfersData.length > 0) {
<table mat-table mat-sort [dataSource]="loanTransfersData">
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Status' | translate }}</th>
<td mat-cell *matCellDef="let item">
<div [ngClass]="itemStatus(item.status)">
<fa-icon icon="stop"></fa-icon>
<span class="m-l-10 status">
{{ itemCurrentStatus(item) | translate }}
</span>
</div>
</td>
</ng-container>
<ng-container matColumnDef="effectiveFrom">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Effective From' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.effectiveFrom | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="ownerExternalId">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Owner External Id' | translate }}</th>
<td mat-cell *matCellDef="let item">
<mifosx-external-identifier externalId="{{ item.owner.externalId }}"></mifosx-external-identifier>
</td>
</ng-container>
<ng-container matColumnDef="transferExternalId">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Transfer External Id' | translate }}</th>
<td mat-cell *matCellDef="let item">
<mifosx-external-identifier externalId="{{ item.transferExternalId }}"></mifosx-external-identifier>
</td>
</ng-container>
<ng-container matColumnDef="settlementDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Settlement Date' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.settlementDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="purchasePriceRatio">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Purchase Price Ratio' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.purchasePriceRatio | number }}</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let item" class="center td-min-space">
@if (!isPendingOrCanceled(item)) {
<button
class="account-action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.View Journal Entries' | translate }}"
matTooltipPosition="left"
(click)="routeJournalEntry($event)"
[routerLink]="['/', 'journal-entry', 'view-transfer', item.transferId]"
>
<i class="fa fa-arrow-circle-right"></i>
</button>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanTransferColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanTransferColumns"></tr>
</table>
}
</div>
@@ -1,10 +1,10 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { ExternalAssetOwner } from 'app/loans/services/external-asset-owner';
import { ExternalAssetOwnerService } from 'app/loans/services/external-asset-owner.service';
import { CancelDialogComponent } from 'app/shared/cancel-dialog/cancel-dialog.component';
import { NgIf, NgClass, DecimalPipe } from '@angular/common';
import { NgClass, DecimalPipe } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { ExternalIdentifierComponent } from '../../../shared/external-identifier/external-identifier.component';
import {
@@ -50,6 +50,12 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class ExternalAssetOwnerTabComponent implements OnInit {
private route = inject(ActivatedRoute);
private router = inject(Router);
private dialog = inject(MatDialog);
private externalAssetOwner = inject(ExternalAssetOwner);
private externalAssetOwnerService = inject(ExternalAssetOwnerService);
defaultDate = '9999-12-31';
loanTransfersData: any[] = [];
activeTransferData: any;
@@ -66,13 +72,7 @@ export class ExternalAssetOwnerTabComponent implements OnInit {
currentItem: any;
existActiveTransfer = false;
constructor(
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog,
private externalAssetOwner: ExternalAssetOwner,
private externalAssetOwnerService: ExternalAssetOwnerService
) {
constructor() {
this.route.data.subscribe((data: { loanTransfersData: any; activeTransferData: any }) => {
this.loanTransfersData = data.loanTransfersData.empty ? [] : data.loanTransfersData.content;
this.activeTransferData = data.activeTransferData || null;
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { ExternalAssetOwner } from 'app/loans/services/external-asset-owner';
import { NgClass } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
@@ -21,11 +21,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class ExternalAssetTransferComponent {
private externalAssetOwner = inject(ExternalAssetOwner);
/** Input Fields Data */
@Input() transferData: any;
constructor(private externalAssetOwner: ExternalAssetOwner) {}
itemStatus(status: string): string {
return this.externalAssetOwner.itemStatus(status);
}
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import {
MatTable,
@@ -35,6 +35,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class FloatingInterestRatesComponent implements OnInit {
private route = inject(ActivatedRoute);
/** Loan Details */
loanDetails: any;
/** Interest Rate Data */
@@ -49,7 +51,7 @@ export class FloatingInterestRatesComponent implements OnInit {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
constructor() {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
@@ -1,5 +1,5 @@
<div class="tab-container mat-typography">
<ng-container *ngIf="loanDetails.summary">
@if (loanDetails.summary) {
<h3>{{ 'labels.heading.Performance History' | translate }}</h3>
<div class="layout-row gap-32px performance-history-container">
<table>
@@ -21,224 +21,253 @@
</tbody>
</table>
</div>
</ng-container>
}
<div *ngIf="loanDetails.summary">
<h3>{{ 'labels.heading.Loan Summary' | translate }}</h3>
@if (loanDetails.summary) {
<div>
<h3>{{ 'labels.heading.Loan Summary' | translate }}</h3>
<table mat-table [dataSource]="dataSource">
<ng-container matColumnDef="Empty">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let ele">{{ ele.property }}</td>
</ng-container>
<ng-container matColumnDef="Original">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Original' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let ele">
{{ ele.original | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Paid">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Paid' | translate }}</th>
<td mat-cell class="r-amount amount-minus" *matCellDef="let ele">
{{ ele.paid | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Adjustments">
<th mat-header-cell class="r-amount" *matHeaderCellDef>
{{ 'labels.inputs.Credit Adjustments' | translate }}
</th>
<td mat-cell class="r-amount amount-plus" *matCellDef="let ele">
{{ ele.adjustment | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Waived">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Waived' | translate }}</th>
<td mat-cell class="r-amount amount-minus" *matCellDef="let ele">
{{ ele.waived | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Written Off">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Written Off' | translate }}</th>
<td mat-cell class="r-amount amount-minus" *matCellDef="let ele">
{{ ele.writtenOff | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Outstanding">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Outstanding' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let ele">
{{ ele.outstanding | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Over Due">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Over Due' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let ele">
{{ ele.overdue | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanSummaryColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanSummaryColumns"></tr>
</table>
</div>
}
<table mat-table [dataSource]="dataSource">
<ng-container matColumnDef="Empty">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let ele">{{ ele.property }}</td>
</ng-container>
@if (loanDetails.summary) {
<div>
<h3>{{ 'labels.heading.Loan Details' | translate }}</h3>
<table mat-table [dataSource]="detailsDataSource">
<ng-container matColumnDef="Key">
<td mat-cell *matCellDef="let ele">{{ 'labels.inputs.' + ele.key | translate }}</td>
</ng-container>
<ng-container matColumnDef="Value">
<td mat-cell *matCellDef="let ele">
@if (ele.key === 'Disbursement Date') {
@if (loanDetails.timeline.actualDisbursementDate) {
<span>
{{ loanDetails.timeline.actualDisbursementDate | dateFormat }}
</span>
}
@if (!loanDetails.timeline.actualDisbursementDate) {
<span>
{{ 'labels.inputs.Not Available' | translate }}
</span>
}
}
@if (ele.key === 'Loan Purpose') {
@if (loanDetails.loanPurposeName) {
<span> {{ loanDetails.loanPurposeName }} </span>
}
@if (!loanDetails.loanPurposeName) {
<span> {{ 'labels.inputs.Not Available' | translate }} </span>
}
}
@if (ele.key === 'Loan Officer') {
@if (!loanDetails.loanOfficerName) {
<span> {{ 'labels.inputs.Unassigned' | translate }} </span>
}
@if (loanDetails.loanOfficerName) {
<span>
{{ loanDetails.loanOfficerName }} &nbsp;
@if (loanDetails.loanOfficerName) {
<span> </span>
}
</span>
}
}
@if (ele.key === 'Currency') {
<span> {{ loanDetails.currency.name }} {{ loanDetails.currency.code }} </span>
}
@if (ele.key === 'External Id') {
@if (loanDetails.externalId) {
<span>
<mifosx-external-identifier
externalId="{{ loanDetails.externalId }}"
completed="true"
></mifosx-external-identifier>
</span>
}
@if (!loanDetails.externalId) {
<span> {{ 'labels.inputs.Not Available' | translate }} </span>
}
}
@if (ele.key === 'Write-off Reason') {
@if (ele.value) {
<span>{{ ele.value }}</span>
}
@if (!ele.value) {
<span>{{ 'labels.inputs.Not Available' | translate }}</span>
}
}
@if (ele.key === 'Proposed Amount' || ele.key === 'Approved Amount' || ele.key === 'Disburse Amount') {
{{ ele.value }}
}
</td>
</ng-container>
<tr mat-row *matRowDef="let row; columns: loanDetailsColumns"></tr>
</table>
</div>
}
<ng-container matColumnDef="Original">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Original' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let ele">
{{ ele.original | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
@if (!loanDetails.summary) {
<div>
<h3>{{ 'labels.heading.Loan Details' | translate }}</h3>
<table mat-table [dataSource]="detailsDataSource">
<ng-container matColumnDef="Key">
<td mat-cell *matCellDef="let ele">{{ 'labels.inputs.' + ele.key | translate }}</td>
</ng-container>
<ng-container matColumnDef="Value">
<td mat-cell *matCellDef="let ele">
@if (ele.key === 'Disbursement Date') {
@if (loanDetails.timeline.actualDisbursementDate) {
<span>
{{ loanDetails.timeline.actualDisbursementDate | dateFormat }}
</span>
}
@if (!loanDetails.timeline.actualDisbursementDate) {
<span>
{{ 'labels.inputs.Not Available' | translate }}
</span>
}
}
@if (ele.key === 'Loan Officer') {
@if (!loanDetails.loanOfficerName) {
<span> {{ 'labels.inputs.Unassigned' | translate }} </span>
}
@if (loanDetails.loanOfficerName) {
<span>
{{ loanDetails.loanOfficerName }} &nbsp;
@if (loanDetails.loanOfficerName) {
<span> </span>
}
</span>
}
}
@if (ele.key === 'Currency') {
<span> {{ loanDetails.currency.name }} {{ loanDetails.currency.code }} </span>
}
@if (ele.key === 'External Id') {
@if (loanDetails.externalId) {
<span>
<mifosx-external-identifier
externalId="{{ loanDetails.externalId }}"
completed="true"
></mifosx-external-identifier>
</span>
}
@if (!loanDetails.externalId) {
<span> {{ 'labels.inputs.Not Available' | translate }} </span>
}
}
</td>
</ng-container>
<tr mat-row *matRowDef="let row; columns: loanDetailsColumns"></tr>
</table>
</div>
}
<ng-container matColumnDef="Paid">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Paid' | translate }}</th>
<td mat-cell class="r-amount amount-minus" *matCellDef="let ele">
{{ ele.paid | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Adjustments">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Credit Adjustments' | translate }}</th>
<td mat-cell class="r-amount amount-plus" *matCellDef="let ele">
{{ ele.adjustment | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Waived">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Waived' | translate }}</th>
<td mat-cell class="r-amount amount-minus" *matCellDef="let ele">
{{ ele.waived | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Written Off">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Written Off' | translate }}</th>
<td mat-cell class="r-amount amount-minus" *matCellDef="let ele">
{{ ele.writtenOff | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Outstanding">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Outstanding' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let ele">
{{ ele.outstanding | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<ng-container matColumnDef="Over Due">
<th mat-header-cell class="r-amount" *matHeaderCellDef>{{ 'labels.inputs.Over Due' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let ele">
{{ ele.overdue | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanSummaryColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanSummaryColumns"></tr>
</table>
</div>
<div *ngIf="loanDetails.summary">
<h3>{{ 'labels.heading.Loan Details' | translate }}</h3>
<table mat-table [dataSource]="detailsDataSource">
<ng-container matColumnDef="Key">
<td mat-cell *matCellDef="let ele">{{ 'labels.inputs.' + ele.key | translate }}</td>
</ng-container>
<ng-container matColumnDef="Value">
<td mat-cell *matCellDef="let ele">
<ng-container *ngIf="ele.key === 'Disbursement Date'">
<span *ngIf="loanDetails.timeline.actualDisbursementDate">
{{ loanDetails.timeline.actualDisbursementDate | dateFormat }}
</span>
<span *ngIf="!loanDetails.timeline.actualDisbursementDate">
{{ 'labels.inputs.Not Available' | translate }}
</span>
</ng-container>
<ng-container *ngIf="ele.key === 'Loan Purpose'">
<span *ngIf="loanDetails.loanPurposeName"> {{ loanDetails.loanPurposeName }} </span>
<span *ngIf="!loanDetails.loanPurposeName"> {{ 'labels.inputs.Not Available' | translate }} </span>
</ng-container>
<ng-container *ngIf="ele.key === 'Loan Officer'">
<span *ngIf="!loanDetails.loanOfficerName"> {{ 'labels.inputs.Unassigned' | translate }} </span>
<span *ngIf="loanDetails.loanOfficerName">
{{ loanDetails.loanOfficerName }} &nbsp;
<span *ngIf="loanDetails.loanOfficerName"> </span>
</span>
</ng-container>
<ng-container *ngIf="ele.key === 'Currency'">
<span> {{ loanDetails.currency.name }} {{ loanDetails.currency.code }} </span>
</ng-container>
<ng-container *ngIf="ele.key === 'External Id'">
<span *ngIf="loanDetails.externalId">
<mifosx-external-identifier
externalId="{{ loanDetails.externalId }}"
completed="true"
></mifosx-external-identifier>
</span>
<span *ngIf="!loanDetails.externalId"> {{ 'labels.inputs.Not Available' | translate }} </span>
</ng-container>
<ng-container *ngIf="ele.key === 'Write-off Reason'">
<span *ngIf="ele.value">{{ ele.value }}</span>
<span *ngIf="!ele.value">{{ 'labels.inputs.Not Available' | translate }}</span>
</ng-container>
<ng-container
*ngIf="ele.key === 'Proposed Amount' || ele.key === 'Approved Amount' || ele.key === 'Disburse Amount'"
>
{{ ele.value }}
</ng-container>
</td>
</ng-container>
<tr mat-row *matRowDef="let row; columns: loanDetailsColumns"></tr>
</table>
</div>
<div *ngIf="!loanDetails.summary">
<h3>{{ 'labels.heading.Loan Details' | translate }}</h3>
<table mat-table [dataSource]="detailsDataSource">
<ng-container matColumnDef="Key">
<td mat-cell *matCellDef="let ele">{{ 'labels.inputs.' + ele.key | translate }}</td>
</ng-container>
<ng-container matColumnDef="Value">
<td mat-cell *matCellDef="let ele">
<ng-container *ngIf="ele.key === 'Disbursement Date'">
<span *ngIf="loanDetails.timeline.actualDisbursementDate">
{{ loanDetails.timeline.actualDisbursementDate | dateFormat }}
</span>
<span *ngIf="!loanDetails.timeline.actualDisbursementDate">
{{ 'labels.inputs.Not Available' | translate }}
</span>
</ng-container>
<ng-container *ngIf="ele.key === 'Loan Officer'">
<span *ngIf="!loanDetails.loanOfficerName"> {{ 'labels.inputs.Unassigned' | translate }} </span>
<span *ngIf="loanDetails.loanOfficerName">
{{ loanDetails.loanOfficerName }} &nbsp;
<span *ngIf="loanDetails.loanOfficerName"> </span>
</span>
</ng-container>
<ng-container *ngIf="ele.key === 'Currency'">
<span> {{ loanDetails.currency.name }} {{ loanDetails.currency.code }} </span>
</ng-container>
<ng-container *ngIf="ele.key === 'External Id'">
<span *ngIf="loanDetails.externalId">
<mifosx-external-identifier
externalId="{{ loanDetails.externalId }}"
completed="true"
></mifosx-external-identifier>
</span>
<span *ngIf="!loanDetails.externalId"> {{ 'labels.inputs.Not Available' | translate }} </span>
</ng-container>
</td>
</ng-container>
<tr mat-row *matRowDef="let row; columns: loanDetailsColumns"></tr>
</table>
</div>
<div *ngIf="!loanDetails.summary">
<h3>{{ 'labels.heading.Loan Purpose' | translate }}</h3>
<div class="container">
<div class="layout-row-wrap responsive-column">
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Loan Purpose' | translate }}:</span>
<span class="flex-50" *ngIf="loanDetails.loanPurposeName">
{{ loanDetails.loanPurposeName }}
</span>
<span class="flex-50" *ngIf="!loanDetails.loanPurposeName">
{{ 'labels.inputs.Not Provided' | translate }}
</span>
</div>
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Proposed Amount' | translate }}:</span>
<span class="flex-50">{{
loanDetails.proposedPrincipal | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}</span>
</div>
<div class="flex-contents" *ngIf="showApprovedAmountBasedOnStatus()">
<span class="flex-50">{{ 'labels.inputs.Approved Amount' | translate }}:</span>
<span class="flex-50">{{
loanDetails.approvedPrincipal | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}</span>
</div>
<div class="flex-contents" *ngIf="showDisbursedAmountBasedOnStatus()">
<span class="flex-50">{{ 'labels.inputs.Disburse Amount' | translate }}:</span>
<span class="flex-50">{{ loanDetails.principal | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}</span>
</div>
<div class="flex-contents" *ngIf="loanDetails.balloonRepaymentAmount > 0">
<span class="flex-50">{{ 'labels.inputs.Balloon Repayment Amount' | translate }}:</span>
<span class="flex-50">{{
loanDetails.balloonRepaymentAmount | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}</span>
</div>
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Arrears By' | translate }}:</span>
<span class="flex-50">{{ 'labels.inputs.Not Provided' | translate }}</span>
@if (!loanDetails.summary) {
<div>
<h3>{{ 'labels.heading.Loan Purpose' | translate }}</h3>
<div class="container">
<div class="layout-row-wrap responsive-column">
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Loan Purpose' | translate }}:</span>
@if (loanDetails.loanPurposeName) {
<span class="flex-50">
{{ loanDetails.loanPurposeName }}
</span>
}
@if (!loanDetails.loanPurposeName) {
<span class="flex-50">
{{ 'labels.inputs.Not Provided' | translate }}
</span>
}
</div>
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Proposed Amount' | translate }}:</span>
<span class="flex-50">{{
loanDetails.proposedPrincipal | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}</span>
</div>
@if (showApprovedAmountBasedOnStatus()) {
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Approved Amount' | translate }}:</span>
<span class="flex-50">{{
loanDetails.approvedPrincipal | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}</span>
</div>
}
@if (showDisbursedAmountBasedOnStatus()) {
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Disburse Amount' | translate }}:</span>
<span class="flex-50">{{
loanDetails.principal | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}</span>
</div>
}
@if (loanDetails.balloonRepaymentAmount > 0) {
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Balloon Repayment Amount' | translate }}:</span>
<span class="flex-50">{{
loanDetails.balloonRepaymentAmount | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}</span>
</div>
}
<div class="flex-contents">
<span class="flex-50">{{ 'labels.inputs.Arrears By' | translate }}:</span>
<span class="flex-50">{{ 'labels.inputs.Not Provided' | translate }}</span>
</div>
</div>
</div>
</div>
</div>
}
</div>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import {
MatTableDataSource,
@@ -13,7 +13,7 @@ import {
MatRowDef,
MatRow
} from '@angular/material/table';
import { NgIf, CurrencyPipe } from '@angular/common';
import { CurrencyPipe } from '@angular/common';
import { ExternalIdentifierComponent } from '../../../shared/external-identifier/external-identifier.component';
import { DateFormatPipe } from '../../../pipes/date-format.pipe';
import { FormatNumberPipe } from '../../../pipes/format-number.pipe';
@@ -42,6 +42,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class GeneralTabComponent implements OnInit {
private route = inject(ActivatedRoute);
/** Currency Code */
currencyCode: string;
loanDetails: any;
@@ -78,7 +80,7 @@ export class GeneralTabComponent implements OnInit {
dataSource: MatTableDataSource<any>;
detailsDataSource: MatTableDataSource<any>;
constructor(private route: ActivatedRoute) {
constructor() {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
this.currencyCode = this.loanDetails.currency.code;
@@ -6,23 +6,27 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Collateral Type' | translate }}</mat-label>
<mat-select required formControlName="collateralTypeId">
<mat-option *ngFor="let collateral of dataObject.allowedCollateralTypes" [value]="collateral.id">
{{ collateral.name }}</mat-option
>
@for (collateral of dataObject.allowedCollateralTypes; track collateral) {
<mat-option [value]="collateral.id"> {{ collateral.name }}</mat-option>
}
</mat-select>
<mat-error *ngIf="collateralForm.controls.collateralTypeId.hasError('required')">
{{ 'labels.inputs.Collateral Type' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (collateralForm.controls.collateralTypeId.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Collateral Type' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Value' | translate }}</mat-label>
<input matInput required formControlName="value" />
<mat-error *ngIf="collateralForm.controls.value.hasError('required')">
{{ 'labels.inputs.Value' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (collateralForm.controls.value.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Value' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -1,5 +1,5 @@
/** Angular Imports. */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
@@ -21,6 +21,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class AddCollateralComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private router = inject(Router);
private route = inject(ActivatedRoute);
private loanService = inject(LoansService);
@Input() dataObject: any;
/** Collateral form. */
@@ -28,20 +33,6 @@ export class AddCollateralComponent implements OnInit {
/** Loan Id. */
loanId: string;
/**
* Retrieve data from `Resolver`.
* @param {FormBuilder} formBuilder Form Builder.
* @param {Router} router Router.
* @param {ActivatedRoute} route Activated Route.
* @param {LoansService} LoansService loans service.
*/
constructor(
private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute,
private loanService: LoansService
) {}
ngOnInit() {
this.createAddCollateralForm();
}
@@ -1,8 +1,10 @@
<div class="container mat-elevation-z8">
<mat-card>
<div class="m-b-20 layout-column" *ngIf="maturityDate">
<span class="m-r-10">{{ 'Maturity Date' | translateKey: 'inputs' }} : {{ maturityDate | dateFormat }}</span>
</div>
@if (maturityDate) {
<div class="m-b-20 layout-column">
<span class="m-r-10">{{ 'Maturity Date' | translateKey: 'inputs' }} : {{ maturityDate | dateFormat }}</span>
</div>
}
<form [formGroup]="interestPauseLoanForm" (ngSubmit)="submit()">
<mat-card-content>
<div class="layout-column">
@@ -18,9 +20,11 @@
/>
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
<mat-datepicker #startDatePicker></mat-datepicker>
<mat-error *ngIf="interestPauseLoanForm.controls.startDate.hasError('required')">
{{ 'labels.inputs.Start Date' | translate }}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (interestPauseLoanForm.controls.startDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Start Date' | translate }}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field (click)="endDatePicker.open()">
@@ -35,9 +39,11 @@
/>
<mat-datepicker-toggle matSuffix [for]="endDatePicker"></mat-datepicker-toggle>
<mat-datepicker #endDatePicker></mat-datepicker>
<mat-error *ngIf="interestPauseLoanForm.controls.endDate.hasError('required')">
{{ 'labels.inputs.End Date' | translate }}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (interestPauseLoanForm.controls.endDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.End Date' | translate }}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -17,6 +17,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class AddInterestPauseComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -40,14 +47,7 @@ export class AddInterestPauseComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -6,23 +6,29 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Charge' | translate }}</mat-label>
<mat-select required formControlName="chargeId">
<mat-option *ngFor="let loanCharge of loanChargeOptions" [value]="loanCharge.id">
{{ loanCharge.name + ' (' + loanCharge?.currency.name + ')' }}
</mat-option>
@for (loanCharge of loanChargeOptions; track loanCharge) {
<mat-option [value]="loanCharge.id">
{{ loanCharge.name + ' (' + loanCharge?.currency.name + ')' }}
</mat-option>
}
</mat-select>
<mat-error *ngIf="loanChargeForm.controls.chargeId.hasError('required')">
{{ 'labels.inputs.Charge' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (loanChargeForm.controls.chargeId.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Charge' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Amount' | translate }}</mat-label>
<input type="number" required matInput formControlName="amount" />
<mat-error *ngIf="loanChargeForm.controls.amount.hasError('required')">
{{ 'labels.inputs.Amount' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (loanChargeForm.controls.amount.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Amount' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -35,23 +41,27 @@
<input matInput formControlName="chargeTime" />
</mat-form-field>
<mat-form-field *ngIf="loanChargeForm.controls['dueDate']" (click)="dueDatePicker.open()">
<mat-label>{{ 'labels.inputs.Due On' | translate }}</mat-label>
<input
matInput
[min]="minDate"
[max]="maxDate"
[matDatepicker]="dueDatePicker"
required
formControlName="dueDate"
/>
<mat-datepicker-toggle matSuffix [for]="dueDatePicker"></mat-datepicker-toggle>
<mat-datepicker #dueDatePicker></mat-datepicker>
<mat-error *ngIf="loanChargeForm.controls.dueDate.hasError('required')">
{{ 'labels.inputs.Due Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
@if (loanChargeForm.controls['dueDate']) {
<mat-form-field (click)="dueDatePicker.open()">
<mat-label>{{ 'labels.inputs.Due On' | translate }}</mat-label>
<input
matInput
[min]="minDate"
[max]="maxDate"
[matDatepicker]="dueDatePicker"
required
formControlName="dueDate"
/>
<mat-datepicker-toggle matSuffix [for]="dueDatePicker"></mat-datepicker-toggle>
<mat-datepicker #dueDatePicker></mat-datepicker>
@if (loanChargeForm.controls.dueDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Due Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
}
</div>
<mat-card-actions class="layout-row layout-xs-column layout-align-center gap-5px">
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import {
UntypedFormGroup,
UntypedFormBuilder,
@@ -27,6 +27,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class AddLoanChargeComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private loansService = inject(LoansService);
private settingsService = inject(SettingsService);
/** Minimum Due Date allowed. */
minDate = new Date(2000, 0, 1);
/** Maximum Due Date allowed. */
@@ -60,14 +67,7 @@ export class AddLoanChargeComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private loansService: LoansService,
private settingsService: SettingsService
) {
constructor() {
this.route.data.subscribe((data: { actionButtonData: any }) => {
this.loanChargeOptions = data.actionButtonData.chargeOptions;
});
@@ -8,10 +8,12 @@
<span matTextSuffix class="m-l-10">{{ loanDetailsData.currency.code }}</span>
<span class="flex-auto"></span>
<input type="number" matInput required class="right-input" formControlName="amount" />
<mat-error *ngIf="adjustLoanChargeForm.controls.amount.hasError('required')">
{{ 'labels.inputs.Amount' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (adjustLoanChargeForm.controls.amount.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Amount' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -22,9 +24,11 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
<mat-select formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypes" [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
@for (paymentType of paymentTypes; track paymentType) {
<mat-option [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
@@ -38,32 +42,28 @@
</span>
</div>
<ng-container *ngIf="showPaymentDetails">
@if (showPaymentDetails) {
<mat-form-field>
<mat-label> {{ 'labels.inputs.Account' | translate }} #</mat-label>
<input matInput formControlName="accountNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Cheque' | translate }} #</mat-label>
<input matInput formControlName="checkNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Routing Code' | translate }}</mat-label>
<input matInput formControlName="routingCode" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reciept' | translate }} #</mat-label>
<input matInput formControlName="receiptNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Bank' | translate }} #</mat-label>
<input matInput formControlName="bankNumber" />
</mat-form-field>
</ng-container>
}
<mat-form-field>
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import {
UntypedFormBuilder,
UntypedFormControl,
@@ -25,6 +25,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class AdjustLoanChargeComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private settingsService = inject(SettingsService);
private organizationService = inject(OrganizationService);
/** Loan Id */
loanId: string;
chargeId: string;
@@ -50,14 +57,7 @@ export class AdjustLoanChargeComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService,
private organizationService: OrganizationService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
this.chargeId = this.route.snapshot.params['id'];
this.route.data.subscribe((data: { loansAccountCharge: any; loanDetailsData: any }) => {
@@ -14,10 +14,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="approvedDatePicker"></mat-datepicker-toggle>
<mat-datepicker #approvedDatePicker></mat-datepicker>
<mat-error *ngIf="approveLoanForm.controls.approvedOnDate.hasError('required')">
{{ 'labels.inputs.Approved Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (approveLoanForm.controls.approvedOnDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Approved Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field (click)="disbursementDatePicker.open()">
@@ -49,10 +51,12 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Transaction Amount' | translate }}</mat-label>
<input matInput type="number" required formControlName="approvedLoanAmount" />
<mat-error *ngIf="approveLoanForm.controls.approvedLoanAmount.hasError('required')">
{{ 'labels.inputs.Transaction Amount' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (approveLoanForm.controls.approvedLoanAmount.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Transaction Amount' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -1,5 +1,5 @@
/** Angular Imports. */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -28,6 +28,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class ApproveLoanComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private route = inject(ActivatedRoute);
private dateUtils = inject(Dates);
private loanService = inject(LoansService);
private router = inject(Router);
private settingsService = inject(SettingsService);
/** Approve Loan form. */
approveLoanForm: UntypedFormGroup;
/** Loan data. */
@@ -49,14 +56,7 @@ export class ApproveLoanComponent implements OnInit {
* @param router Router.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private dateUtils: Dates,
private loanService: LoansService,
private router: Router,
private settingsService: SettingsService
) {
constructor() {
this.route.data.subscribe((data: { actionButtonData: any }) => {
this.loanData = data.actionButtonData;
this.currency = data.actionButtonData.currency;
@@ -15,29 +15,39 @@
/>
<mat-datepicker-toggle matSuffix [for]="settlementDatePicker"></mat-datepicker-toggle>
<mat-datepicker #settlementDatePicker></mat-datepicker>
<mat-error *ngIf="saleLoanForm.controls.settlementDate.hasError('required')">
{{ 'labels.inputs.Settlement Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (saleLoanForm.controls.settlementDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Settlement Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field *ngIf="!isBuyBack()">
<mat-label>{{ 'labels.inputs.Purchase Price Ratio' | translate }}</mat-label>
<input type="number" matInput required formControlName="purchasePriceRatio" />
<mat-error *ngIf="saleLoanForm.controls.purchasePriceRatio.hasError('required')">
{{ 'labels.inputs.Purchase Price Ratio' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
@if (!isBuyBack()) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Purchase Price Ratio' | translate }}</mat-label>
<input type="number" matInput required formControlName="purchasePriceRatio" />
@if (saleLoanForm.controls.purchasePriceRatio.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Purchase Price Ratio' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
}
<mat-form-field *ngIf="!isBuyBack()">
<mat-label>{{ 'labels.inputs.Owner External Id' | translate }}</mat-label>
<input matInput formControlName="ownerExternalId" />
<mat-error *ngIf="saleLoanForm.controls.ownerExternalId.hasError('required')">
{{ 'labels.inputs.Owner External Id' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
@if (!isBuyBack()) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Owner External Id' | translate }}</mat-label>
<input matInput formControlName="ownerExternalId" />
@if (saleLoanForm.controls.ownerExternalId.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Owner External Id' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
}
<mat-form-field>
<mat-label>{{ 'labels.inputs.Transfer External Id' | translate }}</mat-label>
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -15,6 +15,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class AssetTransferLoanComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private externalAssetOwnerService = inject(ExternalAssetOwnerService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
BUYBACK_COMMAND = 'buyback';
SALE_COMMAND = 'sale';
@@ -28,14 +35,7 @@ export class AssetTransferLoanComponent implements OnInit {
/** Sell Loan Form */
saleLoanForm: UntypedFormGroup;
constructor(
private formBuilder: UntypedFormBuilder,
private externalAssetOwnerService: ExternalAssetOwnerService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
const actionName = this.route.snapshot.params['action'];
this.command = actionName === 'Sell Loan' ? this.SALE_COMMAND : this.BUYBACK_COMMAND;
@@ -6,14 +6,18 @@
<mat-form-field>
<mat-label> {{ 'labels.inputs.To Loan Officer' | translate }}</mat-label>
<mat-select required formControlName="toLoanOfficerId">
<mat-option *ngFor="let loanOfficer of loanOfficers" [value]="loanOfficer.id">
{{ loanOfficer.displayName }}
</mat-option>
@for (loanOfficer of loanOfficers; track loanOfficer) {
<mat-option [value]="loanOfficer.id">
{{ loanOfficer.displayName }}
</mat-option>
}
</mat-select>
<mat-error *ngIf="assignOfficerForm.controls.toLoanOfficerId.hasError('required')">
{{ 'labels.inputs.Loan Officer' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (assignOfficerForm.controls.toLoanOfficerId.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Loan Officer' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field (click)="assignOnDatePicker.open()">
@@ -28,10 +32,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="assignOnDatePicker"></mat-datepicker-toggle>
<mat-datepicker #assignOnDatePicker></mat-datepicker>
<mat-error *ngIf="assignOfficerForm.controls.assignmentDate.hasError('required')">
{{ 'labels.inputs.Assignment Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (assignOfficerForm.controls.assignmentDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Assignment Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { LoansService } from 'app/loans/loans.service';
import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
@@ -17,6 +17,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class AssignLoanOfficerComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -35,14 +42,7 @@ export class AssignLoanOfficerComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,23 +15,29 @@
/>
<mat-datepicker-toggle matSuffix [for]="transactionDatePicker"></mat-datepicker-toggle>
<mat-datepicker #transactionDatePicker></mat-datepicker>
<mat-error *ngIf="chargeoffLoanForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (chargeoffLoanForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reason for Charge-Off' | translate }}</mat-label>
<mat-select formControlName="chargeOffReasonId">
<mat-option *ngFor="let chargeOffReason of chargeOffReasonOptions" [value]="chargeOffReason.id">
{{ chargeOffReason.name }}
</mat-option>
@for (chargeOffReason of chargeOffReasonOptions; track chargeOffReason) {
<mat-option [value]="chargeOffReason.id">
{{ chargeOffReason.name }}
</mat-option>
}
</mat-select>
<mat-error *ngIf="chargeoffLoanForm.controls.chargeOffReasonId.hasError('required')">
{{ 'labels.inputs.Reason for Charge-Off' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (chargeoffLoanForm.controls.chargeOffReasonId.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Reason for Charge-Off' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -17,6 +17,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class ChargeOffComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
@@ -41,14 +48,7 @@ export class ChargeOffComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="closedDatePicker"></mat-datepicker-toggle>
<mat-datepicker #closedDatePicker></mat-datepicker>
<mat-error *ngIf="closeLoanForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Closed Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (closeLoanForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Closed Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
import { LoansService } from 'app/loans/loans.service';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
@@ -19,6 +19,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class CloseAsRescheduledComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Close form. */
@@ -37,14 +44,7 @@ export class CloseAsRescheduledComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -7,118 +7,119 @@
{{ 'labels.inputs.Existing Client' | translate }}
</mat-checkbox>
<ng-container *ngIf="!showClientDetailsForm">
@if (!showClientDetailsForm) {
<mat-form-field class="flex-30">
<mat-label>{{ 'labels.inputs.name' | translate }}</mat-label>
<input matInput formControlName="name" [matAutocomplete]="clientsAutocomplete" />
<mat-error *ngIf="newGuarantorForm.controls.name.hasError('required')">
{{ 'labels.inputs.name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (newGuarantorForm.controls.name.hasError('required')) {
<mat-error>
{{ 'labels.inputs.name' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-autocomplete
autoActiveFirstOption
#clientsAutocomplete="matAutocomplete"
[displayWith]="displayClient"
(optionSelected)="clientSelected($event.option.value)"
>
<mat-option *ngFor="let client of clientsData" [value]="client">
{{ client.displayName }}
</mat-option>
@for (client of clientsData; track client) {
<mat-option [value]="client">
{{ client.displayName }}
</mat-option>
}
</mat-autocomplete>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Relationship' | translate }}</mat-label>
<mat-select formControlName="clientRelationshipTypeId">
<mat-option *ngFor="let relationType of relationTypes" [value]="relationType.id">
{{ relationType.name }}
</mat-option>
@for (relationType of relationTypes; track relationType) {
<mat-option [value]="relationType.id">
{{ relationType.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
<ng-container *ngIf="accountOptions?.length > 0">
@if (accountOptions?.length > 0) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Account' | translate }}</mat-label>
<mat-select formControlName="savingsId">
<mat-option *ngFor="let accountOption of accountOptions" [value]="accountOption.id">
{{ accountOption.productName }} - {{ accountOption.accountNo }}
</mat-option>
@for (accountOption of accountOptions; track accountOption) {
<mat-option [value]="accountOption.id">
{{ accountOption.productName }} - {{ accountOption.accountNo }}
</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Amount' | translate }}</mat-label>
<input type="number" matInput required formControlName="amount" />
</mat-form-field>
</ng-container>
</ng-container>
}
}
<ng-container *ngIf="showClientDetailsForm">
@if (showClientDetailsForm) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Relationship' | translate }}</mat-label>
<mat-select formControlName="clientRelationshipTypeId">
<mat-option *ngFor="let relationType of relationTypes" [value]="relationType.id">
{{ relationType.name }}
</mat-option>
@for (relationType of relationTypes; track relationType) {
<mat-option [value]="relationType.id">
{{ relationType.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.First Name' | translate }}</mat-label>
<input matInput required formControlName="firstname" />
<mat-error *ngIf="newGuarantorForm.controls.firstname.hasError('required')">
{{ 'labels.inputs.First Name' | translate }} {{ 'labels.commons.is' | translate }}
{{ 'labels.commons.is' | translate }} <strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (newGuarantorForm.controls.firstname.hasError('required')) {
<mat-error>
{{ 'labels.inputs.First Name' | translate }} {{ 'labels.commons.is' | translate }}
{{ 'labels.commons.is' | translate }} <strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Last Name' | translate }}</mat-label>
<input matInput required formControlName="lastname" />
<mat-error *ngIf="newGuarantorForm.controls.lastname.hasError('required')">
{{ 'labels.inputs.Last Name' | translate }} {{ 'labels.commons.is' | translate }}
{{ 'labels.commons.is' | translate }} <strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (newGuarantorForm.controls.lastname.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Last Name' | translate }} {{ 'labels.commons.is' | translate }}
{{ 'labels.commons.is' | translate }} <strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field (click)="dobDatePicker.open()">
<mat-label>{{ 'labels.inputs.Date Of Birth' | translate }}</mat-label>
<input matInput [min]="minDate" [max]="maxDate" [matDatepicker]="dobDatePicker" formControlName="dob" />
<mat-datepicker-toggle matSuffix [for]="dobDatePicker"></mat-datepicker-toggle>
<mat-datepicker #dobDatePicker></mat-datepicker>
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Address Line' | translate }} 1</mat-label>
<input matInput formControlName="addressLine1" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Address Line' | translate }} 2</mat-label>
<input matInput formControlName="addressLine2" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.City' | translate }}</mat-label>
<input matInput formControlName="city" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Zip' | translate }}</mat-label>
<input matInput formControlName="zip" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Mobile' | translate }}</mat-label>
<input type="number" matInput formControlName="mobileNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Residence Phone' | translate }} #</mat-label>
<input type="number" matInput formControlName="housePhoneNumber" />
</mat-form-field>
</ng-container>
}
</div>
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
@@ -137,7 +138,7 @@
</mat-card-content>
</form>
<ng-container *ngIf="newGuarantorForm?.controls?.name?.value">
@if (newGuarantorForm?.controls?.name?.value) {
<div class="mat-table">
<div class="mat-header-row">
<div class="mat-header-cell">{{ 'labels.inputs.Client Details' | translate }}</div>
@@ -155,6 +156,6 @@
<div class="mat-cell">{{ newGuarantorForm.controls.name.value.officeName }}</div>
</div>
</div>
</ng-container>
}
</mat-card>
</div>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input, AfterViewInit } from '@angular/core';
import { Component, OnInit, Input, AfterViewInit, inject } from '@angular/core';
import {
UntypedFormGroup,
UntypedFormBuilder,
@@ -33,6 +33,14 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class CreateGuarantorComponent implements OnInit, AfterViewInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private clientsService = inject(ClientsService);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** New Guarantor Form */
newGuarantorForm: UntypedFormGroup;
@@ -58,15 +66,7 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private clientsService: ClientsService,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="disbursementDatePicker"></mat-datepicker-toggle>
<mat-datepicker #disbursementDatePicker></mat-datepicker>
<mat-error *ngIf="disbursementForm.controls.actualDisbursementDate.hasError('required')">
{{ 'labels.inputs.Disbursement Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (disbursementForm.controls.actualDisbursementDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Disbursement Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mifosx-input-amount
@@ -35,10 +37,12 @@
<input matInput [value]="dataObject.availableDisbursementAmountWithOverApplied | formatNumber" readonly />
</mat-form-field>
<mat-form-field *ngIf="dataObject.fixedEmiAmount">
<mat-label>{{ 'labels.inputs.Fixed EMI amount' | translate }}</mat-label>
<input matInput type="number" formControlName="fixedEmiAmount" />
</mat-form-field>
@if (dataObject.fixedEmiAmount) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Fixed EMI amount' | translate }}</mat-label>
<input matInput type="number" formControlName="fixedEmiAmount" />
</mat-form-field>
}
<mat-form-field>
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -22,6 +22,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class DisburseToSavingsAccountComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private loanService = inject(LoansService);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Minimum Date allowed. */
@@ -32,23 +39,6 @@ export class DisburseToSavingsAccountComponent implements OnInit {
disbursementForm: UntypedFormGroup;
currency: Currency;
/**
* Get data from `Resolver`.
* @param {FormBuilder} formBuilder FormBuilder.
* @param {ActivatedRoute} route ActivatedRoute.
* @param {Router} router Router.
* @param {LoansService} loanService Loan Service.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private loanService: LoansService,
private settingsService: SettingsService
) {}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.setDisbursementToSavingsForm();
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="actualDisbursementDatePicker"></mat-datepicker-toggle>
<mat-datepicker #actualDisbursementDatePicker></mat-datepicker>
<mat-error *ngIf="disbursementLoanForm.controls.actualDisbursementDate.hasError('required')">
{{ 'labels.inputs.Disbursed On Date' | translate
}}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (disbursementLoanForm.controls.actualDisbursementDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Disbursed On Date' | translate
}}<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mifosx-input-amount
@@ -43,9 +45,11 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
<mat-select formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypes" [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
@for (paymentType of paymentTypes; track paymentType) {
<mat-option [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
@@ -59,32 +63,28 @@
</span>
</div>
<ng-container *ngIf="showPaymentDetails">
@if (showPaymentDetails) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Account' | translate }} #</mat-label>
<input matInput formControlName="accountNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Cheque' | translate }} #</mat-label>
<input matInput formControlName="checkNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Routing Code' | translate }}</mat-label>
<input matInput formControlName="routingCode" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reciept' | translate }} #</mat-label>
<input matInput formControlName="receiptNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Bank' | translate }} #</mat-label>
<input matInput formControlName="bankNumber" />
</mat-form-field>
</ng-container>
}
<mat-form-field>
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
@@ -30,6 +30,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class DisburseComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -52,14 +59,7 @@ export class DisburseComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -2,13 +2,14 @@
<mat-card>
<mat-card-content>
<div class="m-b-10 layout-column">
<mifosx-repayment-schedule-tab
*ngIf="repaymentScheduleDetails"
class="flex-100"
[repaymentScheduleDetails]="repaymentScheduleDetails"
[forEditing]="true"
>
</mifosx-repayment-schedule-tab>
@if (repaymentScheduleDetails) {
<mifosx-repayment-schedule-tab
class="flex-100"
[repaymentScheduleDetails]="repaymentScheduleDetails"
[forEditing]="true"
>
</mifosx-repayment-schedule-tab>
}
</div>
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
@@ -24,6 +24,14 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class EditRepaymentScheduleComponent implements OnInit {
private loansService = inject(LoansService);
private router = inject(Router);
private route = inject(ActivatedRoute);
private dialog = inject(MatDialog);
private dateUtils = inject(Dates);
private translateService = inject(TranslateService);
private settingsService = inject(SettingsService);
/** Loan ID. */
loanId: string;
/** Indicates If the Schedule has been changed */
@@ -43,15 +51,7 @@ export class EditRepaymentScheduleComponent implements OnInit {
* @param {Dates} dateUtils Dates Utils.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private loansService: LoansService,
private router: Router,
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private translateService: TranslateService,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
this.getRepaymentSchedule();
}
@@ -107,7 +107,6 @@ export class EditRepaymentScheduleComponent implements OnInit {
type: 'number',
required: true
})
];
const data = {
title: 'Pattern Update',
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="transactionsDatePicker"></mat-datepicker-toggle>
<mat-datepicker #transactionsDatePicker></mat-datepicker>
<mat-error *ngIf="foreclosureForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (foreclosureForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { LoansService } from 'app/loans/loans.service';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
@@ -19,6 +19,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class ForeclosureComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
loanId: any;
@@ -36,14 +43,7 @@ export class ForeclosureComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -1,69 +1,108 @@
<mifosx-loans-account-close [dataObject]="actionButtonData" *ngIf="actions['Close']"></mifosx-loans-account-close>
<mifosx-undo-approval *ngIf="actions['Undo Approval']"></mifosx-undo-approval>
<mifosx-assign-loan-officer
*ngIf="actions['Assign Loan Officer']"
[dataObject]="actionButtonData"
></mifosx-assign-loan-officer>
<mifosx-foreclosure [dataObject]="actionButtonData" *ngIf="actions['Foreclosure']"></mifosx-foreclosure>
<mifosx-prepay-loan
[dataObject]="actionButtonData"
*ngIf="actions['Prepay Loan'] || actions['Contract Termination']"
></mifosx-prepay-loan>
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Make Repayment']"></mifosx-make-repayment>
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Capitalized Income']"></mifosx-make-repayment>
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Goodwill Credit']"></mifosx-make-repayment>
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Buy Down Fee']"></mifosx-make-repayment>
<mifosx-make-repayment
[dataObject]="actionButtonData"
*ngIf="actions['Interest Payment Waiver']"
></mifosx-make-repayment>
<mifosx-make-repayment [dataObject]="actionButtonData" *ngIf="actions['Payout Refund']"></mifosx-make-repayment>
<mifosx-make-repayment
[dataObject]="actionButtonData"
*ngIf="actions['Merchant Issued Refund']"
></mifosx-make-repayment>
<mifosx-loan-credit-balance-refund
[dataObject]="actionButtonData"
*ngIf="actions['Credit Balance Refund']"
></mifosx-loan-credit-balance-refund>
<mifosx-waive-interest [dataObject]="actionButtonData" *ngIf="actions['Waive Interest']"></mifosx-waive-interest>
<mifosx-write-off-page [dataObject]="actionButtonData" *ngIf="actions['Write Off']"></mifosx-write-off-page>
<mifosx-close-as-rescheduled
[dataObject]="actionButtonData"
*ngIf="actions['Close (as Rescheduled)']"
></mifosx-close-as-rescheduled>
<mifosx-loan-reschedule [dataObject]="actionButtonData" *ngIf="actions['Reschedule']"></mifosx-loan-reschedule>
<mifosx-recovery-repayment
[dataObject]="actionButtonData"
*ngIf="actions['Recovery Payment']"
></mifosx-recovery-repayment>
<mifosx-view-guarantors [dataObject]="actionButtonData" *ngIf="actions['View Guarantors']"></mifosx-view-guarantors>
<mifosx-create-guarantor [dataObject]="actionButtonData" *ngIf="actions['Create Guarantor']"></mifosx-create-guarantor>
<mifosx-disburse-to-savings-account
[dataObject]="actionButtonData"
*ngIf="actions['Disburse to Savings']"
></mifosx-disburse-to-savings-account>
<mifosx-reject-loan *ngIf="actions['Reject']"></mifosx-reject-loan>
<mifosx-disburse [dataObject]="actionButtonData" *ngIf="actions['Disburse']"></mifosx-disburse>
<mifosx-withdrawn-by-client *ngIf="actions['Withdrawn by Client']"></mifosx-withdrawn-by-client>
<mifosx-add-collateral [dataObject]="actionButtonData" *ngIf="actions['Add Collateral']"></mifosx-add-collateral>
<mifosx-undo-disbursal
*ngIf="actions['Undo Disbursal'] || actions['Undo Last Disbursal']"
[actionName]="actionName"
></mifosx-undo-disbursal>
<mifosx-loan-screen-reports
[dataObject]="actionButtonData"
*ngIf="actions['Loan Screen Reports']"
></mifosx-loan-screen-reports>
<mifosx-approve-loan *ngIf="actions['Approve']"></mifosx-approve-loan>
<mifosx-add-loan-charge *ngIf="actions['Add Loan Charge']"></mifosx-add-loan-charge>
<mifosx-edit-repayment-schedule *ngIf="actions['Edit Repayment Schedule']"></mifosx-edit-repayment-schedule>
<mifosx-charge-off [dataObject]="actionButtonData" *ngIf="actions['Charge-Off']"></mifosx-charge-off>
<mifosx-asset-transfer-loan *ngIf="actions['Sell Loan'] || actions['Buy Back Loan']"></mifosx-asset-transfer-loan>
<mifosx-loan-reaging [dataObject]="actionButtonData" *ngIf="actions['Re-Age']"></mifosx-loan-reaging>
<mifosx-loan-reamortize [dataObject]="actionButtonData" *ngIf="actions['Re-Amortize']"></mifosx-loan-reamortize>
<mifosx-add-interest-pause
[dataObject]="navigationData"
*ngIf="actions['Add Interest Pause']"
></mifosx-add-interest-pause>
<mifosx-undo-write-off [dataObject]="actionButtonData" *ngIf="actions['Undo Write-off']"></mifosx-undo-write-off>
@if (actions['Close']) {
<mifosx-loans-account-close [dataObject]="actionButtonData"></mifosx-loans-account-close>
}
@if (actions['Undo Approval']) {
<mifosx-undo-approval></mifosx-undo-approval>
}
@if (actions['Assign Loan Officer']) {
<mifosx-assign-loan-officer [dataObject]="actionButtonData"></mifosx-assign-loan-officer>
}
@if (actions['Foreclosure']) {
<mifosx-foreclosure [dataObject]="actionButtonData"></mifosx-foreclosure>
}
@if (actions['Prepay Loan'] || actions['Contract Termination']) {
<mifosx-prepay-loan [dataObject]="actionButtonData"></mifosx-prepay-loan>
}
@if (actions['Make Repayment']) {
<mifosx-make-repayment [dataObject]="actionButtonData"></mifosx-make-repayment>
}
@if (actions['Capitalized Income']) {
<mifosx-make-repayment [dataObject]="actionButtonData"></mifosx-make-repayment>
}
@if (actions['Goodwill Credit']) {
<mifosx-make-repayment [dataObject]="actionButtonData"></mifosx-make-repayment>
}
@if (actions['Buy Down Fee']) {
<mifosx-make-repayment [dataObject]="actionButtonData"></mifosx-make-repayment>
}
@if (actions['Interest Payment Waiver']) {
<mifosx-make-repayment [dataObject]="actionButtonData"></mifosx-make-repayment>
}
@if (actions['Payout Refund']) {
<mifosx-make-repayment [dataObject]="actionButtonData"></mifosx-make-repayment>
}
@if (actions['Merchant Issued Refund']) {
<mifosx-make-repayment [dataObject]="actionButtonData"></mifosx-make-repayment>
}
@if (actions['Credit Balance Refund']) {
<mifosx-loan-credit-balance-refund [dataObject]="actionButtonData"></mifosx-loan-credit-balance-refund>
}
@if (actions['Waive Interest']) {
<mifosx-waive-interest [dataObject]="actionButtonData"></mifosx-waive-interest>
}
@if (actions['Write Off']) {
<mifosx-write-off-page [dataObject]="actionButtonData"></mifosx-write-off-page>
}
@if (actions['Close (as Rescheduled)']) {
<mifosx-close-as-rescheduled [dataObject]="actionButtonData"></mifosx-close-as-rescheduled>
}
@if (actions['Reschedule']) {
<mifosx-loan-reschedule [dataObject]="actionButtonData"></mifosx-loan-reschedule>
}
@if (actions['Recovery Payment']) {
<mifosx-recovery-repayment [dataObject]="actionButtonData"></mifosx-recovery-repayment>
}
@if (actions['View Guarantors']) {
<mifosx-view-guarantors [dataObject]="actionButtonData"></mifosx-view-guarantors>
}
@if (actions['Create Guarantor']) {
<mifosx-create-guarantor [dataObject]="actionButtonData"></mifosx-create-guarantor>
}
@if (actions['Disburse to Savings']) {
<mifosx-disburse-to-savings-account [dataObject]="actionButtonData"></mifosx-disburse-to-savings-account>
}
@if (actions['Reject']) {
<mifosx-reject-loan></mifosx-reject-loan>
}
@if (actions['Disburse']) {
<mifosx-disburse [dataObject]="actionButtonData"></mifosx-disburse>
}
@if (actions['Withdrawn by Client']) {
<mifosx-withdrawn-by-client></mifosx-withdrawn-by-client>
}
@if (actions['Add Collateral']) {
<mifosx-add-collateral [dataObject]="actionButtonData"></mifosx-add-collateral>
}
@if (actions['Undo Disbursal'] || actions['Undo Last Disbursal']) {
<mifosx-undo-disbursal [actionName]="actionName"></mifosx-undo-disbursal>
}
@if (actions['Loan Screen Reports']) {
<mifosx-loan-screen-reports [dataObject]="actionButtonData"></mifosx-loan-screen-reports>
}
@if (actions['Approve']) {
<mifosx-approve-loan></mifosx-approve-loan>
}
@if (actions['Add Loan Charge']) {
<mifosx-add-loan-charge></mifosx-add-loan-charge>
}
@if (actions['Edit Repayment Schedule']) {
<mifosx-edit-repayment-schedule></mifosx-edit-repayment-schedule>
}
@if (actions['Charge-Off']) {
<mifosx-charge-off [dataObject]="actionButtonData"></mifosx-charge-off>
}
@if (actions['Sell Loan'] || actions['Buy Back Loan']) {
<mifosx-asset-transfer-loan></mifosx-asset-transfer-loan>
}
@if (actions['Re-Age']) {
<mifosx-loan-reaging [dataObject]="actionButtonData"></mifosx-loan-reaging>
}
@if (actions['Re-Amortize']) {
<mifosx-loan-reamortize [dataObject]="actionButtonData"></mifosx-loan-reamortize>
}
@if (actions['Add Interest Pause']) {
<mifosx-add-interest-pause [dataObject]="navigationData"></mifosx-add-interest-pause>
}
@if (actions['Undo Write-off']) {
<mifosx-undo-write-off [dataObject]="actionButtonData"></mifosx-undo-write-off>
}
@@ -1,5 +1,5 @@
/** Angular Imports. */
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { LoansAccountCloseComponent } from './loans-account-close/loans-account-close.component';
import { UndoApprovalComponent } from './undo-approval/undo-approval.component';
@@ -75,6 +75,9 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanAccountActionsComponent {
private route = inject(ActivatedRoute);
private router = inject(Router);
/** Loan Details Data */
navigationData: any;
@@ -167,11 +170,8 @@ export class LoanAccountActionsComponent {
/**
* @param route Activated Route.
*/
constructor(
private route: ActivatedRoute,
private router: Router
) {
const currentNavigation = this.router.getCurrentNavigation();
constructor() {
const currentNavigation = this.router.currentNavigation();
// Safely access data with optional chaining
this.navigationData = currentNavigation?.extras?.state?.data;
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="transactionDatePicker"></mat-datepicker-toggle>
<mat-datepicker #transactionDatePicker></mat-datepicker>
<mat-error *ngIf="creditBalanceLoanForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (creditBalanceLoanForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mifosx-input-amount
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -20,6 +20,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanCreditBalanceRefundComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -38,14 +45,7 @@ export class LoanCreditBalanceRefundComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -1,125 +1,123 @@
<div class="container mat-elevation-z8">
<mat-card>
<form [formGroup]="reagingLoanForm" (ngSubmit)="submit()" *ngIf="loanTransactionData !== null">
<mat-card-content>
<div class="layout-column">
<mat-form-field>
<mat-label>{{ 'labels.inputs.Number of Installments' | translate }}</mat-label>
<input type="number" matInput required formControlName="numberOfInstallments" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Frequency Number' | translate }}</mat-label>
<input type="number" matInput required formControlName="frequencyNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Frequency Type' | translate }}</mat-label>
<mat-select formControlName="frequencyType">
<mat-option *ngFor="let frequencyType of periodFrequencyOptions" [value]="frequencyType">
{{ frequencyType }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field (click)="startDatePicker.open()">
<mat-label>{{ 'labels.inputs.Start Date' | translate }}</mat-label>
<input
matInput
[min]="minDate"
[max]="maxDate"
[matDatepicker]="startDatePicker"
required
formControlName="startDate"
/>
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
<mat-datepicker #startDatePicker></mat-datepicker>
<mat-error *ngIf="reagingLoanForm.controls.startDate.hasError('required')">
{{ 'labels.inputs.Start Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Interest Handling' | translate }}</mat-label>
<mat-select formControlName="reAgeInterestHandling">
<mat-option
*ngFor="let reAgeInterestHandlingOption of reAgeInterestHandlingOptions"
[value]="reAgeInterestHandlingOption.id"
@if (loanTransactionData !== null) {
<form [formGroup]="reagingLoanForm" (ngSubmit)="submit()">
<mat-card-content>
<div class="layout-column">
<mat-form-field>
<mat-label>{{ 'labels.inputs.Number of Installments' | translate }}</mat-label>
<input type="number" matInput required formControlName="numberOfInstallments" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Frequency Number' | translate }}</mat-label>
<input type="number" matInput required formControlName="frequencyNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Frequency Type' | translate }}</mat-label>
<mat-select formControlName="frequencyType">
@for (frequencyType of periodFrequencyOptions; track frequencyType) {
<mat-option [value]="frequencyType">
{{ frequencyType }}
</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field (click)="startDatePicker.open()">
<mat-label>{{ 'labels.inputs.Start Date' | translate }}</mat-label>
<input
matInput
[min]="minDate"
[max]="maxDate"
[matDatepicker]="startDatePicker"
required
formControlName="startDate"
/>
<mat-datepicker-toggle matSuffix [for]="startDatePicker"></mat-datepicker-toggle>
<mat-datepicker #startDatePicker></mat-datepicker>
@if (reagingLoanForm.controls.startDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Start Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Interest Handling' | translate }}</mat-label>
<mat-select formControlName="reAgeInterestHandling">
@for (reAgeInterestHandlingOption of reAgeInterestHandlingOptions; track reAgeInterestHandlingOption) {
<mat-option [value]="reAgeInterestHandlingOption.id">
{{ reAgeInterestHandlingOption.value | translateKey: 'catalogs' }}
</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reason' | translate }}</mat-label>
<mat-select formControlName="reasonCodeValueId">
@for (reAgeReasonOption of reAgeReasonOptions; track reAgeReasonOption) {
<mat-option [value]="reAgeReasonOption.id">
{{ reAgeReasonOption.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.External Id' | translate }}</mat-label>
<input matInput formControlName="externalId" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
<input matInput formControlName="note" />
</mat-form-field>
<div class="flex-fill">
<span
class="expandcollapsebutton m-l-10 m-t-5 m-b-5 flex-75"
(click)="addTransactionAmount = !addTransactionAmount"
>
{{ reAgeInterestHandlingOption.value | translateKey: 'catalogs' }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reason' | translate }}</mat-label>
<mat-select formControlName="reasonCodeValueId">
<mat-option *ngFor="let reAgeReasonOption of reAgeReasonOptions" [value]="reAgeReasonOption.id">
{{ reAgeReasonOption.name }}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.External Id' | translate }}</mat-label>
<input matInput formControlName="externalId" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
<input matInput formControlName="note" />
</mat-form-field>
<div class="flex-fill">
<span
class="expandcollapsebutton m-l-10 m-t-5 m-b-5 flex-75"
(click)="addTransactionAmount = !addTransactionAmount"
>
<mat-slide-toggle>
<div>
<span class="m-l-10">{{ 'labels.inputs.Transaction Amount' | translate }}</span>
</div>
</mat-slide-toggle>
</span>
<mat-slide-toggle>
<div>
<span class="m-l-10">{{ 'labels.inputs.Transaction Amount' | translate }}</span>
</div>
</mat-slide-toggle>
</span>
</div>
@if (addTransactionAmount) {
<mifosx-input-amount
[currency]="loanTransactionData.currency"
[isRequired]="false"
[inputFormControl]="reagingLoanForm.controls.transactionAmount"
[inputLabel]="'Transaction Amount'"
[minVal]="0.01"
[maxVal]="loanTransactionData.amount"
>
</mifosx-input-amount>
}
</div>
<mifosx-input-amount
*ngIf="addTransactionAmount"
[currency]="loanTransactionData.currency"
[isRequired]="false"
[inputFormControl]="reagingLoanForm.controls.transactionAmount"
[inputLabel]="'Transaction Amount'"
[minVal]="0.01"
[maxVal]="loanTransactionData.amount"
>
</mifosx-input-amount>
</div>
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
<button type="button" mat-raised-button [routerLink]="['../../general']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button
mat-raised-button
color="primary"
[disabled]="!reagingLoanForm.valid"
*mifosxHasPermission="'REAGING_LOAN'"
>
{{ 'labels.buttons.Submit' | translate }}
</button>
<button
type="button"
mat-raised-button
color="accent"
[disabled]="!reagingLoanForm.valid"
*mifosxHasPermission="'REAGING_LOAN'"
(click)="preview()"
>
{{ 'labels.buttons.Preview' | translate }}
</button>
</mat-card-actions>
</mat-card-content>
</form>
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
<button type="button" mat-raised-button [routerLink]="['../../general']">
{{ 'labels.buttons.Cancel' | translate }}
</button>
<button
mat-raised-button
color="primary"
[disabled]="!reagingLoanForm.valid"
*mifosxHasPermission="'REAGING_LOAN'"
>
{{ 'labels.buttons.Submit' | translate }}
</button>
<button
type="button"
mat-raised-button
color="accent"
[disabled]="!reagingLoanForm.valid"
*mifosxHasPermission="'REAGING_LOAN'"
(click)="preview()"
>
{{ 'labels.buttons.Preview' | translate }}
</button>
</mat-card-actions>
</mat-card-content>
</form>
}
</mat-card>
</div>
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
@@ -24,6 +24,14 @@ import { MatSlideToggle } from '@angular/material/slide-toggle';
]
})
export class LoanReagingComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private route = inject(ActivatedRoute);
private router = inject(Router);
private settingsService = inject(SettingsService);
private loanService = inject(LoansService);
private dateUtils = inject(Dates);
private dialog = inject(MatDialog);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -42,15 +50,7 @@ export class LoanReagingComponent implements OnInit {
loanTransactionData: LoanTransactionTemplate | null = null;
addTransactionAmount = false;
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private settingsService: SettingsService,
private loanService: LoansService,
private dateUtils: Dates,
private dialog: MatDialog
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -1,4 +1,4 @@
import { Component, Inject } from '@angular/core';
import { Component, inject } from '@angular/core';
import { MAT_DIALOG_DATA, MatDialogRef, MatDialogContent, MatDialogActions } from '@angular/material/dialog';
import { MatButton } from '@angular/material/button';
import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
@@ -23,13 +23,15 @@ export interface ReAgePreviewDialogData {
]
})
export class ReAgePreviewDialogComponent {
dialogRef = inject<MatDialogRef<ReAgePreviewDialogComponent>>(MatDialogRef);
data = inject<ReAgePreviewDialogData>(MAT_DIALOG_DATA);
repaymentSchedule: RepaymentSchedule;
currencyCode: string;
constructor(
public dialogRef: MatDialogRef<ReAgePreviewDialogComponent>,
@Inject(MAT_DIALOG_DATA) public data: ReAgePreviewDialogData
) {
constructor() {
const data = this.data;
this.repaymentSchedule = data.repaymentSchedule;
this.currencyCode = data.currencyCode;
}
@@ -6,15 +6,14 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Interest Handling' | translate }}</mat-label>
<mat-select formControlName="reAmortizationInterestHandling">
<mat-option
*ngFor="
let reAmortizationInterestHandlingOption of reAmortizationInterestHandlingOptions;
trackBy: trackByInterestHandlingOption
"
[value]="reAmortizationInterestHandlingOption.id"
>
{{ reAmortizationInterestHandlingOption.value | translateKey: 'catalogs' }}
</mat-option>
@for (
reAmortizationInterestHandlingOption of reAmortizationInterestHandlingOptions;
track trackByInterestHandlingOption($index, reAmortizationInterestHandlingOption)
) {
<mat-option [value]="reAmortizationInterestHandlingOption.id">
{{ reAmortizationInterestHandlingOption.value | translateKey: 'catalogs' }}
</mat-option>
}
</mat-select>
</mat-form-field>
</div>
@@ -23,12 +22,14 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reason' | translate }}</mat-label>
<mat-select formControlName="reasonCodeValueId">
<mat-option
*ngFor="let reAmortizationReasonOption of reAmortizationReasonOptions; trackBy: trackByReasonOption"
[value]="reAmortizationReasonOption.id"
>
{{ reAmortizationReasonOption.name }}
</mat-option>
@for (
reAmortizationReasonOption of reAmortizationReasonOptions;
track trackByReasonOption($index, reAmortizationReasonOption)
) {
<mat-option [value]="reAmortizationReasonOption.id">
{{ reAmortizationReasonOption.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
</div>
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { LoansService } from 'app/loans/loans.service';
@@ -15,6 +15,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanReamortizeComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private route = inject(ActivatedRoute);
private router = inject(Router);
private loanService = inject(LoansService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -23,12 +28,7 @@ export class LoanReamortizeComponent implements OnInit {
reAmortizationReasonOptions: CodeValue[] = [];
reAmortizationInterestHandlingOptions: OptionData[] = [];
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private loanService: LoansService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -14,23 +14,29 @@
/>
<mat-datepicker-toggle matSuffix [for]="rescheduleDatePicker"></mat-datepicker-toggle>
<mat-datepicker #rescheduleDatePicker></mat-datepicker>
<mat-error *ngIf="rescheduleLoanForm.controls.rescheduleFromDate.hasError('required')">
{{ 'labels.inputs.Reschedule Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (rescheduleLoanForm.controls.rescheduleFromDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Reschedule Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reason for Rescheduling' | translate }}</mat-label>
<mat-select formControlName="rescheduleReasonId">
<mat-option *ngFor="let rescheduleReasonCode of codes" [value]="rescheduleReasonCode.id">
{{ rescheduleReasonCode.name }}
</mat-option>
@for (rescheduleReasonCode of codes; track rescheduleReasonCode) {
<mat-option [value]="rescheduleReasonCode.id">
{{ rescheduleReasonCode.name }}
</mat-option>
}
</mat-select>
<mat-error *ngIf="rescheduleLoanForm.controls.rescheduleReasonId.hasError('required')">
{{ 'labels.inputs.Reason for Rescheduling' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (rescheduleLoanForm.controls.rescheduleReasonId.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Reason for Rescheduling' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field (click)="submittedDatePicker.open()">
@@ -44,10 +50,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="submittedDatePicker"></mat-datepicker-toggle>
<mat-datepicker #submittedDatePicker></mat-datepicker>
<mat-error *ngIf="rescheduleLoanForm.controls.submittedOnDate.hasError('required')">
{{ 'labels.inputs.Submitted On Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (rescheduleLoanForm.controls.submittedOnDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Submitted On Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -59,7 +67,7 @@
{{ 'labels.inputs.Change Repayment Date' | translate }}
</mat-checkbox>
<ng-container *ngIf="changeRepaymentDate.value">
@if (changeRepaymentDate.value) {
<mat-form-field (click)="installmentrescheduledDatePicker.open()">
<mat-label>{{ 'labels.inputs.Installment Rescheduled to' | translate }}</mat-label>
<input
@@ -71,44 +79,43 @@
<mat-datepicker-toggle matSuffix [for]="installmentrescheduledDatePicker"></mat-datepicker-toggle>
<mat-datepicker #installmentrescheduledDatePicker></mat-datepicker>
</mat-form-field>
</ng-container>
}
<mat-checkbox [formControl]="introduceGracePeriods">
{{ 'labels.inputs.Introduce Mid-term grace periods' | translate }}
</mat-checkbox>
<ng-container *ngIf="introduceGracePeriods.value">
@if (introduceGracePeriods.value) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Principal Grace Periods' | translate }} </mat-label>
<input matInput formControlName="graceOnPrincipal" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Interest Grace Periods' | translate }} </mat-label>
<input matInput formControlName="graceOnInterest" />
</mat-form-field>
</ng-container>
}
<mat-checkbox [formControl]="extendRepaymentPeriod">
{{ 'labels.inputs.Extend Repayment Period' | translate }}
</mat-checkbox>
<ng-container *ngIf="extendRepaymentPeriod.value">
@if (extendRepaymentPeriod.value) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Number Of new Repayments' | translate }}</mat-label>
<input matInput formControlName="extraTerms" />
</mat-form-field>
</ng-container>
}
<mat-checkbox [formControl]="adjustinterestrates">
{{ 'labels.inputs.Adjust interest rates for remainder of loan' | translate }}
</mat-checkbox>
<ng-container *ngIf="adjustinterestrates.value">
@if (adjustinterestrates.value) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.New Interest Rate' | translate }}</mat-label>
<input matInput formControlName="newInterestRate" />
</mat-form-field>
</ng-container>
}
</div>
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
@@ -1,4 +1,4 @@
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { LoansService } from 'app/loans/loans.service';
import {
UntypedFormBuilder,
@@ -25,6 +25,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanRescheduleComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
loanId: any;
rescheduleLoanForm: UntypedFormGroup;
@@ -47,14 +54,7 @@ export class LoanRescheduleComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -6,14 +6,18 @@
<mat-form-field class="flex-fill">
<mat-label>{{ 'labels.inputs.Loan Screen Reports' | translate }}</mat-label>
<mat-select formControlName="templateId">
<mat-option *ngFor="let template of templatesData" [value]="template.id">
{{ template.name }}
</mat-option>
@for (template of templatesData; track template) {
<mat-option [value]="template.id">
{{ template.name }}
</mat-option>
}
</mat-select>
<mat-error *ngIf="loanScreenReportForm.controls.templateId.hasError('required')">
{{ 'labels.inputs.Screen Report' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (loanScreenReportForm.controls.templateId.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Screen Report' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
</div>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Renderer2, ViewChild, ElementRef, SecurityContext, Input } from '@angular/core';
import { Component, OnInit, Renderer2, ViewChild, ElementRef, SecurityContext, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
@@ -22,6 +22,12 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanScreenReportsComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loansService = inject(LoansService);
private route = inject(ActivatedRoute);
private sanitizer = inject(DomSanitizer);
private renderer = inject(Renderer2);
@Input() dataObject: any;
/** Loan Screen Reportform. */
loanScreenReportForm: UntypedFormGroup;
@@ -43,13 +49,7 @@ export class LoanScreenReportsComponent implements OnInit {
* @param {DomSanitizer} sanitizer DOM Sanitizer
* @param {Renderer2} renderer Renderer 2
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loansService: LoansService,
private route: ActivatedRoute,
private sanitizer: DomSanitizer,
private renderer: Renderer2
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="closedDatePicker"></mat-datepicker-toggle>
<mat-datepicker #closedDatePicker></mat-datepicker>
<mat-error *ngIf="closeLoanForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Closed Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (closeLoanForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Closed Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators, ReactiveFormsModule } from '@angular/forms';
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
import { LoansService } from 'app/loans/loans.service';
@@ -20,6 +20,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoansAccountCloseComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Close form. */
@@ -38,14 +45,7 @@ export class LoansAccountCloseComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,45 +15,42 @@
/>
<mat-datepicker-toggle matSuffix [for]="transactionDatePicker"></mat-datepicker-toggle>
<mat-datepicker #transactionDatePicker></mat-datepicker>
<mat-error *ngIf="repaymentLoanForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (repaymentLoanForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<div class="layout-row-wrap" *ngIf="showDetails()">
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Principal' | translate }}
@if (showDetails()) {
<div class="layout-row-wrap">
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Principal' | translate }}
</div>
<div class="flex-50 r-amount right-label">
{{ dataObject.principalPortion | formatNumber }}
</div>
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Interest' | translate }}
</div>
<div class="flex-50 r-amount right-label">
{{ dataObject.interestPortion | formatNumber }}
</div>
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Fees' | translate }}
</div>
<div class="flex-50 r-amount right-label">
{{ dataObject.feeChargesPortion | formatNumber }}
</div>
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Penalties' | translate }}
</div>
<div class="flex-50 r-amount right-label">
{{ dataObject.penaltyChargesPortion | formatNumber }}
</div>
</div>
<div class="flex-50 r-amount right-label">
{{ dataObject.principalPortion | formatNumber }}
</div>
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Interest' | translate }}
</div>
<div class="flex-50 r-amount right-label">
{{ dataObject.interestPortion | formatNumber }}
</div>
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Fees' | translate }}
</div>
<div class="flex-50 r-amount right-label">
{{ dataObject.feeChargesPortion | formatNumber }}
</div>
<div class="flex-50 mat-body-strong">
{{ 'labels.inputs.Penalties' | translate }}
</div>
<div class="flex-50 r-amount right-label">
{{ dataObject.penaltyChargesPortion | formatNumber }}
</div>
</div>
}
<mifosx-input-amount
[currency]="currency"
@@ -68,21 +65,27 @@
<input matInput formControlName="externalId" />
</mat-form-field>
<mat-form-field *ngIf="isCapitalizedIncome() || isBuyDownFee()">
<mat-label>{{ 'labels.inputs.Classification' | translate }}</mat-label>
<mat-select formControlName="classificationId">
<mat-option *ngFor="let classificationOption of classificationOptions" [value]="classificationOption.id">
{{ classificationOption.name }}
</mat-option>
</mat-select>
</mat-form-field>
@if (isCapitalizedIncome() || isBuyDownFee()) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Classification' | translate }}</mat-label>
<mat-select formControlName="classificationId">
@for (classificationOption of classificationOptions; track classificationOption) {
<mat-option [value]="classificationOption.id">
{{ classificationOption.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
}
<mat-form-field>
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
<mat-select formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypes" [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
@for (paymentType of paymentTypes; track paymentType) {
<mat-option [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
@@ -96,41 +99,39 @@
</span>
</div>
<ng-container *ngIf="showPaymentDetails">
@if (showPaymentDetails) {
<mat-form-field>
<mat-label> {{ 'labels.inputs.Account' | translate }} #</mat-label>
<input matInput formControlName="accountNumber" />
</mat-form-field>
<mat-form-field>
<mat-label> {{ 'labels.inputs.Cheque' | translate }} #</mat-label>
<input matInput formControlName="checkNumber" />
</mat-form-field>
<mat-form-field>
<mat-label> {{ 'labels.inputs.Routing Code' | translate }}</mat-label>
<input matInput formControlName="routingCode" />
</mat-form-field>
<mat-form-field>
<mat-label> {{ 'labels.inputs.Reciept' | translate }} #</mat-label>
<input matInput formControlName="receiptNumber" />
</mat-form-field>
<mat-form-field>
<mat-label> {{ 'labels.inputs.Bank' | translate }} #</mat-label>
<input matInput formControlName="bankNumber" />
</mat-form-field>
</ng-container>
}
<mat-form-field>
<mat-label> {{ 'labels.inputs.Note' | translate }}</mat-label>
<textarea matInput formControlName="note" cdkTextareaAutosize cdkAutosizeMinRows="2"></textarea>
</mat-form-field>
<mat-checkbox formControlName="skipInterestRefund" *ngIf="showInterestRefundCheckbox()">
{{ 'labels.inputs.Skip Interest Refund Transaction Posting' | translate }}
</mat-checkbox>
@if (showInterestRefundCheckbox()) {
<mat-checkbox formControlName="skipInterestRefund">
{{ 'labels.inputs.Skip Interest Refund Transaction Posting' | translate }}
</mat-checkbox>
}
</div>
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
@@ -30,6 +30,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class MakeRepaymentComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -56,14 +63,7 @@ export class MakeRepaymentComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -102,14 +102,16 @@ export class MakeRepaymentComponent implements OnInit {
new UntypedFormControl('', [
Validators.required,
Validators.min(0.001),
Validators.max(this.dataObject.amount)])
Validators.max(this.dataObject.amount)
])
);
} else {
this.repaymentLoanForm.addControl(
'transactionAmount',
new UntypedFormControl('', [
Validators.required,
Validators.min(0.001)])
Validators.min(0.001)
])
);
}
if (this.isCapitalizedIncome() || this.isBuyDownFee()) {
@@ -3,23 +3,27 @@
<form [formGroup]="prepayLoanForm" (ngSubmit)="submit()">
<mat-card-content>
<div class="layout-column">
<mat-form-field (click)="transactionDatePicker.open()" *ngIf="!contractTermination">
<mat-label>{{ 'labels.inputs.Transaction Date' | translate }}</mat-label>
<input
matInput
[min]="minDate"
[max]="maxDate"
[matDatepicker]="transactionDatePicker"
required
formControlName="transactionDate"
/>
<mat-datepicker-toggle matSuffix [for]="transactionDatePicker"></mat-datepicker-toggle>
<mat-datepicker #transactionDatePicker></mat-datepicker>
<mat-error *ngIf="prepayLoanForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
</mat-form-field>
@if (!contractTermination) {
<mat-form-field (click)="transactionDatePicker.open()">
<mat-label>{{ 'labels.inputs.Transaction Date' | translate }}</mat-label>
<input
matInput
[min]="minDate"
[max]="maxDate"
[matDatepicker]="transactionDatePicker"
required
formControlName="transactionDate"
/>
<mat-datepicker-toggle matSuffix [for]="transactionDatePicker"></mat-datepicker-toggle>
<mat-datepicker #transactionDatePicker></mat-datepicker>
@if (prepayLoanForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
}
<div class="layout-row-wrap">
<div class="flex-50 mat-body-strong">
@@ -55,65 +59,68 @@
</div>
</div>
<mifosx-input-amount
*ngIf="!contractTermination"
[currency]="currency"
[isRequired]="true"
[inputFormControl]="prepayLoanForm.controls.transactionAmount"
[inputLabel]="'Transaction Amount'"
>
</mifosx-input-amount>
@if (!contractTermination) {
<mifosx-input-amount
[currency]="currency"
[isRequired]="true"
[inputFormControl]="prepayLoanForm.controls.transactionAmount"
[inputLabel]="'Transaction Amount'"
>
</mifosx-input-amount>
}
<mat-form-field>
<mat-label>{{ 'labels.inputs.External Id' | translate }}</mat-label>
<input matInput formControlName="externalId" />
</mat-form-field>
<mat-form-field *ngIf="!contractTermination">
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
<mat-select formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypes" [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
</mat-select>
</mat-form-field>
@if (!contractTermination) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
<mat-select formControlName="paymentTypeId">
@for (paymentType of paymentTypes; track paymentType) {
<mat-option [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
}
<div class="flex-fill" *ngIf="!contractTermination">
<span class="expandcollapsebutton m-l-10 m-t-40 flex-75" (click)="addPaymentDetails()">
<mat-slide-toggle>
<div [className]="showPaymentDetails ? 'enabled' : 'disabled'">
<span class="m-l-10">{{ 'labels.inputs.Show Payment Details' | translate }}</span>
</div>
</mat-slide-toggle>
</span>
</div>
@if (!contractTermination) {
<div class="flex-fill">
<span class="expandcollapsebutton m-l-10 m-t-40 flex-75" (click)="addPaymentDetails()">
<mat-slide-toggle>
<div [className]="showPaymentDetails ? 'enabled' : 'disabled'">
<span class="m-l-10">{{ 'labels.inputs.Show Payment Details' | translate }}</span>
</div>
</mat-slide-toggle>
</span>
</div>
}
<ng-container *ngIf="showPaymentDetails">
@if (showPaymentDetails) {
<mat-form-field>
<mat-label> {{ 'labels.inputs.Account' | translate }} #</mat-label>
<input matInput formControlName="accountNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Cheque' | translate }} #</mat-label>
<input matInput formControlName="checkNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Routing Code' | translate }}</mat-label>
<input matInput formControlName="routingCode" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reciept' | translate }} #</mat-label>
<input matInput formControlName="receiptNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Bank' | translate }} #</mat-label>
<input matInput formControlName="bankNumber" />
</mat-form-field>
</ng-container>
}
<mat-form-field>
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import {
UntypedFormGroup,
UntypedFormBuilder,
@@ -36,6 +36,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class PrepayLoanComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -65,14 +72,7 @@ export class PrepayLoanComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="transactionDatePicker"></mat-datepicker-toggle>
<mat-datepicker #transactionDatePicker></mat-datepicker>
<mat-error *ngIf="recoveryRepaymentLoanForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (recoveryRepaymentLoanForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mifosx-input-amount
@@ -37,9 +39,11 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
<mat-select formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypes" [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
@for (paymentType of paymentTypes; track paymentType) {
<mat-option [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
@@ -53,32 +57,28 @@
</span>
</div>
<ng-container *ngIf="showPaymentDetails">
@if (showPaymentDetails) {
<mat-form-field>
<mat-label> {{ 'labels.inputs.Account' | translate }} #</mat-label>
<input matInput formControlName="accountNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Cheque' | translate }} #</mat-label>
<input matInput formControlName="checkNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Routing Code' | translate }}</mat-label>
<input matInput formControlName="routingCode" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reciept' | translate }} #</mat-label>
<input matInput formControlName="receiptNumber" />
</mat-form-field>
<mat-form-field>
<mat-label>{{ 'labels.inputs.Bank' | translate }} #</mat-label>
<input matInput formControlName="bankNumber" />
</mat-form-field>
</ng-container>
}
<mat-form-field>
<mat-label>{{ 'labels.inputs.Note' | translate }}</mat-label>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import {
UntypedFormGroup,
UntypedFormBuilder,
@@ -34,6 +34,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class RecoveryRepaymentComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -56,14 +63,7 @@ export class RecoveryRepaymentComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="rejectedDatePicker"></mat-datepicker-toggle>
<mat-datepicker #rejectedDatePicker></mat-datepicker>
<mat-error *ngIf="rejectLoanForm.controls.rejectedOnDate.hasError('required')">
{{ 'labels.inputs.Rejected Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (rejectLoanForm.controls.rejectedOnDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Rejected Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -1,5 +1,5 @@
/** Angular Imports. */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
@@ -23,6 +23,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class RejectLoanComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private router = inject(Router);
private route = inject(ActivatedRoute);
private loanService = inject(LoansService);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
/** Loan Id. */
loanId: any;
/** Reject Loan form. */
@@ -39,14 +46,7 @@ export class RejectLoanComponent implements OnInit {
* @param route Activated Route.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute,
private loanService: LoansService,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -1,5 +1,5 @@
/** Angular Imports. */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { UntypedFormControl, UntypedFormBuilder, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
@@ -18,21 +18,14 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class UndoApprovalComponent implements OnInit {
private loanService = inject(LoansService);
private formBuilder = inject(UntypedFormBuilder);
private route = inject(ActivatedRoute);
private router = inject(Router);
/** Form Controller. */
note: UntypedFormControl;
/**
* @param loanService Loan Service.
* @param route Activated Route.
* @param router Router.
*/
constructor(
private loanService: LoansService,
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router
) {}
ngOnInit() {
this.note = this.formBuilder.control('');
}
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input, OnInit, inject } from '@angular/core';
import { UntypedFormControl, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
@@ -21,6 +21,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class UndoDisbursalComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loansService = inject(LoansService);
private router = inject(Router);
private route = inject(ActivatedRoute);
@Input() actionName: string;
/** Loan ID. */
@@ -34,12 +39,7 @@ export class UndoDisbursalComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loansService: LoansService,
private router: Router,
private route: ActivatedRoute
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
@@ -24,6 +24,14 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class UndoWriteOffComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
private alertService = inject(AlertService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -41,15 +49,7 @@ export class UndoWriteOffComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService,
private alertService: AlertService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -7,10 +7,10 @@
<tr>
<td>{{ 'labels.inputs.Disbursement Date' | translate }}</td>
<td>
{{ dataObject.timeline.actualDisbursementDate
}}<span *ngIf="!dataObject.timeline.actualDisbursementDate">{{
'labels.inputs.Not Available' | translate
}}</span>
{{ dataObject.timeline.actualDisbursementDate }}
@if (!dataObject.timeline.actualDisbursementDate) {
<span>{{ 'labels.inputs.Not Available' | translate }}</span>
}
</td>
</tr>
<tr>
@@ -21,10 +21,14 @@
<td>{{ 'labels.inputs.Loan Officer' | translate }}</td>
<td>
{{ dataObject.loanOfficerName }}
<span *ngIf="!dataObject.loanOfficerName">{{ 'labels.inputs.Unassigned' | translate }}</span>
<span *ngIf="dataObject.loanOfficerName">
<fa-icon icon="times"></fa-icon>
</span>
@if (!dataObject.loanOfficerName) {
<span>{{ 'labels.inputs.Unassigned' | translate }}</span>
}
@if (dataObject.loanOfficerName) {
<span>
<fa-icon icon="times"></fa-icon>
</span>
}
</td>
</tr>
<tr>
@@ -44,7 +48,9 @@
<td>{{ 'labels.inputs.Loan Purpose' | translate }}</td>
<td>
{{ dataObject.loanPurposeName }}
<span *ngIf="!dataObject.loanPurposeName"> {{ 'labels.inputs.Not Provided' | translate }} </span>
@if (!dataObject.loanPurposeName) {
<span> {{ 'labels.inputs.Not Provided' | translate }} </span>
}
</td>
</tr>
<tr>
@@ -63,7 +69,9 @@
<td>{{ 'labels.inputs.Arrears By' | translate }}</td>
<td>
{{ dataObject.summary?.totalOverdue | formatNumber }}
<span *ngIf="dataObject.summary?.totalOverdue < 0">{{ 'labels.inputs.Not Provided' | translate }}</span>
@if (dataObject.summary?.totalOverdue < 0) {
<span>{{ 'labels.inputs.Not Provided' | translate }}</span>
}
</td>
</tr>
</tbody>
@@ -71,129 +79,139 @@
</div>
</div>
<div *ngIf="guarantorDetails" class="layout-row-wrap responsive-column flex-fill">
<!-- guarantors details table -->
<div class="heading-content">
<div class="layout-column flex-50">
<div class="heading-name">
<h3>{{ 'labels.heading.Guarantors Details' | translate }}</h3>
@if (guarantorDetails) {
<div class="layout-row-wrap responsive-column flex-fill">
<!-- guarantors details table -->
<div class="heading-content">
<div class="layout-column flex-50">
<div class="heading-name">
<h3>{{ 'labels.heading.Guarantors Details' | translate }}</h3>
</div>
</div>
</div>
<div class="layout-column flex-50">
<div class="layout-row align-flex-end">
<button mat-raised-button class="f-right" color="primary" (click)="toggleGuarantorsDetailsOverview()">
{{ showDeletedGuarantorsAccounts ? 'Hide Deleted Guarantors' : 'Show Deleted Guarantors' }}
</button>
<div class="layout-column flex-50">
<div class="layout-row align-flex-end">
<button mat-raised-button class="f-right" color="primary" (click)="toggleGuarantorsDetailsOverview()">
{{ showDeletedGuarantorsAccounts ? 'Hide Deleted Guarantors' : 'Show Deleted Guarantors' }}
</button>
</div>
</div>
</div>
<table
class="flex-fill"
mat-table
[dataSource]="guarantorDetails | accountsFilter: 'guarantor' : showDeletedGuarantorsAccounts"
>
<ng-container matColumnDef="fullname">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.name' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
@if (!guarantor.guarantorFundingDetails) {
<span> {{ guarantor.firstname }} &nbsp; {{ guarantor.lastname }} </span>
}
</td>
</ng-container>
<ng-container matColumnDef="relationship">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Relationship' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
@if (!guarantor.guarantorFundingDetails) {
<span>
{{ guarantor.clientRelationshipType?.name }}
</span>
}
</td>
</ng-container>
<ng-container matColumnDef="guarantortype">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Guarantor Type' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
@if (!guarantor.guarantorFundingDetails) {
<span>
{{ guarantor.guarantorType.value }}
</span>
}
</td>
</ng-container>
<ng-container matColumnDef="depositAccount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Deposit Account' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
@if (!guarantor.guarantorFundingDetails) {
<span> </span>
}
</td>
</ng-container>
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Amount' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
@if (!guarantor.guarantorFundingDetails) {
<span> </span>
}
</td>
</ng-container>
<ng-container matColumnDef="remainingAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Remaining Amount' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
@if (!guarantor.guarantorFundingDetails) {
<span> </span>
}
</td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Status' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
@if (!guarantor.guarantorFundingDetails) {
<span>
@if (guarantor.status) {
<span>
{{ 'labels.inputs.Active' | translate }}
</span>
}
@if (!guarantor.status) {
<span>
{{ 'labels.inputs.Deleted' | translate }}
</span>
}
</span>
}
</td>
</ng-container>
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Action' | translate }}</th>
<td mat-cell *matCellDef="let guarantor; let id = index">
@if (!guarantor.guarantorFundingDetails) {
<span>
<button
mat-raised-button
class="account-action-button"
color="primary"
*mifosxHasPermission="'READ_SAVINGSACCOUNT'"
(click)="viewGuarantorDetails(guarantor)"
>
<fa-icon icon="eye" class="m-r-10"></fa-icon>
</button>
@if (guarantor.status && guarantor.guarantorType.id === 3 && guarantor.id) {
<button mat-raised-button class="account-action-button" color="primary">
<fa-icon icon="edit" class="m-r-10"></fa-icon>
</button>
}
@if (guarantor.status) {
<span>
<button
mat-raised-button
class="account-action-button"
color="warn"
*mifosxHasPermission="'DELETE_GUARANTOR'"
(click)="deleteGuarantor(guarantor.id)"
>
<fa-icon icon="trash" class="m-r-10"></fa-icon>
</button>
</span>
}
</span>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="guarantorsDisplayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: guarantorsDisplayedColumns"></tr>
</table>
</div>
<table
class="flex-fill"
mat-table
[dataSource]="guarantorDetails | accountsFilter: 'guarantor' : showDeletedGuarantorsAccounts"
>
<ng-container matColumnDef="fullname">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.name' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
<span *ngIf="!guarantor.guarantorFundingDetails">
{{ guarantor.firstname }} &nbsp; {{ guarantor.lastname }}
</span>
</td>
</ng-container>
<ng-container matColumnDef="relationship">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Relationship' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
<span *ngIf="!guarantor.guarantorFundingDetails">
{{ guarantor.clientRelationshipType?.name }}
</span>
</td>
</ng-container>
<ng-container matColumnDef="guarantortype">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Guarantor Type' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
<span *ngIf="!guarantor.guarantorFundingDetails">
{{ guarantor.guarantorType.value }}
</span>
</td>
</ng-container>
<ng-container matColumnDef="depositAccount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Deposit Account' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
<span *ngIf="!guarantor.guarantorFundingDetails"> </span>
</td>
</ng-container>
<ng-container matColumnDef="amount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Amount' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
<span *ngIf="!guarantor.guarantorFundingDetails"> </span>
</td>
</ng-container>
<ng-container matColumnDef="remainingAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Remaining Amount' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
<span *ngIf="!guarantor.guarantorFundingDetails"> </span>
</td>
</ng-container>
<ng-container matColumnDef="status">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Status' | translate }}</th>
<td mat-cell *matCellDef="let guarantor">
<span *ngIf="!guarantor.guarantorFundingDetails">
<span *ngIf="guarantor.status">
{{ 'labels.inputs.Active' | translate }}
</span>
<span *ngIf="!guarantor.status">
{{ 'labels.inputs.Deleted' | translate }}
</span>
</span>
</td>
</ng-container>
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Action' | translate }}</th>
<td mat-cell *matCellDef="let guarantor; let id = index">
<span *ngIf="!guarantor.guarantorFundingDetails">
<button
mat-raised-button
class="account-action-button"
color="primary"
*mifosxHasPermission="'READ_SAVINGSACCOUNT'"
(click)="viewGuarantorDetails(guarantor)"
>
<fa-icon icon="eye" class="m-r-10"></fa-icon>
</button>
<button
mat-raised-button
class="account-action-button"
color="primary"
*ngIf="guarantor.status && guarantor.guarantorType.id === 3 && guarantor.id"
>
<fa-icon icon="edit" class="m-r-10"></fa-icon>
</button>
<span *ngIf="guarantor.status">
<button
mat-raised-button
class="account-action-button"
color="warn"
*mifosxHasPermission="'DELETE_GUARANTOR'"
(click)="deleteGuarantor(guarantor.id)"
>
<fa-icon icon="trash" class="m-r-10"></fa-icon>
</button>
</span>
</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="guarantorsDisplayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: guarantorsDisplayedColumns"></tr>
</table>
</div>
}
</mat-card>
</div>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { FormGroup, FormBuilder, Validators, FormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
@@ -54,6 +54,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class ViewGuarantorsComponent implements OnInit {
dialog = inject(MatDialog);
loansService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
@Input() dataObject: any;
guarantorDetails: any;
showDeletedGuarantorsAccounts = false;
@@ -75,12 +80,7 @@ export class ViewGuarantorsComponent implements OnInit {
* @param {route} Route Route
* @param {router} Router Router
*/
constructor(
public dialog: MatDialog,
public loansService: LoansService,
private route: ActivatedRoute,
private router: Router
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="interestDatePicker"></mat-datepicker-toggle>
<mat-datepicker #interestDatePicker></mat-datepicker>
<mat-error *ngIf="loanInterestForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Interest Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (loanInterestForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Interest Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mifosx-input-amount
@@ -1,5 +1,5 @@
/** Angular Imports. */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
import { Router, ActivatedRoute, RouterLink } from '@angular/router';
@@ -26,6 +26,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class WaiveInterestComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private router = inject(Router);
private settingsService = inject(SettingsService);
private dateUtils = inject(Dates);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
@Input() dataObject: any;
/** Loan Interest form. */
@@ -36,22 +43,6 @@ export class WaiveInterestComponent implements OnInit {
maxDate = new Date();
currency: Currency;
/**
* Get data from `Resolver`.
* @param {FormBuilder} formBuilder Form Builder.
* @param {Router} router Router.
* @param {LoansService} loanService Loan Service.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(
private formBuilder: UntypedFormBuilder,
private router: Router,
private settingsService: SettingsService,
private dateUtils: Dates,
private loanService: LoansService,
private route: ActivatedRoute
) {}
ngOnInit() {
this.maxDate = this.settingsService.businessDate;
this.setLoanInterestForm();
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="withdrawnOnDatePicker"></mat-datepicker-toggle>
<mat-datepicker #withdrawnOnDatePicker></mat-datepicker>
<mat-error *ngIf="withdrawnByClientLoanForm.controls.withdrawnOnDate.hasError('required')">
{{ 'labels.inputs.Withdrawn On Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (withdrawnByClientLoanForm.controls.withdrawnOnDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Withdrawn On Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, FormControl, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
@@ -23,6 +23,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class WithdrawnByClientComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private loanService = inject(LoansService);
private route = inject(ActivatedRoute);
private router = inject(Router);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -40,14 +47,7 @@ export class WithdrawnByClientComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -15,10 +15,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="writeOffDatePicker"></mat-datepicker-toggle>
<mat-datepicker #writeOffDatePicker></mat-datepicker>
<mat-error *ngIf="writeOffForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Write Off Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
@if (writeOffForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Write Off Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong>{{ 'labels.commons.required' | translate }}</strong>
</mat-error>
}
</mat-form-field>
<mat-form-field>
@@ -29,9 +31,11 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Reason for Write-Off' | translate }}</mat-label>
<mat-select formControlName="writeoffReasonId">
<mat-option *ngFor="let writeOffReason of writeOffReasonOptions" [value]="writeOffReason.id">
{{ writeOffReason.name }}
</mat-option>
@for (writeOffReason of writeOffReasonOptions; track writeOffReason) {
<mat-option [value]="writeOffReason.id">
{{ writeOffReason.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
@@ -1,5 +1,5 @@
/** Angular Imports. */
import { Component, OnInit, Input } from '@angular/core';
import { Component, OnInit, Input, inject } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, ReactiveFormsModule } from '@angular/forms';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -23,6 +23,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class WriteOffPageComponent implements OnInit {
private formBuilder = inject(UntypedFormBuilder);
private route = inject(ActivatedRoute);
private loanService = inject(LoansService);
private dateUtils = inject(Dates);
private router = inject(Router);
private settingsService = inject(SettingsService);
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -44,14 +51,7 @@ export class WriteOffPageComponent implements OnInit {
* @param {Router} router Router.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private loanService: LoansService,
private dateUtils: Dates,
private router: Router,
private settingsService: SettingsService
) {
constructor() {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -1,60 +1,61 @@
<div class="container">
<h3>{{ 'labels.heading.Buy Down Fees' | translate }}</h3>
<div *ngIf="isLoading" class="loading-indicator">
<mat-spinner diameter="30"></mat-spinner>
</div>
<div *ngIf="!isLoading">
<div *ngIf="buyDownFeeData.length === 0" class="no-data">
{{ 'labels.messages.No Data Found' | translate }}
@if (isLoading) {
<div class="loading-indicator">
<mat-spinner diameter="30"></mat-spinner>
</div>
}
<table mat-table [dataSource]="buyDownFeeData" *ngIf="buyDownFeeData.length > 0">
<ng-container matColumnDef="buyDownFeeDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Date' | translate }}</th>
<td mat-cell *matCellDef="let item">
{{ item.buyDownFeeDate | dateFormat }}
</td>
</ng-container>
<ng-container matColumnDef="buyDownFeeAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Fee Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.buyDownFeeAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<ng-container matColumnDef="amortizedAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Amortized Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.amortizedAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<ng-container matColumnDef="notYetAmortizedAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Not Yet Amortized Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.notYetAmortizedAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<ng-container matColumnDef="adjustedAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Adjusted Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.adjustedAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<ng-container matColumnDef="chargedOffAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Charged Off Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.chargedOffAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="buyDownFeeColumns"></tr>
<tr mat-row *matRowDef="let row; columns: buyDownFeeColumns"></tr>
</table>
</div>
@if (!isLoading) {
<div>
@if (buyDownFeeData.length === 0) {
<div class="no-data">
{{ 'labels.messages.No Data Found' | translate }}
</div>
}
@if (buyDownFeeData.length > 0) {
<table mat-table [dataSource]="buyDownFeeData">
<ng-container matColumnDef="buyDownFeeDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Date' | translate }}</th>
<td mat-cell *matCellDef="let item">
{{ item.buyDownFeeDate | dateFormat }}
</td>
</ng-container>
<ng-container matColumnDef="buyDownFeeAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Fee Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.buyDownFeeAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<ng-container matColumnDef="amortizedAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Amortized Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.amortizedAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<ng-container matColumnDef="notYetAmortizedAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Not Yet Amortized Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.notYetAmortizedAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<ng-container matColumnDef="adjustedAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Adjusted Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.adjustedAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<ng-container matColumnDef="chargedOffAmount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.heading.Charged Off Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.chargedOffAmount | formatNumber: '0.00' }}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="buyDownFeeColumns"></tr>
<tr mat-row *matRowDef="let row; columns: buyDownFeeColumns"></tr>
</table>
}
</div>
}
</div>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import {
MatCell,
MatCellDef,
@@ -39,6 +39,9 @@ import { DateFormatPipe } from '@pipes/date-format.pipe';
]
})
export class LoanBuyDownFeesTabComponent implements OnInit {
private route = inject(ActivatedRoute);
private loansService = inject(LoansService);
buyDownFeeData: BuyDownFeeAmortizationDetails[] = [];
loanId: string;
isLoading = true;
@@ -52,11 +55,6 @@ export class LoanBuyDownFeesTabComponent implements OnInit {
'chargedOffAmount'
];
constructor(
private route: ActivatedRoute,
private loansService: LoansService
) {}
ngOnInit(): void {
this.getLoanId();
this.loadBuyDownFees();
@@ -8,49 +8,49 @@
</div>
</div>
<div class="layout-row gap-32px performance-history-container" *ngIf="loanCollaterals?.length > 0">
<table>
<tbody>
<tr>
<td class="flex-25">
<b>{{ 'labels.inputs.Number of Collaterals' | translate }} :</b>
</td>
<td class="flex-25 left">
{{ loanCollaterals?.length | formatNumber }}
</td>
<td class="flex-25">
<b>{{ 'labels.inputs.Total Amount' | translate }} :</b>
</td>
<td class="flex-25 left">
{{ totalAmount | formatNumber }}
</td>
</tr>
</tbody>
@if (loanCollaterals?.length > 0) {
<div class="layout-row gap-32px performance-history-container">
<table>
<tbody>
<tr>
<td class="flex-25">
<b>{{ 'labels.inputs.Number of Collaterals' | translate }} :</b>
</td>
<td class="flex-25 left">
{{ loanCollaterals?.length | formatNumber }}
</td>
<td class="flex-25">
<b>{{ 'labels.inputs.Total Amount' | translate }} :</b>
</td>
<td class="flex-25 left">
{{ totalAmount | formatNumber }}
</td>
</tr>
</tbody>
</table>
</div>
}
@if (loanCollaterals?.length > 0) {
<table mat-table [dataSource]="loanCollaterals">
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.ID' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.id }}</td>
</ng-container>
<ng-container matColumnDef="currency">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Currency' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.currency.code }}</td>
</ng-container>
<ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Description' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.description }}</td>
</ng-container>
<ng-container matColumnDef="value">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Value' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.value | formatNumber }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
</div>
<table mat-table *ngIf="loanCollaterals?.length > 0" [dataSource]="loanCollaterals">
<ng-container matColumnDef="id">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.ID' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.id }}</td>
</ng-container>
<ng-container matColumnDef="currency">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Currency' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.currency.code }}</td>
</ng-container>
<ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Description' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.description }}</td>
</ng-container>
<ng-container matColumnDef="value">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Value' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.value | formatNumber }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr>
</table>
}
</div>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute, RouterLink } from '@angular/router';
import {
MatTable,
@@ -35,6 +35,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanCollateralTabComponent implements OnInit {
private route = inject(ActivatedRoute);
/** Loan Collateral Details */
loanCollaterals: any[] = [];
/** Columns to be displayed in collateral table. */
@@ -51,7 +53,7 @@ export class LoanCollateralTabComponent implements OnInit {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
constructor() {
this.route.data.subscribe((data: { loanCollaterals: any }) => {
this.loanCollaterals = data.loanCollaterals;
});
@@ -1,36 +1,34 @@
<div class="container">
<h3>{{ 'labels.inputs.Deferred income' | translate }} - {{ 'labels.menus.Capitalized Income' | translate }}</h3>
<table mat-table [dataSource]="capitalizedIncomeData" *ngIf="capitalizedIncomeData.length > 0">
<ng-container matColumnDef="amount">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.amount | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="amortizedAmount">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Amortized Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.amortizedAmount | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="unrecognizedAmount">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Unrecognized Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.unrecognizedAmount | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="amountAdjustment">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Adjustment Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.amountAdjustment | formatNumber: '-' }}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="capitalizedIncomeColumns"></tr>
<tr mat-row *matRowDef="let row; columns: capitalizedIncomeColumns"></tr>
</table>
@if (capitalizedIncomeData.length > 0) {
<table mat-table [dataSource]="capitalizedIncomeData">
<ng-container matColumnDef="amount">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.amount | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="amortizedAmount">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Amortized Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.amortizedAmount | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="unrecognizedAmount">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Unrecognized Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.unrecognizedAmount | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="amountAdjustment">
<th mat-header-cell class="center" *matHeaderCellDef>{{ 'labels.inputs.Adjustment Amount' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.amountAdjustment | formatNumber: '-' }}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="capitalizedIncomeColumns"></tr>
<tr mat-row *matRowDef="let row; columns: capitalizedIncomeColumns"></tr>
</table>
}
</div>
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import {
MatCell,
MatCellDef,
@@ -36,6 +36,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanDeferredIncomeTabComponent {
private route = inject(ActivatedRoute);
capitalizedIncomeData: LoanCapitalizedIncomeData[] = [];
loanId: any;
@@ -47,7 +49,7 @@ export class LoanDeferredIncomeTabComponent {
'amountAdjustment'
];
constructor(private route: ActivatedRoute) {
constructor() {
this.loanId = this.route.parent.parent.snapshot.params['loanId'];
this.capitalizedIncomeData = [];
@@ -1,120 +1,124 @@
<div class="container">
<h3>{{ 'labels.heading.Loan Delinquency Tags' | translate }}</h3>
<table mat-table [dataSource]="loanDelinquencyTags" *ngIf="loanDelinquencyTags.length > 0">
<ng-container matColumnDef="classification">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Delinquency Classification' | translate }}</th>
<td mat-cell *matCellDef="let item">
{{ item.delinquencyRange.classification }}
<span *ngIf="item.delinquencyRange.maximumAgeDays"
>( {{ item.delinquencyRange.minimumAgeDays }} - {{ item.delinquencyRange.maximumAgeDays }} )</span
>
<span *ngIf="!item.delinquencyRange.maximumAgeDays">( {{ item.delinquencyRange.minimumAgeDays }} )</span>
</td>
</ng-container>
<ng-container matColumnDef="addedOn">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Added On' | translate }}</th>
<td mat-cell *matCellDef="let item">
<span *ngIf="item.addedOnDate">
{{ item.addedOnDate | dateFormat }}
</span>
</td>
</ng-container>
<ng-container matColumnDef="liftedOn">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Lifted On' | translate }}</th>
<td mat-cell *matCellDef="let item">
<span *ngIf="item.liftedOnDate">
{{ item.liftedOnDate | dateFormat }}
</span>
</td>
</ng-container>
<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">
@if (loanDelinquencyTags.length > 0) {
<table mat-table [dataSource]="loanDelinquencyTags">
<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' }}
{{ item.delinquencyRange.classification }}
@if (item.delinquencyRange.maximumAgeDays) {
<span>( {{ item.delinquencyRange.minimumAgeDays }} - {{ item.delinquencyRange.maximumAgeDays }} )</span>
}
@if (!item.delinquencyRange.maximumAgeDays) {
<span>( {{ item.delinquencyRange.minimumAgeDays }} )</span>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="installmentDelinquencyTagsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: installmentDelinquencyTagsColumns"></tr>
</table>
</div>
<div class="layout-row m-t-20 m-b-10 align-end align-items-center" *ngIf="allowPause">
<button
mat-raised-button
color="primary"
(click)="createDelinquencyAction()"
*mifosxHasPermission="'CREATE_DELINQUENCY_ACTION'"
>
<fa-icon icon="pause" class="m-r-10"></fa-icon>{{ 'labels.buttons.Pause Delinquency Classification' | translate }}
</button>
</div>
<div *ngIf="loanDelinquencyActions.length > 0" class="m-t-10">
<h3>{{ 'labels.heading.Loan Delinquency Actions' | translate }}</h3>
<table mat-table [dataSource]="loanDelinquencyActions">
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Action' | translate }}</th>
<td mat-cell *matCellDef="let item" ngClass="{{ actionClass(item.action) }}">{{ item.action }}</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>
</ng-container>
<ng-container matColumnDef="endDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.End Date' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.endDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="createdOn">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Created On' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.createdOn | datetimeFormat }}</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<ng-container matColumnDef="addedOn">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Added On' | translate }}</th>
<td mat-cell *matCellDef="let item">
<span *ngIf="isCurrentAndPauseAction(item)">
<button
mat-button
color="primary"
(click)="resumeDelinquencyClassification(item)"
*mifosxHasPermission="'CREATE_DELINQUENCY_ACTION'"
matTooltip="{{ 'tooltips.Resume Delinquency Classification' | translate }}"
>
<fa-icon icon="play" class="m-r-10"></fa-icon>
</button>
</span>
@if (item.addedOnDate) {
<span>
{{ item.addedOnDate | dateFormat }}
</span>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanDelinquencyActionsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanDelinquencyActionsColumns"></tr>
<ng-container matColumnDef="liftedOn">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Lifted On' | translate }}</th>
<td mat-cell *matCellDef="let item">
@if (item.liftedOnDate) {
<span>
{{ item.liftedOnDate | dateFormat }}
</span>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanDelinquencyTagsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanDelinquencyTagsColumns"></tr>
</table>
</div>
}
@if (installmentLevelDelinquency.length > 0) {
<div>
<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>
}
@if (allowPause) {
<div class="layout-row m-t-20 m-b-10 align-end align-items-center">
<button
mat-raised-button
color="primary"
(click)="createDelinquencyAction()"
*mifosxHasPermission="'CREATE_DELINQUENCY_ACTION'"
>
<fa-icon icon="pause" class="m-r-10"></fa-icon
>{{ 'labels.buttons.Pause Delinquency Classification' | translate }}
</button>
</div>
}
@if (loanDelinquencyActions.length > 0) {
<div class="m-t-10">
<h3>{{ 'labels.heading.Loan Delinquency Actions' | translate }}</h3>
<table mat-table [dataSource]="loanDelinquencyActions">
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Action' | translate }}</th>
<td mat-cell *matCellDef="let item" ngClass="{{ actionClass(item.action) }}">{{ item.action }}</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>
</ng-container>
<ng-container matColumnDef="endDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.End Date' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.endDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="createdOn">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Created On' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.createdOn | datetimeFormat }}</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let item">
@if (isCurrentAndPauseAction(item)) {
<span>
<button
mat-button
color="primary"
(click)="resumeDelinquencyClassification(item)"
*mifosxHasPermission="'CREATE_DELINQUENCY_ACTION'"
matTooltip="{{ 'tooltips.Resume Delinquency Classification' | translate }}"
>
<fa-icon icon="play" class="m-r-10"></fa-icon>
</button>
</span>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanDelinquencyActionsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanDelinquencyActionsColumns"></tr>
</table>
</div>
}
</div>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
@@ -14,7 +14,7 @@ import {
import { SettingsService } from 'app/settings/settings.service';
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
import { Currency } from 'app/shared/models/general.model';
import { NgIf, NgClass, CurrencyPipe } from '@angular/common';
import { NgClass, CurrencyPipe } from '@angular/common';
import {
MatTable,
MatColumnDef,
@@ -60,6 +60,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanDelinquencyTagsTabComponent implements OnInit {
private route = inject(ActivatedRoute);
private loansServices = inject(LoansService);
private dateUtils = inject(Dates);
private settingsService = inject(SettingsService);
private translateService = inject(TranslateService);
dialog = inject(MatDialog);
loanDelinquencyTags: LoanDelinquencyTags[] = [];
loanDelinquencyActions: LoanDelinquencyAction[] = [];
currentLoanDelinquencyAction: LoanDelinquencyAction | null;
@@ -89,14 +96,7 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
locale: string;
dateFormat: string;
constructor(
private route: ActivatedRoute,
private loansServices: LoansService,
private dateUtils: Dates,
private settingsService: SettingsService,
private translateService: TranslateService,
public dialog: MatDialog
) {
constructor() {
this.loanId = this.route.parent.parent.snapshot.params['loanId'];
this.route.parent.data.subscribe(
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
/** Custom Services */
@@ -22,6 +22,10 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanDocumentsTabComponent implements OnInit {
private route = inject(ActivatedRoute);
private loansService = inject(LoansService);
private settingsService = inject(SettingsService);
/** Stores the resolved loan documents data */
entityDocuments: any;
/** Loan account Id */
@@ -32,11 +36,7 @@ export class LoanDocumentsTabComponent implements OnInit {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(
private route: ActivatedRoute,
private loansService: LoansService,
private settingsService: SettingsService
) {
constructor() {
this.entityId = this.route.parent.snapshot.params['loanId'];
this.route.data.subscribe((data: { loanDocuments: any }) => {
@@ -1,62 +1,60 @@
<div class="container">
<div *ngFor="let loanTermVariation of loanTermVariationsData">
<h3 class="m-t-20">{{ 'labels.heading.' + loanTermVariation.label | translate }}</h3>
<table mat-table [dataSource]="loanTermVariation.data">
<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="startDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Start Date' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.termVariationApplicableFrom | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="endDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.End Date' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.dateValue | 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="days">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Days' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.days | formatNumber }}</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let item">
<span *ngIf="allowActions(item.termType.value)">
<button
class="button"
mat-icon-button
color="primary"
matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="right"
(click)="manageRequest(item, 'Edit')"
>
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
<button
class="button"
mat-icon-button
color="warn"
matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="left"
(click)="manageRequest(item, 'Delete')"
>
<fa-icon icon="trash" size="lg"></fa-icon>
</button>
</span>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanDTermVariationsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanDTermVariationsColumns"></tr>
</table>
</div>
@for (loanTermVariation of loanTermVariationsData; track loanTermVariation) {
<div>
<h3 class="m-t-20">{{ 'labels.heading.' + loanTermVariation.label | translate }}</h3>
<table mat-table [dataSource]="loanTermVariation.data">
<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="startDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Start Date' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.termVariationApplicableFrom | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="endDate">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.End Date' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.dateValue | 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="days">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Days' | translate }}</th>
<td mat-cell *matCellDef="let item">{{ item.days | formatNumber }}</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let item">
@if (allowActions(item.termType.value)) {
<span>
<button
class="button"
mat-icon-button
color="primary"
matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="right"
(click)="manageRequest(item, 'Edit')"
>
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
<button
class="button"
mat-icon-button
color="warn"
matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="left"
(click)="manageRequest(item, 'Delete')"
>
<fa-icon icon="trash" size="lg"></fa-icon>
</button>
</span>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="loanDTermVariationsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: loanDTermVariationsColumns"></tr>
</table>
</div>
}
</div>
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -8,7 +8,6 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.component';
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-base';
import { AnyKindOfDictionary } from 'cypress/types/lodash';
import {
MatTable,
MatColumnDef,
@@ -52,6 +51,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanTermVariationsTabComponent {
private route = inject(ActivatedRoute);
private router = inject(Router);
private dates = inject(Dates);
private settingsService = inject(SettingsService);
private loansService = inject(LoansService);
private dialog = inject(MatDialog);
/** Loan Term Variation Data */
loanTermVariationsData: any[] = [];
loanDTermVariationsColumns: string[] = [
@@ -76,16 +82,11 @@ export class LoanTermVariationsTabComponent {
invalidData: any[] = [];
loanId: number;
clientId: AnyKindOfDictionary;
clientId: string;
constructor() {
const dates = this.dates;
constructor(
private route: ActivatedRoute,
private router: Router,
private dates: Dates,
private settingsService: SettingsService,
private loansService: LoansService,
private dialog: MatDialog
) {
this.interestPausesData = [];
this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId');
this.route.data.subscribe((data: { loanDetailsData: any }) => {
@@ -241,7 +242,6 @@ export class LoanTermVariationsTabComponent {
maxDate: this.settingsService.maxFutureDate,
required: true
})
];
const data = {
@@ -7,85 +7,92 @@
<h3>{{ 'labels.heading.Loan Tranche Details' | translate }}</h3>
<div class="layout-row margin-t layout-xs-column layout-align-end gap-2percent">
<button mat-raised-button color="primary" *ngIf="showAddTrancheButtons()" (click)="addDisbursementDataEntry()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
<button mat-raised-button color="primary" *ngIf="!pristine" (click)="editDisbursementData()">
{{ 'labels.buttons.Apply Changes' | translate }}
</button>
@if (showAddTrancheButtons()) {
<button mat-raised-button color="primary" (click)="addDisbursementDataEntry()">
<fa-icon icon="plus" class="m-r-10"></fa-icon>{{ 'labels.buttons.Add' | translate }}
</button>
}
@if (!pristine) {
<button mat-raised-button color="primary" (click)="editDisbursementData()">
{{ 'labels.buttons.Apply Changes' | translate }}
</button>
}
</div>
<table mat-table [dataSource]="disbursementDataSource" *ngIf="disbursementDataSource.length > 0">
<ng-container matColumnDef="expected disbursement on">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Expected Disbursement On' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.expectedDisbursementDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="disbursed on">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Disbursed On' | translate }}</th>
<td mat-cell *matCellDef="let ele">
<span *ngIf="ele.actualDisbursementDate">
{{ ele.actualDisbursementDate | dateFormat }}
</span>
</td>
</ng-container>
<ng-container matColumnDef="principal">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Principal' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.principal }}</td>
</ng-container>
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let ele; let rowIndex = index">
<span *ngIf="ele.actualDisbursementDate">
<i class="fa fa-check"></i>
</span>
<button
type="button"
mat-icon-button
color="primary"
(click)="editDisbursementDataEntry(rowIndex)"
matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="left"
*ngIf="!ele.actualDisbursementDate && showActionsTrancheButtons()"
>
<fa-icon icon="edit"></fa-icon>
</button>
<button
type="button"
mat-icon-button
color="warn"
(click)="removeDisbursementDataEntry(rowIndex)"
matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="left"
*ngIf="!ele.actualDisbursementDate && showActionsTrancheButtons()"
>
<fa-icon icon="trash"></fa-icon>
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="expectedDisbursementColumns"></tr>
<tr mat-row *matRowDef="let row; columns: expectedDisbursementColumns"></tr>
</table>
<div *ngIf="loanDetails.emiAmountVariations.length > 0">
<h3>{{ 'labels.heading.Installment Amount Variations' | translate }}:</h3>
<table mat-table [dataSource]="loanDetails.emiAmountVariations">
<ng-container matColumnDef="emi amount variation from">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Applicable From Date' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.termVariationApplicableFrom | dateFormat }}</td>
@if (disbursementDataSource.length > 0) {
<table mat-table [dataSource]="disbursementDataSource">
<ng-container matColumnDef="expected disbursement on">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Expected Disbursement On' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.expectedDisbursementDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="fixed emi amount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Installment Amount' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.termValue }}</td>
<ng-container matColumnDef="disbursed on">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Disbursed On' | translate }}</th>
<td mat-cell *matCellDef="let ele">
@if (ele.actualDisbursementDate) {
<span>
{{ ele.actualDisbursementDate | dateFormat }}
</span>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="emivariationColumns"></tr>
<tr mat-row *matRowDef="let row; columns: emivariationColumns"></tr>
<ng-container matColumnDef="principal">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Principal' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.principal }}</td>
</ng-container>
<ng-container matColumnDef="action">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let ele; let rowIndex = index">
@if (ele.actualDisbursementDate) {
<span>
<i class="fa fa-check"></i>
</span>
}
@if (!ele.actualDisbursementDate && showActionsTrancheButtons()) {
<button
type="button"
mat-icon-button
color="primary"
(click)="editDisbursementDataEntry(rowIndex)"
matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="left"
>
<fa-icon icon="edit"></fa-icon>
</button>
}
@if (!ele.actualDisbursementDate && showActionsTrancheButtons()) {
<button
type="button"
mat-icon-button
color="warn"
(click)="removeDisbursementDataEntry(rowIndex)"
matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="left"
>
<fa-icon icon="trash"></fa-icon>
</button>
}
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="expectedDisbursementColumns"></tr>
<tr mat-row *matRowDef="let row; columns: expectedDisbursementColumns"></tr>
</table>
</div>
}
@if (loanDetails.emiAmountVariations.length > 0) {
<div>
<h3>{{ 'labels.heading.Installment Amount Variations' | translate }}:</h3>
<table mat-table [dataSource]="loanDetails.emiAmountVariations">
<ng-container matColumnDef="emi amount variation from">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Applicable From Date' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.termVariationApplicableFrom | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="fixed emi amount">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Installment Amount' | translate }}</th>
<td mat-cell *matCellDef="let ele">{{ ele.termValue }}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="emivariationColumns"></tr>
<tr mat-row *matRowDef="let row; columns: emivariationColumns"></tr>
</table>
</div>
}
</div>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -53,6 +53,13 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class LoanTrancheDetailsComponent implements OnInit {
private route = inject(ActivatedRoute);
private router = inject(Router);
private dialog = inject(MatDialog);
private loanServices = inject(LoansService);
private settingsService = inject(SettingsService);
private dateUtils = inject(Dates);
loanDetails: any;
return: any;
status: any;
@@ -81,14 +88,7 @@ export class LoanTrancheDetailsComponent implements OnInit {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(
private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog,
private loanServices: LoansService,
private settingsService: SettingsService,
private dateUtils: Dates
) {
constructor() {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanId = data.loanDetailsData.id;
this.loanDetails = data.loanDetailsData;
@@ -177,7 +177,6 @@ export class LoanTrancheDetailsComponent implements OnInit {
required: true,
order: 2
})
];
return formBase;
}
+148 -121
View File
@@ -41,118 +41,147 @@
}}<span class="m-l-5">({{ loanDetailsData.clientAccountNo || loanDetailsData.group.accountNo }})</span
><br />
</span>
<div *ngIf="loanDisplayArrearsDelinquency !== 1">
<table class="account-overview">
<tbody>
<tr *ngIf="loanDetailsData.delinquencyRange">
<td>{{ 'labels.inputs.Delinquency Classification' | translate }} :</td>
<td>
<span class="m-r-3"><i [ngClass]="loanDelinquencyClassificationStyle"></i></span>
{{ loanDetailsData?.delinquencyRange.classification }}
</td>
</tr>
<tr *ngIf="loanDetailsData.delinquent && loanDetailsData.delinquent.pastDueDays > 0">
<td>{{ 'labels.inputs.Past Due Days' | translate }} :</td>
<td>{{ loanDetailsData?.delinquent.pastDueDays | formatNumber }}</td>
</tr>
<tr
*ngIf="
@if (loanDisplayArrearsDelinquency !== 1) {
<div>
<table class="account-overview">
<tbody>
@if (loanDetailsData.delinquencyRange) {
<tr>
<td>{{ 'labels.inputs.Delinquency Classification' | translate }} :</td>
<td>
<span class="m-r-3"><i [ngClass]="loanDelinquencyClassificationStyle"></i></span>
{{ loanDetailsData?.delinquencyRange.classification }}
</td>
</tr>
}
@if (loanDetailsData.delinquent && loanDetailsData.delinquent.pastDueDays > 0) {
<tr>
<td>{{ 'labels.inputs.Past Due Days' | translate }} :</td>
<td>{{ loanDetailsData?.delinquent.pastDueDays | formatNumber }}</td>
</tr>
}
@if (
loanDetailsData.delinquent &&
loanDetailsData.delinquent.delinquentDays > 0 &&
loanDetailsData.delinquent.pastDueDays !== loanDetailsData.delinquent.delinquentDays
"
>
<td>{{ 'labels.inputs.Delinquent Days' | translate }} :</td>
<td>{{ loanDetailsData?.delinquent.delinquentDays | formatNumber }}</td>
) {
<tr>
<td>{{ 'labels.inputs.Delinquent Days' | translate }} :</td>
<td>{{ loanDetailsData?.delinquent.delinquentDays | formatNumber }}</td>
</tr>
}
</tbody>
</table>
</div>
}
</div>
@if (loanDetailsData.summary) {
<div class="loans-overview mat-typography flex-30">
<h3>{{ 'labels.heading.Account Overview' | translate }}</h3>
<table class="account-overview">
<tbody>
<tr>
<td>{{ 'labels.inputs.Current Balance' | translate }}</td>
<td class="r-amount">
{{
loanDetailsData.summary.totalOutstanding | currency: currency.code : 'symbol-narrow' : '1.2-2'
}}
</td>
</tr>
@if (loanDisplayArrearsDelinquency < 2) {
<tr>
<td>{{ 'labels.inputs.Arrears By' | translate }}</td>
@if (loanDetailsData.summary.totalOverdue >= 0) {
<td class="r-amount">
{{
loanDetailsData.summary.totalOverdue | currency: currency.code : 'symbol-narrow' : '1.2-2'
}}
</td>
}
@if (!(loanDetailsData.summary.totalOverdue >= 0)) {
<td>
{{ 'labels.inputs.Not Provided' | translate }}
</td>
}
</tr>
}
@if (loanDetailsData.inArrears) {
<tr>
<td>{{ 'labels.inputs.Arrears Since' | translate }}</td>
<td>{{ loanDetailsData.summary.overdueSinceDate | dateFormat }}</td>
</tr>
}
@if (loanDetailsData.totalOverpaid && loanDetailsData.totalOverpaid > 0) {
<tr>
<td>{{ 'labels.inputs.Overpaid By' | translate }}</td>
<td class="r-amount">
{{ loanDetailsData.totalOverpaid | currency: currency.code : 'symbol-narrow' : '1.2-2' }}
</td>
</tr>
}
</tbody>
</table>
</div>
</div>
<div *ngIf="loanDetailsData.summary" class="loans-overview mat-typography flex-30">
<h3>{{ 'labels.heading.Account Overview' | translate }}</h3>
<table class="account-overview">
<tbody>
<tr>
<td>{{ 'labels.inputs.Current Balance' | translate }}</td>
<td class="r-amount">
{{
loanDetailsData.summary.totalOutstanding | currency: currency.code : 'symbol-narrow' : '1.2-2'
}}
</td>
</tr>
<tr *ngIf="loanDisplayArrearsDelinquency < 2">
<td>{{ 'labels.inputs.Arrears By' | translate }}</td>
<td class="r-amount" *ngIf="loanDetailsData.summary.totalOverdue >= 0">
{{ loanDetailsData.summary.totalOverdue | currency: currency.code : 'symbol-narrow' : '1.2-2' }}
</td>
<td *ngIf="!(loanDetailsData.summary.totalOverdue >= 0)">
{{ 'labels.inputs.Not Provided' | translate }}
</td>
</tr>
<tr *ngIf="loanDetailsData.inArrears">
<td>{{ 'labels.inputs.Arrears Since' | translate }}</td>
<td>{{ loanDetailsData.summary.overdueSinceDate | dateFormat }}</td>
</tr>
<tr *ngIf="loanDetailsData.totalOverpaid && loanDetailsData.totalOverpaid > 0">
<td>{{ 'labels.inputs.Overpaid By' | translate }}</td>
<td class="r-amount">
{{ loanDetailsData.totalOverpaid | currency: currency.code : 'symbol-narrow' : '1.2-2' }}
</td>
</tr>
</tbody>
</table>
</div>
}
<div class="flex-5">
<button
mat-icon-button
[matMenuTriggerFor]="accountMenu"
aria-label="Loan account actions"
yPosition="below"
*ngIf="buttonConfig.singleButtons.length > 0"
>
<mat-icon matListIcon class="actions-menu">
<fa-icon icon="bars" size="sm"></fa-icon>
</mat-icon>
</button>
@if (buttonConfig.singleButtons.length > 0) {
<button
mat-icon-button
[matMenuTriggerFor]="accountMenu"
aria-label="Loan account actions"
yPosition="below"
>
<mat-icon matListIcon class="actions-menu">
<fa-icon icon="bars" size="sm"></fa-icon>
</mat-icon>
</button>
}
</div>
</div>
</mat-card-title>
</div>
<mat-menu #accountMenu="matMenu">
<ng-container *ngFor="let item of buttonConfig.singleButtons">
@for (item of buttonConfig.singleButtons; track item) {
<button mat-menu-item *mifosxHasPermission="item.taskPermissionName" (click)="loanAction(item.name)">
<mat-icon matListIcon>
<fa-icon icon="{{ item.icon }}" size="sm"></fa-icon>
</mat-icon>
<span>{{ 'labels.menus.' + item.name | translate }}</span>
</button>
</ng-container>
}
<ng-container *ngIf="buttonConfig.optionsPayment.length" class="loan-span">
<button mat-menu-item [matMenuTriggerFor]="Payments">{{ 'labels.menus.Payments' | translate }}</button>
<mat-menu #Payments="matMenu">
<span *ngFor="let item of buttonConfig.optionsPayment">
<button mat-menu-item *mifosxHasPermission="item.taskPermissionName" (click)="loanAction(item.name)">
{{ 'labels.menus.' + item.name | translate }}
</button>
</span>
</mat-menu>
</ng-container>
@if (buttonConfig.optionsPayment.length) {
<ng-container class="loan-span">
<button mat-menu-item [matMenuTriggerFor]="Payments">{{ 'labels.menus.Payments' | translate }}</button>
<mat-menu #Payments="matMenu">
@for (item of buttonConfig.optionsPayment; track item) {
<span>
<button mat-menu-item *mifosxHasPermission="item.taskPermissionName" (click)="loanAction(item.name)">
{{ 'labels.menus.' + item.name | translate }}
</button>
</span>
}
</mat-menu>
</ng-container>
}
<ng-container *ngIf="buttonConfig.options.length" class="loan-span">
<button mat-menu-item [matMenuTriggerFor]="More">{{ 'labels.menus.More' | translate }}</button>
<mat-menu #More="matMenu">
<span *ngFor="let item of buttonConfig.options">
<button mat-menu-item *mifosxHasPermission="item.taskPermissionName" (click)="loanAction(item.name)">
{{ 'labels.menus.' + item.name | translate }}
</button>
</span>
</mat-menu>
</ng-container>
@if (buttonConfig.options.length) {
<ng-container class="loan-span">
<button mat-menu-item [matMenuTriggerFor]="More">{{ 'labels.menus.More' | translate }}</button>
<mat-menu #More="matMenu">
@for (item of buttonConfig.options; track item) {
<span>
<button mat-menu-item *mifosxHasPermission="item.taskPermissionName" (click)="loanAction(item.name)">
{{ 'labels.menus.' + item.name | translate }}
</button>
</span>
}
</mat-menu>
</ng-container>
}
</mat-menu>
</mat-card-title-group>
</mat-card-header>
@@ -177,7 +206,7 @@
>
{{ 'labels.inputs.Account Details' | translate }}
</a>
<ng-container *ngIf="loanDetailsData.originalSchedule">
@if (loanDetailsData.originalSchedule) {
<a
mat-tab-link
[routerLink]="['./original-schedule']"
@@ -187,7 +216,7 @@
>
{{ 'labels.inputs.Original Schedule' | translate }}
</a>
</ng-container>
}
<a
mat-tab-link
[routerLink]="['./repayment-schedule']"
@@ -197,7 +226,7 @@
>
{{ 'labels.inputs.Repayment Schedule' | translate }}
</a>
<ng-container *ngIf="loanDetailsData.transactions">
@if (loanDetailsData.transactions) {
<a
mat-tab-link
[routerLink]="['./transactions']"
@@ -207,8 +236,8 @@
>
{{ 'labels.inputs.Transactions' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.enableIncomeCapitalization">
}
@if (loanDetailsData.enableIncomeCapitalization) {
<a
mat-tab-link
[routerLink]="['./deferred-income']"
@@ -218,8 +247,8 @@
>
{{ 'labels.inputs.Deferred income' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.enableBuyDownFee">
}
@if (loanDetailsData.enableBuyDownFee) {
<a
mat-tab-link
[routerLink]="['./buy-down-fees']"
@@ -229,8 +258,8 @@
>
{{ 'labels.heading.Buy Down Fees' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.status.active">
}
@if (loanDetailsData.status.active) {
<a
mat-tab-link
[routerLink]="['./delinquencytags']"
@@ -240,8 +269,8 @@
>
{{ 'labels.inputs.Delinquency Tags' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.collateral">
}
@if (loanDetailsData.collateral) {
<a
mat-tab-link
[routerLink]="['./loan-collateral']"
@@ -251,8 +280,8 @@
>
{{ 'labels.inputs.Loan Collateral Details' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.multiDisburseLoan">
}
@if (loanDetailsData.multiDisburseLoan) {
<a
mat-tab-link
[routerLink]="['./loan-tranche-details']"
@@ -262,8 +291,8 @@
>
{{ 'labels.inputs.Loan Tranche Details' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.loanTermVariations">
}
@if (loanDetailsData.loanTermVariations) {
<a
mat-tab-link
[routerLink]="['./term-variations']"
@@ -273,8 +302,8 @@
>
{{ 'labels.inputs.Term Variations' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.overdueCharges.length > 0">
}
@if (loanDetailsData.overdueCharges.length > 0) {
<a
mat-tab-link
[routerLink]="['./overdue-charges']"
@@ -284,8 +313,8 @@
>
{{ 'labels.inputs.Overdue Charges' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.isLoanProductLinkedToFloatingRate">
}
@if (loanDetailsData.isLoanProductLinkedToFloatingRate) {
<a
mat-tab-link
[routerLink]="['./floating-interest-rates']"
@@ -295,8 +324,8 @@
>
{{ 'labels.inputs.Floating Interest Rates' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.charges">
}
@if (loanDetailsData.charges) {
<a
mat-tab-link
[routerLink]="['./charges']"
@@ -306,10 +335,8 @@
>
{{ 'labels.inputs.Charges' | translate }}
</a>
</ng-container>
<ng-container
*ngIf="loanDetailsData.status.active || loanDetailsData.status.closed || loanDetailsData.status.overpaid"
>
}
@if (loanDetailsData.status.active || loanDetailsData.status.closed || loanDetailsData.status.overpaid) {
<a
mat-tab-link
[routerLink]="['./loan-reschedules']"
@@ -319,7 +346,7 @@
>
{{ 'labels.inputs.Loan Reschedules' | translate }}
</a>
</ng-container>
}
<a
mat-tab-link
[routerLink]="['./loan-documents']"
@@ -339,7 +366,7 @@
>
{{ 'labels.inputs.Notes' | translate }}
</a>
<ng-container *ngIf="loanDetailsData.clientId">
@if (loanDetailsData.clientId) {
<a
mat-tab-link
[routerLink]="['./standing-instruction']"
@@ -349,8 +376,8 @@
>
{{ 'labels.inputs.Standing Instruction' | translate }}
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.status.active">
}
@if (loanDetailsData.status.active) {
<a
mat-tab-link
[routerLink]="['./external-asset-owner']"
@@ -360,8 +387,8 @@
>
{{ 'labels.inputs.External Asset Owner' | translate }}
</a>
</ng-container>
<ng-container *ngFor="let loanDatatable of loanDatatables">
}
@for (loanDatatable of loanDatatables; track loanDatatable) {
<a
mat-tab-link
*mifosxHasPermission="'READ_' + loanDatatable.registeredTableName"
@@ -372,7 +399,7 @@
>
{{ loanDatatable.registeredTableName }}
</a>
</ng-container>
}
</nav>
<mat-tab-nav-panel #tabPanel>
<router-outlet></router-outlet>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute, NavigationExtras, Router, RouterLinkActive, RouterOutlet } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
@@ -67,6 +67,12 @@ import { LoanProducts } from 'app/products/loan-products/loan-products';
]
})
export class LoansViewComponent implements OnInit {
private route = inject(ActivatedRoute);
private router = inject(Router);
loansService = inject(LoansService);
private translateService = inject(TranslateService);
dialog = inject(MatDialog);
/** Loan Details Data */
loanDetailsData: any;
/** Loan Datatables */
@@ -94,13 +100,9 @@ export class LoansViewComponent implements OnInit {
loanReAged = false;
loanReAmortized = false;
constructor(
private route: ActivatedRoute,
private router: Router,
public loansService: LoansService,
private translateService: TranslateService,
public dialog: MatDialog
) {
constructor() {
const loansService = this.loansService;
this.route.data.subscribe(
(data: { loanDetailsData: any; loanDatatables: any; loanArrearsDelinquencyConfig: any }) => {
this.loanDetailsData = data.loanDetailsData;
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
/** Custom Components */
@@ -19,15 +19,15 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class NotesTabComponent implements OnInit {
private route = inject(ActivatedRoute);
private loansService = inject(LoansService);
private authenticationService = inject(AuthenticationService);
entityId: string;
username: string;
entityNotes: any;
constructor(
private route: ActivatedRoute,
private loansService: LoansService,
private authenticationService: AuthenticationService
) {
constructor() {
const savedCredentials = this.authenticationService.getCredentials();
this.username = savedCredentials.username;
this.entityId = this.route.parent.snapshot.params['loanId'];
@@ -1,4 +1,4 @@
import { Component } from '@angular/core';
import { Component, inject } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { Currency } from 'app/shared/models/general.model';
import {
@@ -50,6 +50,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class OriginalScheduleTabComponent {
private route = inject(ActivatedRoute);
/** Loan Details Data */
originalScheduleDetails: any;
/** Columns to be displayed in original schedule table. */
@@ -70,7 +72,7 @@ export class OriginalScheduleTabComponent {
* Retrieves the loans with associations data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
constructor() {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.currency = data.loanDetailsData.currency;
this.originalScheduleDetails = data.loanDetailsData.originalSchedule;
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatSort, MatSortHeader } from '@angular/material/sort';
import {
@@ -45,6 +45,8 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class OverdueChargesTabComponent implements OnInit {
private route = inject(ActivatedRoute);
/** Stores the resolved loan data */
loanDetails: any;
/** Stores the overdue data */
@@ -69,7 +71,7 @@ export class OverdueChargesTabComponent implements OnInit {
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
constructor() {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
@@ -1,321 +1,317 @@
<div class="container">
<div class="layout-row m-t-20 align-end align-items-center" *ngIf="!forEditing">
<button mat-raised-button color="primary" (click)="exportToPDF()">
<fa-icon icon="download" class="m-r-10"></fa-icon>Export to PDF
</button>
</div>
@if (!forEditing) {
<div class="layout-row m-t-20 align-end align-items-center">
<button mat-raised-button color="primary" (click)="exportToPDF()">
<fa-icon icon="download" class="m-r-10"></fa-icon>Export to PDF
</button>
</div>
}
<table mat-table [dataSource]="repaymentScheduleDetails?.periods" *ngIf="!forEditing" id="repaymentSchedule">
<ng-container matColumnDef="number">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>#</th>
<td mat-cell class="right" *matCellDef="let item">{{ item.period }}</td>
<td mat-footer-cell *matFooterCellDef>&nbsp;</td>
</ng-container>
<ng-container matColumnDef="days">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Days' | translate }}</th>
<td mat-cell class="center" *matCellDef="let item" [ngClass]="installmentStyle(item)">{{ item.daysInPeriod }}</td>
<td mat-footer-cell class="center" *matFooterCellDef><b> Total</b></td>
</ng-container>
<ng-container matColumnDef="date">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Date' | translate }}</th>
<td mat-cell class="m-r-5" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.dueDate | dateFormat }}
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="paiddate">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Paid Date' | translate }}
</th>
<td mat-cell class="center" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.obligationsMetOnDate | dateFormat }}
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="check">
<th mat-header-cell *matHeaderCellDef>&nbsp;</th>
<td mat-cell class="center" *matCellDef="let item" [ngClass]="installmentStyle(item)">
<span *ngIf="item.obligationsMetOnDate"> <i class="fa fa-check"></i> </span>
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="balanceOfLoan">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Balance Of Loan' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.principalLoanBalanceOutstanding | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>&nbsp;</td>
</ng-container>
<ng-container matColumnDef="principalDue">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Principal Due' | translate }}
</th>
<td mat-cell class="check r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.principalDue | formatNumber }}
</td>
<td mat-footer-cell class="check r-amount" *matFooterCellDef>
<b>
{{ repaymentScheduleDetails?.totalPrincipalExpected | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}</b
>
</td>
</ng-container>
<ng-container matColumnDef="interest">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Interest' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.interestOriginalDue | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b>
{{ repaymentScheduleDetails?.totalInterestCharged | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</b>
</td>
</ng-container>
<ng-container matColumnDef="fees">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Fees' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.feeChargesDue | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b>
{{ repaymentScheduleDetails?.totalFeeChargesCharged | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</b>
</td>
</ng-container>
<ng-container matColumnDef="penalties">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Penalties' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.penaltyChargesDue | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b>
{{
repaymentScheduleDetails?.totalPenaltyChargesCharged | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}
</b>
</td>
</ng-container>
<ng-container matColumnDef="due">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Due' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalDueForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b>
{{ repaymentScheduleDetails?.totalRepaymentExpected | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</b>
</td>
</ng-container>
<ng-container matColumnDef="paid">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Paid' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalPaidForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalRepayment | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
</td>
</ng-container>
<ng-container matColumnDef="inadvance">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.In advance' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalPaidInAdvanceForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalPaidInAdvance | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
</td>
</ng-container>
<ng-container matColumnDef="late">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Late' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalPaidLateForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalPaidLate | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
</td>
</ng-container>
<ng-container *ngIf="isWaived">
<ng-container matColumnDef="waived">
@if (!forEditing) {
<table mat-table [dataSource]="repaymentScheduleDetails?.periods" id="repaymentSchedule">
<ng-container matColumnDef="number">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>#</th>
<td mat-cell class="right" *matCellDef="let item">{{ item.period }}</td>
<td mat-footer-cell *matFooterCellDef>&nbsp;</td>
</ng-container>
<ng-container matColumnDef="days">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Days' | translate }}</th>
<td mat-cell class="center" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.daysInPeriod }}
</td>
<td mat-footer-cell class="center" *matFooterCellDef><b> Total</b></td>
</ng-container>
<ng-container matColumnDef="date">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Date' | translate }}</th>
<td mat-cell class="m-r-5" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.dueDate | dateFormat }}
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="paiddate">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Paid Date' | translate }}
</th>
<td mat-cell class="center" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.obligationsMetOnDate | dateFormat }}
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="check">
<th mat-header-cell *matHeaderCellDef>&nbsp;</th>
<td mat-cell class="center" *matCellDef="let item" [ngClass]="installmentStyle(item)">
@if (item.obligationsMetOnDate) {
<span> <i class="fa fa-check"></i> </span>
}
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<ng-container matColumnDef="balanceOfLoan">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Waived' | translate }}
{{ 'labels.inputs.Balance Of Loan' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalWaivedForPeriod | formatNumber }}
{{ item.principalLoanBalanceOutstanding | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>&nbsp;</td>
</ng-container>
<ng-container matColumnDef="principalDue">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Principal Due' | translate }}
</th>
<td mat-cell class="check r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.principalDue | formatNumber }}
</td>
<td mat-footer-cell class="check r-amount" *matFooterCellDef>
<b>
{{
repaymentScheduleDetails?.totalPrincipalExpected | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}</b
>
</td>
</ng-container>
<ng-container matColumnDef="interest">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Interest' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.interestOriginalDue | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalWaived | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
<b>
{{ repaymentScheduleDetails?.totalInterestCharged | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</b>
</td>
</ng-container>
</ng-container>
<ng-container *ngIf="!isWaived">
<ng-container matColumnDef="waived">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let item"></td>
<td mat-footer-cell *matFooterCellDef><b> </b></td>
<ng-container matColumnDef="fees">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Fees' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.feeChargesDue | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b>
{{ repaymentScheduleDetails?.totalFeeChargesCharged | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</b>
</td>
</ng-container>
</ng-container>
<ng-container matColumnDef="outstanding">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Outstanding' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">{{ item.totalOutstandingForPeriod | formatNumber }}</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalOutstanding | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
</td>
</ng-container>
<ng-container matColumnDef="header">
<th mat-header-cell *matHeaderCellDef [attr.colspan]="5"></th>
</ng-container>
<ng-container matColumnDef="header-amount">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef [attr.colspan]="2">
{{ 'labels.inputs.Loan Amount and Balance' | translate }}
</th>
</ng-container>
<ng-container matColumnDef="header-total-cost">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef [attr.colspan]="3">
{{ 'labels.inputs.Total Cost of Loan' | translate }}
</th>
</ng-container>
<ng-container matColumnDef="header-installment-totals">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef [attr.colspan]="6">
{{ 'labels.inputs.Installment Totals' | translate }}
</th>
</ng-container>
<tr
mat-header-row
*matHeaderRowDef="['header', 'header-amount', 'header-total-cost', 'header-installment-totals']"
></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns" class="table-row"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
</table>
<ng-container matColumnDef="penalties">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Penalties' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.penaltyChargesDue | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b>
{{
repaymentScheduleDetails?.totalPenaltyChargesCharged | currency: currencyCode : 'symbol-narrow' : '1.2-2'
}}
</b>
</td>
</ng-container>
<ng-container matColumnDef="due">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Due' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalDueForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b>
{{ repaymentScheduleDetails?.totalRepaymentExpected | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</b>
</td>
</ng-container>
<ng-container matColumnDef="paid">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Paid' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalPaidForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalRepayment | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
</td>
</ng-container>
<ng-container matColumnDef="inadvance">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.In advance' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalPaidInAdvanceForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b>
{{ repaymentScheduleDetails?.totalPaidInAdvance | currency: currencyCode : 'symbol-narrow' : '1.2-2' }}
</b>
</td>
</ng-container>
<ng-container matColumnDef="late">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Late' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalPaidLateForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalPaidLate | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
</td>
</ng-container>
@if (isWaived) {
<ng-container matColumnDef="waived">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Waived' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item" [ngClass]="installmentStyle(item)">
{{ item.totalWaivedForPeriod | formatNumber }}
</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalWaived | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
</td>
</ng-container>
}
@if (!isWaived) {
<ng-container matColumnDef="waived">
<th mat-header-cell *matHeaderCellDef></th>
<td mat-cell *matCellDef="let item"></td>
<td mat-footer-cell *matFooterCellDef><b> </b></td>
</ng-container>
}
<ng-container matColumnDef="outstanding">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Outstanding' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">{{ item.totalOutstandingForPeriod | formatNumber }}</td>
<td mat-footer-cell class="r-amount" *matFooterCellDef>
<b> {{ repaymentScheduleDetails?.totalOutstanding | currency: currencyCode : 'symbol-narrow' : '1.2-2' }} </b>
</td>
</ng-container>
<ng-container matColumnDef="header">
<th mat-header-cell *matHeaderCellDef [attr.colspan]="5"></th>
</ng-container>
<ng-container matColumnDef="header-amount">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef [attr.colspan]="2">
{{ 'labels.inputs.Loan Amount and Balance' | translate }}
</th>
</ng-container>
<ng-container matColumnDef="header-total-cost">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef [attr.colspan]="3">
{{ 'labels.inputs.Total Cost of Loan' | translate }}
</th>
</ng-container>
<ng-container matColumnDef="header-installment-totals">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef [attr.colspan]="6">
{{ 'labels.inputs.Installment Totals' | translate }}
</th>
</ng-container>
<tr
mat-header-row
*matHeaderRowDef="['header', 'header-amount', 'header-total-cost', 'header-installment-totals']"
></tr>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns" class="table-row"></tr>
<tr mat-footer-row *matFooterRowDef="displayedColumns"></tr>
</table>
}
<!-- Repayment Schedule to be Edited -->
<table
mat-table
[dataSource]="repaymentScheduleDetails?.periods"
*ngIf="forEditing && repaymentScheduleDetails?.periods?.length > 0"
id="repaymentScheduleEdit"
>
<ng-container matColumnDef="number">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>#</th>
<td mat-cell *matCellDef="let item">{{ item.period }}</td>
</ng-container>
<ng-container matColumnDef="date">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Date' | translate }}</th>
<td mat-cell class="m-r-10" *matCellDef="let item">
<ng-container>
{{ item.dueDate | dateFormat }}
</ng-container>
</td>
</ng-container>
<ng-container matColumnDef="balanceOfLoan">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Balance Of Loan' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.principalLoanBalanceOutstanding | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="principalDue">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Principal Due' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">
<ng-container>
{{ item.principalDue | formatNumber }}
</ng-container>
</td>
</ng-container>
<ng-container matColumnDef="interest">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Interest' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">{{ item.interestOriginalDue | formatNumber }}</td>
</ng-container>
<ng-container matColumnDef="fees">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Fees' | translate }}</th>
<td mat-cell class="r-amount" *matCellDef="let item">{{ item.feeChargesDue | formatNumber }}</td>
</ng-container>
<ng-container matColumnDef="due">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Installment Amount' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">
<span *ngIf="!item.changed">
{{ item.totalDueForPeriod | formatNumber }}
</span>
<span *ngIf="item.changed" class="amount-changed">
<b>{{ item.totalDueForPeriod | formatNumber }}</b>
</span>
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell class="center" *matCellDef="let item">
<span *ngIf="item.period && item.period + 1 < repaymentScheduleDetails?.periods?.length">
@if (forEditing && repaymentScheduleDetails?.periods?.length > 0) {
<table mat-table [dataSource]="repaymentScheduleDetails?.periods" id="repaymentScheduleEdit">
<ng-container matColumnDef="number">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>#</th>
<td mat-cell *matCellDef="let item">{{ item.period }}</td>
</ng-container>
<ng-container matColumnDef="date">
<th mat-header-cell class="center mat-header-cell" *matHeaderCellDef>{{ 'labels.inputs.Date' | translate }}</th>
<td mat-cell class="m-r-10" *matCellDef="let item">
<ng-container>
<button
type="button"
color="primary"
mat-icon-button
matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="above"
(click)="editInstallment(item)"
>
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
<button
type="button"
color="warn"
mat-icon-button
matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="above"
(click)="startEdit(item.period)"
>
<fa-icon icon="trash" size="lg"></fa-icon>
</button>
{{ item.dueDate | dateFormat }}
</ng-container>
</span>
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumnsEdit"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumnsEdit"></tr>
</table>
</td>
</ng-container>
<ng-container matColumnDef="balanceOfLoan">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Balance Of Loan' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">
{{ item.principalLoanBalanceOutstanding | formatNumber }}
</td>
</ng-container>
<ng-container matColumnDef="principalDue">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Principal Due' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">
<ng-container>
{{ item.principalDue | formatNumber }}
</ng-container>
</td>
</ng-container>
<ng-container matColumnDef="interest">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Interest' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">{{ item.interestOriginalDue | formatNumber }}</td>
</ng-container>
<ng-container matColumnDef="fees">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Fees' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">{{ item.feeChargesDue | formatNumber }}</td>
</ng-container>
<ng-container matColumnDef="due">
<th mat-header-cell class="r-amount mat-header-cell" *matHeaderCellDef>
{{ 'labels.inputs.Installment Amount' | translate }}
</th>
<td mat-cell class="r-amount" *matCellDef="let item">
@if (!item.changed) {
<span>
{{ item.totalDueForPeriod | formatNumber }}
</span>
}
@if (item.changed) {
<span class="amount-changed">
<b>{{ item.totalDueForPeriod | formatNumber }}</b>
</span>
}
</td>
</ng-container>
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell class="center" *matCellDef="let item">
@if (item.period && item.period + 1 < repaymentScheduleDetails?.periods?.length) {
<span>
<ng-container>
<button
type="button"
color="primary"
mat-icon-button
matTooltip="{{ 'tooltips.Edit' | translate }}"
matTooltipPosition="above"
(click)="editInstallment(item)"
>
<fa-icon icon="edit" size="lg"></fa-icon>
</button>
<button
type="button"
color="warn"
mat-icon-button
matTooltip="{{ 'tooltips.Delete' | translate }}"
matTooltipPosition="above"
(click)="startEdit(item.period)"
>
<fa-icon icon="trash" size="lg"></fa-icon>
</button>
</ng-container>
</span>
}
</td>
<td mat-footer-cell *matFooterCellDef></td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumnsEdit"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumnsEdit"></tr>
</table>
}
</div>
@@ -80,6 +80,11 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class RepaymentScheduleTabComponent implements OnInit, OnChanges {
private route = inject(ActivatedRoute);
private settingsService = inject(SettingsService);
private dateUtils = inject(Dates);
private dialog = inject(MatDialog);
/** Currency Code */
@Input() currencyCode: string;
/** Loan Repayment Schedule to be Edited */
@@ -139,12 +144,7 @@ export class RepaymentScheduleTabComponent implements OnInit, OnChanges {
* Retrieves the loans with associations data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(
private route: ActivatedRoute,
private settingsService: SettingsService,
private dateUtils: Dates,
private dialog: MatDialog
) {
constructor() {
this.businessDate = this.settingsService.businessDate;
}
@@ -297,7 +297,6 @@ export class RepaymentScheduleTabComponent implements OnInit, OnChanges {
type: 'number',
required: true
})
];
const data = {
@@ -41,28 +41,30 @@
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let item">
<span *ngIf="item.statusEnum.pendingApproval">
<button
class="action-button"
mat-raised-button
color="warn"
matTooltip="{{ 'tooltips.Reject Reschedule' | translate }}"
matTooltipPosition="left"
(click)="manageRequest(item, 'Reject')"
>
<fa-icon icon="trash"></fa-icon>
</button>
<button
class="action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.Approve Reschedule' | translate }}"
matTooltipPosition="right"
(click)="manageRequest(item, 'Approve')"
>
<fa-icon icon="check"></fa-icon>
</button>
</span>
@if (item.statusEnum.pendingApproval) {
<span>
<button
class="action-button"
mat-raised-button
color="warn"
matTooltip="{{ 'tooltips.Reject Reschedule' | translate }}"
matTooltipPosition="left"
(click)="manageRequest(item, 'Reject')"
>
<fa-icon icon="trash"></fa-icon>
</button>
<button
class="action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.Approve Reschedule' | translate }}"
matTooltipPosition="right"
(click)="manageRequest(item, 'Approve')"
>
<fa-icon icon="check"></fa-icon>
</button>
</span>
}
</td>
</ng-container>
@@ -1,4 +1,4 @@
import { Component, Input } from '@angular/core';
import { Component, Input, inject } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
@@ -19,7 +19,7 @@ import {
MatRowDef,
MatRow
} from '@angular/material/table';
import { NgClass, NgIf } from '@angular/common';
import { NgClass } from '@angular/common';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { MatTooltip } from '@angular/material/tooltip';
import { StatusLookupPipe } from '../../../pipes/status-lookup.pipe';
@@ -50,6 +50,14 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class RescheduleLoanTabComponent {
private route = inject(ActivatedRoute);
private router = inject(Router);
private loansServices = inject(LoansService);
private settingsService = inject(SettingsService);
private dateUtils = inject(Dates);
private translateService = inject(TranslateService);
private dialog = inject(MatDialog);
@Input() loanStatus: LoanStatus;
loanRescheduleData: any;
@@ -62,15 +70,7 @@ export class RescheduleLoanTabComponent {
];
clientId: any;
constructor(
private route: ActivatedRoute,
private router: Router,
private loansServices: LoansService,
private settingsService: SettingsService,
private dateUtils: Dates,
private translateService: TranslateService,
private dialog: MatDialog
) {
constructor() {
this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId');
this.route.parent.data.subscribe((data: { loanRescheduleData: any }) => {
this.loanRescheduleData = data.loanRescheduleData;
@@ -22,12 +22,14 @@
<ng-container matColumnDef="beneficiary">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Beneficiary' | translate }}</th>
<td mat-cell *matCellDef="let instruction">
<span *ngIf="instruction.fromClient.id !== instruction.toClient.id">
{{ instruction.toClient.displayName }}
</span>
<span *ngIf="instruction.fromClient.id === instruction.toClient.id">{{
'labels.inputs.Own Account' | translate
}}</span>
@if (instruction.fromClient.id !== instruction.toClient.id) {
<span>
{{ instruction.toClient.displayName }}
</span>
}
@if (instruction.fromClient.id === instruction.toClient.id) {
<span>{{ 'labels.inputs.Own Account' | translate }}</span>
}
</td>
</ng-container>
@@ -53,29 +55,33 @@
<ng-container matColumnDef="actions">
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
<td mat-cell *matCellDef="let instruction">
<span *ngIf="instruction.status.value !== 'Deleted'">
<button
class="account-action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.Edit Standing Instruction' | translate }}"
*mifosxHasPermission="'UPDATE_STANDINGINSTRUCTION'"
>
<i class="fa fa-edit"></i>
</button>
</span>
<span *ngIf="instruction.status.value !== 'Deleted'">
<button
class="account-action-button"
mat-raised-button
color="warn"
matTooltip="{{ 'tooltips.Delete Standing Instruction' | translate }}"
*mifosxHasPermission="'DELETE_STANDINGINSTRUCTION'"
(click)="deleteStandingInstruction(instruction.id)"
>
<i class="fa fa-times"></i>
</button>
</span>
@if (instruction.status.value !== 'Deleted') {
<span>
<button
class="account-action-button"
mat-raised-button
color="primary"
matTooltip="{{ 'tooltips.Edit Standing Instruction' | translate }}"
*mifosxHasPermission="'UPDATE_STANDINGINSTRUCTION'"
>
<i class="fa fa-edit"></i>
</button>
</span>
}
@if (instruction.status.value !== 'Deleted') {
<span>
<button
class="account-action-button"
mat-raised-button
color="warn"
matTooltip="{{ 'tooltips.Delete Standing Instruction' | translate }}"
*mifosxHasPermission="'DELETE_STANDINGINSTRUCTION'"
(click)="deleteStandingInstruction(instruction.id)"
>
<i class="fa fa-times"></i>
</button>
</span>
}
<button
class="account-action-button"
mat-raised-button
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import {
MatTableDataSource,
@@ -51,6 +51,12 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class StandingInstructionsTabComponent implements OnInit {
private route = inject(ActivatedRoute);
private loansService = inject(LoansService);
private dialog = inject(MatDialog);
private accountTransfersService = inject(AccountTransfersService);
private settingsService = inject(SettingsService);
/** Loans Data */
loanDetailsData: any;
/** Instructions Data */
@@ -76,13 +82,7 @@ export class StandingInstructionsTabComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {SettingsService} settingsService Settings Service
*/
constructor(
private route: ActivatedRoute,
private loansService: LoansService,
private dialog: MatDialog,
private accountTransfersService: AccountTransfersService,
private settingsService: SettingsService
) {
constructor() {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetailsData = data.loanDetailsData;
});
@@ -1,15 +1,17 @@
<div class="container">
<div class="layout-row transaction-buttons align-end gap-20px" *ngIf="checkStatus()">
<mat-checkbox [formControl]="hideReversedParam" (click)="hideReversed()" class="accruals">
{{ 'labels.inputs.Hide Reversed' | translate }}</mat-checkbox
>
<mat-checkbox [formControl]="hideAccrualsParam" (click)="hideAccruals()" class="accruals">
{{ 'labels.inputs.Hide Accruals' | translate }}</mat-checkbox
>
<button mat-raised-button color="primary" class="transaction-button" [routerLink]="['export']">
{{ 'labels.buttons.Export' | translate }}
</button>
</div>
@if (checkStatus()) {
<div class="layout-row transaction-buttons align-end gap-20px">
<mat-checkbox [formControl]="hideReversedParam" (click)="hideReversed()" class="accruals">
{{ 'labels.inputs.Hide Reversed' | translate }}</mat-checkbox
>
<mat-checkbox [formControl]="hideAccrualsParam" (click)="hideAccruals()" class="accruals">
{{ 'labels.inputs.Hide Accruals' | translate }}</mat-checkbox
>
<button mat-raised-button color="primary" class="transaction-button" [routerLink]="['export']">
{{ 'labels.buttons.Export' | translate }}
</button>
</div>
}
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="row">
@@ -143,93 +145,105 @@
<ng-container matColumnDef="actions">
<td mat-cell *matCellDef="let transaction" class="center">
<button
mat-icon-button
[matMenuTriggerFor]="transactionMenu"
aria-label=""
class="action-button"
*ngIf="displaySubMenu(transaction)"
>
<mat-icon>more_vert</mat-icon>
</button>
@if (displaySubMenu(transaction)) {
<button mat-icon-button [matMenuTriggerFor]="transactionMenu" aria-label="" class="action-button">
<mat-icon>more_vert</mat-icon>
</button>
}
<mat-menu #transactionMenu="matMenu">
<span *ngIf="showTransaction(transaction)">
<button mat-menu-item (click)="showTransactions(transaction)">
<mat-icon><fa-icon icon="eye" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.text.View Transaction' | translate }}</span>
</button>
</span>
<span *ngIf="canCreateInterestRefund(transaction)">
<button mat-menu-item (click)="openInterestRefundDialog(transaction)">
<mat-icon><fa-icon icon="plus" size="sm"></fa-icon></mat-icon>
<span>{{ 'tooltips.Create Interest Refund' | translate }}</span>
</button>
</span>
<span *ngIf="allowUndoTransaction(transaction)">
<button mat-menu-item *mifosxHasPermission="'ADJUST_LOAN'" (click)="undoTransaction(transaction, $event)">
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
<span>{{ 'tooltips.Undo Transaction' | translate }}</span>
</button>
<button
mat-menu-item
class="account-action-button"
(click)="routeEdit($event)"
[routerLink]="[transaction.id, 'reciept']"
>
<mat-icon><fa-icon icon="receipt" size="sm"></fa-icon></mat-icon>
<span>{{ 'tooltips.View Receipts' | translate }}</span>
</button>
</span>
<span *ngIf="isReAge(transaction.type) && !transaction.manuallyReversed">
<button
mat-menu-item
*mifosxHasPermission="'UNDO_REAGE_LOAN'"
(click)="undoReAgeOrReAmortize(transaction, $event)"
>
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.menus.Undo Re-Age' | translate }}</span>
</button>
</span>
<span *ngIf="isReAmortize(transaction.type) && !transaction.manuallyReversed">
<button
mat-menu-item
*mifosxHasPermission="'UNDO_REAMORTIZE_LOAN'"
(click)="undoReAgeOrReAmortize(transaction, $event)"
>
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.menus.Undo Re-Amortize' | translate }}</span>
</button>
</span>
<span *ngIf="isCapitalizedIncome(transaction.type) && !transaction.manuallyReversed">
<button
mat-menu-item
*mifosxHasPermission="'CAPITALIZEDINCOME_LOAN'"
(click)="capitalizedIncomeAdjustmentTransaction(transaction, $event)"
>
<mat-icon><fa-icon icon="coins" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.menus.Capitalized Income Adjustment' | translate }}</span>
</button>
</span>
<span *ngIf="isBuyDownFee(transaction.type) && !transaction.manuallyReversed">
<button
mat-menu-item
*mifosxHasPermission="'BUYDOWNFEE_LOAN'"
(click)="buyDownFeeAdjustmentTransaction(transaction, $event)"
>
<mat-icon><fa-icon icon="coins" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.menus.Buy Down Fee Adjustment' | translate }}</span>
</button>
</span>
<span *ngIf="viewJournalEntry(transaction.type)">
<button
mat-menu-item
(click)="routeEdit($event)"
[routerLink]="['/', 'journal-entry', 'view', 'L' + transaction.id]"
>
<mat-icon><fa-icon icon="table-cells" size="sm"></fa-icon></mat-icon>
<span>{{ 'tooltips.View Journal Entries' | translate }}</span>
</button>
</span>
@if (showTransaction(transaction)) {
<span>
<button mat-menu-item (click)="showTransactions(transaction)">
<mat-icon><fa-icon icon="eye" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.text.View Transaction' | translate }}</span>
</button>
</span>
}
@if (canCreateInterestRefund(transaction)) {
<span>
<button mat-menu-item (click)="openInterestRefundDialog(transaction)">
<mat-icon><fa-icon icon="plus" size="sm"></fa-icon></mat-icon>
<span>{{ 'tooltips.Create Interest Refund' | translate }}</span>
</button>
</span>
}
@if (allowUndoTransaction(transaction)) {
<span>
<button mat-menu-item *mifosxHasPermission="'ADJUST_LOAN'" (click)="undoTransaction(transaction, $event)">
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
<span>{{ 'tooltips.Undo Transaction' | translate }}</span>
</button>
<button
mat-menu-item
class="account-action-button"
(click)="routeEdit($event)"
[routerLink]="[transaction.id, 'reciept']"
>
<mat-icon><fa-icon icon="receipt" size="sm"></fa-icon></mat-icon>
<span>{{ 'tooltips.View Receipts' | translate }}</span>
</button>
</span>
}
@if (isReAge(transaction.type) && !transaction.manuallyReversed) {
<span>
<button
mat-menu-item
*mifosxHasPermission="'UNDO_REAGE_LOAN'"
(click)="undoReAgeOrReAmortize(transaction, $event)"
>
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.menus.Undo Re-Age' | translate }}</span>
</button>
</span>
}
@if (isReAmortize(transaction.type) && !transaction.manuallyReversed) {
<span>
<button
mat-menu-item
*mifosxHasPermission="'UNDO_REAMORTIZE_LOAN'"
(click)="undoReAgeOrReAmortize(transaction, $event)"
>
<mat-icon><fa-icon icon="undo" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.menus.Undo Re-Amortize' | translate }}</span>
</button>
</span>
}
@if (isCapitalizedIncome(transaction.type) && !transaction.manuallyReversed) {
<span>
<button
mat-menu-item
*mifosxHasPermission="'CAPITALIZEDINCOME_LOAN'"
(click)="capitalizedIncomeAdjustmentTransaction(transaction, $event)"
>
<mat-icon><fa-icon icon="coins" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.menus.Capitalized Income Adjustment' | translate }}</span>
</button>
</span>
}
@if (isBuyDownFee(transaction.type) && !transaction.manuallyReversed) {
<span>
<button
mat-menu-item
*mifosxHasPermission="'BUYDOWNFEE_LOAN'"
(click)="buyDownFeeAdjustmentTransaction(transaction, $event)"
>
<mat-icon><fa-icon icon="coins" size="sm"></fa-icon></mat-icon>
<span>{{ 'labels.menus.Buy Down Fee Adjustment' | translate }}</span>
</button>
</span>
}
@if (viewJournalEntry(transaction.type)) {
<span>
<button
mat-menu-item
(click)="routeEdit($event)"
[routerLink]="['/', 'journal-entry', 'view', 'L' + transaction.id]"
>
<mat-icon><fa-icon icon="table-cells" size="sm"></fa-icon></mat-icon>
<span>{{ 'tooltips.View Journal Entries' | translate }}</span>
</button>
</span>
}
</mat-menu>
</td>
</ng-container>
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, OnInit, ViewChild, inject } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { UntypedFormControl, Validators } from '@angular/forms';
import { MatPaginator } from '@angular/material/paginator';
@@ -72,6 +72,15 @@ import { STANDALONE_SHARED_IMPORTS } from 'app/standalone-shared.module';
]
})
export class TransactionsTabComponent implements OnInit {
private route = inject(ActivatedRoute);
private dateUtils = inject(Dates);
private router = inject(Router);
private dialog = inject(MatDialog);
private loansService = inject(LoansService);
private translateService = inject(TranslateService);
private settingsService = inject(SettingsService);
private alertService = inject(AlertService);
/** Loan Details Data */
transactionsData: LoanTransaction[] = [];
loanDetailsData: any;
@@ -127,16 +136,7 @@ export class TransactionsTabComponent implements OnInit {
* Retrieves the loans with associations data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(
private route: ActivatedRoute,
private dateUtils: Dates,
private router: Router,
private dialog: MatDialog,
private loansService: LoansService,
private translateService: TranslateService,
private settingsService: SettingsService,
private alertService: AlertService
) {
constructor() {
this.route.parent.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetailsData = data.loanDetailsData;
this.status = data.loanDetailsData.status.value;
@@ -520,7 +520,6 @@ export class TransactionsTabComponent implements OnInit {
required: false,
order: 4
})
];
const data = {
title: this.translateService.instant('labels.buttons.Create Interest Refund'),
@@ -595,10 +594,10 @@ export class TransactionsTabComponent implements OnInit {
max: transactionAmount,
validators: [
Validators.min(0.001),
Validators.max(transactionAmount)],
Validators.max(transactionAmount)
],
order: 2
})
];
const data = {
title: `Adjustment ${transaction.type.value} Transaction`,
@@ -671,10 +670,10 @@ export class TransactionsTabComponent implements OnInit {
max: transactionAmount,
validators: [
Validators.min(0.001),
Validators.max(transactionAmount)],
Validators.max(transactionAmount)
],
order: 2
})
];
const data = {
title: `Adjustment ${transaction.type.value} Transaction`,
@@ -14,10 +14,12 @@
/>
<mat-datepicker-toggle matSuffix [for]="dueDatePicker"></mat-datepicker-toggle>
<mat-datepicker #dueDatePicker></mat-datepicker>
<mat-error *ngIf="editTransactionForm.controls.transactionDate.hasError('required')">
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong> {{ 'labels.commons.required' | translate }} </strong>
</mat-error>
@if (editTransactionForm.controls.transactionDate.hasError('required')) {
<mat-error>
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
<strong> {{ 'labels.commons.required' | translate }} </strong>
</mat-error>
}
</mat-form-field>
<mifosx-input-amount
@@ -36,9 +38,11 @@
<mat-form-field>
<mat-label>{{ 'labels.inputs.Payment Type' | translate }}</mat-label>
<mat-select formControlName="paymentTypeId">
<mat-option *ngFor="let paymentType of paymentTypeOptions" [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
@for (paymentType of paymentTypeOptions; track paymentType) {
<mat-option [value]="paymentType.id">
{{ paymentType.name }}
</mat-option>
}
</mat-select>
</mat-form-field>
@@ -52,30 +56,40 @@
</span>
</div>
<mat-form-field *ngIf="editTransactionForm.controls['accountNumber']">
<mat-label>{{ 'labels.inputs.Account Number' | translate }}</mat-label>
<input type="number" formControlName="accountNumber" matInput />
</mat-form-field>
@if (editTransactionForm.controls['accountNumber']) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Account Number' | translate }}</mat-label>
<input type="number" formControlName="accountNumber" matInput />
</mat-form-field>
}
<mat-form-field *ngIf="editTransactionForm.controls['checkNumber']">
<mat-label>{{ 'labels.inputs.Cheque' | translate }}</mat-label>
<input type="number" formControlName="checkNumber" matInput />
</mat-form-field>
@if (editTransactionForm.controls['checkNumber']) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Cheque' | translate }}</mat-label>
<input type="number" formControlName="checkNumber" matInput />
</mat-form-field>
}
<mat-form-field *ngIf="editTransactionForm.controls['routingCode']">
<mat-label>{{ 'labels.inputs.Routing Code' | translate }}</mat-label>
<input formControlName="routingCode" matInput />
</mat-form-field>
@if (editTransactionForm.controls['routingCode']) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Routing Code' | translate }}</mat-label>
<input formControlName="routingCode" matInput />
</mat-form-field>
}
<mat-form-field *ngIf="editTransactionForm.controls['receiptNumber']">
<mat-label>{{ 'labels.inputs.Receipt Number' | translate }}</mat-label>
<input formControlName="receiptNumber" matInput />
</mat-form-field>
@if (editTransactionForm.controls['receiptNumber']) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Receipt Number' | translate }}</mat-label>
<input formControlName="receiptNumber" matInput />
</mat-form-field>
}
<mat-form-field *ngIf="editTransactionForm.controls['bankNumber']">
<mat-label>{{ 'labels.inputs.Bank' | translate }}</mat-label>
<input formControlName="bankNumber" matInput />
</mat-form-field>
@if (editTransactionForm.controls['bankNumber']) {
<mat-form-field>
<mat-label>{{ 'labels.inputs.Bank' | translate }}</mat-label>
<input formControlName="bankNumber" matInput />
</mat-form-field>
}
<mat-card-actions class="layout-row layout-xs-column layout-align-center gap-5px">
<button type="button" mat-raised-button [routerLink]="['../']">

Some files were not shown because too many files have changed in this diff Show More