@@ -18,5 +18,6 @@
|
||||
<mifosx-disburse [dataObject]="actionButtonData" *ngIf="actions.disburse"></mifosx-disburse>
|
||||
<mifosx-withdrawn-by-client *ngIf="actions.withdrawn_by_client"></mifosx-withdrawn-by-client>
|
||||
<mifosx-add-collateral [dataObject]="actionButtonData" *ngIf="actions.add_collateral"></mifosx-add-collateral>
|
||||
<mifosx-undo-disbursal *ngIf="actions.undo_disbursal"></mifosx-undo-disbursal>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
@@ -30,7 +30,8 @@ export class LoanAccountActionsComponent {
|
||||
view_guarantors: boolean,
|
||||
create_guarantor: boolean,
|
||||
disburse: boolean,
|
||||
withdrawn_by_client: boolean } = {
|
||||
withdrawn_by_client: boolean,
|
||||
undo_disbursal: boolean } = {
|
||||
close: false,
|
||||
undo_approval: false,
|
||||
write_off: false,
|
||||
@@ -48,8 +49,8 @@ export class LoanAccountActionsComponent {
|
||||
view_guarantors: false,
|
||||
create_guarantor: false,
|
||||
disburse: false,
|
||||
withdrawn_by_client: false };
|
||||
|
||||
withdrawn_by_client: false,
|
||||
undo_disbursal: false };
|
||||
actionButtonData: any;
|
||||
actionName: any;
|
||||
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
<div class="container">
|
||||
|
||||
<mat-card-content>
|
||||
|
||||
<mat-form-field fxLayoutAlign="center">
|
||||
<mat-label>Note</mat-label>
|
||||
<textarea matInput [formControl]="note"></textarea>
|
||||
</mat-form-field>
|
||||
|
||||
<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" (click)="submit()" *mifosxHasPermission="'DISBURSALUNDO_LOAN'">Submit</button>
|
||||
</mat-card-actions>
|
||||
|
||||
</mat-card-content>
|
||||
|
||||
</div>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { UndoDisbursalComponent } from './undo-disbursal.component';
|
||||
|
||||
describe('UndoDisbursalComponent', () => {
|
||||
let component: UndoDisbursalComponent;
|
||||
let fixture: ComponentFixture<UndoDisbursalComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ UndoDisbursalComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(UndoDisbursalComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormControl, FormBuilder } from '@angular/forms';
|
||||
import { Router, ActivatedRoute } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from '../../../loans.service';
|
||||
|
||||
/**
|
||||
* Undo Disbursal component.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'mifosx-undo-disbursal',
|
||||
templateUrl: './undo-disbursal.component.html',
|
||||
styleUrls: ['./undo-disbursal.component.scss']
|
||||
})
|
||||
export class UndoDisbursalComponent implements OnInit {
|
||||
|
||||
/** Loan ID. */
|
||||
loanId: any;
|
||||
/** Undo disbursal form. */
|
||||
note: FormControl;
|
||||
|
||||
/**
|
||||
* @param {FormBuilder} formBuilder Form Builder.
|
||||
* @param {LoansService} loansService Loans Service.
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(private formBuilder: FormBuilder,
|
||||
private loansService: LoansService,
|
||||
private router: Router,
|
||||
private route: ActivatedRoute) {
|
||||
this.loanId = this.route.parent.snapshot.params['loanId'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the undo disbursal form.
|
||||
*/
|
||||
ngOnInit() {
|
||||
this.note = this.formBuilder.control('');
|
||||
}
|
||||
|
||||
/**
|
||||
* Submits the undo disbursal form.
|
||||
*/
|
||||
submit() {
|
||||
this.loansService.loanActionButtons(this.loanId, 'undoDisbursal', {'note': this.note.value}).subscribe((response: any) => {
|
||||
this.router.navigate(['../general'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@@ -48,6 +48,7 @@ import { DisburseLoanAccountComponent } from './loans-view/loan-account-actions/
|
||||
import { DisburseComponent } from './loans-view/loan-account-actions/disburse/disburse.component';
|
||||
import { RejectLoanComponent } from './loans-view/loan-account-actions/reject-loan/reject-loan.component';
|
||||
import { WithdrawnByClientComponent } from './loans-view/loan-account-actions/withdrawn-by-client/withdrawn-by-client.component';
|
||||
import { UndoDisbursalComponent } from './loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component';
|
||||
|
||||
/** Dialog Components */
|
||||
import { LoansAccountViewGuarantorDetailsDialogComponent } from './custom-dialog/loans-account-view-guarantor-details-dialog/loans-account-view-guarantor-details-dialog.component';
|
||||
@@ -105,7 +106,8 @@ import { AddCollateralComponent } from './loans-view/loan-account-actions/add-co
|
||||
RejectLoanComponent,
|
||||
DisburseComponent,
|
||||
WithdrawnByClientComponent,
|
||||
AddCollateralComponent
|
||||
AddCollateralComponent,
|
||||
UndoDisbursalComponent,
|
||||
],
|
||||
entryComponents: [
|
||||
LoansAccountAddCollateralDialogComponent,
|
||||
|
||||
Reference in New Issue
Block a user