svn commit: r1831186 - /ofbiz/branches/release16.11/applications/order/minilang/order/OrderServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1831186 - /ofbiz/branches/release16.11/applications/order/minilang/order/OrderServices.xml

rishi
Author: rishi
Date: Tue May  8 13:37:11 2018
New Revision: 1831186

URL: http://svn.apache.org/viewvc?rev=1831186&view=rev
Log:
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. Applied fix from trunk revision 1831183.
(OFBIZ-10374)
Thank you Suraj Khuran for reporting the issue and providing patch for the same.

Modified:
    ofbiz/branches/release16.11/applications/order/minilang/order/OrderServices.xml

Modified: ofbiz/branches/release16.11/applications/order/minilang/order/OrderServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release16.11/applications/order/minilang/order/OrderServices.xml?rev=1831186&r1=1831185&r2=1831186&view=diff
==============================================================================
--- ofbiz/branches/release16.11/applications/order/minilang/order/OrderServices.xml (original)
+++ ofbiz/branches/release16.11/applications/order/minilang/order/OrderServices.xml Tue May  8 13:37:11 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">