From 72a63121464baf00e6936eac5d67563278e380b8 Mon Sep 17 00:00:00 2001 From: pines Date: Tue, 17 Oct 2006 18:44:09 +0000 Subject: [PATCH] checkin via id for handling deleted items in Items Out 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 | 2 +- Open-ILS/xul/staff_client/server/circ/checkout.js | 4 ++-- .../xul/staff_client/server/circ/copy_status.js | 2 +- Open-ILS/xul/staff_client/server/circ/util.js | 28 ++++++++++++---------- Open-ILS/xul/staff_client/server/patron/items.js | 6 ++--- 5 files changed, 22 insertions(+), 20 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/circ/checkin.js b/Open-ILS/xul/staff_client/server/circ/checkin.js index 9e52a5e343..81a2d129df 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkin.js +++ b/Open-ILS/xul/staff_client/server/circ/checkin.js @@ -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'); diff --git a/Open-ILS/xul/staff_client/server/circ/checkout.js b/Open-ILS/xul/staff_client/server/circ/checkout.js index 184ec374e3..dc4fc5f270 100644 --- a/Open-ILS/xul/staff_client/server/circ/checkout.js +++ b/Open-ILS/xul/staff_client/server/circ/checkout.js @@ -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; } diff --git a/Open-ILS/xul/staff_client/server/circ/copy_status.js b/Open-ILS/xul/staff_client/server/circ/copy_status.js index 80f548e0fe..72470873f8 100644 --- a/Open-ILS/xul/staff_client/server/circ/copy_status.js +++ b/Open-ILS/xul/staff_client/server/circ/copy_status.js @@ -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.'); diff --git a/Open-ILS/xul/staff_client/server/circ/util.js b/Open-ILS/xul/staff_client/server/circ/util.js index 8426a49456..9e60e84bf3 100644 --- a/Open-ILS/xul/staff_client/server/circ/util.js +++ b/Open-ILS/xul/staff_client/server/circ/util.js @@ -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'); } diff --git a/Open-ILS/xul/staff_client/server/patron/items.js b/Open-ILS/xul/staff_client/server/patron/items.js index 95ea23aea5..c30154f53e 100644 --- a/Open-ILS/xul/staff_client/server/patron/items.js +++ b/Open-ILS/xul/staff_client/server/patron/items.js @@ -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 */ } -- 2.11.0