From e4c29a7c7767bebfe6fb557987a8a5a854d8d79e Mon Sep 17 00:00:00 2001 From: Lebbeous Fogle-Weekley Date: Mon, 11 Mar 2013 12:27:06 -0400 Subject: [PATCH] acq - invoice interface more autofill Signed-off-by: Lebbeous Fogle-Weekley --- Open-ILS/src/templates/acq/invoice/view.tt2 | 8 ++++---- Open-ILS/web/css/skin/default/acq.css | 2 ++ Open-ILS/web/js/ui/default/acq/invoice/view.js | 27 +++++++++++++++++++++++--- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/templates/acq/invoice/view.tt2 b/Open-ILS/src/templates/acq/invoice/view.tt2 index 3871c64390..678eec5a9a 100644 --- a/Open-ILS/src/templates/acq/invoice/view.tt2 +++ b/Open-ILS/src/templates/acq/invoice/view.tt2 @@ -73,9 +73,9 @@ [% l('Title Details') %] - [% l('# Invoiced / # Paid') %] + [% l('# Invoiced / # Paid') %] [% l('Billed') %] - [% l('Per Copy') %] + [% l('Per Copy') %] [% l('Paid') %] [% l('Detach') %] @@ -103,11 +103,11 @@ - + [% l('Charge Type') %] [% l('Fund') %] - [% l('Title/Description') %] + [% l('Title / Description') %] [% l('Billed') %] [% l('Paid') %] diff --git a/Open-ILS/web/css/skin/default/acq.css b/Open-ILS/web/css/skin/default/acq.css index 771a31d92c..39c66cc24f 100644 --- a/Open-ILS/web/css/skin/default/acq.css +++ b/Open-ILS/web/css/skin/default/acq.css @@ -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; } diff --git a/Open-ILS/web/js/ui/default/acq/invoice/view.js b/Open-ILS/web/js/ui/default/acq/invoice/view.js index 42f83771a7..f447f182b6 100644 --- a/Open-ILS/web/js/ui/default/acq/invoice/view.js +++ b/Open-ILS/web/js/ui/default/acq/invoice/view.js @@ -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 -- 2.11.0