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/08/25 16:33:53 UTC

svn commit: r688737 - in /ofbiz/trunk/applications: ecommerce/config/ ecommerce/script/org/ofbiz/ecommerce/customer/ ecommerce/webapp/ecommerce/customer/profile/ ecommerce/webapp/ecommerce/images/ ecommerce/widget/ party/script/org/ofbiz/party/contact/

Author: mor
Date: Mon Aug 25 07:33:52 2008
New Revision: 688737

URL: http://svn.apache.org/viewvc?rev=688737&view=rev
Log:
Continuing improvements in new profile and customer pages. Thanks to Sumit Pandit, Brajesh Patel, Rishi Solanki and Santosh Malviya for this contribution

Added:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl   (with props)
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl   (with props)
Modified:
    ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml
    ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js
    ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml
    ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml

Modified: ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml?rev=688737&r1=688736&r2=688737&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml (original)
+++ ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.xml Mon Aug 25 07:33:52 2008
@@ -2128,8 +2128,8 @@
         <value xml:lang="th">เห็นด้วย</value>
         <value xml:lang="zh">忠诚度点数</value>
     </property>
-    <property key="EcommerceManage">
-        <value xml:lang="en">Manage</value>
+    <property key="EcommerceManageAddresses">
+        <value xml:lang="en">Manage Addresses</value>
     </property>
     <property key="EcommerceMessage1">
         <value xml:lang="en">Sorry, it appears that the specified product ID</value>

Modified: ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml?rev=688737&r1=688736&r2=688737&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml (original)
+++ ofbiz/trunk/applications/ecommerce/script/org/ofbiz/ecommerce/customer/CustomerEvents.xml Mon Aug 25 07:33:52 2008
@@ -1451,9 +1451,9 @@
         <set field="shipToTelecomNumberCtx.contactMechPurposeTypeId" value="PHONE_SHIPPING"/>
         <!-- call create telecom service -->
         <call-service service-name="createPartyTelecomNumber" in-map-name="shipToTelecomNumberCtx">
-            <result-to-field result-name="contactMechId" field-name="shipToTelecomContactMechId"/>
+            <result-to-field result-name="contactMechId" field-name="parameters.shipToTelecomContactMechId"/>
         </call-service>
-        <log level="info" message="Shipping telecom number is created with contactMechId ${shipToTelecomContactMechId}"/>
+        <log level="info" message="Shipping telecom number is created with contactMechId ${parameters.shipToTelecomContactMechId}"/>
 
         <!-- Create billing address -->
         <if-compare field="parameters.useShippingAddressForBilling" operator="not-equals" value="Y">
@@ -1464,21 +1464,26 @@
             <call-service service-name="createPostalAddressAndPurposes" in-map-name="billToAddressCtx">
                 <result-to-field result-name="contactMechId" field-name="billToContactMechId"/>
             </call-service>
+            <!-- create billing telecom number  -->
+            <set field="billToTelecomNumberCtx.partyId" from-field="parameters.partyId"/>
+            <set field="billToTelecomNumberCtx.userLogin" from-field="parameters.userLogin"/>
+            <set field="billToTelecomNumberCtx.contactMechPurposeTypeId" value="PHONE_BILLING"/>
+            <!-- call create telecom service -->
+            <call-service service-name="createPartyTelecomNumber" in-map-name="billToTelecomNumberCtx">
+                <result-to-field result-name="contactMechId" field-name="billToTelecomContactMechId"/>
+            </call-service>
+        
             <log level="info" message="Billing address created with contactMechId ${billToContactMechId}"/>
         <else>
+            <set field="billToTelecomNumberCtx.contactMechPurposeTypeId" value="PHONE_BILLING"/>
+            <set field="billToTelecomNumberCtx.partyId" from-field="partyId"/>
+            <set-service-fields service-name="createPartyContactMechPurpose" map-name="billToTelecomNumberCtx" to-map-name="serviceInMap"/>
+            <set field="serviceInMap.contactMechId" from-field="parameters.shipToTelecomContactMechId"/>
+            <set field="serviceInMap.userLogin" from-field="parameters.userLogin"/>
+            <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceInMap"/>
             <log level="info" message="Billing address created same as Shipping address with contactMechId ${shipToContactMechId}"/>
         </else>
         </if-compare>
