[open-ils-commits] r20448 - in trunk/Open-ILS/web: css/skin/default js/dojo/openils/acq js/ui/default/acq/invoice templates/default/acq/invoice (erickson)

svn at svn.open-ils.org svn at svn.open-ils.org
Mon May 9 14:27:47 EDT 2011


Author: erickson
Date: 2011-05-09 14:27:42 -0400 (Mon, 09 May 2011)
New Revision: 20448

Modified:
   trunk/Open-ILS/web/css/skin/default/acq.css
   trunk/Open-ILS/web/js/dojo/openils/acq/Lineitem.js
   trunk/Open-ILS/web/js/ui/default/acq/invoice/view.js
   trunk/Open-ILS/web/templates/default/acq/invoice/view.tt2
Log:
Invoice from LI seeds invoice data

    * When creating a new invoice from a lineitem, seed the invoice with
        provider data from the lineitem.
    * Make money textbox's a little larger to accommodate larger sums
        without scrolling
    * Truncate long titles in lineitem summary view

Modified: trunk/Open-ILS/web/css/skin/default/acq.css
===================================================================
--- trunk/Open-ILS/web/css/skin/default/acq.css	2011-05-06 19:41:31 UTC (rev 20447)
+++ trunk/Open-ILS/web/css/skin/default/acq.css	2011-05-09 18:27:42 UTC (rev 20448)
@@ -214,6 +214,7 @@
 .acq-link-invoice-dialog td,.acq-link-invoice-dialog th {padding-top: 10px;}
 .acq-invoice-paid-col {background : #E0E0E0; text-align: center;}
 .acq-invoice-center-col { text-align: center; }
+.acq-invoice-money { width: 7em; }
 
 .acq-lineitem-summary { font-weight: bold; }
 .acq-lineitem-summary-extra { padding-left: 10px; }

Modified: trunk/Open-ILS/web/js/dojo/openils/acq/Lineitem.js
===================================================================
--- trunk/Open-ILS/web/js/dojo/openils/acq/Lineitem.js	2011-05-06 19:41:31 UTC (rev 20447)
+++ trunk/Open-ILS/web/js/dojo/openils/acq/Lineitem.js	2011-05-09 18:27:42 UTC (rev 20448)
@@ -181,7 +181,14 @@
                         liLink,
                         (po) ? 'foo' : '', // forces class='hiddenfoo' i.e. not hidden
                         (pl) ? 'foo' : '', // ditto
-                    ]
+                    ],
+                    function(str) {
+                        // prevent long titles from filling up the page
+                        var truncSize = 100;
+                        if(str.length > truncSize)
+                            str = str.substring(0, truncSize) + '...';
+                        return str;
+                    }
                 );
 
                 callback(lineitem, displayString);

Modified: trunk/Open-ILS/web/js/ui/default/acq/invoice/view.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/invoice/view.js	2011-05-06 19:41:31 UTC (rev 20447)
+++ trunk/Open-ILS/web/js/ui/default/acq/invoice/view.js	2011-05-09 18:27:42 UTC (rev 20448)
@@ -133,9 +133,22 @@
 
     //var invoiceArgs = {provider : lineitem.provider(), shipper : lineitem.provider()}; 
     if(cgi.param('create')) {
-        var invoiceArgs = {};
-        invoicePane = drawInvoicePane(dojo.byId('acq-view-invoice-div'), null, invoiceArgs);
+
+        fieldmapper.standardRequest(
+            ['open-ils.acq', 'open-ils.acq.lineitem.retrieve.authoritative'],
+            {
+                params : [openils.User.authtoken, attachLi, {clear_marc:1}],
+                oncomplete : function(r) {
+                    var li = openils.Util.readResponse(r);
+                    invoicePane = drawInvoicePane(
+                        dojo.byId('acq-view-invoice-div'), null, 
+                        {provider : li.provider(), shipper : li.provider()}
+                    );
+                }
+            }
+        );
     }
+
     var entry = new fieldmapper.acqie();
     entry.id(virtualId--);
     entry.isnew(true);
@@ -283,7 +296,7 @@
             if(field == 'title' || field == 'author') {
                 //args = {style : 'width:10em'};
             } else if(field == 'cost_billed' || field == 'amount_paid') {
-                args = {required : true, style : 'width: 6em'};
+                args = {required : true, style : 'width: 8em'};
             }
             registerWidget(
                 item,
@@ -430,6 +443,7 @@
                 ['inv_item_count', 'phys_item_count', 'cost_billed', 'amount_paid'],
                 function(field) {
                     var dijitArgs = {required : true, constraints : {min: 0}, style : 'width:6em'};
+                    if(!field.match(/count/)) dijitArgs.style = 'width:9em';
                     if(entry.isnew() && field == 'phys_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) - 

Modified: trunk/Open-ILS/web/templates/default/acq/invoice/view.tt2
===================================================================
--- trunk/Open-ILS/web/templates/default/acq/invoice/view.tt2	2011-05-06 19:41:31 UTC (rev 20447)
+++ trunk/Open-ILS/web/templates/default/acq/invoice/view.tt2	2011-05-09 18:27:42 UTC (rev 20448)
@@ -90,7 +90,7 @@
             </tbody>
             <thead>
                 <tr>
-                    <th colspan='4'/>
+                    <th colspan='3'/>
                     <th class='acq-invoice-center-col' class='acq-invoice-billed-col'>Total</th>
                     <th class='acq-invoice-paid-col'>Total</th>
                     <th class='acq-invoice-center-col' class='acq-invoice-balance-col'>Balance</th>
@@ -98,7 +98,7 @@
             </thead>
             <tbody>
                 <tr>
-                    <td colspan='4' style='text-align:right;'>
+                    <td colspan='3' style='text-align:right;'>
                         <button jsId='invoiceSaveButton' class='hide-complete'
                             dojoType='dijit.form.Button' onclick='saveChanges();'>Save</button>
                         <button jsId='invoiceProrateButton' class='hide-complete'
@@ -110,9 +110,9 @@
                                 dojoType='dijit.form.Button' onclick='saveChanges(false, false, true);'>Reopen Invoice</button>
                         </span>
                     </td>
-                    <td class='acq-invoice-center-col'><div jsId='totalInvoicedBox' dojoType='dijit.form.CurrencyTextBox' style='width:6em;'/></td>
-                    <td class='acq-invoice-paid-col'><div jsId='totalPaidBox' dojoType='dijit.form.CurrencyTextBox' style='width:6em;'/></td>
-                    <td class='acq-invoice-center-col'><div jsId='balanceOwedBox' dojoType='dijit.form.CurrencyTextBox' style='width:6em;'/></td>
+                    <td class='acq-invoice-center-col'><div jsId='totalInvoicedBox' dojoType='dijit.form.CurrencyTextBox' style='width:9em;'/></td>
+                    <td class='acq-invoice-paid-col'><div jsId='totalPaidBox' dojoType='dijit.form.CurrencyTextBox' style='width:9em;'/></td>
+                    <td class='acq-invoice-center-col'><div jsId='balanceOwedBox' dojoType='dijit.form.CurrencyTextBox' style='width:9em;'/></td>
                 </tr>
             </tbody>
         </table>



More information about the open-ils-commits mailing list