<thead id='acq-invoice-entry-thead' class='hidden'>
<tr>
<th colspan='2'>[% l('Title Details') %]</th>
- <th class='acq-invoice-center-col'>[% l('# Invoiced / # 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>
.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; }
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);
+ }
+ );
+ }
+ }
+ );
}
);
} 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) -
)
} // 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