Web Client: Reprint Last Receipt doesn't work with Hatch enabled

Bug #1743622 reported by Terran McCanna
56
This bug affects 10 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

In 3.0.2:

In Chrome with Hatch installed, F9 and Circulation > Print Last Receipt do not respond.

This is particularly problematic for libraries who need to print two copies of a bill payment receipt because of another bug which ignores the # Copies field:

https://bugs.launchpad.net/evergreen/+bug/1742521

And also because bills cannot be printed from Bill History:

https://bugs.launchpad.net/evergreen/+bug/1606645

Changed in evergreen:
importance: Undecided → Medium
Revision history for this message
John Amundson (jamundson) wrote :

Confirmed in Evergreen 3.0.8

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Lynn Floyd (lfloyd) wrote :

Confirmed in Evergreen 3.1.9

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

Confirmed in 3.3.4

I can see that the In-Browser Pref for the last printed receipt does exist, eg.print.last_printed seems to have the correct data in it.

But when Circulation -> Reprint Last Receipt gets selected, the console shows
"TypeError: o._remotePrint is not a function"

It looks like print.js is trying to call egHatch._remotePrint() but I don't think there is an egHatch._remotePrint function, but there is a egPrint._remotePrint function... which seems to call egHatch.remotePrint.

I'm trying to test it out, but I think I'm running into caching of some sort... so I'll keep trying to see if I can figure out what might be going on.
Josh

Revision history for this message
Josh Stompro (u-launchpad-stompro-org) wrote :

That seems to fix it, I edited core.bundle.js and found the correct "o._remotePrint()" and changed it to "u._remotePrint()" where I think u = service... so service._remotePrint() in print.js instead of egHatch._remotePrint().

Now when I choose reprint last receipt with hatch enabled, it works fine.

I don't know what I'm doing when it comes to rebuilding the core.bundle.js, so maybe someone else could try this out on a dev system?

Josh

Revision history for this message
Jane Sandberg (sandbergja) wrote :

I agree, Josh. These few lines in print.js do look pretty suspicious to me: https://github.com/evergreen-library-system/Evergreen/blob/master/Open-ILS/web/js/ui/default/staff/services/print.js#L186

A simple way to rebuild core.bundle.js would be to:

cd {EVERGREEN_SOURCE_DIR}/Open-ILS/web/js/ui/default/staff
rm -rf build
npm run build-prod

I'm going to stay away from testing this one, though, since I am not very familiar with Hatch.

Revision history for this message
John Amundson (jamundson) wrote :

I was curious if anyone has simply tested "Reprint Last Receipt" on Evergreen 3.4 with Hatch enabled lately.

When investigating something else on our testing server, I clicked "Reprint Last Receipt", and to my surprise, it just... worked. Hatch is enabled.

Here are the details of my setup:
Evergreen 3.4.2ish
Windows 10 64-bit
Java 8 Update 211 64-bit
Hatch version 0.1.4
Hatch Native Messenger Extension version 0.2.2

I'm inclined to believe the difference has less to do with my setup and more to do with Evergreen versions, though. Our production server is running 3.2.8ish, and Reprint Last Receipt does not work with Hatch enabled. This is on the same machine.

Revision history for this message
John Amundson (jamundson) wrote :

Perhaps addressed by the Hatch Omnibus patch? https://bugs.launchpad.net/evergreen/+bug/1830391 or just a fluke on my part?

Revision history for this message
Terran McCanna (tmccanna) wrote :

I confirmed that Reprint Last Receipt still isn't working for us on 3.4.2 in Chrome. This is what I see in the browser console:

TypeError: o._remotePrint is not a function
    at core.bundle.js:1
    at l (vendor.bundle.js:6)
    at vendor.bundle.js:6
    at f.$digest (vendor.bundle.js:6)
    at f.$apply (vendor.bundle.js:6)
    at HTMLAnchorElement.<anonymous> (vendor.bundle.js:6)
    at HTMLAnchorElement.dispatch (jquery.min.js:2)
    at HTMLAnchorElement.v.handle (jquery.min.js:2) "Possibly unhandled rejection: {}"

