[open-ils-commits] r11460 - trunk/Open-ILS/xul/staff_client/server/patron
svn at svn.open-ils.org
svn at svn.open-ils.org
Mon Dec 8 20:35:23 EST 2008
Author: miker
Date: 2008-12-08 20:35:22 -0500 (Mon, 08 Dec 2008)
New Revision: 11460
Modified:
trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js
Log:
filter out system billing types by id
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-09 00:51:47 UTC (rev 11459)
+++ trunk/Open-ILS/xul/staff_client/server/patron/bill_wizard.js 2008-12-09 01:35:22 UTC (rev 11460)
@@ -98,19 +98,20 @@
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 ml = util.widgets.make_menulist(
util.functional.map_list(
- g.OpenILS.data.list.cbt.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(),
+ 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(),
function(obj) { return [ obj.name(), obj.id() ]; } //function(obj) { return [ obj, obj ]; }
),
- g.OpenILS.data.list.cbt.sort( function(a,b) { if (a.name()>b.name()) return 1; if (a.name()<b.name()) return -1; return 0; } )[0]
+ billing_list.sort( function(a,b) { if (a.name()>b.name()) return 1; if (a.name()<b.name()) return -1; return 0; } )[0]
);
ml.setAttribute('id','billing_type');
document.getElementById('menu_placeholder').appendChild(ml);
ml.addEventListener(
'command',
function() {
- $('bill_amount').value = g.OpenILS.data.hash.cbt[ ml.value ].default_price();
+ $('bill_amount').value = billing_list[ ml.value ].default_price();
},
false
);
@@ -119,7 +120,7 @@
$('billing_location').setAttribute('value', g.OpenILS.data.hash.aou[ g.OpenILS.data.list.au[0].ws_ou() ].name() );
- $('bill_amount').value = g.OpenILS.data.hash.cbt[ ml.value ].default_price();
+ $('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