diff --git a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html
index 7a9645149..f5be7af08 100644
--- a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html
+++ b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.html
@@ -18,5 +18,6 @@
+
diff --git a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts
index adc6df88e..66df0deeb 100644
--- a/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts
+++ b/src/app/loans/loans-view/loan-account-actions/loan-account-actions.component.ts
@@ -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;
diff --git a/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.html b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.html
new file mode 100644
index 000000000..7a66639d4
--- /dev/null
+++ b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.html
@@ -0,0 +1,17 @@
+
+
+
+
+
+ Note
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.scss b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.scss
new file mode 100644
index 000000000..e69de29bb
diff --git a/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.spec.ts b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.spec.ts
new file mode 100644
index 000000000..6a7777c5b
--- /dev/null
+++ b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.spec.ts
@@ -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;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ UndoDisbursalComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(UndoDisbursalComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.ts b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.ts
new file mode 100644
index 000000000..ee67a8597
--- /dev/null
+++ b/src/app/loans/loans-view/loan-account-actions/undo-disbursal/undo-disbursal.component.ts
@@ -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 });
+ });
+ }
+
+}
diff --git a/src/app/loans/loans.module.ts b/src/app/loans/loans.module.ts
index e01c21c7c..b906e17ea 100644
--- a/src/app/loans/loans.module.ts
+++ b/src/app/loans/loans.module.ts
@@ -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,