From: Bill Erickson Date: Mon, 12 Apr 2021 15:39:12 +0000 (-0400) Subject: LP1904036 checkin; more transit handling/slips X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2a538047b77046b68d8f67076c3611874e2103d2;p=evergreen%2Fmasslnc.git LP1904036 checkin; more transit handling/slips 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 e3acc3c3b1..8680b09f8a 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 @@ -15,9 +15,7 @@ import {BarcodeSelectComponent } from '@eg/staff/share/barcodes/barcode-select.component'; interface CheckinGridEntry extends CheckinResult { - title?: string; - author?: string; - isbn?: string; + // May need to extend... } @Component({ @@ -84,23 +82,17 @@ export class CheckinComponent implements OnInit, AfterViewInit { }) .then((result: CheckinResult) => { - if (result) { - this.dispatchResult(result); - return result; + if (result && result.success) { + this.gridifyResult(result); } + delete this.copiesInFlight[this.barcode]; + this.resetForm(); + return result; }) .finally(() => delete this.copiesInFlight[this.barcode]); } - dispatchResult(result: CheckinResult) { - if (result.success) { - this.gridifyResult(result); - this.resetForm(); - return; - } - } - collectParams(): Promise { const params: CheckinParams = { diff --git a/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts b/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts index 124ef241ce..d5bdcb553e 100644 --- a/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/circ/patron/checkout.component.ts @@ -146,23 +146,17 @@ export class CheckoutComponent implements OnInit, AfterViewInit { }) .then((result: CheckoutResult) => { - if (result) { - this.dispatchResult(result); - return result; + if (result && result.success) { + this.gridifyResult(result); } + delete this.copiesInFlight[barcode]; + this.resetForm(); + return result; }) .finally(() => delete this.copiesInFlight[barcode]); } - dispatchResult(result: CheckoutResult) { - if (result.success) { - this.gridifyResult(result); - this.resetForm(); - return; - } - } - resetForm() { if (this.dueDateOptions < 2) { 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 f667fc1e69..829298f1ba 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 @@ -169,9 +169,16 @@ export interface CheckinResult { record?: IdlObject; hold?: IdlObject; transit?: IdlObject; - org?: number; patron?: IdlObject; - routeTo?: string; + + // Calculated values + routeTo?: string; // org name or in-branch destination + title?: string; + author?: string; + isbn?: string; + destOrg?: IdlObject; + destAddress?: IdlObject; + destCourierCode?: string; } @Injectable() @@ -245,7 +252,7 @@ export class CircService { getOrgAddr(orgId: number, addrType): Promise { const org = this.org.get(orgId); - const addrId = this.org[addrType](); + const addrId = this.org[addrType]; if (!addrId) { return Promise.resolve(null); } @@ -563,7 +570,18 @@ export class CircService { const circ = result.circ; const parent_circ = result.parent_circ; - let promise = Promise.resolve();; + let promise = Promise.resolve(); + + if (result.record) { + result.title = result.record.title(); + result.author = result.record.author(); + result.isbn = result.record.isbn(); + + } else if (result.copy) { + result.title = result.copy.dummy_title(); + result.author = result.copy.dummy_author(); + result.isbn = result.copy.dummy_isbn(); + } if (copy) { if (this.copyLocationCache[copy.location()]) { diff --git a/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html index f2486a334e..ec18c50958 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/circ/route-dialog.component.html @@ -1,36 +1,11 @@ - -
- This item should be routed to the Private Holds Shelf -
-
- This item should be routed to the Public Holds Shelf -
- -
-
- Item Barcode: - {{checkin.copy.barcode()}} -
-
- Title: - {{checkin.record.title()}} -
-
- Author: - {{checkin.record.author()}} -
-
- Call Number: - {{checkin.volume.prefix().label()}} {{checkin.volume.label()}} {{checkin.volume.suffix().label()}} -
-
- +
Hold for patron {{checkin.patron.alias()}}
@@ -52,15 +27,34 @@ Patron Barcode: {{checkin.patron.card().barcode()}} -
Notify by phone: {{checkin.hold.phone_notify()}}
-
Notify by text: {{checkin.hold.sms_notify()}}
-
Notify by email: {{checkin.patron.email()}}
-
+
+ + +
+ Item Barcode: + {{checkin.copy.barcode()}} +
+
+ Title: + {{checkin.title}} +
+
+ Author: + {{checkin.author}} +
+
+ Call Number: + {{checkin.volume.prefix().label()}} {{ + checkin.volume.label()}} {{checkin.volume.suffix().label()}} +
+
+ +
Request Date: {{checkin.hold.request_time() | date:'short'}}
-
+
Request Notes:
  • @@ -69,6 +63,27 @@
+ + + +
+ This item should be routed to the Private Holds Shelf +
+
+ This item should be routed to the Public Holds Shelf +
+
+ +
+
+ + +
Notify by phone: {{checkin.hold.phone_notify()}}
+
Notify by text: {{checkin.hold.sms_notify()}}
+
Notify by email: {{checkin.patron.email()}}
+ + +
Slip Date: {{today | date:'short'}} @@ -76,13 +91,51 @@ +
+ checkin.destination + {{checkin.destOrg.shortname()}} +
+
{{checkin.destCourierCode}}
+
+
+
+ {{checkin.destOrg.name()}}
+ + {{checkin.destAddress.street1()}} {{checkin.destAddress.street2()}}
+ {{checkin.destAddress.city()}}, {{checkin.destAddress.state()}} {{checkin.destAddress.post_code()}} +
+ + We do not have a holds address for this library. + +
+ P: {{checkin.destOrg.phone()}} +
+
+ +
+
+ +
+ +
+
+
+ Slip Date: + {{today | date:'short'}} +
$TEMPLATE$ WHERE name = 'hold_shelf_slip'; + + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('transit_slip', 'Transit Slip', 1, TRUE, 'en-US', 'text/html', ''); + + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET checkin = template_data.checkin; + SET copy = checkin.copy; + SET destOrg = checkin.destOrg; + SET destAddress = checkin.destAddress; + SET destCourierCode = checkin.destCourierCode; +%] +
+
This item needs to be routed to [% destOrg.shortname %]
+
[% destOrg.name %]
+ [% IF destCourierCode %]Courier Code: [% destCourierCode %][% END %] + + [% IF destAddress %] +
[% destAddress.street1 %]
+
[% destAddress.street2 %]
+
[% destAddress.city %], + [% destAddress.state %] + [% destAddress.post_code %]
+ [% ELSE %] +
We do not have a holds address for this library.
+ [% END %] + +
+
Barcode: [% copy.barcode %]
+
Title: [% checkin.title %]
+
Author: [% checkin.author %]
+ +
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'transit_slip'; + +*/ + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('hold_transit_slip', 'Hold Transit Slip', 1, TRUE, 'en-US', 'text/html', ''); + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET checkin = template_data.checkin; + SET copy = checkin.copy; + SET hold = checkin.hold; + SET patron = checkin.patron; + SET destOrg = checkin.destOrg; + SET destAddress = checkin.destAddress; + SET destCourierCode = checkin.destCourierCode; +%] +
+
This item needs to be routed to [% destOrg.shortname %]
+
[% destOrg.name %]
+ [% IF destCourierCode %]Courier Code: [% destCourierCode %][% END %] + + [% IF destAddress %] +
[% destAddress.street1 %]
+
[% destAddress.street2 %]
+
[% destAddress.city %], + [% destAddress.state %] + [% destAddress.post_code %]
+ [% ELSE %] +
We do not have a holds address for this library.
+ [% END %] + +
+
Barcode: [% copy.barcode %]
+
Title: [% checkin.title %]
+
Author: [% checkin.author %]
+ +
+
Hold for patron [% patron.card.barcode %]
+ +
+
Request Date: [% + date.format(helpers.format_date(hold.request_time, staff_org_timezone), '%x %r') %] +
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'transit_slip'; + + COMMIT;