From cd312909a9806728d3c9c42701385b2eb8c93a38 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 6 Jul 2022 12:26:46 -0400 Subject: [PATCH] LP1859701 Cash reports inline patron info Display patron info in the User Payments grid inline with the grid instead of requiring an additional click to open a separate dialog. Make patron barcode a link so the patron can be opened in a new tab. Adds grid prefs workstation settings. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Michele Morgan --- .../local/cash-reports/cash-reports.component.html | 29 ++++++++----------- .../local/cash-reports/cash-reports.component.ts | 23 +++++---------- .../local/cash-reports/cash-reports.module.ts | 4 +-- .../local/cash-reports/user-dialog.component.html | 13 --------- .../local/cash-reports/user-dialog.component.ts | 29 -------------------- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 16 +++++++++++ .../Pg/upgrade/XXXX.data.angular-cash-reports.sql | 22 +++++++++++++++ 7 files changed, 59 insertions(+), 77 deletions(-) delete mode 100644 Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/user-dialog.component.html delete mode 100644 Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/user-dialog.component.ts create mode 100644 Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-cash-reports.sql diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.html index bb136bc..1cf4c64 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.html @@ -48,6 +48,7 @@
{{deskTotals.credit_card_payment | currency}}
Total Goods Payments
{{userTotals.goods_payment | currency}}
+ + + {{row.user.card()}} + + + + + + +
- - - - - - - - - - - - diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts index e131e1b..f77a147 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.component.ts @@ -1,11 +1,11 @@ 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; @@ -38,10 +38,11 @@ export class CashReportsComponent implements OnInit { 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; @@ -55,19 +56,10 @@ export class CashReportsComponent implements OnInit { 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) { @@ -91,6 +83,7 @@ export class CashReportsComponent implements OnInit { result.forEach((userObject, index) => { result[index].user = userObject.usr(); result[index].usr(userObject.usr().usrname()); + console.log('USER IS', userObject); }); } this[dataSource].data = result; diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.module.ts index 5ab480f..380c710 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/cash-reports.module.ts @@ -2,13 +2,11 @@ import {NgModule} from '@angular/core'; 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, diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/user-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/user-dialog.component.html deleted file mode 100644 index 764b4a6..0000000 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/user-dialog.component.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/user-dialog.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/user-dialog.component.ts deleted file mode 100644 index 872aeea..0000000 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/cash-reports/user-dialog.component.ts +++ /dev/null @@ -1,29 +0,0 @@ -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 { - if (!args) { - args = {}; - } - return super.open(args); - } - - closeEditor() { - this.close(); - } -} diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 121fb20..93b7481 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -23207,3 +23207,19 @@ UPDATE config.print_template SET template = $TEMPLATE$ $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' + ) +); diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-cash-reports.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-cash-reports.sql new file mode 100644 index 0000000..c8dd55e --- /dev/null +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-cash-reports.sql @@ -0,0 +1,22 @@ +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; -- 1.7.2.5