Author: surajk
Date: Sat Jul 28 09:32:05 2018 New Revision: 1836882 URL: http://svn.apache.org/viewvc?rev=1836882&view=rev Log: Improved: Verify contact mech details (expired or not) before copying it to new order while re-ordering. (OFBIZ-9544) Modified: ofbiz/ofbiz-framework/trunk/applications/order/entitydef/entitymodel_view.xml ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java Modified: ofbiz/ofbiz-framework/trunk/applications/order/entitydef/entitymodel_view.xml URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/entitydef/entitymodel_view.xml?rev=1836882&r1=1836881&r2=1836882&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/entitydef/entitymodel_view.xml (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/entitydef/entitymodel_view.xml Sat Jul 28 09:32:05 2018 @@ -1775,4 +1775,26 @@ under the License. <key-map field-name="workEffortId"/> </view-link> </view-entity> + <view-entity entity-name="OrderAndPartyContactMech" + package-name="org.apache.ofbiz.party.party" + title="Order contact mech and purpose view"> + <member-entity entity-alias="OCM" entity-name="OrderContactMech"/> + <member-entity entity-alias="CM" entity-name="ContactMech"/> + <member-entity entity-alias="PCM" entity-name="PartyContactMech"/> + <alias-all entity-alias="OCM"/> + <alias entity-alias="PCM" name="partyId"/> + <alias entity-alias="PCM" name="contactFromDate" field="fromDate"/> + <alias entity-alias="PCM" name="contactThruDate" field="thruDate"/> + <alias entity-alias="CM" name="contactMechTypeId"/> + <alias entity-alias="CM" name="infoString"/> + <alias entity-alias="PCM" name="comments"/> + <alias entity-alias="PCM" name="extension"/> + <alias entity-alias="PCM" name="allowSolicitation"/> + <view-link entity-alias="OCM" rel-entity-alias="CM"> + <key-map field-name="contactMechId"/> + </view-link> + <view-link entity-alias="CM" rel-entity-alias="PCM"> + <key-map field-name="contactMechId"/> + </view-link> + </view-entity> </entitymodel> Modified: ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java?rev=1836882&r1=1836881&r2=1836882&view=diff ============================================================================== --- ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java (original) +++ ofbiz/ofbiz-framework/trunk/applications/order/src/main/java/org/apache/ofbiz/order/shoppingcart/ShoppingCartServices.java Sat Jul 28 09:32:05 2018 @@ -185,6 +185,7 @@ public class ShoppingCartServices { orderHeader = EntityQuery.use(delegator).from("OrderHeader").where("orderId", orderId).queryOne(); orderTerms = orderHeader.getRelated("OrderTerm", null, null, false); orderContactMechs = orderHeader.getRelated("OrderContactMech", null, null, false); + orderContactMechs = EntityQuery.use(delegator).select("orderId", "contactMechId", "contactMechPurposeTypeId").from("OrderAndPartyContactMech").where("orderId", orderId).filterByDate("contactFromDate", "contactThruDate").distinct().queryList(); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); |
Free forum by Nabble | Edit this page |