bill payment
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Jul 2005 19:05:15 +0000 (19:05 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Thu, 21 Jul 2005 19:05:15 +0000 (19:05 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@1342 dcc99617-32d9-48b4-a31d-7c20da2025e4

Evergreen/staff_client/chrome/content/evergreen/patron/patron_bills.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display.js
Evergreen/staff_client/chrome/content/evergreen/patron/patron_display_overlay.xul
Evergreen/staff_client/chrome/content/evergreen/patron/patron_utils.js

index 6d8c45b..6cdf70f 100644 (file)
@@ -117,7 +117,34 @@ function patron_bills_init(p) {
 
        p.control_box.bill_apply_payment.addEventListener(
                'command',
-               function() { alert('Fatal error.. gasp.. arggg.. choke... cough.. sputter'); },
+               function() { 
+                       //alert(p.control_box.payment_type.value);      
+                       var payment_blob = {};
+                       payment_blob.payment_type = p.control_box.payment_type.value;
+                       payment_blob.payments = [];
+                       for (var i = 0; i < p.current_payments.length; i++) {
+                               var tb = p.current_payments[ i ].textbox;
+                               if ( !(tb.value == '0.00' || tb.value == '') ) {
+                                       payment_blob.payments.push( 
+                                               [
+                                                       p.current_payments[ i ].mbts_id,
+                                                       tb.value
+                                               ]
+                                       );
+                               }
+                       }
+                       try {
+                               if ( patron_pay_bills( payment_blob ) ) {
+
+                                       if (p.refresh) p.refresh();
+
+                               }
+
+                       } catch(E) {
+
+                               handle_error(E);
+                       }
+               },
                false
        );
 
index 1a9c3b0..039ceae 100755 (executable)
@@ -488,7 +488,7 @@ function patron_display_patron_bills_init(p) {
                'debug' : p.app 
        } );
 
-       p.patron_bills.update_callback = function() { p.refresh(); }
+       p.patron_bills.refresh = function() { p.refresh(); }
 
        p.redraw_patron_bills = function() {
                try {
index 99edaa8..5a885f2 100755 (executable)
                                                        accesskey="t" control="payment_type_menulist" />
                                                <menulist id="payment_type_menulist">
                                                        <menupopup id="payment_type_menupopup">
-                                                               <menuitem id="payment_type_menuitem1" label="Cash" />
-                                                               <menuitem id="payment_type_menuitem2" label="Credit Card" />
-                                                               <menuitem id="payment_type_menuitem3" label="Patron Credit" />
-                                                               <menuitem id="payment_type_menuitem4" label="Forgive" />
+                                                               <menuitem id="payment_type_menuitem1" label="Cash" value="cash_payment"/>
+                                                               <menuitem id="payment_type_menuitem2" label="Check" value="check_payment"/>
+                                                               <menuitem id="payment_type_menuitem3" label="Credit Card" value="credit_card_payment"/>
+                                                               <menuitem id="payment_type_menuitem4" label="Patron Credit" value="credit_payment" />
+                                                               <menuitem id="payment_type_menuitem5" label="Work" value="work_payment"/>
+                                                               <menuitem id="payment_type_menuitem6" label="Forgive" value="forgive_payment"/>
                                                        </menupopup>
                                                </menulist>
                                        </row>
index 36daa38..8a29a54 100755 (executable)
@@ -299,6 +299,17 @@ function patron_get_standing_css_style( value ) {
        }
 }
 
+function patron_pay_bills( payment_blob ) {
+       sdump('D_PATRON_UTILS',arg_dump(arguments,{0:true}));
+       try {
+               alert("Bill's API call goes here.  payment_blob = \n" + pretty_print( js2JSON( payment_blob ) ) + '\n');
+               return true;
+       } catch(E) {
+               handle_error(E);
+               return false;
+       }
+}
+
 function retrieve_patron_by_barcode( barcode, f ) {
        sdump('D_PATRON_UTILS',arg_dump(arguments));
        if (!barcode) return null;