-
-        <!-- create billing telecom number  -->
-        <set field="billToTelecomNumberCtx.partyId" from-field="parameters.partyId"/>
-        <set field="billToTelecomNumberCtx.userLogin" from-field="parameters.userLogin"/>
-        <set field="billToTelecomNumberCtx.contactMechPurposeTypeId" value="PHONE_BILLING"/>
-        <!-- call create telecom service -->
-        <call-service service-name="createPartyTelecomNumber" in-map-name="billToTelecomNumberCtx">
-            <result-to-field result-name="contactMechId" field-name="billToTelecomContactMechId"/>
-        </call-service>
-        <log level="info" message="Billing telecom number is created with contactMechId ${billToTelecomContactMechId}"/>
      </simple-method>
     
     <simple-method method-name="updateCustomerProfile" short-description="Update a customer profile">

Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl?rev=688737&view=auto
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl (added)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl Mon Aug 25 07:33:52 2008
@@ -0,0 +1,107 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div id="billToServerError" class="errorMessage"></div>
+<form id="editBillToPostalAddress" name="editBillToPostalAddress" method="post" action="<@o...@ofbizUrl>">
+  <div>
+    <input type="hidden" name="setBillingPurpose" value="Y"/>
+    <input type="hidden" name="contactMechId" value="${parameters.billToContactMechId?if_exists}"/>
+    <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request)/>
+    <input type="hidden" name="productStoreId" value="${productStoreId?if_exists}"/>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyAddressLine1}*</label>
+      <span>
+        <input type="text" class="left required" name="address1" id="billToAddress1" value="${parameters.billToAddress1?if_exists}" size="30" maxlength="30">
+        <span id="advice-required-billToAddress1" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyAddressLine2}</label>
+      <span>
+        <input type="text" class="left" name="address2" value="${parameters.billToAddress2?if_exists}" size="30" maxlength="30">    
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyCity}*</label>
+      <span>
+        <input type="text" class="left required" name="city" id="billToCity" value="${parameters.billToCity?if_exists}" size="30" maxlength="30">
+        <span id="advice-required-billToCity" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyZipCode}*</label>
+      <span>
+        <input type="text" class="left required" name="postalCode" id="billToPostalCode" value="${parameters.billToPostalCode?if_exists}" size="12" maxlength="10">
+        <span id="advice-required-billToPostalCode" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyState}*</label>
+      <span>
+        <select name="stateProvinceGeoId" id="billToStateProvinceGeoId" class="left required" style="width: 70%">
+          <#if parameters.billToStateProvinceGeoId?exists>
+            <option value='${parameters.billToStateProvinceGeoId}'>${selectedStateName?default(parameters.billToStateProvinceGeoId)}</option>
+          </#if>
+          <option value="">${uiLabelMap.PartyNoState}</option>
+          ${screens.render("component://common/widget/CommonScreens.xml#states")}
+        </select>
+        <span id="advice-required-billToStateProvinceGeoId" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyCountry}*</label>
+      <span>
+        <select name="countryGeoId" id="billToCountryGeoId" class="left required" style="width: 70%">
+          <#if parameters.billToCountryGeoId?exists>
+            <option value='${parameters.billToCountryGeoId}'>${selectedCountryName?default(parameters.billToCountryGeoId)}</option>
+          </#if>
+          ${screens.render("component://common/widget/CommonScreens.xml#countries")}
+        </select>
+        <span id="advice-required-billToCountryGeoId" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <#if telecomNumber?has_content>
+      <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/>
+      <div class="form-row">
+        <div class="field-label">
+          <label for="phoneNumber_${telecomNumber.contactMechId}">${uiLabelMap.PartyPhoneNumber}*</label>
+        </div>
+        <div>
+          <input type="hidden" name="phoneContactMechId" value="${telecomNumber.contactMechId?if_exists}"/>
+          <input type="text" name="countryCode" id="countryCode_${telecomNumber.contactMechId}" class="required" value="${telecomNumber.countryCode?if_exists}" size="3" maxlength="3"/>
+          - <input type="text" name="areaCode" id="areaCode_${telecomNumber.contactMechId}" class="required" value="${telecomNumber.areaCode?if_exists}" size="3" maxlength="3"/>
+          - <input type="text" name="contactNumber" id="contactNumber_${telecomNumber.contactMechId}" class="required" value="${contactNumber?default("${telecomNumber.contactNumber?if_exists}")}" size="6" maxlength="7"/>
+          - <input type="text" name="extension" id="extension_${telecomNumber.contactMechId}" value="${extension?default("${pcm.extension?if_exists}")}" size="3" maxlength="3"/>
+        </div>
+      </div>
+    </#if>
+    <#if parameters.shipToContactMechId != parameters.billToContactMechId>
+      <div class="form-row">
+        <b>${uiLabelMap.EcommerceMyDefaultShippingAddress}</b>
+        <input type="checkbox" name="setShippingPurpose" value="Y" <#if setShippingPurpose?exists>checked</#if>/>
+      </div>
+    </#if>
+    <div class="form-row">
+      <a name="submitEditBillToPostalAddress" id="submitEditBillToPostalAddress" class="buttontext" onclick="updatePartyBillToPostalAddress('submitEditBillToPostalAddress')">${uiLabelMap.CommonSubmit}</a>
+      <form action="">
+        <input class="popup_closebox buttontext" type="button" value="${uiLabelMap.CommonClose}"/>
+      </form>
+    </div>
+  </div>
+</form>

Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl?rev=688737&r1=688736&r2=688737&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditPostalAddress.ftl Mon Aug 25 07:33:52 2008
@@ -24,28 +24,6 @@
   <input type="hidden" name="contactMechId" value="${postalAddress.contactMechId?if_exists}"/>
   <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request)/>
   <input type="hidden" name="productStoreId" value="${productStoreId?if_exists}"/>
