[open-ils-commits] r11685 - trunk/Open-ILS/xul/staff_client/server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Dec 29 12:33:46 EST 2008
Author: phasefx
Date: 2008-12-29 12:33:43 -0500 (Mon, 29 Dec 2008)
New Revision: 11685
Modified:
trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js
Log:
Javascript functions don't have an implicit return. Inverted the logic (filter_list is backwards). Added some defensive code
Modified: trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js
===================================================================
--- trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js 2008-12-29 17:30:16 UTC (rev 11684)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js 2008-12-29 17:33:43 UTC (rev 11685)
@@ -98,7 +98,7 @@
JSAN.use('util.money');
JSAN.use('util.widgets');
JSAN.use('util.functional');
- var billing_list = util.functional.filter_list( g.OpenILS.data.list.cbt, function (x) { x.id() < 100 } );
+ var billing_list = util.functional.filter_list( g.OpenILS.data.list.cbt, function (x) { return x.id() >= 100 } );
var ml = util.widgets.make_menulist(
util.functional.map_list(
billing_list.sort( function(a,b) { if (a.name()>b.name()) return 1; if (a.name()<b.name()) return -1; return 0; } ), //g.OpenILS.data.list.billing_type.sort(),
@@ -111,7 +111,9 @@
ml.addEventListener(
'command',
function() {
- $('bill_amount').value = billing_list[ ml.value ].default_price();
+ if ( billing_list[ ml.value ] ) {
+ $('bill_amount').value = billing_list[ ml.value ].default_price();
+ }
},
false
);
@@ -120,7 +122,9 @@
$('billing_location').setAttribute('value', g.OpenILS.data.hash.aou[ g.OpenILS.data.list.au[0].ws_ou() ].name() );
- $('bill_amount').value = billing_list[ ml.value ].default_price();
+ if ( billing_list[ ml.value ] ) {
+ $('bill_amount').value = billing_list[ ml.value ].default_price();
+ }
$('bill_amount').select(); $('bill_amount').focus();
if (xul_param('xact_id',{'modal_xulG':true})) {
More information about the open-ils-commits
mailing list