Hi Christian,
you are right but the bug is not into ManageQuotePrices.bsh but only in ViewQuoteItemInfo.ftl.
In ManageQuotePrices.bsh there is a check that set the selectedAmount to 1 if it's null or equal to 0.
double selectedAmount = 1.0;
if (quoteItem.get("quantity") != null) {
quantity = (quoteItem.getDouble("quantity")).doubleValue();
}
if (quoteItem.get("selectedAmount") != null) {
selectedAmount = (quoteItem.getDouble("selectedAmount")).doubleValue();
}
if (selectedAmount == 0.0) {
selectedAmount = 1.0;
}
I have fix the issue on the ViewQuoteItemInfo.ftl into rev. 631668.
Thanks a lot to review it.
Marco
----
[hidden email] schrieb:
Author: mrisaliti
Date: Tue Feb 26 10:45:08 2008
New Revision: 631330
URL:
http://svn.apache.org/viewvc?rev=631330&view=revLog:
Quote Items subtotal are not correctly calculated (Issue OFBIZ-1677)
[..]
--- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/quote/ManageQuotePrices.bsh (original)
+++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/actions/quote/ManageQuotePrices.bsh Tue Feb 26 10:45:08 2008
@@ -73,7 +73,7 @@
}
defaultQuoteUnitPrice = averageCost * costToPriceMult * selectedAmount;
totalCost += (averageCost * quantity);
- totalPrice += (unitPrice * quantity);
+ totalPrice += (unitPrice * quantity * selectedAmount);
But this causes a problem if selectedAmount is zero.
My understanding is that the amount field is optional and only used if you need a non-integer quantity.
--
Christian