-  <#assign showSetShippingPurpose = "Y">
-  <#assign showSetBillingPurpose = "Y">
-  <#assign telecomNumber = "">
-  <#list partyContactMechValueMap.partyContactMechPurposes?if_exists as partyContactMechPurpose> 
-    <#assign contactMechPurposeType = partyContactMechPurpose.getRelatedOneCache("ContactMechPurposeType")>
-    <#if contactMechPurposeType.contactMechPurposeTypeId == "SHIPPING_LOCATION">
-      <#assign showSetShippingPurpose = "N">
-      <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_SHIPPING")))>
-      <#if pcmps?has_content>
-        <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/>
-        <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/>
-      </#if>
-    </#if>
-    <#if contactMechPurposeType.contactMechPurposeTypeId == "BILLING_LOCATION">
-      <#assign showSetBillingPurpose = "N">
-      <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_BILLING")))>
-      <#if pcmps?has_content>
-        <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/>
-        <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/>
-      </#if>
-    </#if>
-  </#list>
   <div class="screenlet-body">
     <div class="form-row">
       <label>${uiLabelMap.PartyAddressLine1}*</label>
@@ -99,39 +77,14 @@
         <span id="advice-required-countryGeoId_${contactMech.contactMechId}" style="display: none" class="errorMessage">(required)</span>
       </span>
     </div>
-
-    <#if telecomNumber?has_content>
-      <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/>
-      <div class="form-row">
-        <div class="field-label">
-          <label for="phoneNumber_${telecomNumber.contactMechId}">${uiLabelMap.PartyPhoneNumber}*</label>
-        </div>
-        <div>
-          <input type="hidden" name="phoneContactMechId" value="${telecomNumber.contactMechId?if_exists}"/>
-          <input type="text" name="countryCode" id="countryCode_${telecomNumber.contactMechId}" class="required" value="${telecomNumber.countryCode?if_exists}" size="3" maxlength="3"/>
-          - <input type="text" name="areaCode" id="areaCode_${telecomNumber.contactMechId}" class="required" value="${telecomNumber.areaCode?if_exists}" size="3" maxlength="3"/>
-          - <input type="text" name="contactNumber" id="contactNumber_${telecomNumber.contactMechId}" class="required" value="${contactNumber?default("${telecomNumber.contactNumber?if_exists}")}" size="6" maxlength="7"/>
-          - <input type="text" name="extension" id="extension_${telecomNumber.contactMechId}" value="${extension?default("${pcm.extension?if_exists}")}" size="3" maxlength="3"/>
-        </div>
-      </div>    
-    </#if>
-    <#if showSetShippingPurpose == "Y">
-      <div class="form-row">
-        <b>${uiLabelMap.EcommerceMyDefaultShippingAddress}</b>
-        <input type="checkbox" name="setShippingPurpose" value="Y" <#if setShippingPurpose?exists>checked</#if>/>
-      </div>
-    <#else>
-        <input type="hidden" name="setShippingPurpose" value="Y"/>
-    </#if>
-    <#if showSetBillingPurpose == "Y">
-      <div class="form-row">
-        <b>${uiLabelMap.EcommerceMyDefaultBillingAddress}</b>
-        <input type="checkbox" name="setBillingPurpose" value="Y" <#if setBillingPurpose?exists>checked</#if>/>
-      </div>
-    <#else>
-      <input type="hidden" name="setBillingPurpose" value="Y"/>
-    </#if>
-
+    <div class="form-row">
+      <b>${uiLabelMap.EcommerceMyDefaultShippingAddress}</b>
+      <input type="checkbox" name="setShippingPurpose" value="Y" <#if setShippingPurpose?exists>checked</#if>/>
+    </div>
+    <div class="form-row">
+      <b>${uiLabelMap.EcommerceMyDefaultBillingAddress}</b>
+      <input type="checkbox" name="setBillingPurpose" value="Y" <#if setBillingPurpose?exists>checked</#if>/>
+    </div>
     <div class="form-row">
       <a name="submitEditPostalAddress_${contactMech.contactMechId}" id="submitEditPostalAddress_${contactMech.contactMechId}" class="buttontext" onclick="updatePartyPostalAddress('submitEditPostalAddress_${contactMech.contactMechId}')">${uiLabelMap.CommonSubmit}</a>
       <form action="">

Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl?rev=688737&view=auto
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl (added)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl Mon Aug 25 07:33:52 2008
@@ -0,0 +1,107 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<div id="shipToServerError" class="errorMessage"></div>
+<form id="editShipToPostalAddress" name="editShipToPostalAddress" method="post" action="<@o...@ofbizUrl>">
+  <div>
+    <input type="hidden" name="setShippingPurpose" value="Y"/>
+    <input type="hidden" name="contactMechId" value="${parameters.shipToContactMechId?if_exists}"/>
+    <#assign productStoreId = Static["org.ofbiz.product.store.ProductStoreWorker"].getProductStoreId(request)/>
+    <input type="hidden" name="productStoreId" value="${productStoreId?if_exists}"/>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyAddressLine1}*</label>
+      <span>
+        <input type="text" class="left required" name="address1" id="shipToAddress1" value="${parameters.shipToAddress1?if_exists}" size="30" maxlength="30">
+        <span id="advice-required-shipToAddress1" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyAddressLine2}</label>
+      <span>
+        <input type="text" class="left" name="address2" value="${parameters.shipToAddress2?if_exists}" size="30" maxlength="30">    
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyCity}*</label>
+      <span>
+        <input type="text" class="left required" name="city" id="shipToCity" value="${parameters.shipToCity?if_exists}" size="30" maxlength="30">
+        <span id="advice-required-shipToCity" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyZipCode}*</label>
+      <span>
+        <input type="text" class="left required" name="postalCode" id="shipToPostalCode" value="${parameters.shipToPostalCode?if_exists}" size="12" maxlength="10">
+        <span id="advice-required-shipToPostalCode" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyState}*</label>
+      <span>
+        <select name="stateProvinceGeoId" id="shipToStateProvinceGeoId" class="left required" style="width: 70%">
+          <#if parameters.shipToStateProvinceGeoId?exists>
+            <option value='${parameters.shipToStateProvinceGeoId}'>${selectedStateName?default(parameters.shipToStateProvinceGeoId)}</option>
+          </#if>
+          <option value="">${uiLabelMap.PartyNoState}</option>
+          ${screens.render("component://common/widget/CommonScreens.xml#states")}
+        </select>
+        <span id="advice-required-shipToStateProvinceGeoId" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <div class="form-row">
+      <label>${uiLabelMap.PartyCountry}*</label>
+      <span>
+        <select name="countryGeoId" id="shipToCountryGeoId" class="left required" style="width: 70%">
+          <#if parameters.shipToCountryGeoId?exists>
+            <option value='${parameters.shipToCountryGeoId}'>${selectedCountryName?default(parameters.shipToCountryGeoId)}</option>
+          </#if>
+          ${screens.render("component://common/widget/CommonScreens.xml#countries")}
+        </select>
+        <span id="advice-required-shipToCountryGeoId" style="display: none" class="errorMessage">(required)</span>
+      </span>
+    </div>
+    <#if telecomNumber?has_content>
+      <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/>
+      <div class="form-row">
+        <div class="field-label">
+          <label for="phoneNumber_${telecomNumber.contactMechId}">${uiLabelMap.PartyPhoneNumber}*</label>
+        </div>
+        <div>
+          <input type="hidden" name="phoneContactMechId" value="${telecomNumber.contactMechId?if_exists}"/>
+          <input type="text" name="countryCode" id="countryCode_${telecomNumber.contactMechId}" class="required" value="${telecomNumber.countryCode?if_exists}" size="3" maxlength="3"/>
+          - <input type="text" name="areaCode" id="areaCode_${telecomNumber.contactMechId}" class="required" value="${telecomNumber.areaCode?if_exists}" size="3" maxlength="3"/>
+          - <input type="text" name="contactNumber" id="contactNumber_${telecomNumber.contactMechId}" class="required" value="${contactNumber?default("${telecomNumber.contactNumber?if_exists}")}" size="6" maxlength="7"/>
+          - <input type="text" name="extension" id="extension_${telecomNumber.contactMechId}" value="${extension?default("${pcm.extension?if_exists}")}" size="3" maxlength="3"/>
+        </div>
+      </div>    
+    </#if>
+    <#if parameters.shipToContactMechId != parameters.billToContactMechId>
+      <div class="form-row">
+        <b>${uiLabelMap.EcommerceMyDefaultBillingAddress}</b>
+        <input type="checkbox" name="setBillingPurpose" value="Y" <#if setBillingPurpose?exists>checked</#if>/>
+      </div>
+    </#if>
+    <div class="form-row">
+      <a name="submitEditShipToPostalAddress" id="submitEditShipToPostalAddress" class="buttontext" onclick="updatePartyShipToPostalAddress('submitEditShipToPostalAddress')">${uiLabelMap.CommonSubmit}</a>
+      <form action="">
+        <input class="popup_closebox buttontext" type="button" value="${uiLabelMap.CommonClose}"/>
+      </form>
+    </div>
+  </div>
+</form>

Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl?rev=688737&r1=688736&r2=688737&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl Mon Aug 25 07:33:52 2008
@@ -40,7 +40,7 @@
           </div>
         </div>
         <div class="form-row">
