Author: ashish
Date: Tue Dec 1 09:43:05 2009
New Revision: 885702
URL:
http://svn.apache.org/viewvc?rev=885702&view=revLog:
Applied patch from jira issue: OFBIZ-3277 - Problem in the createUpdateBillingAddress service.
From one page checkout if register user select shipping and billing address not same.
Go for continue then another Postal Address created in the system which should not be the case.
The new postal address should create only when user do some changes in the billing postal address (in case of register user and keep address book set to Y).
Thanks Deepak & Rishi for the contribution.
Modified:
ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
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=885702&r1=885701&r2=885702&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 Tue Dec 1 09:43:05 2009
@@ -1072,9 +1072,17 @@
</call-service>
</if-compare>
<if-compare field="keepAddressBook" operator="equals" value="Y">
- <call-service service-name="createPartyPostalAddress" in-map-name="billToAddressCtx">
- <result-to-field result-name="contactMechId" field="parameters.billToContactMechId"/>
- </call-service>
+ <make-value entity-name="PostalAddress" value-field="newValue"/>
+ <set-pk-fields value-field="newValue" map="billToAddressCtx"/>
+ <set-nonpk-fields value-field="newValue" map="billToAddressCtx"/>
+ <entity-one entity-name="PostalAddress" value-field="oldValue" auto-field-map="false">
+ <field-map field-name="contactMechId" from-field="billToAddressCtx.contactMechId"/>
+ </entity-one>
+ <if-compare-field field="oldValue" to-field="newValue" operator="not-equals" type="Object">
+ <call-service service-name="createPartyPostalAddress" in-map-name="billToAddressCtx">
+ <result-to-field result-name="contactMechId" field="parameters.billToContactMechId"/>
+ </call-service>
+ </if-compare-field>
</if-compare>
<log level="info" message="Billing Postal Address created billToContactMechId is ${parameters.billToContactMechId}"/>
</else>