+1
-1
@@ -56,7 +56,7 @@
|
||||
</span>
|
||||
<span *ngIf="instruction.status.value!=='Deleted'">
|
||||
<button class="account-action-button" mat-raised-button color="warn"
|
||||
matTooltip="Delete Standing Instruction" *mifosxHasPermission="'DELETE_STANDINGINSTRUCTION'">
|
||||
matTooltip="Delete Standing Instruction" *mifosxHasPermission="'DELETE_STANDINGINSTRUCTION'" (click)="deleteStandingInstruction(instruction.id)">
|
||||
<i class="fa fa-times"></i>
|
||||
</button>
|
||||
</span>
|
||||
|
||||
+20
-2
@@ -1,10 +1,14 @@
|
||||
/** Angular Imports */
|
||||
import { Component, OnInit, ViewChild } from '@angular/core';
|
||||
import { MatTableDataSource, MatTable } from '@angular/material';
|
||||
import { MatTableDataSource, MatTable, MatDialog } from '@angular/material';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
/** Custom Services */
|
||||
import { LoansService } from 'app/loans/loans.service';
|
||||
import { AccountTransfersService } from 'app/account-transfers/account-transfers.service';
|
||||
|
||||
/** Dialog Components */
|
||||
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
|
||||
|
||||
/**
|
||||
* Loans Standing Instructions Tab
|
||||
@@ -33,7 +37,9 @@ export class StandingInstructionsTabComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private loansService: LoansService) {
|
||||
private loansService: LoansService,
|
||||
private dialog: MatDialog,
|
||||
private accountTransfersService: AccountTransfersService) {
|
||||
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
|
||||
this.loanDetailsData = data.loanDetailsData;
|
||||
});
|
||||
@@ -59,4 +65,16 @@ export class StandingInstructionsTabComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
deleteStandingInstruction(instructionId: any) {
|
||||
const deleteStandingInstructionDialogRef = this.dialog.open(DeleteDialogComponent, {
|
||||
data: { deleteContext: `standing instruction id: ${instructionId}` }
|
||||
});
|
||||
deleteStandingInstructionDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
this.accountTransfersService.deleteStandingInstrucions(instructionId)
|
||||
.subscribe(() => { });
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user