-          ${uiLabelMap.PartyAddressLine2}<div class="form-field"><input type="text" class="inputBox" name="address2" value="" size="30" maxlength="30"></div>
+          ${uiLabelMap.PartyAddressLine2}<div class="form-field"><input type="text" name="address2" value="" size="30" maxlength="30"></div>
         </div>
         <div class="form-row">
           ${uiLabelMap.PartyCity}*
@@ -94,118 +94,79 @@
     </script>
   </div>
 
-  <#-- Manage Addresses -->
+  <#-- Default Addresses -->
   <div class="left center">
     <div class="screenlet-header"><div class="boxhead">&nbsp;${uiLabelMap.EcommerceDefault} ${uiLabelMap.CommonAddresses}</div></div>
     <div class="screenlet-body">
-      <#assign postalAddressFlag = "N">
-      <#list partyContactMechValueMaps as partyContactMechValueMap>
-        <#assign contactMech = partyContactMechValueMap.contactMech?if_exists>
-        <#if contactMech.contactMechTypeId?if_exists = "POSTAL_ADDRESS">
-          <#assign partyContactMech = partyContactMechValueMap.partyContactMech?if_exists>
-          <#if partyContactMechValueMap.partyContactMechPurposes?has_content>
-            <#assign postalAddressFlag = "Y">
-            <div id="displayEditAddressForm_${contactMech.contactMechId}" class="popup" style="display: none;">
-              <#include "EditPostalAddress.ftl"/>
-            </div>
-            <div class="form-row">
-              <div class="form-field">
-                <#if showSetShippingPurpose == "N">
-                  <h3>${uiLabelMap.EcommercePrimary} ${uiLabelMap.OrderShippingAddress}</h3>
-                <#else>
-                  <h3>${uiLabelMap.EcommercePrimary} ${uiLabelMap.PartyBillingAddress}</h3>
-                </#if>
-              </div>
-            </div>
-
-            <#assign postalAddress = partyContactMechValueMap.postalAddress?if_exists>
-            <#if postalAddress?exists>
-              <div class="form-row">
-                <div class="form-label"></div>
-                <div class="form-field">
-                  <div>
-                    ${postalAddress.address1}<br/>
-                    <#if postalAddress.address2?has_content>${postalAddress.address2}<br/></#if>
-                    ${postalAddress.city}
-                    <#if postalAddress.stateProvinceGeoId?has_content>,&nbsp;${postalAddress.stateProvinceGeoId}</#if>
-                    &nbsp;${postalAddress.postalCode?if_exists}
-                    <#if postalAddress.countryGeoId?has_content><br/>${postalAddress.countryGeoId}</#if>
-                    <#if (!postalAddress.countryGeoId?has_content || postalAddress.countryGeoId?if_exists = "USA")>
-                      <#assign addr1 = postalAddress.address1?if_exists>
-                      <#if (addr1.indexOf(" ")  gt 0)>
-                        <#assign addressNum = addr1.substring(0, addr1.indexOf(" "))>
-                        <#assign addressOther = addr1.substring(addr1.indexOf(" ")+1)>
-                        <a target="_blank" href="${uiLabelMap.EcommerceLookupWhitepagesLink}" class="linktext">(${uiLabelMap.EcommerceLookupWhitepages})</a>
-                      </#if>
-                    </#if>
-                  </div>
-                </div>
-              </div>
-              <div class="form-row"></div>
-              <span>
-                <#if showSetShippingPurpose == "N">
-                  <div class="form-row">
-                     <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_SHIPPING")))>
-                     <#if pcmps?has_content>
-                       <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/>
-                       <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/>
-                     </#if>
-      
-                    <#if telecomNumber?has_content>
-                      <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/>
-                      ${telecomNumber.countryCode?if_exists}-
-                      ${telecomNumber.areaCode?if_exists}-
-                      ${telecomNumber.contactNumber?if_exists}-
-                      ${pcm.extension?if_exists}
-                    </#if>
-                  </div><br/>
-                  <a id="update_${contactMech.contactMechId}" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit} ${uiLabelMap.OrderShippingAddress}</a>&nbsp;
-                <#else>
-                  <div class="form-row">
-                     <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_BILLING")))>
-                     <#if pcmps?has_content>
-                       <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/>
-                       <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/>
-                     </#if>
-                     
-                    <#if telecomNumber?has_content>
-                      <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/>
-                      ${telecomNumber.countryCode?if_exists}-
-                      ${telecomNumber.areaCode?if_exists}-
-                      ${telecomNumber.contactNumber?if_exists}-
-                      ${pcm.extension?if_exists}
-                    </#if>
-                  </div><br/>
-                  <a id="update_${contactMech.contactMechId}" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit} ${uiLabelMap.PartyBillingAddress}</a>&nbsp;
-                </#if>
+      <#--===================================== Billing Address and Telecom number ===========================================-->
+      <h3>${uiLabelMap.EcommercePrimary} ${uiLabelMap.PartyBillingAddress}</h3>
+      <#if parameters.billToContactMechId?exists>
+        ${parameters.billToAddress1?if_exists}<br/>
+        <#if parameters.billToAddress2?has_content>${parameters.billToAddress2?if_exists}<br/></#if>
+        ${parameters.billToCity?if_exists},
+        ${parameters.billToStateProvinceGeoId?if_exists}
+        ${parameters.billToPostalCode?if_exists}<br/>
+        ${parameters.billToCountryGeoId?if_exists}<br/>
+        <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_BILLING")))>
+        <#if pcmps?has_content>
+          <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/>
+          <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/>
+        </#if>
+        <#if telecomNumber?has_content>
+          <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/>
+          ${telecomNumber.countryCode?if_exists}-
+          ${telecomNumber.areaCode?if_exists}-
+          ${telecomNumber.contactNumber?if_exists}
+          <#if pcm.extension?has_content>-${pcm.extension?if_exists}</#if><br/>
+          <a id="updateBillToPostalAddress" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit} ${uiLabelMap.PartyBillingAddress}</a>&nbsp;
+        </#if>
+      <#else>
+        ${uiLabelMap.PartyBillingAddress} ${uiLabelMap.EcommerceNotExists}
+      </#if>
+      <div id="displayEditBillToPostalAddress" class="popup" style="display: none;">
+        <#include "EditBillToAddress.ftl"/>
+      </div>
+      <div class="form-row"><hr class="sepbar"/></div>
+      <script type="text/javascript">
+        new Popup('displayEditBillToPostalAddress','updateBillToPostalAddress', {modal: true, position: 'center', trigger: 'click'})
+      </script>
 
