<ngb-tab title="Desk Payments">
<ng-template ngbTabContent>
<div class="mb-5">
+ <div class="row">
+ <div class="col-sm-2" i18n>Total Cash Payments</div>
+ <div class="col-sm-10">{{deskTotals.formatted_cash_payment}}</div>
+ </div>
+ <div class="row">
+ <div class="col-sm-2" i18n>Total Check Payments</div>
+ <div class="col-sm-10">{{deskTotals.formatted_check_payment}}</div>
+ </div>
+ <div class="row">
+ <div class="col-sm-2" i18n>Total Credit Card Payments</div>
+ <div class="col-sm-10">{{deskTotals.formatted_credit_card_payment}}</div>
+ </div>
<eg-grid #deskPaymentGrid
[disableSelect]="true"
[disablePaging]="true"
<ngb-tab title="User Payments">
<ng-template ngbTabContent>
<div class="mb-3">
+ <div class="row">
+ <div class="col-sm-2" i18n>Total Credit Payments</div>
+ <div class="col-sm-10">{{userTotals.formatted_credit_payment}}</div>
+ </div>
+ <div class="row">
+ <div class="col-sm-2" i18n>Total Forgive Payments</div>
+ <div class="col-sm-10">{{userTotals.formatted_forgive_payment}}</div>
+ </div>
+ <div class="row">
+ <div class="col-sm-2" i18n>Total Work Payments</div>
+ <div class="col-sm-10">{{userTotals.formatted_work_payment}}</div>
+ </div>
+ <div class="row">
+ <div class="col-sm-2" i18n>Total Goods Payments</div>
+ <div class="col-sm-10">{{userTotals.formatted_goods_payment}}</div>
+ </div>
<eg-grid #userPaymentGrid
(onRowActivate) = "onRowActivate($event)"
[disableSelect]="true"
import {Component, OnInit, Input, ViewChild} from '@angular/core';
import {GridComponent} from '@eg/share/grid/grid.component';
import {GridDataSource, GridColumn, GridRowFlairEntry} from '@eg/share/grid/grid';
+import {FormatService} from '@eg/core/format.service';
import {IdlService} from '@eg/core/idl.service';
import {NetService} from '@eg/core/net.service';
import {AuthService} from '@eg/core/auth.service';
cash_payment = 0;
check_payment = 0;
credit_card_payment = 0;
+ formatted_cash_payment = '0.00';
+ formatted_check_payment = '0.00';
+ formatted_credit_card_payment = '0.00';
};
class UserTotals {
work_payment = 0;
credit_payment = 0;
goods_payment = 0;
+ formatted_forgive_payment = '0.00';
+ formatted_work_payment = '0.00';
+ formatted_credit_payment = '0.00';
+ formatted_goods_payment = '0.00';
};
@Component({
private idl: IdlService,
private net: NetService,
private org: OrgService,
+ private format: FormatService,
private auth: AuthService){}
ngOnInit() {
let dataForTotal;
if(idlClass === this.deskIdlClass) {
dataForTotal = this.getDeskTotal(result);
+ this.deskTotals.formatted_cash_payment = this.format.transform({value: this.deskTotals.cash_payment, datatype: 'money'});
+ this.deskTotals.formatted_check_payment = this.format.transform({value: this.deskTotals.check_payment, datatype: 'money'});
+ this.deskTotals.formatted_credit_card_payment = this.format.transform({value: this.deskTotals.credit_card_payment, datatype: 'money'});
} else if(idlClass === this.userIdlClass) {
dataForTotal = this.getUserTotal(result);
+ this.userTotals.formatted_credit_payment = this.format.transform({value: this.userTotals.credit_payment, datatype: 'money'});
+ this.userTotals.formatted_forgive_payment = this.format.transform({value: this.userTotals.forgive_payment, datatype: 'money'});
+ this.userTotals.formatted_work_payment = this.format.transform({value: this.userTotals.work_payment, datatype: 'money'});
+ this.userTotals.formatted_goods_payment = this.format.transform({value: this.userTotals.goods_payment, datatype: 'money'});
result.forEach((userObject, index) => {
result[index].user = userObject.usr();
result[index].usr(userObject.usr().usrname())
});
}
- if(result.length > 0) {
- result.push(dataForTotal);
- }
+ //if(result.length > 0) {
+ // result.push(dataForTotal);
+ //}
this[dataSource].data = result;
this.eraseUserGrid();
});