acq invoice : update search to use new attachLi as list
authorBill Erickson <berick@esilibrary.com>
Wed, 25 Jul 2012 16:09:19 +0000 (12:09 -0400)
committerBill Erickson <berick@esilibrary.com>
Wed, 25 Jul 2012 16:09:19 +0000 (12:09 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/web/js/ui/default/acq/invoice/view.js

index d754c06..7b5e0be 100644 (file)
@@ -370,17 +370,18 @@ function searchResultsLoader() {
 
 function addSelectedToInvoice() {
     var inputs = dojo.query('[name=search-results-checkbox]');
+    attachLi = [];
     dojo.forEach(inputs,
         function(checkbox) {
             if (checkbox.checked) {
-                attachLi = checkbox.getAttribute('lineitem');
-                doAttachLi(true);
+                attachLi.push(checkbox.getAttribute('lineitem'));
                 checkbox.disabled = true;
                 checkbox.checked = false;
                 dojo.addClass(checkbox.parentNode, 'search-results-already-invoiced');
             }
         }
     );
+    doAttachLi(true);
 }
 
 function clearSearchResTable() {
@@ -666,6 +667,7 @@ function updateExpectedCost(li, entry) {
 }
 
 function addInvoiceEntry(entry) {
+    console.log('Adding new entry for lineitem ' + entry.lineitem());
 
     openils.Util.removeCSSClass(dojo.byId('acq-invoice-entry-header'), 'hidden');
     openils.Util.removeCSSClass(dojo.byId('acq-invoice-entry-thead'), 'hidden');