checkin via id for handling deleted items in Items Out
authorpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 17 Oct 2006 18:44:09 +0000 (18:44 +0000)
committerpines <pines@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 17 Oct 2006 18:44:09 +0000 (18:44 +0000)
git-svn-id: svn://svn.open-ils.org/ILS/trunk@6476 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/xul/staff_client/server/circ/checkin.js
Open-ILS/xul/staff_client/server/circ/checkout.js
Open-ILS/xul/staff_client/server/circ/copy_status.js
Open-ILS/xul/staff_client/server/circ/util.js
Open-ILS/xul/staff_client/server/patron/items.js

index 9e52a5e..81a2d12 100644 (file)
@@ -271,7 +271,7 @@ circ.checkin.prototype = {
                        if (auto_print) auto_print = auto_print.checked;
                        JSAN.use('circ.util');
                        circ.util.checkin_via_barcode(
-                               ses(), barcode, backdate, auto_print, {
+                               ses(), { 'barcode' : barcode }, backdate, auto_print, {
                                        'disable_textbox' : function() { 
                                                obj.controller.view.checkin_barcode_entry_textbox.disabled = true; 
                                                obj.controller.view.cmd_checkin_submit_barcode.setAttribute('disabled', 'true'); 
index 184ec37..dc4fc5f 100644 (file)
@@ -615,11 +615,11 @@ circ.checkout.prototype = {
                                                                JSAN.use('circ.util');
                                                                switch(r) {
                                                                        case 1:
-                                                                               circ.util.checkin_via_barcode( ses(), params.barcode );
+                                                                               circ.util.checkin_via_barcode( ses(), { 'barcode' : params.barcode } );
                                                                                obj.checkout(params);
                                                                        break;
                                                                        case 2:
-                                                                               circ.util.checkin_via_barcode( ses(), params.barcode, due_date );
+                                                                               circ.util.checkin_via_barcode( ses(), { 'barcode' : params.barcode }, due_date );
                                                                                obj.checkout(params);
                                                                        break;
                                                                }
index 80f548e..7247087 100644 (file)
@@ -101,7 +101,7 @@ circ.copy_status.prototype = {
                                                                JSAN.use('circ.util');
                                                                for (var i = 0; i < obj.selection_list.length; i++) {
                                                                        var barcode = obj.selection_list[i].barcode;
-                                                                       var checkin = circ.util.checkin_via_barcode( ses(), barcode );
+                                                                       var checkin = circ.util.checkin_via_barcode( ses(), { 'barcode' : barcode } );
                                                                        funcs.push( function(a) { return function() { obj.copy_status( a ); }; }(barcode) );
                                                                }
                                                                alert('Action complete.');
index 8426a49..9e60e84 100644 (file)
@@ -964,7 +964,7 @@ circ.util.std_map_row_to_columns = function(error_value) {
        }
 }
 
-circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print,async) {
+circ.util.checkin_via_barcode = function(session,params,backdate,auto_print,async) {
        try {
                JSAN.use('util.error'); var error = new util.error();
                JSAN.use('util.network'); var network = new util.network();
@@ -973,7 +973,7 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print,asy
 
                if (backdate && (backdate == util.date.formatted_date(new Date(),'%Y-%m-%d')) ) backdate = null;
 
-               var params = { 'barcode' : barcode };
+               //var params = { 'barcode' : barcode };
                if (backdate) params.backdate = backdate;
 
                if (typeof async == 'object') {
@@ -986,7 +986,7 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print,asy
                        async ? function(req) { 
                                try {
                                        var check = req.getResultObject();
-                                       var r = circ.util.checkin_via_barcode2(session,barcode,backdate,auto_print,check); 
+                                       var r = circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check); 
                                        if (typeof async == 'object') {
                                                try { async.checkin_result(r); } catch(E) { error.sdump('D_ERROR','async.checkin_result() = ' + E); };
                                        }
@@ -1024,7 +1024,7 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print,asy
                        }
                );
                if (!async) {
-                       return circ.util.checkin_via_barcode2(session,barcode,backdate,auto_print,check); 
+                       return circ.util.checkin_via_barcode2(session,params,backdate,auto_print,check); 
                }
 
 
@@ -1038,7 +1038,7 @@ circ.util.checkin_via_barcode = function(session,barcode,backdate,auto_print,asy
        }
 }
 
-circ.util.checkin_via_barcode2 = function(session,barcode,backdate,auto_print,check) {
+circ.util.checkin_via_barcode2 = function(session,params,backdate,auto_print,check) {
        try {
                JSAN.use('util.error'); var error = new util.error();
                JSAN.use('util.network'); var network = new util.network();
@@ -1065,9 +1065,11 @@ circ.util.checkin_via_barcode2 = function(session,barcode,backdate,auto_print,ch
                                JSAN.use('util.money');
                                var bill = req.getResultObject();
                                if (Number(bill.balance_owed()) == 0) return;
-                               var m = document.getElementById('no_change_label').getAttribute('value');
-                               document.getElementById('no_change_label').setAttribute('value', m + 'Transaction for ' + barcode + ' billable $' + util.money.sanitize(bill.balance_owed()) + '  ');
-                               document.getElementById('no_change_label').setAttribute('hidden','false');
+                               if (document.getElementById('no_change_label')) {
+                                       var m = document.getElementById('no_change_label').getAttribute('value');
+                                       document.getElementById('no_change_label').setAttribute('value', m + 'Transaction for ' + params.barcode + ' billable $' + util.money.sanitize(bill.balance_owed()) + '  ');
+                                       document.getElementById('no_change_label').setAttribute('hidden','false');
+                               }
                        });
                }
 
@@ -1079,7 +1081,7 @@ circ.util.checkin_via_barcode2 = function(session,barcode,backdate,auto_print,ch
                                //msg = 'This item is already checked in.\n';
                                if (document.getElementById('no_change_label')) {
                                        var m = document.getElementById('no_change_label').getAttribute('value');
-                                       document.getElementById('no_change_label').setAttribute('value',m + barcode + ' was already checked in.  ');
+                                       document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' was already checked in.  ');
                                        document.getElementById('no_change_label').setAttribute('hidden','false');
                                }
                        }
@@ -1138,7 +1140,7 @@ circ.util.checkin_via_barcode2 = function(session,barcode,backdate,auto_print,ch
                                        msg = '';
                                        if (document.getElementById('no_change_label')) {
                                                var m = document.getElementById('no_change_label').getAttribute('value');
-                                               document.getElementById('no_change_label').setAttribute('value',m + barcode + ' has been captured for a hold.  ');
+                                               document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' has been captured for a hold.  ');
                                                document.getElementById('no_change_label').setAttribute('hidden','false');
                                        }
                                break;
@@ -1156,7 +1158,7 @@ circ.util.checkin_via_barcode2 = function(session,barcode,backdate,auto_print,ch
                                        }
                                        if (document.getElementById('no_change_label')) {
                                                var m = document.getElementById('no_change_label').getAttribute('value');
-                                               document.getElementById('no_change_label').setAttribute('value',m + barcode + ' needs to be cataloged.  ');
+                                               document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' needs to be cataloged.  ');
                                                document.getElementById('no_change_label').setAttribute('hidden','false');
                                        }
                                break;
@@ -1222,7 +1224,7 @@ circ.util.checkin_via_barcode2 = function(session,barcode,backdate,auto_print,ch
                        }
                        if (document.getElementById('no_change_label')) {
                                var m = document.getElementById('no_change_label').getAttribute('value');
-                               document.getElementById('no_change_label').setAttribute('value',m + barcode + ' is in transit.  ');
+                               document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' is in transit.  ');
                                document.getElementById('no_change_label').setAttribute('hidden','false');
                        }
 
@@ -1239,7 +1241,7 @@ circ.util.checkin_via_barcode2 = function(session,barcode,backdate,auto_print,ch
                        );
                        if (document.getElementById('no_change_label')) {
                                var m = document.getElementById('no_change_label').getAttribute('value');
-                               document.getElementById('no_change_label').setAttribute('value',m + barcode + ' is mis-scanned or not cataloged.  ');
+                               document.getElementById('no_change_label').setAttribute('value',m + params.barcode + ' is mis-scanned or not cataloged.  ');
                                document.getElementById('no_change_label').setAttribute('hidden','false');
                        }
 
index 95ea23a..c30154f 100644 (file)
@@ -393,10 +393,10 @@ patron.items.prototype = {
                        if (!r) { return; }
                        JSAN.use('circ.util');
                        for (var i = 0; i < retrieve_ids.length; i++) {
-                               var barcode = retrieve_ids[i].barcode;
-                               dump('Check in barcode = ' + barcode);
+                               var copy_id = retrieve_ids[i].copy_id;
+                               dump('Check in copy_id = ' + copy_id + ' barcode = ' + retrieve_ids[i].barcode + '\n');
                                var robj = circ.util.checkin_via_barcode(
-                                       ses(), barcode
+                                       ses(), { 'copy_id' : copy_id }
                                );
                                /* circ.util.checkin_via_barcode handles errors currently */
                        }