From: Bill Erickson Date: Thu, 15 Apr 2021 19:42:56 +0000 (-0400) Subject: LP1904036 more checkin X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2f10ee4484298371e4ed1e1c005660e84853f13d;p=evergreen%2Fpines.git LP1904036 more checkin Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.html b/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.html index c2f2aeb652..8ce201bc1c 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.html +++ b/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.html @@ -4,6 +4,37 @@ +
+
+ Backdated Check In {{backdate | date:'shortDate'}} + Use Effective Date Until Logout + Ignore Pre-Cataloged Items + Suppress Holds and Transits + Amnesty Mode + Auto-Print Hold and Transit Slips + Clear Holds Shelf + + Always Retarget Local Holds + Retarget Local Holds + + Capture Local Holds As Transits + Manual Floating Active + Update Inventory +
+
+
@@ -21,11 +52,17 @@
-
- Effective Date: - +
+
+ + +
+
Effective Date:
+
@@ -107,3 +144,111 @@ + + + diff --git a/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.ts index f07d5edd60..f8be484750 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.ts @@ -13,12 +13,29 @@ import {CircService, CircDisplayInfo, CheckinParams, CheckinResult import {Pager} from '@eg/share/util/pager'; import {BarcodeSelectComponent } from '@eg/staff/share/barcodes/barcode-select.component'; +import {PrintService} from '@eg/share/print/print.service'; interface CheckinGridEntry extends CheckinResult { // May need to extend... foo?: number; // Empty interfaces are not allowed. } +const TRIM_LIST_TO = 20; + +const CHECKIN_MODIFIERS = [ + 'void_overdues', + 'clear_expired', + 'hold_as_transit', + 'manual_float', + 'no_precat_alert', + 'retarget_holds', + 'retarget_holds_all' +]; + +const SETTINGS = [ + 'circ.checkin.strict_barcode' +] + @Component({ templateUrl: 'checkin.component.html', styleUrls: ['checkin.component.css'] @@ -28,12 +45,18 @@ export class CheckinComponent implements OnInit, AfterViewInit { autoIndex = 0; barcode: string; - backdate: string; // ISO + backdate: string; + backdateUntilLogout = false; fineTally = 0; + isHoldCapture = false; + strictBarcode = false; + trimList = false; gridDataSource: GridDataSource = new GridDataSource(); cellTextGenerator: GridCellTextGenerator; + modifiers: {[key: string]: boolean} = {}; + private copiesInFlight: {[barcode: string]: boolean} = {}; @ViewChild('grid') private grid: GridComponent; @@ -47,6 +70,7 @@ export class CheckinComponent implements OnInit, AfterViewInit { private auth: AuthService, private store: ServerStoreService, private circ: CircService, + private printer: PrintService, public patronService: PatronService ) {} @@ -54,6 +78,23 @@ export class CheckinComponent implements OnInit, AfterViewInit { this.gridDataSource.getRows = (pager: Pager, sort: any[]) => { return from(this.checkins); }; + + const setNames = + CHECKIN_MODIFIERS.map(mod => `eg.circ.checkin.${mod}`) + .concat(SETTINGS); + + this.store.getItemBatch(setNames).then(sets => { + CHECKIN_MODIFIERS.forEach(mod => + this.modifiers[mod] = sets[`eg.circ.checkin.${mod}`]); + + this.strictBarcode = sets['circ.checkin.strict_barcode']; + + if (this.isHoldCapture) { + this.modifiers.noop = false; + this.modifiers.auto_print_holds_transits = true; + } + + }); } ngAfterViewInit() { @@ -133,7 +174,54 @@ export class CheckinComponent implements OnInit, AfterViewInit { } this.checkins.unshift(entry); + + if (this.trimList && this.checkins.length >= TRIM_LIST_TO) { + this.checkins.length = TRIM_LIST_TO; + } this.grid.reload(); } + + toggleMod(mod: string) { + if (this.modifiers[mod]) { + this.modifiers[mod] = false; + this.store.removeItem('eg.circ.checkin.' + mod); + } else { + this.modifiers[mod] = true; + this.store.setItem('eg.circ.checkin.' + mod, true); + } + } + + toggleStrictBarcode(active: boolean) { + if (active) { + this.store.setItem('circ.checkin.strict_barcode', true); + } else { + this.store.removeItem('circ.checkin.strict_barcode'); + } + } + + printReceipt() { + if (this.checkins.length === 0) { return; } + + this.printer.print({ + printContext: 'default', + templateName: 'checkin', + contextData: {checkins: this.checkins} + }); + } + + hasAlerts(): boolean { + return ( + Boolean(this.backdate) || + this.modifiers.noop || + this.modifiers.manual_float || + this.modifiers.void_overdues || + this.modifiers.clear_expired || + this.modifiers.retarget_holds || + this.modifiers.hold_as_transit || + this.modifiers.no_precat_alert || + this.modifiers.do_inventory_update || + this.modifiers.auto_print_holds_transits + ); + } } diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-patron.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-patron.sql index 68e4ecef83..af05cdc58b 100644 --- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-patron.sql +++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.angular-patron.sql @@ -390,8 +390,6 @@ UPDATE config.print_template SET template = $TEMPLATE$ $TEMPLATE$ WHERE name = 'transit_slip'; -*/ - INSERT INTO config.print_template (name, label, owner, active, locale, content_type, template) @@ -442,6 +440,47 @@ UPDATE config.print_template SET template = $TEMPLATE$ $TEMPLATE$ WHERE name = 'transit_slip'; +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('checkin', 'Checkin', 1, TRUE, 'en-US', 'text/html', ''); + +*/ + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET checkins = template_data.checkins; +%] + +
+
Welcome to [% staff_org.name %]
+
You checked in the following items:
+
+
    + [% FOR checkin IN checkins %] +
  1. +
    [% checkin.title %]
    + Barcode: + [% checkin.copy.barcode %] + Call Number: + + [% IF checkin.volume %] + [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %] + [% ELSE %] + Not Cataloged + [% END %] + +
  2. + [% END %] +
+
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'checkin'; + COMMIT;