227 lines
10 KiB
HTML
227 lines
10 KiB
HTML
<div class="container">
|
|
<div *ngIf="isLoading" class="loader-wrapper">
|
|
<div class="bottom triangle"></div>
|
|
<div class="top triangle"></div>
|
|
<div class="left triangle"></div>
|
|
<div class="right triangle"></div>
|
|
</div>
|
|
<mat-card *ngIf="!isLoading" class="transfer-card">
|
|
<mat-card-content>
|
|
<!-- Source Account Details Section -->
|
|
<div class="section-container">
|
|
<h3 class="section-title transfer-heading">{{ 'labels.heading.Transferring From Details' | translate }}</h3>
|
|
|
|
<mat-divider></mat-divider>
|
|
|
|
<div class="info-grid">
|
|
<div class="info-row">
|
|
<div class="info-label">{{ 'labels.inputs.Applicant' | translate }}</div>
|
|
<div class="info-value">{{ accountTransferTemplateData.fromClient.displayName }}</div>
|
|
</div>
|
|
|
|
<div class="info-row">
|
|
<div class="info-label">{{ 'labels.inputs.Office' | translate }}</div>
|
|
<div class="info-value">{{ accountTransferTemplateData.fromOffice.name }}</div>
|
|
</div>
|
|
|
|
<div class="info-row">
|
|
<div class="info-label">{{ 'labels.inputs.From Account' | translate }}</div>
|
|
<div class="info-value">
|
|
{{ accountTransferTemplateData.fromAccount.productName }} - #{{
|
|
accountTransferTemplateData.fromAccount.accountNo
|
|
}}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="info-row">
|
|
<div class="info-label">{{ 'labels.inputs.From Account Type' | translate }}</div>
|
|
<div class="info-value">{{ accountTransferTemplateData.fromAccountType.value }}</div>
|
|
</div>
|
|
|
|
<div class="info-row">
|
|
<div class="info-label">{{ 'labels.inputs.Currency' | translate }}</div>
|
|
<div class="info-value">{{ accountTransferTemplateData.currency.name }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Interbank Section -->
|
|
<div *ngIf="interbank" class="section-container">
|
|
<div class="interbank-section">
|
|
<h3 class="section-title transfer-heading">{{ 'labels.heading.Transferred To' | translate }}</h3>
|
|
<mat-form-field class="full-width">
|
|
<mat-label>{{ 'labels.inputs.Phone Number' | translate }}</mat-label>
|
|
<input
|
|
matInput
|
|
[disabled]="interbankTransferForm"
|
|
type="tel"
|
|
#input
|
|
[(ngModel)]="phoneAccount"
|
|
maxlength="10"
|
|
required
|
|
placeholder="Enter phone number"
|
|
title="Phone number"
|
|
/>
|
|
<mat-hint align="end">{{ phoneAccount.length || 0 }}/10</mat-hint>
|
|
</mat-form-field>
|
|
</div>
|
|
|
|
<mat-card-actions *ngIf="!interbankTransferForm" class="action-buttons">
|
|
<button type="button" mat-raised-button [routerLink]="['../..']" class="cancel-button">
|
|
{{ 'labels.buttons.Cancel' | translate }}
|
|
</button>
|
|
<button
|
|
mat-raised-button
|
|
color="primary"
|
|
[disabled]="phoneAccount.length !== 10"
|
|
(click)="searchAccountByNumber()"
|
|
*mifosxHasPermission="'CREATE_ACCOUNTTRANSFER'"
|
|
id="search-button"
|
|
class="primary-button"
|
|
>
|
|
{{ 'labels.buttons.Search' | translate }}
|
|
</button>
|
|
</mat-card-actions>
|
|
</div>
|
|
|
|
<mat-divider *ngIf="!interbank"></mat-divider>
|
|
|
|
<!-- Transfer Form Section -->
|
|
<form *ngIf="!interbank" [formGroup]="makeAccountTransferForm" class="transfer-form" (ngSubmit)="submit()">
|
|
<h3 class="section-title transfer-heading">{{ 'labels.heading.Transfer Details' | translate }}</h3>
|
|
|
|
<div class="form-grid">
|
|
<mat-form-field class="form-field" (click)="transferDatePicker.open()">
|
|
<mat-label>{{ 'labels.inputs.Transaction Date' | translate }}</mat-label>
|
|
<input
|
|
matInput
|
|
[min]="minDate"
|
|
[max]="maxDate"
|
|
[matDatepicker]="transferDatePicker"
|
|
required
|
|
formControlName="transferDate"
|
|
placeholder="Select date"
|
|
title="Transaction Date"
|
|
/>
|
|
<mat-datepicker-toggle matSuffix [for]="transferDatePicker"></mat-datepicker-toggle>
|
|
<mat-datepicker #transferDatePicker></mat-datepicker>
|
|
<mat-error *ngIf="makeAccountTransferForm.controls.transferDate.hasError('required')">
|
|
{{ 'labels.inputs.Transaction Date' | translate }} {{ 'labels.commons.is' | translate }}
|
|
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="form-field">
|
|
<mat-label>{{ 'labels.inputs.Office' | translate }}</mat-label>
|
|
<mat-select required formControlName="toOfficeId" (selectionChange)="changeEvent()">
|
|
<mat-option *ngFor="let toOfficeType of toOfficeTypeData" [value]="toOfficeType.id">
|
|
{{ toOfficeType.name }}
|
|
</mat-option>
|
|
</mat-select>
|
|
<mat-error *ngIf="makeAccountTransferForm.controls.toOfficeId.hasError('required')">
|
|
{{ 'labels.inputs.Office' | translate }} {{ 'labels.commons.is' | translate }}
|
|
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="form-field">
|
|
<mat-label>{{ 'labels.inputs.Client' | translate }}</mat-label>
|
|
<input
|
|
matInput
|
|
formControlName="toClientId"
|
|
[matAutocomplete]="clientsAutocomplete"
|
|
placeholder="Select or type client name"
|
|
title="Client name"
|
|
/>
|
|
<mat-error *ngIf="makeAccountTransferForm.controls.toClientId.hasError('required')">
|
|
{{ 'labels.inputs.Client' | translate }} {{ 'labels.commons.is' | translate }}
|
|
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-autocomplete autoActiveFirstOption #clientsAutocomplete="matAutocomplete" [displayWith]="displayClient">
|
|
<mat-option *ngFor="let client of clientsData" [value]="client">
|
|
{{ client.id }} - {{ client.displayName }}
|
|
</mat-option>
|
|
</mat-autocomplete>
|
|
|
|
<mat-form-field class="form-field">
|
|
<mat-label>{{ 'labels.inputs.Account Type' | translate }}</mat-label>
|
|
<mat-select required formControlName="toAccountType" (selectionChange)="changeEvent()">
|
|
<mat-option *ngFor="let toAccountType of toAccountTypeData" [value]="toAccountType.id">
|
|
{{ toAccountType.value }}
|
|
</mat-option>
|
|
</mat-select>
|
|
<mat-error *ngIf="makeAccountTransferForm.controls.toAccountType.hasError('required')">
|
|
{{ 'labels.inputs.Account Type' | translate }} {{ 'labels.commons.is' | translate }}
|
|
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="form-field">
|
|
<mat-label>{{ 'labels.inputs.Account' | translate }}</mat-label>
|
|
<mat-select required formControlName="toAccountId" (selectionChange)="changeEvent()">
|
|
<mat-option *ngFor="let toAccount of toAccountData" [value]="toAccount.id">
|
|
{{ toAccount.productName }} - {{ toAccount.accountNo }}
|
|
</mat-option>
|
|
</mat-select>
|
|
<mat-error *ngIf="makeAccountTransferForm.controls.toAccountId.hasError('required')">
|
|
{{ 'labels.inputs.Account' | translate }} {{ 'labels.commons.is' | translate }}
|
|
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="form-field">
|
|
<mat-label>{{ 'labels.inputs.Amount' | translate }}</mat-label>
|
|
<input
|
|
type="number"
|
|
matInput
|
|
required
|
|
formControlName="transferAmount"
|
|
placeholder="Enter amount"
|
|
title="Transfer amount"
|
|
/>
|
|
<mat-error *ngIf="makeAccountTransferForm.controls.transferAmount.hasError('required')">
|
|
{{ 'labels.inputs.Amount' | translate }} {{ 'labels.commons.is' | translate }}
|
|
<strong>{{ 'labels.commons.required' | translate }}</strong>
|
|
</mat-error>
|
|
<mat-error *ngIf="makeAccountTransferForm.get('transferAmount')?.hasError('amountExceedsBalance')">
|
|
<fa-icon icon="exclamation-triangle" size="md"></fa-icon>
|
|
{{ 'errors.validation.msg.savingsproduct.insufficient.balance' | translate: { balance } }}
|
|
</mat-error>
|
|
</mat-form-field>
|
|
|
|
<mat-form-field class="form-field description-field">
|
|
<mat-label>{{ 'labels.inputs.Description' | translate }}</mat-label>
|
|
<textarea
|
|
matInput
|
|
formControlName="transferDescription"
|
|
cdkTextareaAutosize
|
|
cdkAutosizeMinRows="2"
|
|
placeholder="Enter transfer description"
|
|
title="Transfer description"
|
|
></textarea>
|
|
<mat-error *ngIf="makeAccountTransferForm.controls.transferDescription.hasError('required')">
|
|
{{ 'labels.inputs.Transfer Description' | 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">
|
|
<button type="button" mat-raised-button [routerLink]="['../../transactions']">
|
|
{{ 'labels.buttons.Cancel' | translate }}
|
|
</button>
|
|
<button mat-raised-button color="primary" [disabled]="!makeAccountTransferForm.valid">
|
|
{{ 'labels.buttons.Submit' | translate }}
|
|
</button>
|
|
</mat-card-actions>
|
|
</form>
|
|
<mifosx-make-account-interbank-transfers
|
|
*ngIf="interbank && interbankTransferForm"
|
|
[makeAccountTransferForm]="makeAccountTransferForm"
|
|
[balance]="balance"
|
|
></mifosx-make-account-interbank-transfers>
|
|
</mat-card-content>
|
|
</mat-card>
|
|
</div>
|