-                <div class="form-row"></div>
-                <a href="<@o...@ofbizUrl>" class="buttontext">${uiLabelMap.CommonDelete}</a>&nbsp;&nbsp;
-              </span>
-              <script type="text/javascript">
-                new Popup('displayEditAddressForm_${contactMech.contactMechId}','update_${contactMech.contactMechId}', {modal: true, position: 'center', trigger: 'click'})
-              </script>
-            <#else>
-              <div class="form-row">
-                <div class="form-label">
-                  <h5>${uiLabelMap.PartyPostalInformationNotFound}.</h5>
-                </div>
-              </div>
-            </#if>
-            <div class="form-row"><hr class="sepbar"/></div>
-          </#if>
+    <#--===================================== Shipping Address and Telecom number ===========================================-->
+      <h3>${uiLabelMap.EcommercePrimary} ${uiLabelMap.OrderShippingAddress}</h3>
+      <#if parameters.shipToContactMechId?exists>
+        ${parameters.shipToAddress1?if_exists}<br/>
+        <#if parameters.shipToAddress2?has_content>${parameters.shipToAddress2?if_exists}<br/></#if>
+        ${parameters.shipToCity?if_exists},
+        ${parameters.shipToStateProvinceGeoId?if_exists}
+        ${parameters.shipToPostalCode?if_exists}<br/>
+        ${parameters.shipToCountryGeoId?if_exists}<br/>
+        <#assign pcmps = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(party.getRelatedByAnd("PartyContactMechPurpose", Static["org.ofbiz.base.util.UtilMisc"].toMap("contactMechPurposeTypeId", "PHONE_SHIPPING")))>
+        <#if pcmps?has_content>
+          <#assign pcmp = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(pcmps)/>
+          <#assign telecomNumber = pcmp.getRelatedOne("TelecomNumber")/>
         </#if>
