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:
@@ -4,60 +4,80 @@
|
||||
<mat-form-field class="flex-98">
|
||||
<mat-label>{{ 'labels.inputs.Branch Office' | translate }}</mat-label>
|
||||
<mat-select formControlName="officeId" required>
|
||||
<mat-option *ngFor="let office of officesData" [value]="office.id">
|
||||
{{ office.name }}
|
||||
</mat-option>
|
||||
@for (office of officesData; track office) {
|
||||
<mat-option [value]="office.id">
|
||||
{{ office.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
<mat-error *ngIf="collectionSheetForm.controls.officeId.hasError('required')">
|
||||
{{ 'labels.inputs.Branch Office' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
@if (collectionSheetForm.controls.officeId.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Branch Office' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-98" (click)="meetingDatePicker.open()" *ngIf="officeId !== null">
|
||||
<mat-label>{{ 'labels.inputs.Meeting Date' | translate }}</mat-label>
|
||||
<input
|
||||
matInput
|
||||
[min]="minDate"
|
||||
[max]="maxDate"
|
||||
[matDatepicker]="meetingDatePicker"
|
||||
required
|
||||
formControlName="meetingDate"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="meetingDatePicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #meetingDatePicker></mat-datepicker>
|
||||
<mat-error *ngIf="collectionSheetForm.controls.meetingDate.hasError('required')">
|
||||
{{ 'labels.inputs.Meeting Date' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
@if (officeId !== null) {
|
||||
<mat-form-field class="flex-98" (click)="meetingDatePicker.open()">
|
||||
<mat-label>{{ 'labels.inputs.Meeting Date' | translate }}</mat-label>
|
||||
<input
|
||||
matInput
|
||||
[min]="minDate"
|
||||
[max]="maxDate"
|
||||
[matDatepicker]="meetingDatePicker"
|
||||
required
|
||||
formControlName="meetingDate"
|
||||
/>
|
||||
<mat-datepicker-toggle matSuffix [for]="meetingDatePicker"></mat-datepicker-toggle>
|
||||
<mat-datepicker #meetingDatePicker></mat-datepicker>
|
||||
@if (collectionSheetForm.controls.meetingDate.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Meeting Date' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
}
|
||||
|
||||
<mat-form-field class="flex-98" *ngIf="officeId !== null">
|
||||
<mat-label>{{ 'labels.inputs.Staff' | translate }}</mat-label>
|
||||
<mat-select formControlName="staffId">
|
||||
<mat-option *ngFor="let loanOfficer of loanOfficerData" [value]="loanOfficer.id">
|
||||
{{ loanOfficer.displayName }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@if (officeId !== null) {
|
||||
<mat-form-field class="flex-98">
|
||||
<mat-label>{{ 'labels.inputs.Staff' | translate }}</mat-label>
|
||||
<mat-select formControlName="staffId">
|
||||
@for (loanOfficer of loanOfficerData; track loanOfficer) {
|
||||
<mat-option [value]="loanOfficer.id">
|
||||
{{ loanOfficer.displayName }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
}
|
||||
|
||||
<mat-form-field class="flex-98" *ngIf="officeId !== null">
|
||||
<mat-label>{{ 'labels.inputs.Group' | translate }}</mat-label>
|
||||
<mat-select formControlName="groupId">
|
||||
<mat-option *ngFor="let group of groupsData" [value]="group.id">
|
||||
{{ group.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@if (officeId !== null) {
|
||||
<mat-form-field class="flex-98">
|
||||
<mat-label>{{ 'labels.inputs.Group' | translate }}</mat-label>
|
||||
<mat-select formControlName="groupId">
|
||||
@for (group of groupsData; track group) {
|
||||
<mat-option [value]="group.id">
|
||||
{{ group.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
}
|
||||
|
||||
<mat-form-field class="flex-98" *ngIf="officeId !== null">
|
||||
<mat-label>{{ 'labels.inputs.Center' | translate }}</mat-label>
|
||||
<mat-select formControlName="centerId">
|
||||
<mat-option *ngFor="let center of centersData" [value]="center.id">
|
||||
{{ center.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
@if (officeId !== null) {
|
||||
<mat-form-field class="flex-98">
|
||||
<mat-label>{{ 'labels.inputs.Center' | translate }}</mat-label>
|
||||
<mat-select formControlName="centerId">
|
||||
@for (center of centersData; track center) {
|
||||
<mat-option [value]="center.id">
|
||||
{{ center.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
}
|
||||
</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 { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
|
||||
import { CollectionsService } from '../collections.service';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
@@ -22,6 +22,15 @@ import { CollectionSheetData, JLGGroupData, MeetingFallCenter } from '../models/
|
||||
]
|
||||
})
|
||||
export class CollectionSheetComponent implements OnInit {
|
||||
private formBuilder = inject(UntypedFormBuilder);
|
||||
private centerService = inject(CentersService);
|
||||
private collectionsService = inject(CollectionsService);
|
||||
private organizationService = inject(OrganizationService);
|
||||
private router = inject(Router);
|
||||
private route = inject(ActivatedRoute);
|
||||
private settingsService = inject(SettingsService);
|
||||
private dateUtils = inject(Dates);
|
||||
|
||||
/** Offices Data */
|
||||
officesData: any;
|
||||
/** Group Data */
|
||||
@@ -50,16 +59,7 @@ export class CollectionSheetComponent implements OnInit {
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private centerService: CentersService,
|
||||
private collectionsService: CollectionsService,
|
||||
private organizationService: OrganizationService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute,
|
||||
private settingsService: SettingsService,
|
||||
private dateUtils: Dates
|
||||
) {
|
||||
constructor() {
|
||||
this.route.data.subscribe((data: { officesData: any }) => {
|
||||
this.officesData = data.officesData;
|
||||
});
|
||||
|
||||
@@ -41,7 +41,6 @@ const routes: Routes = [
|
||||
]
|
||||
}
|
||||
])
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Angular Imports */
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Injectable, inject } from '@angular/core';
|
||||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
|
||||
/** rxjs Imports */
|
||||
@@ -12,7 +12,7 @@ import { Observable } from 'rxjs';
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class CollectionsService {
|
||||
constructor(private http: HttpClient) {}
|
||||
private http = inject(HttpClient);
|
||||
|
||||
/**
|
||||
* Retrieves the Collection Sheet Data
|
||||
|
||||
+166
-163
@@ -1,170 +1,173 @@
|
||||
<mat-card class="container" *ngIf="!isCollapsed">
|
||||
<div class="alert" *ngIf="noData">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.No repayments and disbursal' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form [formGroup]="collectionSheetForm" (ngSubmit)="previewCollectionSheet()">
|
||||
<div class="layout-row-wrap gap-2percent responsive-column align-start-center">
|
||||
<mat-form-field class="flex-98">
|
||||
<mat-label>{{ 'labels.inputs.Branch Office' | translate }}</mat-label>
|
||||
<mat-select formControlName="officeId" required>
|
||||
<mat-option *ngFor="let office of officesData" [value]="office.id">
|
||||
{{ office.name }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="collectionSheetForm.controls.officeId.hasError('required')">
|
||||
{{ 'labels.inputs.Branch Office' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-98" (click)="transactionDatePicker.open()">
|
||||
<mat-label>{{ 'labels.inputs.Repayment 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="collectionSheetForm.controls.transactionDate.hasError('required')">
|
||||
{{ 'labels.inputs.Repayment Date' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
||||
<mat-form-field class="flex-98">
|
||||
<mat-label>{{ 'labels.inputs.Staff' | translate }}</mat-label>
|
||||
<mat-select formControlName="staffId">
|
||||
<mat-option *ngFor="let loanOfficer of loanOfficerData" [value]="loanOfficer.id">
|
||||
{{ loanOfficer.displayName }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">{{ 'labels.buttons.Cancel' | translate }}</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!collectionSheetForm.valid">
|
||||
<fa-icon icon="search" class="m-r-10"></fa-icon> {{ 'labels.buttons.Collection Sheet' | translate }}
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</form>
|
||||
</mat-card>
|
||||
|
||||
<div class="showcollectionsheet">
|
||||
<div class="container" *ngIf="isCollapsed">
|
||||
<mat-card>
|
||||
<div class="m-b-20">
|
||||
<button mat-raised-button color="primary" (click)="isCollapsed = false">
|
||||
{{ 'labels.buttons.Parameters' | translate }}
|
||||
</button>
|
||||
@if (!isCollapsed) {
|
||||
<mat-card class="container">
|
||||
@if (noData) {
|
||||
<div class="alert">
|
||||
<div class="message">
|
||||
<i class="fa fa-exclamation-circle alert-check"></i>
|
||||
{{ 'labels.text.No repayments and disbursal' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
<form [formGroup]="collectionSheetForm" (ngSubmit)="previewCollectionSheet()">
|
||||
<div class="layout-row-wrap gap-2percent responsive-column align-start-center">
|
||||
<mat-form-field class="flex-98">
|
||||
<mat-label>{{ 'labels.inputs.Branch Office' | translate }}</mat-label>
|
||||
<mat-select formControlName="officeId" required>
|
||||
@for (office of officesData; track office) {
|
||||
<mat-option [value]="office.id">
|
||||
{{ office.name }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
@if (collectionSheetForm.controls.officeId.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Branch Office' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<mat-form-field class="flex-98" (click)="transactionDatePicker.open()">
|
||||
<mat-label>{{ 'labels.inputs.Repayment 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 (collectionSheetForm.controls.transactionDate.hasError('required')) {
|
||||
<mat-error>
|
||||
{{ 'labels.inputs.Repayment Date' | translate }} {{ 'labels.commons.is' | translate }}
|
||||
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
||||
</mat-error>
|
||||
}
|
||||
</mat-form-field>
|
||||
<mat-form-field class="flex-98">
|
||||
<mat-label>{{ 'labels.inputs.Staff' | translate }}</mat-label>
|
||||
<mat-select formControlName="staffId">
|
||||
@for (loanOfficer of loanOfficerData; track loanOfficer) {
|
||||
<mat-option [value]="loanOfficer.id">
|
||||
{{ loanOfficer.displayName }}
|
||||
</mat-option>
|
||||
}
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
</div>
|
||||
|
||||
<ng-container *ngIf="loansDataSource">
|
||||
<h2 class="mat-h2">{{ 'labels.heading.Due Collections' | translate }}</h2>
|
||||
|
||||
<table class="mat-elevation-z1" mat-table [dataSource]="loansDataSource" matSort>
|
||||
<ng-container matColumnDef="loanAccount">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Loan Account' | translate }} #</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.accountId }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="productName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Product Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.productShortName }}({{ loan.productId }})</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="clientName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Client Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.clientName }}({{ loan.clientId }})</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="totalDue">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Total Due' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.totalDue }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="charges">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Charges' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.feeDue }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan; let i = index">
|
||||
<button mat-raised-button color="primary" (click)="showAndStorePaymentDetails('loans/accounts', loan, i)">
|
||||
{{ 'labels.buttons.Add Payment' | translate }}
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="loansDisplayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: loansDisplayedColumns"></tr>
|
||||
</table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="savingsDataSource">
|
||||
<h2 class="mat-h2">{{ 'labels.inputs.Due Savings Collections' | translate }}</h2>
|
||||
|
||||
<table class="mat-elevation-z1" mat-table [dataSource]="savingsDataSource" matSort>
|
||||
<ng-container matColumnDef="depositAccount">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Deposit Account' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.depositAccountType }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="savingsAccountNo">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
||||
{{ 'labels.inputs.Savings Account' | translate }} #
|
||||
</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.accountId }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="productName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Product Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.productName }}({{ saving.productId }})</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="clientName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Client Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.clientName }}({{ saving.clientId }})</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="totalDue">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Total Due' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.dueAmount }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving; let j = index">
|
||||
<button mat-raised-button color="primary" (click)="showAndStorePaymentDetails('savings', saving, j)">
|
||||
{{ 'labels.buttons.Add Payment' | translate }}
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
<tr mat-header-row *matHeaderRowDef="savingsDisplayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: savingsDisplayedColumns"></tr>
|
||||
</table>
|
||||
|
||||
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
</ng-container>
|
||||
|
||||
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">
|
||||
{{ 'labels.buttons.Cancel' | translate }}
|
||||
</button>
|
||||
<button mat-raised-button color="primary" (click)="submit()">{{ 'labels.buttons.Submit' | translate }}</button>
|
||||
<button mat-raised-button color="primary" [disabled]="!collectionSheetForm.valid">
|
||||
<fa-icon icon="search" class="m-r-10"></fa-icon> {{ 'labels.buttons.Collection Sheet' | translate }}
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</div>
|
||||
</form>
|
||||
</mat-card>
|
||||
}
|
||||
|
||||
<div class="showcollectionsheet">
|
||||
@if (isCollapsed) {
|
||||
<div class="container">
|
||||
<mat-card>
|
||||
<div class="m-b-20">
|
||||
<button mat-raised-button color="primary" (click)="isCollapsed = false">
|
||||
{{ 'labels.buttons.Parameters' | translate }}
|
||||
</button>
|
||||
</div>
|
||||
@if (loansDataSource) {
|
||||
<h2 class="mat-h2">{{ 'labels.heading.Due Collections' | translate }}</h2>
|
||||
<table class="mat-elevation-z1" mat-table [dataSource]="loansDataSource" matSort>
|
||||
<ng-container matColumnDef="loanAccount">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
||||
{{ 'labels.inputs.Loan Account' | translate }} #
|
||||
</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.accountId }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="productName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Product Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.productShortName }}({{ loan.productId }})</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="clientName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Client Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.clientName }}({{ loan.clientId }})</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="totalDue">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Total Due' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.totalDue }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="charges">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Charges' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan">{{ loan.feeDue }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let loan; let i = index">
|
||||
<button
|
||||
mat-raised-button
|
||||
color="primary"
|
||||
(click)="showAndStorePaymentDetails('loans/accounts', loan, i)"
|
||||
>
|
||||
{{ 'labels.buttons.Add Payment' | translate }}
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
<tr mat-header-row *matHeaderRowDef="loansDisplayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: loansDisplayedColumns"></tr>
|
||||
</table>
|
||||
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
}
|
||||
@if (savingsDataSource) {
|
||||
<h2 class="mat-h2">{{ 'labels.inputs.Due Savings Collections' | translate }}</h2>
|
||||
<table class="mat-elevation-z1" mat-table [dataSource]="savingsDataSource" matSort>
|
||||
<ng-container matColumnDef="depositAccount">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
||||
{{ 'labels.inputs.Deposit Account' | translate }}
|
||||
</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.depositAccountType }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="savingsAccountNo">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>
|
||||
{{ 'labels.inputs.Savings Account' | translate }} #
|
||||
</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.accountId }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="productName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Product Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.productName }}({{ saving.productId }})</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="clientName">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Client Name' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.clientName }}({{ saving.clientId }})</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="totalDue">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Total Due' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving">{{ saving.dueAmount }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef mat-sort-header>{{ 'labels.inputs.Actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let saving; let j = index">
|
||||
<button mat-raised-button color="primary" (click)="showAndStorePaymentDetails('savings', saving, j)">
|
||||
{{ 'labels.buttons.Add Payment' | translate }}
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
<tr mat-header-row *matHeaderRowDef="savingsDisplayedColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: savingsDisplayedColumns"></tr>
|
||||
</table>
|
||||
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
|
||||
}
|
||||
<mat-card-actions class="layout-row align-center gap-5px responsive-column">
|
||||
<button type="button" mat-raised-button [routerLink]="['../']">
|
||||
{{ 'labels.buttons.Cancel' | translate }}
|
||||
</button>
|
||||
<button mat-raised-button color="primary" (click)="submit()">
|
||||
{{ 'labels.buttons.Submit' | translate }}
|
||||
</button>
|
||||
</mat-card-actions>
|
||||
</mat-card>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
||||
+11
-12
@@ -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 { MatPaginator } from '@angular/material/paginator';
|
||||
import { MatSort, MatSortHeader } from '@angular/material/sort';
|
||||
@@ -63,6 +63,15 @@ import { OrganizationService } from 'app/organization/organization.service';
|
||||
]
|
||||
})
|
||||
export class IndividualCollectionSheetComponent implements OnInit {
|
||||
private formBuilder = inject(UntypedFormBuilder);
|
||||
private collectionsService = inject(CollectionsService);
|
||||
private organizationService = inject(OrganizationService);
|
||||
private route = inject(ActivatedRoute);
|
||||
private dateUtils = inject(Dates);
|
||||
dialog = inject(MatDialog);
|
||||
private router = inject(Router);
|
||||
private settingsService = inject(SettingsService);
|
||||
|
||||
/** Offices Data */
|
||||
officesData: any;
|
||||
/** Loan Officer Data */
|
||||
@@ -134,16 +143,7 @@ export class IndividualCollectionSheetComponent implements OnInit {
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private collectionsService: CollectionsService,
|
||||
private organizationService: OrganizationService,
|
||||
private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
public dialog: MatDialog,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
constructor() {
|
||||
this.route.data.subscribe((data: { officesData: any }) => {
|
||||
this.officesData = data.officesData;
|
||||
});
|
||||
@@ -285,7 +285,6 @@ export class IndividualCollectionSheetComponent implements OnInit {
|
||||
type: 'number',
|
||||
required: false
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: `Payment for ${type === 'loans' ? 'Loan' : 'Saving'} Id ${type === 'loans' ? selectedData.loanId : selectedData.savingsId}`,
|
||||
|
||||
Reference in New Issue
Block a user