@@ -79,16 +79,16 @@
|
||||
</span>
|
||||
<span *ngIf="savingsAccountData.status.value === 'Active' && charge.amountOutstanding !== 0">
|
||||
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Pay Charge"
|
||||
*mifosxHasPermission="'PAY_SAVINGSACCOUNTCHARGE'" (click)="payCharge(charge.id)">
|
||||
*mifosxHasPermission="'PAY_SAVINGSACCOUNTCHARGE'" (click)="routeEdit($event); payCharge(charge.id)">
|
||||
<i class="fa fa-dollar"></i>
|
||||
</button>
|
||||
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Waive Charge"
|
||||
*mifosxHasPermission="'WAIVE_SAVINGSACCOUNTCHARGE'" (click)="waiveCharge(charge.id)">
|
||||
*mifosxHasPermission="'WAIVE_SAVINGSACCOUNTCHARGE'" (click)="routeEdit($event); waiveCharge(charge.id)">
|
||||
<i class="fa fa-flag"></i>
|
||||
</button>
|
||||
<ng-container *ngIf="isRecurringCharge(charge)">
|
||||
<button class="account-action-button" mat-raised-button color="primary" matTooltip="Inactivate Charge"
|
||||
*mifosxHasPermission="'INACTIVATE_SAVINGSACCOUNTCHARGE'" (click)="inactivateCharge(charge.id)">
|
||||
*mifosxHasPermission="'INACTIVATE_SAVINGSACCOUNTCHARGE'" (click)="routeEdit($event); inactivateCharge(charge.id)">
|
||||
<i class="fa fa-ban"></i>
|
||||
</button>
|
||||
</ng-container>
|
||||
|
||||
@@ -132,7 +132,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
};
|
||||
this.savingsService.executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'paycharge', dataObject, chargeId)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -148,7 +148,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
if (response.confirm) {
|
||||
this.savingsService.executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'waive', {}, chargeId)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -164,7 +164,7 @@ export class ChargesTabComponent implements OnInit {
|
||||
if (response.confirm) {
|
||||
this.savingsService.executeSavingsAccountChargesCommand(this.savingsAccountData.id, 'inactivate', {}, chargeId)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
this.reload();
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -178,4 +178,23 @@ export class ChargesTabComponent implements OnInit {
|
||||
return charge.chargeTimeType.value === 'Monthly Fee' || charge.chargeTimeType.value === 'Annual Fee' || charge.chargeTimeType.value === 'Weekly Fee';
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops the propagation to view charge page.
|
||||
* @param $event Mouse Event
|
||||
*/
|
||||
routeEdit($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
/**
|
||||
* Refetches data fot the component
|
||||
* TODO: Replace by a custom reload component instead of hard-coded back-routing.
|
||||
*/
|
||||
private reload() {
|
||||
const clientId = this.savingsAccountData.clientId;
|
||||
const url: string = this.router.url;
|
||||
this.router.navigateByUrl(`/clients/${clientId}/savingsaccounts`, {skipLocationChange: true})
|
||||
.then(() => this.router.navigate([url]));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user