182 lines
8.9 KiB
HTML
182 lines
8.9 KiB
HTML
<!--
|
|
Copyright since 2025 Mifos Initiative
|
|
|
|
This Source Code Form is subject to the terms of the Mozilla Public
|
|
License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
-->
|
|
|
|
@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>
|
|
<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">
|
|
@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.heading.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>
|