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/26 15:00:16 UTC

svn commit: r689054 - in /ofbiz/trunk/applications: ecommerce/webapp/ecommerce/WEB-INF/actions/customer/ ecommerce/webapp/ecommerce/customer/profile/ party/script/org/ofbiz/party/contact/

Author: mor
Date: Tue Aug 26 06:00:15 2008
New Revision: 689054

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

Modified:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl
    ofbiz/trunk/applications/party/script/org/ofbiz/party/contact/PartyContactMechServices.xml

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy?rev=689054&r1=689053&r2=689054&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditBillingAddress.groovy Tue Aug 26 06:00:15 2008
@@ -43,6 +43,14 @@
         }
     }
     
+	billToContactMechList = ContactHelper.getContactMech(party, "PHONE_BILLING", "TELECOM_NUMBER", false)
+	if (billToContactMechList) {
+        billToTelecomNumber = (EntityUtil.getFirst(billToContactMechList)).getRelatedOne("TelecomNumber");
+        pcm = EntityUtil.getFirst(billToTelecomNumber.getRelated("PartyContactMech"));
+        context.billToTelecomNumber = billToTelecomNumber;
+        context.billToExtension = pcm.extension;
+    }
+    
     creditCards = []; 
     paymentMethod = EntityUtil.getFirst(EntityUtil.filterByDate(delegator.findList("PaymentMethod", EntityCondition.makeCondition([partyId : party.partyId]), null, ["fromDate"], null, false)));
     if (paymentMethod) {

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy?rev=689054&r1=689053&r2=689054&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/EditShippingAddress.groovy Tue Aug 26 06:00:15 2008
@@ -46,4 +46,13 @@
             parameters.shipToCountryProvinceGeo =  shipToCountryProvinceGeo.geoName;
         }
     }
+    
+	shipToContactMechList = ContactHelper.getContactMech(party, "PHONE_SHIPPING", "TELECOM_NUMBER", false)
+    if (shipToContactMechList) {
+        shipToTelecomNumber = (EntityUtil.getFirst(shipToContactMechList)).getRelatedOne("TelecomNumber");
+        pcm = EntityUtil.getFirst(shipToTelecomNumber.getRelated("PartyContactMech"));
+        context.shipToTelecomNumber = shipToTelecomNumber;
+        context.shipToExtension = pcm.extension;
+    }
+
 }
\ No newline at end of file

Modified: 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=689054&r1=689053&r2=689054&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditBillToAddress.ftl Tue Aug 26 06:00:15 2008
@@ -76,27 +76,24 @@
         <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"))/>
+    <#if billToTelecomNumber?has_content>
       <div class="form-row">
         <div class="field-label">
