Author: jonesde
Date: Wed Jan 27 08:52:03 2010
New Revision: 903568
URL:
http://svn.apache.org/viewvc?rev=903568&view=revLog:
Now if currency conversion fails a zero will be returned for the product cost, ie the service was unable to determine the product code in the desired currency; note that this uses the new ignore error behavior for the break-on-error attribute introduced in rev 903567
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml
Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml?rev=903568&r1=903567&r2=903568&view=diff==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/cost/CostServices.xml Wed Jan 27 08:52:03 2010
@@ -138,9 +138,15 @@
<set from-field="priceCost.lastPrice" field="inputMap.originalValue"/>
<set from-field="priceCost.currencyUomId" field="inputMap.uomId"/>
<set from-field="parameters.currencyUomId" field="inputMap.uomIdTo"/>
- <call-service service-name="convertUom" in-map-name="inputMap">
+
+ <call-service service-name="convertUom" in-map-name="inputMap" require-new-transaction="true" break-on-error="false">
<result-to-field result-name="convertedValue" field="productCost"/>
</call-service>
+
+ <!-- if currency conversion fails then a 0 cost will be returned -->
+ <if-empty field="productCost">
+ <set field="productCost" value="0" type="BigDecimal"/>
+ </if-empty>
</if-not-empty>
</if-compare>
</if-compare>