You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ar...@apache.org on 2017/07/08 18:38:17 UTC

svn commit: r1801310 - in /ofbiz/ofbiz-framework/trunk/applications: datamodel/entitydef/ product/groovyScripts/facility/shipment/

Author: arunpatidar
Date: Sat Jul  8 18:38:17 2017
New Revision: 1801310

URL: http://svn.apache.org/viewvc?rev=1801310&view=rev
Log:
Improved: Improvements in OrderHeader entity definition and services. (OFBIZ-9457)
Thanks Rishi solanki and Aishwary Shrivastav for your contribution.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/order-entitymodel.xml
    ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/AddItemsFromOrder.groovy
    ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy

Modified: ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/order-entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/order-entitymodel.xml?rev=1801310&r1=1801309&r2=1801310&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/order-entitymodel.xml (original)
+++ ofbiz/ofbiz-framework/trunk/applications/datamodel/entitydef/order-entitymodel.xml Sat Jul  8 18:38:17 2017
@@ -432,12 +432,6 @@ under the License.
       <relation type="one" fk-name="ORDER_HDR_CUOM" rel-entity-name="Uom">
         <key-map field-name="currencyUom" rel-field-name="uomId"/>
       </relation>
-      <relation type="many" rel-entity-name="OrderHeaderNoteView">
-        <key-map field-name="orderId"/>
-      </relation>
-      <relation type="many" rel-entity-name="OrderItemAndShipGroupAssoc">
-        <key-map field-name="orderId"/>
-      </relation>
       <index name="ORDEREXT_ID_IDX">
         <index-field name="externalId"/>
       </index>

Modified: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/AddItemsFromOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/AddItemsFromOrder.groovy?rev=1801310&r1=1801309&r2=1801310&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/AddItemsFromOrder.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/AddItemsFromOrder.groovy Sat Jul  8 18:38:17 2017
@@ -57,11 +57,7 @@ if (orderId && shipment) {
             context.orderItemShipGroup = orderItemShipGroup
         }
 
-        oiasgaLimitMap = null
-        if (orderItemShipGroup) {
-            oiasgaLimitMap = [shipGroupSeqId : shipGroupSeqId]
-        }
-        orderItems = orderHeader.getRelated("OrderItemAndShipGroupAssoc", oiasgaLimitMap, ['shipGroupSeqId', 'orderItemSeqId'], false)
+        orderItems = from("OrderItemAndShipGroupAssoc").where("shipGroupSeqId", shipGroupSeqId, "orderId", orderHeader.orderId).orderBy('shipGroupSeqId', 'orderItemSeqId').queryList();
         orderItemDatas = [] as LinkedList
         orderItems.each { orderItemAndShipGroupAssoc ->
             orderItemData = [:]

Modified: ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy?rev=1801310&r1=1801309&r2=1801310&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/product/groovyScripts/facility/shipment/ReceiveInventoryAgainstPurchaseOrder.groovy Sat Jul  8 18:38:17 2017
@@ -107,16 +107,12 @@ if (!itemQuantitiesToReceive) {
     itemQuantitiesToReceive = [_shipmentId : shipmentId, _orderId : orderId]
 }
 
-oiasgaLimitMap = null
-if (shipGroupSeqId) {
-    oiasgaLimitMap = [shipGroupSeqId : shipGroupSeqId]
-}
 
 orderItemDatas = [:] as TreeMap
 totalAvailableToReceive = 0
 
 // Populate the order item data for the FTL
-orderItems = orderHeader.getRelated("OrderItemAndShipGroupAssoc", oiasgaLimitMap, ['shipGroupSeqId', 'orderItemSeqId'], false)
+orderItems = from("OrderItemAndShipGroupAssoc").where("shipGroupSeqId", shipGroupSeqId, "orderId", orderHeader.orderId).orderBy('shipGroupSeqId', 'orderItemSeqId').queryList();
 orderItems.each { orderItemAndShipGroupAssoc ->
     product = orderItemAndShipGroupAssoc.getRelatedOne("Product", false)