<div class="col-sm-10">{{deskTotals.credit_card_payment | currency}}</div>
</div>
<eg-grid #deskPaymentGrid
+ persistKey="admin.local.cash_reports.desk_payments"
[disableSelect]="true"
[disablePaging]="true"
[dataSource]="deskPaymentDataSource"
<div class="col-sm-2" i18n>Total Goods Payments</div>
<div class="col-sm-10">{{userTotals.goods_payment | currency}}</div>
</div>
+ <ng-template #cardTmpl let-row="row">
+ <a target="_blank" href="/eg/staff/circ/patron/{{row.user.id()}}/checkout">
+ {{row.user.card()}}
+ </a>
+ </ng-template>
<eg-grid #userPaymentGrid
- (onRowActivate) = "onRowActivate($event)"
+ persistKey="admin.local.cash_reports.user_payments"
[disableSelect]="true"
[disablePaging]="true"
[dataSource]="userPaymentDataSource"
<eg-grid-column label="Forgive Payment" name="forgive_payment" i18n-label datatype="money"></eg-grid-column>
<eg-grid-column label="Work Payment" name="work_payment" i18n-label datatype="money"></eg-grid-column>
<eg-grid-column label="Goods Payment" name="goods_payment" i18n-label datatype="money"></eg-grid-column>
+ <eg-grid-column label="Patron Card" name="card" i18n-label [cellTemplate]="cardTmpl"></eg-grid-column>
+ <eg-grid-column label="Patron Email" path="user.email" i18n-label></eg-grid-column>
+ <eg-grid-column label="Patron First Name" path="user.first_given_name" i18n-label></eg-grid-column>
+ <eg-grid-column label="Patron Family Name" path="user.family_name" i18n-label></eg-grid-column>
+ <eg-grid-column label="Patron Home OU" path="user.home_ou" i18n-label></eg-grid-column>
</eg-grid>
</div>
</ng-template>
</li>
</ul>
<div [ngbNavOutlet]="cashReportsNav"></div>
-
-<eg-user-dialog #userDialog>
- <ng-container *ngIf="userDataSource.data && userDataSource.data.length>0">
- <eg-grid #userGrid
- [disableSelect]="true"
- [disablePaging]="true"
- [dataSource]="userDataSource"
- [sortable]="false">
- <eg-grid-column label="Card" name="card" [index]="true" i18n-label></eg-grid-column>
- <eg-grid-column label="Email" name="email" i18n-label></eg-grid-column>
- <eg-grid-column label="First Name" name="first_given_name" i18n-label></eg-grid-column>
- <eg-grid-column label="Family Name" name="family_name" i18n-label></eg-grid-column>
- <eg-grid-column label="Home OU" name="home_ou" i18n-label></eg-grid-column>
- </eg-grid>
- </ng-container>
-</eg-user-dialog>
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 {GridDataSource, GridColumn,
+ GridCellTextGenerator, GridRowFlairEntry} from '@eg/share/grid/grid';
import {IdlService} from '@eg/core/idl.service';
import {NetService} from '@eg/core/net.service';
import {AuthService} from '@eg/core/auth.service';
import {OrgService} from '@eg/core/org.service';
-import {UserDialogComponent} from './user-dialog.component';
class DeskTotals {
cash_payment = 0;
userTotals = new UserTotals();
disabledOrgs = [];
activeTab = 'deskPayments';
+ cellTextGenerator: GridCellTextGenerator;
+
// Default sort field, used when no grid sorting is applied.
@Input() sortField: string;
- @ViewChild('userDialog') userDialog: UserDialogComponent;
@ViewChild('deskPaymentGrid') deskPaymentGrid: GridComponent;
@ViewChild('userPaymentGrid') userPaymentGrid: GridComponent;
@ViewChild('userGrid') userGrid: GridComponent;
ngOnInit() {
this.disabledOrgs = this.getFilteredOrgList();
this.searchForData(this.startDate, this.endDate);
- }
-
- onRowActivate(userObject) {
- if (userObject.user && this.userDataSource.data.length === 0) {
- this.userDataSource.data = [userObject.user];
- this.showUserInformation();
- } else {
- this.eraseUserGrid();
- }
- }
- showUserInformation() {
- return this.userDialog.open({size: 'lg'}).toPromise();
+ this.cellTextGenerator = {
+ card: row => row.user.card()
+ };
}
searchForData(start, end) {
result.forEach((userObject, index) => {
result[index].user = userObject.usr();
result[index].usr(userObject.usr().usrname());
+ console.log('USER IS', userObject);
});
}
this[dataSource].data = result;
import {TreeModule} from '@eg/share/tree/tree.module';
import {StaffCommonModule} from '@eg/staff/common.module';
import {CashReportsComponent} from './cash-reports.component';
-import {UserDialogComponent} from './user-dialog.component';
import {CashReportsRoutingModule} from './routing.module';
@NgModule({
declarations: [
- CashReportsComponent,
- UserDialogComponent
+ CashReportsComponent
],
imports: [
StaffCommonModule,
+++ /dev/null
-
-<ng-template #dialogContent>
- <div class="modal-header bg-info">
- <h4 class="modal-title" i18n>User Information</h4>
-
- </div>
- <div class="modal-body">
- <ng-content></ng-content>
- </div>
- <div class="modal-footer">
- <button class="btn btn-success" (click)="closeEditor()" i18n>Close</button>
- </div>
-</ng-template>
\ No newline at end of file
+++ /dev/null
-import {Component, OnInit, Input, ViewChild} from '@angular/core';
-import {NgbModal, NgbModalOptions} from '@ng-bootstrap/ng-bootstrap';
-import {Observable} from 'rxjs';
-import { DialogComponent } from '@eg/share/dialog/dialog.component';
-
-@Component({
- selector: 'eg-user-dialog',
- templateUrl: './user-dialog.component.html'
-})
-export class UserDialogComponent extends DialogComponent implements OnInit {
-
- ngOnInit() {}
-
- constructor(
- private modal: NgbModal) {
- super(modal);
- }
-
- open(args?: NgbModalOptions): Observable<any> {
- if (!args) {
- args = {};
- }
- return super.open(args);
- }
-
- closeEditor() {
- this.close();
- }
-}
$TEMPLATE$ WHERE name = 'renew';
+INSERT into config.workstation_setting_type (name, grp, datatype, label)
+VALUES (
+ 'eg.grid.admin.local.cash_reports.desk_payments', 'gui', 'object',
+ oils_i18n_gettext(
+ 'eg.grid.admin.local.cash_reports.desk_payments',
+ 'Grid Config: admin.local.cash_reports.desk_payments',
+ 'cwst', 'label'
+ )
+), (
+ 'eg.grid.admin.local.cash_reports.user_payments', 'gui', 'object',
+ oils_i18n_gettext(
+ 'eg.grid.admin.local.cash_reports.user_payments',
+ 'Grid Config: admin.local.cash_reports.user_payments',
+ 'cwst', 'label'
+ )
+);
--- /dev/null
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('TODO', :eg_version);
+
+INSERT into config.workstation_setting_type (name, grp, datatype, label)
+VALUES (
+ 'eg.grid.admin.local.cash_reports.desk_payments', 'gui', 'object',
+ oils_i18n_gettext(
+ 'eg.grid.admin.local.cash_reports.desk_payments',
+ 'Grid Config: admin.local.cash_reports.desk_payments',
+ 'cwst', 'label'
+ )
+), (
+ 'eg.grid.admin.local.cash_reports.user_payments', 'gui', 'object',
+ oils_i18n_gettext(
+ 'eg.grid.admin.local.cash_reports.user_payments',
+ 'Grid Config: admin.local.cash_reports.user_payments',
+ 'cwst', 'label'
+ )
+);
+
+COMMIT;