@@ -54,10 +54,10 @@
|
|||||||
<ng-container matColumnDef="Actions">
|
<ng-container matColumnDef="Actions">
|
||||||
<th mat-header-cell *matHeaderCellDef> Actions </th>
|
<th mat-header-cell *matHeaderCellDef> Actions </th>
|
||||||
<td mat-cell *matCellDef="let element">
|
<td mat-cell *matCellDef="let element">
|
||||||
<button class="account-action-button" mat-raised-button color="primary">
|
<button class="account-action-button" mat-raised-button color="primary" [routerLink]="['../','paycharge',element.id]">
|
||||||
<i class="fa fa-dollar"></i>
|
<i class="fa fa-dollar"></i>
|
||||||
</button>
|
</button>
|
||||||
<button class="account-action-button" mat-raised-button color="primary">
|
<button class="account-action-button" mat-raised-button color="primary" (click)="waiveCharge(element.id,element.clientId)">
|
||||||
<i class="fa fa-flag"></i>
|
<i class="fa fa-flag"></i>
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -3,14 +3,18 @@ import { Component, OnInit } from '@angular/core';
|
|||||||
import { Router, ActivatedRoute } from '@angular/router';
|
import { Router, ActivatedRoute } from '@angular/router';
|
||||||
import { DatePipe } from '@angular/common';
|
import { DatePipe } from '@angular/common';
|
||||||
|
|
||||||
|
/** Custom Services. */
|
||||||
|
import { ClientsService } from 'app/clients/clients.service';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* General Tab component.
|
||||||
|
*/
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'mifosx-general-tab',
|
selector: 'mifosx-general-tab',
|
||||||
templateUrl: './general-tab.component.html',
|
templateUrl: './general-tab.component.html',
|
||||||
styleUrls: ['./general-tab.component.scss']
|
styleUrls: ['./general-tab.component.scss']
|
||||||
})
|
})
|
||||||
export class GeneralTabComponent implements OnInit {
|
export class GeneralTabComponent {
|
||||||
openLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Actions'];
|
openLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Actions'];
|
||||||
closedLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Closed Date'];
|
closedLoansColumns: string[] = ['Account No', 'Loan Account', 'Original Loan', 'Loan Balance', 'Amount Paid', 'Type', 'Closed Date'];
|
||||||
openSavingsColumns: string[] = ['Account No', 'Saving Account', 'Last Active', 'Balance', 'Actions'];
|
openSavingsColumns: string[] = ['Account No', 'Saving Account', 'Last Active', 'Balance', 'Actions'];
|
||||||
@@ -30,8 +34,7 @@ export class GeneralTabComponent implements OnInit {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private route: ActivatedRoute,
|
private route: ActivatedRoute,
|
||||||
private router: Router,
|
private clientService: ClientsService
|
||||||
private datePipe: DatePipe,
|
|
||||||
) {
|
) {
|
||||||
this.route.data.subscribe((data: { clientAccountsData: any, clientChargesData: any, clientSummary: any }) => {
|
this.route.data.subscribe((data: { clientAccountsData: any, clientChargesData: any, clientSummary: any }) => {
|
||||||
this.clientAccountData = data.clientAccountsData;
|
this.clientAccountData = data.clientAccountsData;
|
||||||
@@ -43,9 +46,6 @@ export class GeneralTabComponent implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleLoanAccountsOverview() {
|
toggleLoanAccountsOverview() {
|
||||||
this.showClosedLoanAccounts = !this.showClosedLoanAccounts;
|
this.showClosedLoanAccounts = !this.showClosedLoanAccounts;
|
||||||
}
|
}
|
||||||
@@ -57,4 +57,26 @@ export class GeneralTabComponent implements OnInit {
|
|||||||
this.showClosedShareAccounts = !this.showClosedShareAccounts;
|
this.showClosedShareAccounts = !this.showClosedShareAccounts;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Waive Charge.
|
||||||
|
* @param chargeId Selected Charge Id.
|
||||||
|
* @param clientId Selected Client Id.
|
||||||
|
*/
|
||||||
|
waiveCharge(chargeId: string, clientId: string) {
|
||||||
|
const charge = { clientId: clientId.toString(), resourceType: chargeId};
|
||||||
|
this.clientService.waiveClientCharge(charge).subscribe(() => {
|
||||||
|
this.getChargeData(clientId);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get Charge Data.
|
||||||
|
* @param clientId Selected Client Id.
|
||||||
|
*/
|
||||||
|
getChargeData(clientId: string) {
|
||||||
|
this.clientService.getClientChargesData(clientId).subscribe((data: any) => {
|
||||||
|
this.upcomingCharges = data.pageItems;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,14 @@ export class ClientsService {
|
|||||||
return this.http.get(`/clients/${clientId}/charges`, { params: httpParams });
|
return this.http.get(`/clients/${clientId}/charges`, { params: httpParams });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param chargeData Charge Data to be waived.
|
||||||
|
*/
|
||||||
|
waiveClientCharge(chargeData: any) {
|
||||||
|
const httpParams = new HttpParams().set('command', 'waive');
|
||||||
|
return this.http.post(`/clients/${chargeData.clientId}/charges/${chargeData.resourceType}`, chargeData, { params: httpParams });
|
||||||
|
}
|
||||||
|
|
||||||
getClientSummary(clientId: string) {
|
getClientSummary(clientId: string) {
|
||||||
const httpParams = new HttpParams().set('R_clientId', clientId)
|
const httpParams = new HttpParams().set('R_clientId', clientId)
|
||||||
.set('genericResultSet', 'false');
|
.set('genericResultSet', 'false');
|
||||||
|
|||||||
Reference in New Issue
Block a user