Author: rishi
Date: Tue May 8 13:34:54 2018
New Revision: 1831183
URL:
http://svn.apache.org/viewvc?rev=1831183&view=revLog:
Fixed: Existing BILLING_LOCATION record of party should expire while creating a new one. Now service will first expires all the billing location against party and create new one.
(OFBIZ-10374)
Thank you Suraj Khuran for reporting the issue and providing patch for the same.
Modified:
ofbiz/ofbiz-framework/trunk/applications/order/minilang/order/OrderServices.xml
Modified: ofbiz/ofbiz-framework/trunk/applications/order/minilang/order/OrderServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/minilang/order/OrderServices.xml?rev=1831183&r1=1831182&r2=1831183&view=diff==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/order/minilang/order/OrderServices.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/order/minilang/order/OrderServices.xml Tue May 8 13:34:54 2018
@@ -1015,6 +1015,25 @@ under the License.
<call-service service-name="createPartyPostalAddress" in-map-name="billToAddressCtx">
<result-to-field result-name="contactMechId" field="parameters.billToContactMechId"/>
</call-service>
+ <set-service-fields service-name="createPartyContactMechPurpose" map="parameters" to-map="serviceContext"/>
+ <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+
+ <entity-and entity-name="PartyContactMechPurpose" list="pcmpList" filter-by-date="true">
+ <field-map field-name="partyId" from-field="billToAddressCtx.partyId"/>
+ <field-map field-name="contactMechPurposeTypeId" value="BILLING_LOCATION"/>
+ </entity-and>
+ <if-not-empty field="pcmpList">
+ <first-from-list list="pcmpList" entry="pcmp"/>
+ <set-service-fields service-name="deletePartyContactMechPurposeIfExists" map="pcmp" to-map="serviceInMap"/>
+ <call-service service-name="deletePartyContactMechPurposeIfExists" in-map-name="serviceInMap"/>
+ <clear-field field="serviceInMap"/>
+ </if-not-empty>
+ <set field="serviceContext.partyId" from-field="userLogin.partyId"/>
+ <set field="serviceContext.contactMechId" from-field="parameters.billToContactMechId"/>
+ <set field="serviceContext.contactMechPurposeTypeId" value="BILLING_LOCATION"/>
+ <call-service service-name="createPartyContactMechPurpose" in-map-name="serviceContext"/>
+ <clear-field field="pcmpList"/>
+ <clear-field field="serviceContext"/>
<log level="info" message="Billing address updated with contactMechId ${parameters.billToContactMechId}"/>
<else>
<if-compare field="keepAddressBook" operator="equals" value="N">