oops. need to use a hash here
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Dec 2008 17:21:25 +0000 (17:21 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Dec 2008 17:21:25 +0000 (17:21 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@11709 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/patron/bill_wizard.js

index 9d65d7f..21a28e5 100644 (file)
@@ -104,15 +104,15 @@ function patron_bill_init() {
                 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 ]; }
             ),
-            billing_list.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].id()
         );
         ml.setAttribute('id','billing_type');
         document.getElementById('menu_placeholder').appendChild(ml);
         ml.addEventListener(
             'command',
             function() {
-                if ( billing_list[ ml.value ] ) {
-                    $('bill_amount').value = billing_list[ ml.value ].default_price();
+                if ( g.OpenILS.data.hash.cbt[ ml.value ] ) {
+                    $('bill_amount').value = g.OpenILS.data.hash.cbt[ ml.value ].default_price();
                 }
             },
             false
@@ -122,8 +122,8 @@ function patron_bill_init() {
 
         $('billing_location').setAttribute('value', g.OpenILS.data.hash.aou[ g.OpenILS.data.list.au[0].ws_ou() ].name() );
 
-        if ( billing_list[ ml.value ] ) {
-            $('bill_amount').value = billing_list[ ml.value ].default_price();
+        if ( g.OpenILS.data.hash.cbt[ ml.value ] ) {
+            $('bill_amount').value = g.OpenILS.data.hash.cbt[ ml.value ].default_price();
         }
         $('bill_amount').select(); $('bill_amount').focus();