(If I disable Hatch, Reprint Last Receipt works.)

Revision history for this message
John Amundson (jamundson) wrote :

Odd. I get that same error on 3.2.8 but not on 3.4.2. I am also on Chrome, (forgot to mention that earlier).

On 3.4.2, the last receipt simply prints with Hatch enabled. I don't get see any response in the console unless I set the level to "verbose". Then I see this:

egNet open-ils.actor.settings.retrieve.atomic
core.bundle.js:1 egNet open-ils.actor.settings.retrieve.atomic
core.bundle.js:1 sending to Hatch: {"action":"print","settings":{"autoMargins":true,"allPages":true,"pageRanges":[],"context":"default","printer":"Star TSP100 Tear Bar (TSP113)","marginType":"HARDWARE_MINIMUM"},"content":"<html><body><div style=\"font-family:calibri\" class=\"ng-scope\"> \n\t<hr> <h2 style=\"text-align:center\"> <i>Welcome to the</i> <br> \n\t<div style=\"font-size:1.3em\" class=\"ng-binding\">Templeton Boynton Public Library</div> </h2> <hr> <br> \n\t<div style=\"font-size:1.3em; \" class=\"ng-binding\">Current bills as of\n\t 2020-02-27<br> </div>\n</div><br class=\"ng-scope\">\n\n<dl class=\"ng-scope\">\n \t<!-- ngRepeat: xact in transactions --><div ng-repeat=\"xact in transactions\" class=\"ng-scope\">\n \t\t <dd>\n \t\t <table> \n \t\t\t<tbody><tr valign=\"top\">\n \t\t\t\t<td>Item Title:</td>\n \t\t\t<td class=\"ng-binding\">CWMARS Teaches PHP: the slow and not fun way</td>\n \t\t\t</tr> \n \t\t\t<tr valign=\"top\">\n \t\t\t<td>Barcode:</td>\n \t\t\t<td class=\"ng-binding\">37447spring20</td>\n \t\t\t</tr> \n \t\t\t<tr valign=\"top\">\n \t\t\t<td>Billing Type:</td>\n \t\t\t\t<td class=\"ng-binding\">Lost Materials<br>\n \t\t\t\tSYSTEM GENERATED\n \t\t\t\t </td>\n \t\t\t</tr> \n \t\t\t<tr valign=\"top\">\n \t\t\t<td>Last Payment:</td>\n \t\t\t<td class=\"ng-binding\">cash_payment<br>\n \t\t\t\t\n \t\t\t</td>\n \t\t\t</tr><tr valign=\"top\">\n \t\t\t<td><b>Balance:</b></td>\n \t\t\t<td><b class=\"ng-binding\">$9.14</b><hr></td>\n \t\t\t</tr> \n \t\t</tbody></table>\n \t\t</dd>\n \t</div><!-- end ngRepeat: xact in transactions --><!-- ng-repeat -->\n</dl>\n<hr class=\"ng-scope\">\n<div style=\"font-size:.8em; text-align:center\" ;\"position:relative;=\"\" top:8px;\"=\"\" class=\"ng-binding ng-scope\">\n\tTempleton Boynton Public Library<br> \n\t2/27/2020 3:14 PM<hr>\n</div></body></html>","contentType":"text/html","msgid":2}
core.bundle.js:1 Hatch responded to message ID 2

tags: removed: webstaffclient
tags: added: circ-billing hatch receipt
removed: billing
Revision history for this message
Michele Morgan (mmorgan) wrote :

Just tested "Reprint Last Receipt" on three different Evergreen systems:

Evergreen 3.7.2, 3.8.1, and 3.9.0
Hatch version 0.3.2
Chrome version 103.0.5060.134

With Hatch enabled, "Reprint Last Receipt" worked with no issues.

Marking this Fix Released

Changed in evergreen:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.