LP#1129318: fix exception thrown when printing circ receipts
authorGalen Charlton <gmc@esilibrary.com>
Mon, 18 Feb 2013 17:44:50 +0000 (12:44 -0500)
committerBen Shum <bshum@biblio.org>
Mon, 18 Feb 2013 18:08:16 +0000 (13:08 -0500)
Because of a misplaced parenthesis in the patch introducing the
PATRON_EXPIRE_DATE_YMD receipt macro, attempting to print
various circ receipts would result in the following exception:

Error in util.date.formatted_date:
location.href = oils://remote/xul/2.3_5/server/circ/checkin.xul
typeof orig_date = string orig_date = 2014-11-07T00:00:00-0500
typeof _date = object _date = Fri Nov 07 2014 00:00:00 GMT-0500 (Eastern Standard Time)
format = undefined
TypeError: s is undefined

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
Signed-off-by: Ben Shum <bshum@biblio.org>
Open-ILS/xul/staff_client/chrome/content/util/print.js

index 78a15d4..f79c555 100644 (file)
@@ -364,7 +364,7 @@ util.print.prototype = {
                 catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
             try{b = s; s = s.replace(/%PATRON_EXPIRE_DATE%/g,this.escape_html(params.patron.expire_date()));}
                 catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
-            try{b = s; s = s.replace(/%PATRON_EXPIRE_DATE_YMD%/g,util.date.formatted_date(params.patron.expire_date()), '%Y-%m-%d');}
+            try{b = s; s = s.replace(/%PATRON_EXPIRE_DATE_YMD%/g,util.date.formatted_date(params.patron.expire_date(), '%Y-%m-%d'));}
                 catch(E){s = b; this.error.sdump('D_WARN','string = <' + s + '> error = ' + js2JSON(E)+'\n');}
 
             try{b = s; s=s.replace(/%TODAY%/g,(new Date()));}