invoice search add-to-invoice action; already-added style; show li count summary
authorBill Erickson <berick@esilibrary.com>
Mon, 16 Jul 2012 20:18:38 +0000 (16:18 -0400)
committerBill Erickson <berick@esilibrary.com>
Mon, 16 Jul 2012 20:18:38 +0000 (16:18 -0400)
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/src/templates/acq/invoice/view.tt2
Open-ILS/web/js/ui/default/acq/invoice/view.js

index 83a6c92..8ee5237 100644 (file)
@@ -4,17 +4,20 @@
 
     <div dojoType="dijit.layout.ContentPane" layoutAlign="client" class='oils-header-panel'>
         <div> Invoice </div>
-        <div id="acq-view-invoice-receive" class="hidden"><button id="acq-view-invoice-receive-link">Receive Items</button></div>
+        <div id="acq-view-invoice-receive" class="hidden">
+            <button id="acq-view-invoice-receive-link">Receive Items</button>
+        </div>
     </div>
 
     <div dojoType="dijit.layout.ContentPane" layoutAlign="client">
         <div id='acq-invoice-summary'>
             <div id='acq-view-invoice-div'></div>
-            <button dojoType='dijit.form.Button' id='acq-invoice-summary-toggle-off'>[% l('Hide Summary') %]</button>
+            <button id='acq-invoice-summary-toggle-off'>[% l('Hide Details') %]</button>
         </div>
         <div id='acq-invoice-summary-small'>
             <h3 id='acq-invoice-summary-name'></h3>
-            <button dojoType='dijit.form.Button' id='acq-invoice-summary-toggle-on'>[% l('Show Summary') %]</button>
+            <div>[% l("Lineitems: " ) %]<span id='acq-invoice-summary-count'>0</span></div><br/>
+            <button id='acq-invoice-summary-toggle-on'>[% l('Show Details') %]</button>
         </div>
         <br/>
     </div>
                             .search-results-content-td {
                                 padding-left: 8px; border-left: 2px solid #888; 
                             }
+                            .search-results-already-invoiced {
+                                background-color: #E99;
+                            }
                         </style>
                         <table>
                             <tbody id='acq-invoice-search-results-tbody'>
index c5d2ace..fb11ab0 100644 (file)
@@ -270,8 +270,10 @@ function searchResultsLoader() {
         checkbox.setAttribute('lineitem', li_id);
 
         // this lineitem is already part of the invoice
-        if (dojo.query('[entry_lineitem_row=' + li_id + ']')[0])
+        if (dojo.query('[entry_lineitem_row=' + li_id + ']')[0]) {
             checkbox.disabled = true;
+            dojo.addClass(checkbox.parentNode, 'search-results-already-invoiced');
+        }
 
         openils.acq.Lineitem.fetchAndRender(
             li_id, {}, 
@@ -290,6 +292,8 @@ function addSelectedToInvoice() {
                 attachLi = checkbox.getAttribute('lineitem');
                 doAttachLi(true);
                 checkbox.disabled = true;
+                checkbox.checked = false;
+                dojo.addClass(checkbox.parentNode, 'search-results-already-invoiced');
             }
         }
     );
@@ -531,6 +535,9 @@ function addInvoiceEntry(entry) {
     openils.Util.removeCSSClass(dojo.byId('acq-invoice-entry-thead'), 'hidden');
     openils.Util.removeCSSClass(dojo.byId('acq-invoice-entry-tbody'), 'hidden');
 
+    dojo.byId('acq-invoice-summary-count').innerHTML = 
+        Number(dojo.byId('acq-invoice-summary-count').innerHTML) + 1;
+
     entryTbody = dojo.byId('acq-invoice-entry-tbody');
     if(entryTemplate == null) {
         entryTemplate = entryTbody.removeChild(dojo.byId('acq-invoice-entry-template'));