You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by William Perng <wp...@salmonllc.com> on 2007/11/26 17:03:56 UTC

price rule and quote

When a quote item is created, will the system take the price rule into
account ?  
 
Thanks
 
William Perng
wperng@salmonllc.com
 
 
 

RE: price rule and quote

Posted by William Perng <wp...@salmonllc.com>.
Yes, I understand quantity is an optional parameter for service
"caculateProductPrice".  However, my point is the caller (createQuoteItem
method of QuoteServices.xml) should pass the quantity to the service in this
case. If there is a price rule which will be triggered only when quantity is
larger than 1, the caculateProductPrice has no chance to return the correct
unit price, since the quantity is always 1 in "caculateProductPrice" and no
price rule will be triggered.

Thanks

William

-----Original Message-----
From: Jacques Le Roux [mailto:jacques.le.roux@les7arts.com] 
Sent: Tuesday, November 27, 2007 10:02 AM
To: user@ofbiz.apache.org; wperng@salmonllc.com
Subject: Re: price rule and quote

De : "William Perng" <wp...@salmonllc.com>
> I guess the problem is in createQuoteItem method of QuoteServices.xml.  
> When the "calculateProductPrice" service is called, the quantity is 
> not passed in.

No, the quantity is optionnal and this snippet is used in
PriceServices.calculateProductPrice

        Double quantityDbl = (Double) context.get("quantity");
        if (quantityDbl == null) quantityDbl = new Double(1.0);
        double quantity = quantityDbl.doubleValue();

The only IN mandatory parameter is product (GenericValue)

Sorry I have no time to look furter yet and did not test your case nor know
if it's intended to work like you described or not. This is an interesting
case, though. I will look try to look further. Any experiments are welcome

Thanks

Jacques

> Thanks
>
> William
>
> -----Original Message-----
> From: William Perng [mailto:wperng@salmonllc.com]
> Sent: Monday, November 26, 2007 11:04 AM
> To: user@ofbiz.apache.org
> Subject: price rule and quote
>
> When a quote item is created, will the system take the price rule into 
> account ?
>
> Thanks
>
> William Perng
> wperng@salmonllc.com
>
>
>
>



Re: price rule and quote

Posted by Jacques Le Roux <ja...@les7arts.com>.
De : "William Perng" <wp...@salmonllc.com>
> I guess the problem is in createQuoteItem method of QuoteServices.xml.  When
> the "calculateProductPrice" service is called, the quantity is not passed
> in.

No, the quantity is optionnal and this snippet is used in PriceServices.calculateProductPrice

        Double quantityDbl = (Double) context.get("quantity");
        if (quantityDbl == null) quantityDbl = new Double(1.0);
        double quantity = quantityDbl.doubleValue();

The only IN mandatory parameter is product (GenericValue)

Sorry I have no time to look furter yet and did not test your case nor know if it's intended to work like you described or not. This
is an interesting case, though. I will look try to look further. Any experiments are welcome

Thanks

Jacques

> Thanks
>
> William
>
> -----Original Message-----
> From: William Perng [mailto:wperng@salmonllc.com]
> Sent: Monday, November 26, 2007 11:04 AM
> To: user@ofbiz.apache.org
> Subject: price rule and quote
>
> When a quote item is created, will the system take the price rule into
> account ?
>
> Thanks
>
> William Perng
> wperng@salmonllc.com
>
>
>
>


RE: price rule and quote

Posted by William Perng <wp...@salmonllc.com>.
I guess the problem is in createQuoteItem method of QuoteServices.xml.  When
the "calculateProductPrice" service is called, the quantity is not passed
in. 

Thanks

William

-----Original Message-----
From: William Perng [mailto:wperng@salmonllc.com] 
Sent: Monday, November 26, 2007 11:04 AM
To: user@ofbiz.apache.org
Subject: price rule and quote 

When a quote item is created, will the system take the price rule into
account ?  
 
Thanks
 
William Perng
wperng@salmonllc.com