-      </#list>
-      <#if postalAddressFlag == "N">
-        <div class="form-row">
-          <div class="form-label">
-            <h5>${uiLabelMap.PartyPostalInformationNotFound}.</h5>
-          </div>
-        </div>
+        <#if telecomNumber?has_content>
+          <#assign pcm = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(telecomNumber.getRelated("PartyContactMech"))/>
+          ${telecomNumber.countryCode?if_exists}-
+          ${telecomNumber.areaCode?if_exists}-
+          ${telecomNumber.contactNumber?if_exists}
+          <#if pcm.extension?has_content>-${pcm.extension?if_exists}</#if><br/>
+          <a id="updateShipToPostalAddress" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit} ${uiLabelMap.OrderShippingAddress}</a>&nbsp;
+        </#if>
+      <#else>
+        ${uiLabelMap.OrderShippingAddress} ${uiLabelMap.EcommerceNotExists}
       </#if>
+      <div id="displayEditShipToPostalAddress" class="popup" style="display: none;">
+        <#include "EditShipToAddress.ftl"/>
+      </div>
+      <div class="form-row"><hr class="sepbar"/></div>
+      <script type="text/javascript">
+          new Popup('displayEditShipToPostalAddress','updateShipToPostalAddress', {modal: true, position: 'center', trigger: 'click'})
+      </script>
     </div>
   </div>
 
+  <#-- Additional Addresses -->
   <div class="center right">
     <div class="screenlet-header">
       <div class="boxhead">&nbsp;${uiLabelMap.EcommerceAdditional} ${uiLabelMap.CommonAddresses}</div>

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl?rev=688737&r1=688736&r2=688737&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl Mon Aug 25 07:33:52 2008
@@ -44,7 +44,7 @@
     <#-- Manage Addresses -->
     <div class="screenlet-header"><div class='boxhead'>&nbsp;${uiLabelMap.EcommerceAddressBook}</div></div>
     <div class="screenlet-body">
-      <div align="right"><a class="buttontext" href="<@o...@ofbizUrl>">${uiLabelMap.EcommerceManage} ${uiLabelMap.CommonAddresses}</a>&nbsp;</div>
+      <div align="right"><a class="buttontext" href="<@o...@ofbizUrl>">${uiLabelMap.EcommerceManageAddresses}</a>&nbsp;</div>
       <div class="left center">
         <div class="screenlet-header"><div class='boxhead'>${uiLabelMap.EcommercePrimary} ${uiLabelMap.OrderShippingAddress}</div></div>
         <div class="screenlet-body">

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js?rev=688737&r1=688736&r2=688737&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/images/profile.js Mon Aug 25 07:33:52 2008
@@ -99,8 +99,10 @@
         $('billToAreaCode').value = $F('shipToAreaCode');
         $('billToContactNumber').value = $F('shipToContactNumber');
         $('billToExtension').value = $F('shipToExtension');
+        hideErrorMessage();
         Effect.BlindUp($('billingAddress'), {duration: 0.3});
     } else {
+    	validBillingAddress();
         Effect.BlindDown($('billingAddress'), {duration: 0.3});
     }
 }
