Author: hansbak
Date: Fri Apr 6 23:26:19 2007
New Revision: 526369
URL:
http://svn.apache.org/viewvc?view=rev&rev=526369Log:
when an quote item is added and the productId is supplied but no price, take it from the product record.
Modified:
ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml
Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml?view=diff&rev=526369&r1=526368&r2=526369==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml Fri Apr 6 23:26:19 2007
@@ -280,6 +280,17 @@
<field-to-result field-name="newEntity.quoteId" result-name="quoteId"/>
<field-to-result field-name="newEntity.quoteItemSeqId" result-name="quoteItemSeqId"/>
+ <!-- if there is no price and a productItem is supplied fill the price from the product record -->
+ <if-empty field-name="parameters.quoteUnitPrice">
+ <if-not-empty field-name="parameters.productId">
+ <entity-one entity-name="Product" value-name="product"/>
+ <set from-field="product" field="calculateProductPriceMap.product"/>
+ <call-service service-name="calculateProductPrice" in-map-name="calculateProductPriceMap">
+ <result-to-field result-name="price" field-name="newEntity.quoteUnitPrice"/>
+ </call-service>
+ </if-not-empty>
+ </if-empty>
+
<!-- finally create the record (should not exist already)-->
<create-value value-name="newEntity"/>
<check-errors/>