backport hold capture delay and item rental/deposit code, but needs testing
authorphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 3 Nov 2008 18:37:12 +0000 (18:37 +0000)
committerphasefx <phasefx@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Mon, 3 Nov 2008 18:37:12 +0000 (18:37 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@11042 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/util.js

index ca8c564..26d6c3b 100644 (file)
@@ -516,6 +516,8 @@ circ.checkout.prototype = {
                                                1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */,
                                                1213 /* PATRON_BARRED */,
                                                1215 /* CIRC_EXCEEDS_COPY_RANGE */,
+                        1232 /* ITEM_DEPOSIT_REQUIRED */,
+                        1233 /* ITEM_RENTAL_FEE_REQUIRED */,
                                                7002 /* PATRON_EXCEEDS_CHECKOUT_COUNT */,
                                                7003 /* COPY_CIRC_NOT_ALLOWED */,
                                                7004 /* COPY_NOT_AVAILABLE */, 
@@ -525,6 +527,12 @@ circ.checkout.prototype = {
                                                7013 /* PATRON_EXCEEDS_FINES */,
                                        ],
                                        'text' : {
+                        '1232' : function(r) {
+                            return "A billing for an Item Deposit will be added to the patron's account if this action is overrided.";
+                        },
+                        '1233' : function(r) {
+                            return "A billing for an Item Rental Fee will be added to the patron's account if this action is overrided.";
+                        },
                                                '7004' : function(r) {
                                                        //return obj.data.hash.ccs[ r.payload ].name();
                                                        return r.payload.status().name();
@@ -640,6 +648,8 @@ circ.checkout.prototype = {
                                                        msg += 'This account has expired  and may not circulate items.\n';
                                                        obj.error.yns_alert(msg,'Check Out Failed','OK',null,null,'Check here to confirm this message');
                                                break;
+                                               case 1232 /* ITEM_DEPOSIT_REQUIRED */ :
+                                               case 1233 /* ITEM_RENTAL_FEE_REQUIRED */ :
                                                case 7013 /* PATRON_EXCEEDS_FINES */ :
                                                        found_handled = true;
                                                break;
index 2ceb9f7..4f576bc 100644 (file)
@@ -1057,6 +1057,7 @@ circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,asyn
                                        1213 /* PATRON_BARRED */,
                                        1217 /* PATRON_INACTIVE */,
                                        1224 /* PATRON_ACCOUNT_EXPIRED */,
+                                       1234 /* ITEM_DEPOSIT_PAID */,
                                        7009 /* CIRC_CLAIMS_RETURNED */,
                                        7010 /* COPY_ALERT_MESSAGE */, 
                                        7011 /* COPY_STATUS_LOST */, 
@@ -1068,6 +1069,9 @@ circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,asyn
                                                //return data.hash.ccs[ r.payload.status() ].name();
                                                return r.payload.status().name();
                                        },
+                                       '1234' : function(r) {
+                                               return "A paid deposit will be owed to this patron if this action is overrided.";
+                                       },
                                        '7010' : function(r) {
                                                return r.payload;
                                        },
@@ -1304,6 +1308,23 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                                document.getElementById('no_change_label').setAttribute('hidden','false');
                        }
 
+               } else /* HOLD_CAPTURE_DELAYED */ if (check.ilsevent == 7019) {
+
+                       var rv = 0;
+                       msg += "\nThis item could fulfill a hold request but capture has been delayed by policy.\n";
+                       rv = error.yns_alert_formatted(
+                               msg,
+                "Hold Capture Delayed",
+                               "Do Not Capture",
+                               "Capture",
+                               null,
+                               "Check here to confirm this message",
+                               '/xul/server/skin/media/images/stop_sign.png'
+                       );
+                       params.capture = rv == 0 ? 'nocapture' : 'capture';
+
+                       return circ.util.checkin_via_barcode(session,params,backdate,auto_print,false); 
+
                } else /* NETWORK TIMEOUT */ if (check.ilsevent == -1) {
                        error.standard_network_error_alert('Check In Failed.  If you wish to use the offline interface, in the top menubar select Circulation -> Offline Interface');
                } else {
@@ -1313,6 +1334,7 @@ circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,che
                                case 1213 /* PATRON_BARRED */ :
                                case 1217 /* PATRON_INACTIVE */ :
                                case 1224 /* PATRON_ACCOUNT_EXPIRED */ :
+                               case 1234 /* ITEM_DEPOSIT_PAID */ :
                                case 7009 /* CIRC_CLAIMS_RETURNED */ :
                                case 7010 /* COPY_ALERT_MESSAGE */ : 
                                case 7011 /* COPY_STATUS_LOST */ : 
@@ -1355,6 +1377,7 @@ circ.util.renew_via_barcode = function ( barcode, patron_id, async ) {
                                                case 1213 /* PATRON_BARRED */ : break;
                                                case 1215 /* CIRC_EXCEEDS_COPY_RANGE */ : break;
                                                case 1224 /* PATRON_ACCOUNT_EXPIRED */ : break;
+                        case 1233 /* ITEM_RENTAL_FEE_REQUIRED */ : break;
                                                case 1500 /* ACTION_CIRCULATION_NOT_FOUND */ : break;
                                                case 7002 /* PATRON_EXCEEDS_CHECKOUT_COUNT */ : break;
                                                case 7003 /* COPY_CIRC_NOT_ALLOWED */ : break;
@@ -1389,6 +1412,7 @@ circ.util.renew_via_barcode = function ( barcode, patron_id, async ) {
                                        1212 /* PATRON_EXCEEDS_OVERDUE_COUNT */,
                                        1213 /* PATRON_BARRED */,
                                        1215 /* CIRC_EXCEEDS_COPY_RANGE */,
+                    1233 /* ITEM_RENTAL_FEE_REQUIRED */,
                                        7002 /* PATRON_EXCEEDS_CHECKOUT_COUNT */,
                                        7003 /* COPY_CIRC_NOT_ALLOWED */,
                                        7004 /* COPY_NOT_AVAILABLE */,
@@ -1403,6 +1427,9 @@ circ.util.renew_via_barcode = function ( barcode, patron_id, async ) {
                                        '1212' : function(r) { return 'Barcode: ' + barcode; },
                                        '1213' : function(r) { return 'Barcode: ' + barcode; },
                                        '1215' : function(r) { return 'Barcode: ' + barcode; },
+                    '1233' : function(r) {
+                        return "For item with barcode " + barcode + ", a billing for an Item Rental Fee will be added to the patron's account if this action is overrided.";
+                    },
                                        '7002' : function(r) { return 'Barcode: ' + barcode; },
                                        '7003' : function(r) { return 'Barcode: ' + barcode; },
                                        '7004' : function(r) {