selfcheck checkin UI
authorBill Erickson <berick@esilibrary.com>
Mon, 4 Feb 2013 18:49:19 +0000 (13:49 -0500)
committerBill Erickson <berick@esilibrary.com>
Mon, 4 Feb 2013 18:49:19 +0000 (13:49 -0500)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/circ/selfcheck/selfcheck.js

index de859a9..73840a1 100644 (file)
@@ -836,7 +836,7 @@ SelfCheckManager.prototype.updateCircSummary = function(increment) {
 
     if(increment) {
         // local checkout occurred.  Add to the total and the session.
-        this.circSummary.total += 1; // TODO += increment for checkins
+        this.circSummary.total += increment;
         this.circSummary.session += 1;
     }
 
@@ -1043,10 +1043,9 @@ SelfCheckManager.prototype.checkinCopy = function(args) {
         {   async : true,
             params : [
                 this.authtoken, {
-                    patron_id : this.patron.id(),
                     copy_barcode : args.barcode,
-                    void_overdues : args.void_overdues,
-                    backdate : args.backdate
+                    backdate : args.backdate,
+                    void_overdues : args.void_overdues
                 }
             ],
             oncomplete : function(r) {
@@ -1177,14 +1176,17 @@ SelfCheckManager.prototype.displayCheckin = function(result, outcomeText) {
         var date = dojo.date.stamp.fromISOString(circ.due_date());
         this.byName(row, 'due_date').innerHTML = 
             dojo.date.locale.format(date, {selector : 'date'});
+
+        // if a patron is loaded and we just checked an item
+        // in for this patron, decrement the items-out count by 1
+        if (this.patron && this.patron.id() == circ.usr())
+            this.updateCircSummary(-1);
     }
 
 
     // put new circs at the top of the list
     var tbody = this.checkinTbody;
     tbody.insertBefore(row, tbody.getElementsByTagName('tr')[0]);
-
-    this.updateCircSummary();
 }
 
 SelfCheckManager.prototype.handleCheckinResult = function(item, result) {
@@ -1269,7 +1271,7 @@ SelfCheckManager.prototype.handleXactResult = function(action, item, result) {
                 this.updateHoldsSummary();
             }
 
-            this.updateCircSummary(true);
+            this.updateCircSummary(1);
 
         } else if(action == 'renew') {