@@ -206,4 +208,91 @@
             }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'}
         });
     }
+}
+
+function updatePartyShipToPostalAddress(e) {
+    formId = 'editShipToPostalAddress';
+    var validateEditPostalAddress = new Validation(formId, {immediate: true, onSubmit: false});
+    errorId = 'shipToServerError';
+    popupId = 'displayEditShipToPostalAddress';
+    if (validateEditPostalAddress.validate()) {
+        new Ajax.Request('updatePartyPostalAddress', {
+            asynchronous: false, 
+            onSuccess: function(transport) {
+                var data = transport.responseText.evalJSON(true);
+                var serverError = getServerError(data);
+                if (serverError != "") {
+                    Effect.Appear(errorId);
+                    Effect.Appear(popupId);
+                    $(errorId).update(serverError);
+                } else {
+                    Effect.Fade(popupId);
+                    Effect.Fade(errorId);
+                    $('refreshRequestForm').submit();
+                }
+            }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'}
+        });
+    }
+}
+
+function updatePartyBillToPostalAddress(e) {
+    formId = 'editBillToPostalAddress';
+    var validateEditPostalAddress = new Validation(formId, {immediate: true, onSubmit: false});
+    errorId = 'billToServerError';
+    popupId = 'displayEditBillToPostalAddress';
+    if (validateEditPostalAddress.validate()) {
+        new Ajax.Request('updatePartyPostalAddress', {
+            asynchronous: false, 
+            onSuccess: function(transport) {
+                var data = transport.responseText.evalJSON(true);
+                var serverError = getServerError(data);
+                if (serverError != "") {
+                    Effect.Appear(errorId);
+                    Effect.Appear(popupId);
+                    $(errorId).update(serverError);
+                } else {
+                    Effect.Fade(popupId);
+                    Effect.Fade(errorId);
+                    $('refreshRequestForm').submit();
+                }
+            }, parameters: $(formId).serialize(), requestHeaders: {Accept: 'application/json'}
+        });
+    }
+}
+
+function validBillingAddress () {
+    Event.observe($('billToAddress1'), 'blur', function() {
+        if ($('billToAddress1').value == "") {
+            Effect.Appear('advice-required-billToAddress1');
+        }
+    });
+    Event.observe($('billToStateProvinceGeoId'), 'blur', function() {
+        if ($('billToStateProvinceGeoId').value == "") {
+            Effect.Appear('advice-required-billToStateProvinceGeoId');
+        }
+    });
+    Event.observe($('billToCity'), 'blur', function() {
+        if ($('billToCity').value == "") {
+            Effect.Appear('advice-required-billToCity');
+        }
+    });
+    Event.observe($('billToPostalCode'), 'blur', function() {
+        if ($('billToPostalCode').value == "") {
+            Effect.Appear('advice-required-billToPostalCode');
+        }
+    });
+    Event.observe($('billToCountryGeoId'), 'blur', function() {
+        if ($('billToCountryGeoId').value == "") {
+            Effect.Appear('advice-required-billToCountryGeoId');
+        }
+    });
+}
+
+function hideErrorMessage() {
+    Effect.Fade('advice-required-billToAddress1');
+    Effect.Fade('advice-required-billToStateProvinceGeoId');
+    Effect.Fade('advice-required-billToCity');
+    Effect.Fade('advice-required-billToPostalCode');
+    Effect.Fade('advice-required-billToCountryGeoId');
+    Effect.Fade('billToPhoneRequired');
 }
\ No newline at end of file

Modified: ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml?rev=688737&r1=688736&r2=688737&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/CustomerScreens.xml Mon Aug 25 07:33:52 2008
@@ -583,7 +583,7 @@
     <screen name="ManageAddress">
         <section>
             <actions>
-                <set field="titleProperty" value="PageTitleViewProfile"/>
+                <set field="titleProperty" value="EcommerceManageAddresses"/>
                 <set field="partyId" from-field="userLogin.partyId"/>
                 <entity-one entity-name="Party" value-name="party"/>
                 <entity-one entity-name="Person" value-name="person"/>
@@ -591,6 +591,8 @@
 
                 <set field="layoutSettings.javaScripts[+0]" value="/images/prototypejs/controls.js" global="true"/>
                 <set field="layoutSettings.javaScripts[]" value="/ecommerce/images/profile.js" global="true"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy"/>
                 <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ViewProfile.groovy"/>
             </actions>
             <widgets>

Modified: ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml?rev=688737&r1=688736&r2=688737&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml (original)
+++ ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml Mon Aug 25 07:33:52 2008
@@ -369,10 +369,34 @@
     </simple-method>
 
     <simple-method method-name="updatePostalAddressAndPurposes" short-description="Update postal address, purposes and set them defaults" login-required="false">
