svn commit: r679016 - /ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml

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

svn commit: r679016 - /ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml

bibryam
Author: bibryam
Date: Wed Jul 23 01:14:30 2008
New Revision: 679016

URL: http://svn.apache.org/viewvc?rev=679016&view=rev
Log:
Calculate the total price of configurable product when creating a quote from request.

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?rev=679016&r1=679015&r2=679016&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml Wed Jul 23 01:14:30 2008
@@ -300,14 +300,40 @@
         <if-empty field="parameters.quoteUnitPrice">
             <if-not-empty field="parameters.productId">
                 <entity-one entity-name="Product" value-name="product"/>
-                <set from-field="product" field="calculateProductPriceMap.product"/>
-                <set from-field="parameters.quantity" field="calculateProductPriceMap.quantity"/>
-                <if-not-empty field="parameters.selectedAmount">
-                    <set from-field="parameters.selectedAmount" field="calculateProductPriceMap.amount"/>
-                </if-not-empty>
-                <call-service service-name="calculateProductPrice" in-map-name="calculateProductPriceMap">
-                    <result-to-field result-name="price" field-name="newEntity.quoteUnitPrice"/>
-                </call-service>
+                <if>
+                    <condition>
+                    <and>
+                        <if-compare operator="equals" value="AGGREGATED" field="product.productTypeId"></if-compare>
+                        <not><if-empty field="parameters.configId"></if-empty></not>
+                    </and>                    
+                    </condition>
+                    <then>
+        <call-class-method class-name="org.ofbiz.product.config.ProductConfigWorker" method-name="loadProductConfigWrapper" ret-field-name="configWrapper">
+            <field field-name="delegator" type="org.ofbiz.entity.GenericDelegator"/>
+            <field field-name="dispatcher" type="org.ofbiz.service.LocalDispatcher"/>
+            <field field-name="parameters.configId" type="java.lang.String"/>
+            <field field-name="parameters.productId" type="java.lang.String"/>
+            <field field-name="" type="java.lang.String"/>
+            <field field-name="" type="java.lang.String"/>
+            <field field-name="" type="java.lang.String"/>
+            <field field-name="" type="java.lang.String"/>
+            <field field-name="locale" type="java.util.Locale"/>
+            <field field-name="userLogin" type="org.ofbiz.entity.GenericValue"/>
+        </call-class-method>
+        <call-object-method method-name="getTotalPrice" obj-field-name="configWrapper" ret-field-name="totalPrice"></call-object-method>
+        <set field="newEntity.quoteUnitPrice" from-field="totalPrice"/>                          
+                    </then>
+                    <else>
+                    <set from-field="product" field="calculateProductPriceMap.product"/>
+                <set from-field="parameters.quantity" field="calculateProductPriceMap.quantity"/>
+                <if-not-empty field="parameters.selectedAmount">
+                    <set from-field="parameters.selectedAmount" field="calculateProductPriceMap.amount"/>
+                </if-not-empty>
+                <call-service service-name="calculateProductPrice" in-map-name="calculateProductPriceMap">
+                    <result-to-field result-name="price" field-name="newEntity.quoteUnitPrice"/>
+                </call-service>
+                    </else>
+                </if>
             </if-not-empty>
         </if-empty>