Re: svn commit: r631330 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/quote/ManageQuotePrices.bsh WEB-INF/actions/quote/ViewQuoteProfit.bsh quote/ViewQuoteItemInfo.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r631330 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/quote/ManageQuotePrices.bsh WEB-INF/actions/quote/ViewQuoteProfit.bsh quote/ViewQuoteItemInfo.ftl

Christian Geisert
[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=rev
> Log:
> 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

Reply | Threaded
Open this post in threaded view
|

Re: Re: svn commit: r631330 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/quote/ManageQuotePrices.bsh WEB-INF/actions/quote/ViewQuoteProfit.bsh quote/ViewQuoteItemInfo.ftl

mrisaliti@libero.it
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=rev
Log:
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



Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r631330 - in /ofbiz/trunk/applications/order/webapp/ordermgr: WEB-INF/actions/quote/ManageQuotePrices.bsh WEB-INF/actions/quote/ViewQuoteProfit.bsh quote/ViewQuoteItemInfo.ftl

Christian Geisert
[hidden email] schrieb:
> 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.

Looks like a picked the wrong source ...I just did a quick test with
ViewQuote.


> I have fix the issue on the ViewQuoteItemInfo.ftl into rev. 631668.

Confirmed ;-)

--
Christian