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:[EMAIL PROTECTED] 
Sent: Tuesday, November 27, 2007 10:02 AM
To: [email protected]; [EMAIL PROTECTED]
Subject: Re: price rule and quote

De : "William Perng" <[EMAIL PROTECTED]>
> 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:[EMAIL PROTECTED]
> Sent: Monday, November 26, 2007 11:04 AM
> To: [email protected]
> Subject: price rule and quote
>
> When a quote item is created, will the system take the price rule into 
> account ?
>
> Thanks
>
> William Perng
> [EMAIL PROTECTED]
>
>
>
>


Reply via email to