-        <call-service service-name="updatePartyPostalAddress" in-map-name="parameters">
-            <result-to-field result-name="contactMechId" field-name="parameters.contactMechId"/>
-            <result-to-result result-name="contactMechId"/>
-        </call-service>
+        <entity-one entity-name="PartyProfileDefault" value-name="partyProfileDefault">
+            <field-map field-name="partyId" env-name="userLogin.partyId"/>
+            <field-map field-name="productStoreId" env-name="parameters.productStoreId"/>
+        </entity-one>
+        <if-compare-field field="partyProfileDefault.defaultBillAddr" operator="not-equals" to-field="partyProfileDefault.defaultShipAddr"> 
+            <call-service service-name="updatePartyPostalAddress" in-map-name="parameters">
+                <result-to-field result-name="contactMechId" field-name="parameters.contactMechId"/>
+                <result-to-result result-name="contactMechId"/>
+            </call-service>
+        <else>
+            <set-service-fields service-name="updatePostalAddress" map-name="parameters" to-map-name="updatePostalAddressMap"/>
+            <call-service service-name="updatePostalAddress" in-map-name="updatePostalAddressMap">
+                <default-message resource="PartyUiLabels" property="PartyPostalAddressSuccessfullyUpdated"/>
+                <result-to-field result-name="contactMechId" field-name="parameters.newContactMechId"/>
+                <result-to-result result-name="contactMechId"/>
+            </call-service>
+
+            <if-compare-field field="parameters.contactMechId" operator="not-equals" to-field="parameters.newContactMechId">
+                <set-service-fields service-name="createPartyContactMech" map-name="parameters" to-map-name="createPartyContactMechMap"/>
+                <set field="createPartyContactMechMap.contactMechId" from-field="parameters.newContactMechId"/>
+                <set field="createPartyContactMechMap.contactMechTypeId" value="POSTAL_ADDRESS"/>
+                <call-service service-name="createPartyContactMech" in-map-name="createPartyContactMechMap" break-on-error="true">
+                    <default-message resource="PartyUiLabels" property="PartyPostalAddressSuccessfullyCreated"/>
+                </call-service>
+            </if-compare-field>
+            <set field="parameters.contactMechId" from-field="parameters.newContactMechId"/>
+        </else>
+        </if-compare-field>
         <if>
             <condition>
                 <or>
@@ -425,15 +449,40 @@
     </simple-method>
 
     <simple-method method-name="updateContactMechAndPurposes" short-description="Update postal address, telecom number and purposes">
+        <entity-one entity-name="PartyProfileDefault" value-name="partyProfileDefault" >
+            <field-map field-name="partyId" env-name="userLogin.partyId"/>
+            <field-map field-name="productStoreId" env-name="parameters.productStoreId"/>
+        </entity-one>
         <set-service-fields service-name="updatePostalAddressAndPurposes" map-name="parameters" to-map-name="updatePostalAddressAndPurposesCtx"/>
         <call-service service-name="updatePostalAddressAndPurposes" in-map-name="updatePostalAddressAndPurposesCtx"/>
 
         <if-not-empty field="parameters.phoneContactMechId">
+
             <set field="parameters.contactMechId" from-field="parameters.phoneContactMechId"/>
-            <set-service-fields service-name="updatePartyTelecomNumber" map-name="parameters" to-map-name="updatePartyTelecomNumberCtx"/>
-            <call-service service-name="updatePartyTelecomNumber" in-map-name="updatePartyTelecomNumberCtx">
-                <result-to-field result-name="contactMechId" field-name="parameters.contactMechId"/>
-            </call-service>
+       
+            <if-compare-field field="partyProfileDefault.defaultBillAddr" operator="not-equals" to-field="partyProfileDefault.defaultShipAddr">
+                <set-service-fields service-name="updatePartyTelecomNumber" map-name="parameters" to-map-name="updatePartyTelecomNumberCtx"/>
+                <call-service service-name="updatePartyTelecomNumber" in-map-name="updatePartyTelecomNumberCtx">
+                    <result-to-field result-name="contactMechId" field-name="parameters.contactMechId"/>
+                </call-service>
+            <else>
+                <set-service-fields service-name="updateTelecomNumber" map-name="parameters" to-map-name="updateTelecomNumberMap"/>          
+                <call-service service-name="updateTelecomNumber" in-map-name="updateTelecomNumberMap">
+                    <default-message resource="PartyUiLabels" property="PartyTelecomNumberSuccessfullyUpdated"/>
+                    <result-to-field result-name="contactMechId" field-name="parameters.newContactMechId"/>
+                </call-service>
+
+                <if-compare-field field="parameters.contactMechId" operator="not-equals" to-field="parameters.newContactMechId">
+                    <set-service-fields service-name="createPartyContactMech" map-name="parameters" to-map-name="createPartyContactMechMap"/>
+                    <set field="createPartyContactMechMap.contactMechId" from-field="parameters.newContactMechId"/>
+                    <set field="createPartyContactMechMap.contactMechTypeId" value="TELECOM_NUMBER"/>
+                    <call-service service-name="createPartyContactMech" in-map-name="createPartyContactMechMap" break-on-error="true">
+                        <default-message resource="PartyUiLabels" property="PartyPostalAddressSuccessfullyCreated"/>
+                    </call-service>
+                </if-compare-field>
+                <set field="parameters.contactMechId" from-field="parameters.newContactMechId"/>
+            </else>
+            </if-compare-field>
             <set-service-fields service-name="createPartyContactMechPurpose" map-name="parameters" to-map-name="serviceContext"/>
             <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
             <if-compare field="parameters.setShippingPurpose" operator="equals" value="Y">