feat: add loan action button (#874)

- add prepay loan action
- add repayment loan action

Fixes: #243
Fixes: #242
This commit is contained in:
Muskan Khedia
2020-06-13 17:54:26 +05:30
committed by GitHub
parent da609f0de4
commit 06fd5e793c
17 changed files with 504 additions and 32 deletions
@@ -0,0 +1,91 @@
<div class="container">
<form [formGroup]="repaymentLoanForm" (ngSubmit)="submit()">
<mat-card-content>
<div fxLayout="column">
<mat-form-field>
<mat-label>Transaction Date</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="repaymentLoanForm.controls.transactionDate.hasError('required')">
Transaction Date <strong>is required</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Transaction Amount</mat-label>
<input matInput required formControlName="transactionAmount">
<mat-error *ngIf="repaymentLoanForm.controls.transactionAmount.hasError('required')">
Transaction Amount <strong>is required</strong>
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>Payment Type</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>
<div fxFlexFill>
<span fxFlex="25%">Show Payment Details</span>
<span fxFlex="75%" class="expandCollapsebutton" (click)="toggleDisplay()">
<button mat-raised-button color="primary" *ngIf="showPaymentDetails">
<i class="fa fa-minus"></i>
</button>
<button mat-raised-button color="primary" *ngIf="!showPaymentDetails">
<i class="fa fa-plus"></i>
</button>
</span>
</div>
<ng-container *ngIf="showPaymentDetails">
<mat-form-field>
<mat-label> Account #</mat-label>
<input matInput formControlName="accountNumber">
</mat-form-field>
<mat-form-field>
<mat-label>Cheque #</mat-label>
<input matInput formControlName="chequeNumber">
</mat-form-field>
<mat-form-field>
<mat-label>Routing Code</mat-label>
<input matInput formControlName="routingCode">
</mat-form-field>
<mat-form-field>
<mat-label>Reciept #</mat-label>
<input matInput formControlName="receiptNumber">
</mat-form-field>
<mat-form-field>
<mat-label>Bank #</mat-label>
<input matInput formControlName="bankNumber">
</mat-form-field>
</ng-container>
<mat-form-field>
<mat-label>Note</mat-label>
<textarea matInput formControlName="note"></textarea>
</mat-form-field>
</div>
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
<button type="button" mat-raised-button [routerLink]="['../general']">Cancel</button>
<button mat-raised-button color="primary" [disabled]="!repaymentLoanForm.valid" *mifosxHasPermission="'REPAYMENT_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
</form>
</div>