/** Angular Imports */ import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute , Router } from '@angular/router' ; import { DatePipe } from '@angular/common' ; import { ClientsService } from 'app/clients/clients.service' ; /**
 * View Charge component.
 */ @ Component ( { selector : 'mifosx-view-charge' , templateUrl : './view-charge.component.html' , styleUrls : [ './view-charge.component.scss' ] } ) export class ViewChargeComponent implements OnInit { /** Charge Data. */ chargeData : any ; /** Mat Table Column defs. */ viewChargeTableColumns : string [ ] = [ 'id' , 'officeName' , 'type' , 'transactionDate' , 'amount' , 'actions' ] ; param { ActivatedRoute } route param { Router } router constructor ( private route , private router , private date , private clientService ) { this . route . data . subscribe ( ( data ) => { this . chargeData = data . clientChargeData ; } ) ; } ngOnInit ( ) { } /**
     * Waive Charge.
     */ waiveCharge ( ) { const waiveChargeObj = { clientId : this . chargeData . clientId , resourceType : this . chargeData . id } ; this . clientService . waiveClientCharge ( waiveChargeObj ) . subscribe ( ( ) => { this . getChargeData ( ) ; } ) ; } /**
     * Undo Transaction.
     */ undoTransaction ( transactionId ) { const transactionData = { clientId : this . chargeData . clientId . toString ( ) , transactionId : transactionId } ; this . clientService . undoTransaction ( transactionData ) . subscribe ( ( ) => { this . getChargeData ( ) ; } ) ; } /**
     * Get Charge Data.
     */ getChargeData ( ) { this . clientService . getSelectedChargeData ( this . chargeData . clientId , this . chargeData . id ) . subscribe ( ( data ) => { this . chargeData = data ; } ) ; } /**
     * Delete Charge.
     */ deleteCharge ( ) { this . clientService . deleteCharge ( this . chargeData . clientId , this . chargeData . id ) . subscribe ( ( ) => { this . router . navigate ( [ '../../clients' , this . chargeData . clientId , 'general' ] ) ; } ) ; } }