From: phasefx Date: Mon, 7 Aug 2006 19:23:41 +0000 (+0000) Subject: handle null due_dates X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=7c9e85dda5a18d1029181c749b4968aaf0627f00;p=evergreen%2Fpines.git handle null due_dates git-svn-id: svn://svn.open-ils.org/ILS/trunk@5338 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index ff7b952812..e78c2c7cf9 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -500,10 +500,10 @@ circ.checkout.prototype = { var my_circ = obj.network.simple_request('FM_CIRC_RETRIEVE_VIA_COPY',[ses(),my_copy.id(),1]); if (typeof my_circ.ilsevent != 'undefined') throw(my_copy); my_circ = my_circ[0]; - var due_date = my_circ.due_date().substr(0,10); + var due_date = my_circ.due_date() ? my_circ.due_date().substr(0,10) : null; JSAN.use('util.date'); var today = util.date.formatted_date(new Date(),'%F'); - if (today > due_date) msg += '\nThis item was due on ' + due_date + '.\n'; - var r = obj.error.yns_alert(msg,'Check Out Failed','Cancel','Checkin then Checkout', today > due_date ? 'Forgiving Checkin then Checkout' : null,'Check here to confirm this message'); + if (due_date) if (today > due_date) msg += '\nThis item was due on ' + due_date + '.\n'; + var r = obj.error.yns_alert(msg,'Check Out Failed','Cancel','Checkin then Checkout', due_date ? (today > due_date ? 'Forgiving Checkin then Checkout' : null) : null,'Check here to confirm this message'); JSAN.use('circ.util'); switch(r) { case 1: