+32
@@ -0,0 +1,32 @@
|
|||||||
|
<div class="container">
|
||||||
|
|
||||||
|
<mat-card>
|
||||||
|
|
||||||
|
<form [formGroup]="acceptClientTransferForm" (ngSubmit)="submit()">
|
||||||
|
|
||||||
|
<mat-card-content fxLayout="column">
|
||||||
|
|
||||||
|
<mat-form-field>
|
||||||
|
<mat-label>Transfer Date</mat-label>
|
||||||
|
<input matInput [matDatepicker]="transferDatePicker" required formControlName="transferDate">
|
||||||
|
<mat-datepicker-toggle matSuffix [for]="transferDatePicker"></mat-datepicker-toggle>
|
||||||
|
<mat-datepicker #transferDatePicker></mat-datepicker>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field fxFlex>
|
||||||
|
<mat-label>Note</mat-label>
|
||||||
|
<textarea matInput formControlName="note"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
</mat-card-content>
|
||||||
|
|
||||||
|
<mat-card-actions fxLayout="row" fxLayout.xs="column" fxLayoutAlign="center" fxLayoutGap="5px">
|
||||||
|
<button type="button" mat-raised-button [routerLink]="['../../']">Cancel</button>
|
||||||
|
<button mat-raised-button color="primary" [disabled]="!acceptClientTransferForm.valid">Confirm</button>
|
||||||
|
</mat-card-actions>
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</mat-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
+3
@@ -0,0 +1,3 @@
|
|||||||
|
.container {
|
||||||
|
max-width: 37rem;
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||||
|
|
||||||
|
import { AcceptClientTransferComponent } from './accept-client-transfer.component';
|
||||||
|
|
||||||
|
describe('AcceptClientTransferComponent', () => {
|
||||||
|
let component: AcceptClientTransferComponent;
|
||||||
|
let fixture: ComponentFixture<AcceptClientTransferComponent>;
|
||||||
|
|
||||||
|
beforeEach(async(() => {
|
||||||
|
TestBed.configureTestingModule({
|
||||||
|
declarations: [ AcceptClientTransferComponent ]
|
||||||
|
})
|
||||||
|
.compileComponents();
|
||||||
|
}));
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
fixture = TestBed.createComponent(AcceptClientTransferComponent);
|
||||||
|
component = fixture.componentInstance;
|
||||||
|
fixture.detectChanges();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should create', () => {
|
||||||
|
expect(component).toBeTruthy();
|
||||||
|
});
|
||||||
|
});
|
||||||
+72
@@ -0,0 +1,72 @@
|
|||||||
|
/** Angular Imports */
|
||||||
|
import { Component, OnInit } from '@angular/core';
|
||||||
|
import { FormGroup, FormBuilder } from '@angular/forms';
|
||||||
|
import { ActivatedRoute, Router } from '@angular/router';
|
||||||
|
|
||||||
|
/** Custom Services */
|
||||||
|
import { ClientsService } from 'app/clients/clients.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accept Client Transfer Component
|
||||||
|
*/
|
||||||
|
@Component({
|
||||||
|
selector: 'mifosx-accept-client-transfer',
|
||||||
|
templateUrl: './accept-client-transfer.component.html',
|
||||||
|
styleUrls: ['./accept-client-transfer.component.scss']
|
||||||
|
})
|
||||||
|
export class AcceptClientTransferComponent implements OnInit {
|
||||||
|
|
||||||
|
/** Accept Client Transfer form. */
|
||||||
|
acceptClientTransferForm: FormGroup;
|
||||||
|
/** Client Id */
|
||||||
|
clientId: any;
|
||||||
|
/** Transfer Date */
|
||||||
|
transferDate: any;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param {FormBuilder} formBuilder Form Builder
|
||||||
|
* @param {ClientsService} clientsService Clients Service
|
||||||
|
* @param {ActivatedRoute} route Activated Route
|
||||||
|
* @param {Router} router Router
|
||||||
|
*/
|
||||||
|
constructor(private formBuilder: FormBuilder,
|
||||||
|
private clientsService: ClientsService,
|
||||||
|
private route: ActivatedRoute,
|
||||||
|
private router: Router) {
|
||||||
|
this.route.data.subscribe((data: { clientActionData: any }) => {
|
||||||
|
this.transferDate = data.clientActionData;
|
||||||
|
});
|
||||||
|
this.clientId = this.route.parent.snapshot.params['clientId'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the accept-approval savings form.
|
||||||
|
*/
|
||||||
|
ngOnInit() {
|
||||||
|
this.createAcceptClientTransferForm();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates the accept-approval savings account form.
|
||||||
|
*/
|
||||||
|
createAcceptClientTransferForm() {
|
||||||
|
this.acceptClientTransferForm = this.formBuilder.group({
|
||||||
|
'transferDate': {value: new Date(this.transferDate), disabled: true},
|
||||||
|
'note': ['']
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Submits the form and accept the transfer of client
|
||||||
|
* if successful redirects to the client.
|
||||||
|
*/
|
||||||
|
submit() {
|
||||||
|
const data = {
|
||||||
|
...this.acceptClientTransferForm.value,
|
||||||
|
};
|
||||||
|
this.clientsService.executeClientCommand(this.clientId, 'acceptTransfer', data).subscribe(() => {
|
||||||
|
this.router.navigate(['../../'], { relativeTo: this.route });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -8,3 +8,4 @@
|
|||||||
<mifosx-transfer-client *ngIf="actions['Transfer Client']"></mifosx-transfer-client>
|
<mifosx-transfer-client *ngIf="actions['Transfer Client']"></mifosx-transfer-client>
|
||||||
<mifosx-undo-client-transfer *ngIf="actions['Undo Transfer']"></mifosx-undo-client-transfer>
|
<mifosx-undo-client-transfer *ngIf="actions['Undo Transfer']"></mifosx-undo-client-transfer>
|
||||||
<mifosx-reject-client-transfer *ngIf="actions['Reject Transfer']"></mifosx-reject-client-transfer>
|
<mifosx-reject-client-transfer *ngIf="actions['Reject Transfer']"></mifosx-reject-client-transfer>
|
||||||
|
<mifosx-accept-client-transfer *ngIf="actions['Accept Transfer']"></mifosx-accept-client-transfer>
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ import { UpdateClientSavingsAccountComponent } from './clients-view/client-actio
|
|||||||
import { TransferClientComponent } from './clients-view/client-actions/transfer-client/transfer-client.component';
|
import { TransferClientComponent } from './clients-view/client-actions/transfer-client/transfer-client.component';
|
||||||
import { UndoClientTransferComponent } from './clients-view/client-actions/undo-client-transfer/undo-client-transfer.component';
|
import { UndoClientTransferComponent } from './clients-view/client-actions/undo-client-transfer/undo-client-transfer.component';
|
||||||
import { RejectClientTransferComponent } from './clients-view/client-actions/reject-client-transfer/reject-client-transfer.component';
|
import { RejectClientTransferComponent } from './clients-view/client-actions/reject-client-transfer/reject-client-transfer.component';
|
||||||
|
import { AcceptClientTransferComponent } from './clients-view/client-actions/accept-client-transfer/accept-client-transfer.component';
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -81,7 +82,8 @@ import { RejectClientTransferComponent } from './clients-view/client-actions/rej
|
|||||||
UpdateClientSavingsAccountComponent,
|
UpdateClientSavingsAccountComponent,
|
||||||
TransferClientComponent,
|
TransferClientComponent,
|
||||||
UndoClientTransferComponent,
|
UndoClientTransferComponent,
|
||||||
RejectClientTransferComponent
|
RejectClientTransferComponent,
|
||||||
|
AcceptClientTransferComponent
|
||||||
],
|
],
|
||||||
entryComponents: [
|
entryComponents: [
|
||||||
UploadDocumentDialogComponent,
|
UploadDocumentDialogComponent,
|
||||||
|
|||||||
Reference in New Issue
Block a user