You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2008/10/23 16:01:52 UTC

svn commit: r707377 - in /ofbiz/trunk/applications: ecommerce/webapp/ecommerce/images/checkoutProcess.js order/script/org/ofbiz/order/order/OrderServices.xml

Author: mor
Date: Thu Oct 23 07:01:51 2008
New Revision: 707377

URL: http://svn.apache.org/viewvc?rev=707377&view=rev
Log:
Fix:Updating shipping and billing address on One Page, address purpose was not updated properly.
Applied patch from Jira Issue OFBIZ-2013 (https://issues.apache.org/jira/browse/OFBIZ-2013)
Thanks to Kirti Dhakad, Onima Kasliwal and Rishi Solanki. 

Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js
    ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js?rev=707377&r1=707376&r2=707377&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/checkoutProcess.js Thu Oct 23 07:01:51 2008
@@ -203,6 +203,11 @@
          hideOrderSubmitPanel();
          Effect.BlindDown('editBillingPanel', {duration: 0.0});
     }
+    if ($F('shipToContactMechId') != $F('billToContactMechId')) {
+        $('useShippingAddressForBilling').checked = false;
+        Effect.BlindDown($('billingAddress'), {duration: 0.3});
+        $('useShippingAddressForBilling').value = "N";
+    }
 }
 
 function showOrderSubmitPanel() {
@@ -315,10 +320,12 @@
         $('billToCity').value = $F('shipToCity');
         $('billToPostalCode').value = $F('shipToPostalCode');
         $('billToCountryGeoId').value = $F('shipToCountryGeoId');
+        $('useShippingAddressForBilling').value = "Y";
         $('billToStateProvinceGeoId').update("<option value = " + $F('shipToStateProvinceGeoId') + " > " + $('shipToStateProvinceGeo').value + " </option>");
         Effect.BlindUp($('billingAddress'), {duration: 0.3});
     } else {
         Effect.BlindDown($('billingAddress'), {duration: 0.3});
+        $('useShippingAddressForBilling').value = "N";
     }
 }
 

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml?rev=707377&r1=707376&r2=707377&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml Thu Oct 23 07:01:51 2008
@@ -967,7 +967,7 @@
                     <if-compare-field field="oldValue" to-field="newValue" operator="not-equals" type="Object">
                         <entity-and entity-name="PartyContactMechPurpose" list-name="pcmpList" filter-by-date="true">
                             <field-map field-name="contactMechId" env-name="shipToAddressCtx.shipToContactMechId"/>
-                            <field-map field-name="partyId" env-name="partyId"/>
+                            <field-map field-name="partyId" env-name="userLogin.partyId"/>
                             <field-map field-name="contactMechPurposeTypeId" value="SHIPPING_LOCATION"/>
                         </entity-and>
                         <first-from-list list-name="pcmpList" entry-name="pcmp"/>
@@ -975,6 +975,7 @@
                             <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map-name="pcmp" to-map-name="serviceInMap"/>
                             <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
                         </if-not-empty>
+                        <set field="shipToAddressCtx.contactMechPurposeTypeId" value="SHIPPING_LOCATION"/>
                         <call-service service-name="createPartyPostalAddress" in-map-name="shipToAddressCtx">
                             <result-to-field result-name="contactMechId" field-name="parameters.shipToContactMechId"/>
                         </call-service>
@@ -1047,7 +1048,6 @@
                 <log level="info" message="Billing address created with contactmechId ${parameters.billToContactMechId}"/>
             <else>
                 <if-compare-field field="parameters.shipToContactMechId" operator="equals" to-field="parameters.billToContactMechId">
-                    <set field="billToAddressCtx.contactMechPurposeTypeId" value="BILLING_LOCATION"/>
                     <call-service service-name="createPartyPostalAddress" in-map-name="billToAddressCtx">
                         <result-to-field result-name="contactMechId" field-name="parameters.billToContactMechId"/>
                     </call-service>