acq - invoice interface more autofill acq-po-work-flow-improve-2013
authorLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 11 Mar 2013 16:27:06 +0000 (12:27 -0400)
committerLebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Mon, 11 Mar 2013 18:00:53 +0000 (14:00 -0400)
Signed-off-by: Lebbeous Fogle-Weekley <lebbeous@esilibrary.com>
Open-ILS/src/templates/acq/invoice/view.tt2
Open-ILS/web/css/skin/default/acq.css
Open-ILS/web/js/ui/default/acq/invoice/view.js

index 3871c64..678eec5 100644 (file)
@@ -73,9 +73,9 @@
                     <thead id='acq-invoice-entry-thead' class='hidden'>
                         <tr>
                             <th colspan='2'>[% l('Title Details') %]</th>
-                            <th class='acq-invoice-center-col'>[% l('#&nbsp;Invoiced&nbsp;/&nbsp;#&nbsp;Paid') %]</th>
+                            <th class='acq-invoice-center-col'>[% l('# Invoiced / # Paid') %]</th>
                             <th class='acq-invoice-center-col'>[% l('Billed') %]</th>
-                            <th class='acq-invoice-paid-per-copy-col'>[% l('Per Copy') %]</th>
+                            <th class='acq-invoice-paid-per-copy-col' style="white-space: normal">[% l('Per Copy') %]</th>
                             <th class='acq-invoice-paid-col'>[% l('Paid') %]</th>
                             <th class='acq-invoice-center-col hide-complete'>[% l('Detach') %]</th>
                         </tr>
                         </tr>
                     </tbody>
                     <!-- acq.invoice_item -->
-                    <thead>
+                    <thead id="acq-invoice-item-thead">
                         <tr>
                             <th>[% l('Charge Type') %]</th>
                             <th class='acq-invoice-center-col'>[% l('Fund') %]</th>
-                            <th>[% l('Title/Description') %]</th>
+                            <th>[% l('Title / Description') %]</th>
                             <th class='acq-invoice-center-col'>[% l('Billed') %]</th>
                             <th/>
                             <th class='acq-invoice-paid-col'>[% l('Paid') %]</th>
index 771a31d..39c66cc 100644 (file)
@@ -220,6 +220,8 @@ span[name="notes_alert_flag"] {color: #c00;font-weight: bold;font-size: 110%;mar
 .acq-invoice-paid-col {background : #E0E0E0; text-align: center;}
 .acq-invoice-center-col { text-align: center; }
 .acq-invoice-money { width: 7em; }
+#acq-invoice-entry-thead th { white-space: nowrap; }
+#acq-invoice-item-thead th { white-space: nowrap; }
 
 .acq-lineitem-summary { font-weight: bold; }
 .acq-lineitem-summary-extra { padding-left: 10px; }
index 42f8377..f447f18 100644 (file)
@@ -589,8 +589,19 @@ function addInvoiceItem(item) {
                     readOnly : invoice && openils.Util.isTrue(invoice.complete()),
                     dijitArgs : args,
                     parentNode : nodeByName(field, row)
-                })
-            )
+                }),
+                function(w) {
+                    if (field == "cost_billed") {
+                        dojo.connect(
+                            w, "onChange", function(value) {
+                                var paid = widgetRegistry.acqii[item.id()].amount_paid.widget;
+                                if (value && isNaN(paid.attr("value")))
+                                    paid.attr("value", value);
+                            }
+                        );
+                    }
+                }
+            );
         }
     );
 
@@ -819,7 +830,7 @@ function addInvoiceEntry(entry) {
                     } else {
                         dijitArgs.style = 'width:9em;';
                     }
-                    if(entry.isnew() && field == 'phys_item_count') {
+                    if (entry.isnew() && (field == 'phys_item_count' || field == 'inv_item_count')) {
                         // by default, attempt to pay for all non-canceled and as-of-yet-un-invoiced items
                         var count = Number(li.order_summary().item_count() || 0) - 
                                     Number(li.order_summary().cancel_count() || 0) -
@@ -854,6 +865,16 @@ function addInvoiceEntry(entry) {
                                 )
                             } // if
 
+                            if (field == "cost_billed") {
+                                // hooks applied with dojo.connect to dijit events are additive, so there's no conflict between this and what comes next
+                                dojo.connect(
+                                    w, "onChange", function(value) {
+                                    var paid = widgetRegistry.acqie[entry.id()].amount_paid.widget;
+                                        if (value && isNaN(paid.attr("value")))
+                                            paid.attr("value", value);
+                                    }
+                                );
+                            }
                             if(field == 'inv_item_count' || field == 'cost_billed') {
                                 setPerCopyPrice(row, entry);
                                 // update the per-copy count as invoice count and cost billed change