[open-ils-commits] r12846 - trunk/Open-ILS/web/js/ui/default/acq/common (erickson)
svn at svn.open-ils.org
svn at svn.open-ils.org
Fri Apr 10 11:18:43 EDT 2009
Author: erickson
Date: 2009-04-10 11:18:40 -0400 (Fri, 10 Apr 2009)
New Revision: 12846
Modified:
trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
Log:
use the existing price-finding logic
Modified: trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js
===================================================================
--- trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-04-10 15:18:16 UTC (rev 12845)
+++ trunk/Open-ILS/web/js/ui/default/acq/common/li_table.js 2009-04-10 15:18:40 UTC (rev 12846)
@@ -141,7 +141,8 @@
dojo.query('[name=count]', row)[0].appendChild(document.createTextNode(li.item_count()));
var priceInput = dojo.query('[name=estimated_price]', row)[0];
- priceInput.value = liWrapper.findAttr('estimated_price', 'lineitem_local_attr_definition') || '';
+ var priceData = liWrapper.getPrice();
+ priceInput.value = (priceData) ? priceData.price : '';
priceInput.onchange = function() { self.updateLiPrice(priceInput, li) };
self.tbody.appendChild(row);
@@ -149,11 +150,14 @@
};
self.updateLiPrice = function(input, li) {
+
var price = input.value;
var liWrapper = new openils.acq.Lineitem({lineitem:li});
- var oldPrice = liWrapper.findAttr('estimated_price', 'lineitem_local_attr_definition') || null;
+ var oldPrice = liWrapper.getPrice() || null;
+
+ if(oldPrice) oldPrice = oldPrice.price;
if(price == oldPrice) return;
- console.log("setting price " + price + " for " + li.id());
+
fieldmapper.standardRequest(
['open-ils.acq', 'open-ils.acq.lineitem_local_attr.set'],
{ async : true,
More information about the open-ils-commits
mailing list