feat: add loan button (close-as-rescheduled) (#876)

Fixes: #848
This commit is contained in:
Muskan Khedia
2020-06-26 00:27:46 +05:30
committed by GitHub
parent 1dffa27e82
commit c1aa7d800a
11 changed files with 153 additions and 6 deletions
@@ -25,7 +25,7 @@
<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]="!closeLoanForm.valid">Submit</button>
<button mat-raised-button color="primary" [disabled]="!closeLoanForm.valid" *mifosxHasPermission="'CLOSE_LOAN'">Submit</button>
</mat-card-actions>
</mat-card-content>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
import { Router, ActivatedRoute } from '@angular/router';
import { LoansService } from 'app/loans/loans.service';
@@ -12,6 +12,8 @@ import { DatePipe } from '@angular/common';
})
export class LoansAccountCloseComponent implements OnInit {
@Input() dataObject: any;
/** Close form. */
closeLoanForm: FormGroup;
/** Loan Id */
@@ -47,7 +49,7 @@ export class LoansAccountCloseComponent implements OnInit {
*/
createCloseForm() {
this.closeLoanForm = this.formBuilder.group({
'transactionDate': [new Date(), Validators.required],
'transactionDate': [new Date(this.dataObject.date) || new Date(), Validators.required],
'note': []
});
}