From: Bill Erickson Date: Thu, 29 Apr 2021 15:35:49 +0000 (-0400) Subject: LP1904036 improve checkin modifiers; handling noncats X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=4ba63aa9c3b87131563b8b1fe7fedbbe1f033cff;p=Evergreen.git LP1904036 improve checkin modifiers; handling noncats 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.ts b/Open-ILS/src/eg2/src/app/staff/circ/checkin/checkin.component.ts index 357a2b2926..3b6d42446a 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 @@ -169,6 +169,12 @@ export class CheckinComponent implements OnInit, AfterViewInit { backdate: this.backdate }; + Object.keys(this.modifiers).forEach(mod => { + if (this.modifiers[mod]) { + params[mod] = true; + } + }); + return this.barcodeSelect.getBarcode('asset', this.barcode) .then(selection => { if (selection) { @@ -238,16 +244,8 @@ export class CheckinComponent implements OnInit, AfterViewInit { 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 + Boolean(this.backdate) || + Object.keys(this.modifiers).filter(mod => this.modifiers[mod]).length > 0 ); } diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts index bb233c35f2..53192ba6b5 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/circ.service.ts @@ -173,6 +173,12 @@ export interface CheckinParams { capture?: string; next_copy_status?: number[]; new_copy_alerts?: boolean; + clear_expired?: boolean; + hold_as_transit?: boolean; + manual_float?: boolean; + no_precat_alert?: boolean; + retarget_holds?: boolean; + retarget_holds_all?: boolean; // internal / local values that are moved from the API request. _override?: boolean; @@ -772,11 +778,6 @@ export class CircService { const firstEvent = allEvents[0]; const payload = firstEvent.payload; - if (!payload) { - this.audio.play('error.unknown.no_payload'); - return Promise.reject(); - } - const success = firstEvent.textcode.match(/SUCCESS|NO_CHANGE|ROUTE_ITEM/) !== null; @@ -786,15 +787,21 @@ export class CircService { allEvents: allEvents, params: params, success: success, - circ: payload.circ, - parent_circ: payload.parent_circ, - copy: payload.copy, - volume: payload.volume, - record: payload.record, - transit: payload.transit, - hold: payload.hold }; + if (!payload) { + // e.g. ASSET_COPY_NOT_FOUND + return Promise.resolve(result); + } + + result.circ = payload.circ; + result.parent_circ = payload.parent_circ; + result.copy = payload.copy; + result.volume = payload.volume; + result.record = payload.record; + result.transit = payload.transit; + result.hold = payload.hold; + const copy = result.copy; const volume = result.volume; const transit = result.transit; @@ -992,15 +999,15 @@ export class CircService { } handleCheckinUncatAlert(result: CheckinResult): Promise { - const copy = result.copy; + const barcode = result.copy ? + result.copy.barcode() : result.params.copy_barcode; if (this.suppressCheckinPopups) { return Promise.resolve(result); } return this.strings.interpolate( - 'staff.circ.checkin.uncat.alert', - {barcode: copy.barcode()} + 'staff.circ.checkin.uncat.alert', {barcode: barcode} ).then(str => { this.components.uncatAlertDialog.dialogBody = str; return this.components.uncatAlertDialog.open().toPromise() diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html index a937b4bb64..59f437373b 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/components.component.html @@ -19,14 +19,17 @@ + + + - Item {{barcode}} was mis-scanned or is not cataloged + Item "{{barcode}}" was mis-scanned or is not cataloged - +