-          <label for="phoneNumber_${telecomNumber.contactMechId}">${uiLabelMap.PartyPhoneNumber}*</label>
+          <label for="phoneNumber_${billToTelecomNumber.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"/>
+          <input type="hidden" name="phoneContactMechId" value="${billToTelecomNumber.contactMechId?if_exists}"/>
+          <input type="text" name="countryCode" id="countryCode_${billToTelecomNumber.contactMechId}" class="required" value="${billToTelecomNumber.countryCode?if_exists}" size="3" maxlength="3"/>
+          - <input type="text" name="areaCode" id="areaCode_${billToTelecomNumber.contactMechId}" class="required" value="${billToTelecomNumber.areaCode?if_exists}" size="3" maxlength="3"/>
+          - <input type="text" name="contactNumber" id="contactNumber_${billToTelecomNumber.contactMechId}" class="required" value="${contactNumber?default("${billToTelecomNumber.contactNumber?if_exists}")}" size="6" maxlength="7"/>
+          - <input type="text" name="extension" id="extension_${billToTelecomNumber.contactMechId}" value="${extension?default("${billToExtension?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">
+      <b>${uiLabelMap.EcommerceMyDefaultShippingAddress}</b>
+      <input type="checkbox" name="setShippingPurpose" value="Y" <#if setShippingPurpose?exists>checked</#if>/>
+    </div>
     <div class="form-row">
       <a name="submitEditBillToPostalAddress" id="submitEditBillToPostalAddress" class="buttontext" onclick="updatePartyBillToPostalAddress('submitEditBillToPostalAddress')">${uiLabelMap.CommonSubmit}</a>
       <form action="">

Modified: 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=689054&r1=689053&r2=689054&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/EditShipToAddress.ftl Tue Aug 26 06:00:15 2008
@@ -76,27 +76,24 @@
         <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"))/>
+    <#if shipToTelecomNumber?has_content>
       <div class="form-row">
         <div class="field-label">
-          <label for="phoneNumber_${telecomNumber.contactMechId}">${uiLabelMap.PartyPhoneNumber}*</label>
+          <label for="phoneNumber_${shipToTelecomNumber.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"/>
+          <input type="hidden" name="phoneContactMechId" value="${shipToTelecomNumber.contactMechId?if_exists}"/>
+          <input type="text" name="countryCode" id="countryCode_${shipToTelecomNumber.contactMechId}" class="required" value="${shipToTelecomNumber.countryCode?if_exists}" size="3" maxlength="3"/>
+          - <input type="text" name="areaCode" id="areaCode_${shipToTelecomNumber.contactMechId}" class="required" value="${shipToTelecomNumber.areaCode?if_exists}" size="3" maxlength="3"/>
+          - <input type="text" name="contactNumber" id="contactNumber_${shipToTelecomNumber.contactMechId}" class="required" value="${contactNumber?default("${shipToTelecomNumber.contactNumber?if_exists}")}" size="6" maxlength="7"/>
+          - <input type="text" name="extension" id="extension_${shipToTelecomNumber.contactMechId}" value="${extension?default("${shipToExtension?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">
+      <b>${uiLabelMap.EcommerceMyDefaultBillingAddress}</b>
+      <input type="checkbox" name="setBillingPurpose" value="Y" <#if setBillingPurpose?exists>checked</#if>/>
+    </div>
     <div class="form-row">
       <a name="submitEditShipToPostalAddress" id="submitEditShipToPostalAddress" class="buttontext" onclick="updatePartyShipToPostalAddress('submitEditShipToPostalAddress')">${uiLabelMap.CommonSubmit}</a>
       <form action="">

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=689054&r1=689053&r2=689054&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ManageAddress.ftl Tue Aug 26 06:00:15 2008
@@ -55,15 +55,6 @@
           </div>
         </div>
         <div class="form-row">
-          ${uiLabelMap.PartyCountry}*
-          <div class="form-field">
-            <select name="countryGeoId" id="countryGeoId" class="required" style="width: 70%">
-              ${screens.render("component://common/widget/CommonScreens.xml#countries")}
-            </select>
-            <span id="advice-required-countryGeoId" style="display: none" class="errorMessage">(required)</span>
-          </div>
-        </div>
-        <div class="form-row">
           ${uiLabelMap.PartyState}*
           <div class="form-field">
             <select name="stateProvinceGeoId" id="stateProvinceGeoId" class="required" style="width: 70%">
@@ -74,6 +65,15 @@
           </div>
         </div>
         <div class="form-row">
+          ${uiLabelMap.PartyCountry}*
+          <div class="form-field">
+            <select name="countryGeoId" id="countryGeoId" class="required" style="width: 70%">
+              ${screens.render("component://common/widget/CommonScreens.xml#countries")}
+            </select>
+            <span id="advice-required-countryGeoId" style="display: none" class="errorMessage">(required)</span>
+          </div>
+        </div>
+        <div class="form-row">
           <b>${uiLabelMap.EcommerceMyDefaultShippingAddress}</b>
           <input type="checkbox" name="setShippingPurpose" id="setShippingPurpose" value="Y" <#if setShippingPurpose?exists>checked</#if>/>
         </div>
@@ -107,17 +107,11 @@
         ${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/>
+        <#if billToTelecomNumber?has_content>
+          ${billToTelecomNumber.countryCode?if_exists}-
+          ${billToTelecomNumber.areaCode?if_exists}-
+          ${billToTelecomNumber.contactNumber?if_exists}
+          <#if billToExtension?has_content>-${billToExtension?if_exists}</#if><br/>
           <a id="updateBillToPostalAddress" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit} ${uiLabelMap.PartyBillingAddress}</a>&nbsp;
         </#if>
       <#else>
@@ -128,7 +122,7 @@
       </div>
       <div class="form-row"><hr class="sepbar"/></div>
       <script type="text/javascript">
-        new Popup('displayEditBillToPostalAddress','updateBillToPostalAddress', {modal: true, position: 'center', trigger: 'click'})
+        new Popup('displayEditBillToPostalAddress', 'updateBillToPostalAddress', {modal: true, position: 'center', trigger: 'click'})
       </script>
 
     <#--===================================== Shipping Address and Telecom number ===========================================-->
@@ -140,17 +134,11 @@
         ${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>
-        <#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/>
+        <#if shipToTelecomNumber?has_content>
+          ${shipToTelecomNumber.countryCode?if_exists}-
+          ${shipToTelecomNumber.areaCode?if_exists}-
+          ${shipToTelecomNumber.contactNumber?if_exists}
+          <#if shipToExtension?exists>-${shipToExtension?if_exists}</#if><br/>
           <a id="updateShipToPostalAddress" href="javascript:void(0)" class="buttontext popup_link">${uiLabelMap.CommonEdit} ${uiLabelMap.OrderShippingAddress}</a>&nbsp;
         </#if>
       <#else>

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=689054&r1=689053&r2=689054&view=diff
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/profile/ViewProfile.ftl Tue Aug 26 06:00:15 2008
@@ -50,22 +50,16 @@
         <div class="screenlet-body">
           <#if parameters.shipToContactMechId?exists>
             ${parameters.shipToAddress1?if_exists}<br/>
-            ${parameters.shipToAddress2?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>
-            <#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 shipToTelecomNumber?has_content>
+              ${shipToTelecomNumber.countryCode?if_exists}-
+              ${shipToTelecomNumber.areaCode?if_exists}-
+              ${shipToTelecomNumber.contactNumber?if_exists}
+              <#if shipToExtension?exists>-${shipToExtension?if_exists}</#if><br/>
             </#if>
           <#else>
             ${uiLabelMap.OrderShippingAddress} ${uiLabelMap.EcommerceNotExists}
@@ -78,22 +72,16 @@
         <div class="screenlet-body">
           <#if parameters.billToContactMechId?exists>
             ${parameters.billToAddress1?if_exists}<br/>
-            ${parameters.billToAddress2?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}-
-              ${pcm.extension?if_exists}
+            <#if billToTelecomNumber?has_content>
+              ${billToTelecomNumber.countryCode?if_exists}-
+              ${billToTelecomNumber.areaCode?if_exists}-
+              ${billToTelecomNumber.contactNumber?if_exists}
+              <#if billToExtension?exists>-${billToExtension?if_exists}</#if><br/>
             </#if>
           <#else>
             ${uiLabelMap.PartyBillingAddress} ${uiLabelMap.EcommerceNotExists}

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=689054&r1=689053&r2=689054&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 Tue Aug 26 06:00:15 2008
@@ -449,18 +449,27 @@
     </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">
-
+            <entity-and entity-name="PartyContactMechPurpose" list-name="partyContactMachPurposes" filter-by-date="true">
+                <field-map field-name="partyId" env-name="userLogin.partyId"/>
+                <field-map field-name="contactMechId" env-name="parameters.phoneContactMechId"/>
+                <select-field field-name="contactMechPurposeTypeId"/>
+            </entity-and>
+            
+            <iterate list-name="partyContactMachPurposes" entry-name="partyContactMachPurpose">
+                <if-compare field="partyContactMachPurpose.contactMechPurposeTypeId" operator="equals" value="PHONE_SHIPPING">
+                    <set field="hasShipToPhonePurpose" value="Y"/>
+                </if-compare>
+                <if-compare field="partyContactMachPurpose.contactMechPurposeTypeId" operator="equals" value="PHONE_BILLING">
+                    <set field="hasBillToPhonePurpose" value="Y"/>
+                </if-compare>
+            </iterate>
             <set field="parameters.contactMechId" from-field="parameters.phoneContactMechId"/>
-       
-            <if-compare-field field="partyProfileDefault.defaultBillAddr" operator="not-equals" to-field="partyProfileDefault.defaultShipAddr">
+
+            <if-compare-field field="hasShipToPhonePurpose" operator="not-equals" to-field="hasBillToPhonePurpose">
                 <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"/>