REFUND_EXCEEDS_DESK_PAYMENTS
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Aug 2006 04:48:27 +0000 (04:48 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Wed, 30 Aug 2006 04:48:27 +0000 (04:48 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@5772 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index fb0e781..fcf16a8 100644 (file)
@@ -530,12 +530,13 @@ patron.bills.prototype = {
                                api.BILL_PAY.method,
                                [ ses(), payment_blob ]
                        );
-                       if (robj && robj.ilsevent && robj.ilsevent == 0) {
-                               return true;
-                       } else if (robj == 1) {
-                               return true;
-                       } else {
-                               throw robj;
+                       if (robj == 1) { return true; } 
+                       if (typeof robj.ilsevent != 'undefined') {
+                               switch(robj.ilsevent) {
+                                       case 0 /* SUCCESS */ : return true; break;
+                                       case 1226 /* REFUND_EXCEEDS_DESK_PAYMENTS */ : alert(robj.desc); return false; break;
+                                       default: throw(robj); break;
+                               }
                        }
                } catch(E) {
                        obj.error.standard_unexpected_error_alert('Bill payment likely failed',E);