[UOM Management] Merge with pi.
authorDavid Miguelez <david.miguelez@openbravo.com>
Fri, 02 Dec 2016 12:32:08 +0100
changeset 30841 a57c4aa5d672
parent 30840 8138ee07c1cb (current diff)
parent 30717 0fba1fd4f076 (diff)
child 30842 cde4e226d8de
[UOM Management] Merge with pi.
.project
src-core/.project
src-db/database/model/functions/M_INOUT_POST.xml
src-db/database/model/views/M_RM_SHIPMENT_PICK_EDIT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_TAB.xml
src-trl/.project
src-wad/.project
--- a/.project	Fri Dec 02 11:00:27 2016 +0100
+++ b/.project	Fri Dec 02 12:32:08 2016 +0100
@@ -15,6 +15,11 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationConstants.java	Fri Dec 02 11:00:27 2016 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/ApplicationConstants.java	Fri Dec 02 12:32:08 2016 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -65,6 +65,8 @@
   public static final String TABLEBASEDTABLE = "Table";
   public static final String HQLBASEDTABLE = "HQL";
 
+  public static final String REPORT_UI_PATTERN = "OBUIAPP_Report";
+
   static {
     try {
       ACTION_RESULT_SUCCESS = new JSONObject("{result: 'success'}");
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/GlobalMenu.java	Fri Dec 02 11:00:27 2016 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/GlobalMenu.java	Fri Dec 02 12:32:08 2016 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -155,7 +155,7 @@
   }
 
   /**
-   * Each menu option is configured with additional paramters
+   * Each menu option is configured with additional parameters
    * 
    */
   private void linkMenus(List<Menu> menus, List<MenuOption> menuOptions, String language) {
@@ -236,6 +236,10 @@
               && menu.getOBUIAPPProcessDefinition().isActive()) {
             foundOption.setType(MenuEntryType.ProcessDefinition);
             foundOption.setObjectId(menu.getOBUIAPPProcessDefinition().getId());
+            if (ApplicationConstants.REPORT_UI_PATTERN.equals(menu.getOBUIAPPProcessDefinition()
+                .getUIPattern())) {
+              foundOption.setReport(true);
+            }
           } else if (menu.getWindow() != null && menu.getWindow().isActive()) {
             boolean found = false;
             for (Tab tab : menu.getWindow().getADTabList()) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/QuickLaunchDataSource.java	Fri Dec 02 11:00:27 2016 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/QuickLaunchDataSource.java	Fri Dec 02 12:32:08 2016 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -121,7 +121,7 @@
         } else if (menuOption.isForm()) {
           data.put(OPTION_TYPE, OPTION_TYPE_URL);
           data.put(FORM_ID, menuOption.getFormId());
-        } else if (menuOption.isReport()) {
+        } else if (menuOption.isReport() && !menuOption.isProcessDefinition()) {
           data.put(OPTION_TYPE, OPTION_TYPE_URL);
           data.put(PROCESS_ID, menuOption.getMenu().getProcess().getId());
         } else if (menuOption.isProcessDefinition()) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/templates/application-menu.js.ftl	Fri Dec 02 11:00:27 2016 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/navigationbarcomponents/templates/application-menu.js.ftl	Fri Dec 02 12:32:08 2016 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -45,7 +45,7 @@
         , type: 'processManual'
         , manualUrl: '${menuOption.id?js_string}'
         , manualProcessId: '${menuOption.menu.process.id}'
-    <#elseif menuOption.report>
+    <#elseif menuOption.report && !menuOption.processDefinition>
         , type: 'report'
         , manualUrl: '${menuOption.id?js_string}'
         , manualProcessId: '${menuOption.menu.process.id}'
@@ -64,6 +64,7 @@
     <#elseif menuOption.processDefinition>
         , type: 'processDefinition'
         , viewId: 'processDefinition_${menuOption.menu.oBUIAPPProcessDefinition.id}'
+        , uiPattern: '${menuOption.menu.oBUIAPPProcessDefinition.uIPattern?js_string}'
     </#if>
     , singleRecord: ${menuOption.singleRecordStringValue}
     , readOnly: ${menuOption.readOnlyStringValue}
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ParameterWindowComponent.java	Fri Dec 02 11:00:27 2016 +0100
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/ParameterWindowComponent.java	Fri Dec 02 12:32:08 2016 +0100
@@ -30,6 +30,7 @@
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
 import org.hibernate.criterion.Restrictions;
+import org.openbravo.client.application.ApplicationConstants;
 import org.openbravo.client.application.Parameter;
 import org.openbravo.client.application.Process;
 import org.openbravo.client.application.ReportDefinition;
@@ -158,7 +159,7 @@
   }
 
   public boolean isReport() {
-    return "OBUIAPP_Report".equals(process.getUIPattern());
+    return ApplicationConstants.REPORT_UI_PATTERN.equals(process.getUIPattern());
   }
 
   public String getReportId() {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js	Fri Dec 02 11:00:27 2016 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js	Fri Dec 02 12:32:08 2016 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011-2014 Openbravo SLU
+ * All portions are Copyright (C) 2011-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -262,27 +262,31 @@
     this.Super('showMenu', arguments);
   },
 
-  getNodeIcon: function (type) {
+  getNodeIcon: function (node) {
     var iconPath;
-    if (type === 'window') {
+    if (node.type === 'window') {
       iconPath = this.nodeIcons.Window;
-    } else if (type === 'process') {
+    } else if (node.type === 'process') {
       iconPath = this.nodeIcons.Process;
-    } else if (type === 'processManual') {
+    } else if (node.type === 'processManual') {
       iconPath = this.nodeIcons.ProcessManual;
-    } else if (type === 'report') {
+    } else if (node.type === 'report') {
       iconPath = this.nodeIcons.Report;
-    } else if (type === 'task') {
+    } else if (node.type === 'task') {
       iconPath = this.nodeIcons.Task;
-    } else if (type === 'form') {
+    } else if (node.type === 'form') {
       iconPath = this.nodeIcons.Form;
-    } else if (type === 'external') {
+    } else if (node.type === 'external') {
       iconPath = this.nodeIcons.ExternalLink;
-    } else if (type === 'view') {
+    } else if (node.type === 'view') {
       iconPath = this.nodeIcons.View;
-    } else if (type === 'processDefinition') {
-      iconPath = this.nodeIcons.Process;
-    } else if (type === 'folder') {
+    } else if (node.type === 'processDefinition') {
+      if (node.uiPattern === 'OBUIAPP_Report') {
+        iconPath = this.nodeIcons.Report;
+      } else {
+        iconPath = this.nodeIcons.Process;
+      }
+    } else if (node.type === 'folder') {
       iconPath = this.nodeIcons.Folder;
     }
     return iconPath;
@@ -293,7 +297,7 @@
       var i, length = node.length;
       for (i = 0; i < length; i++) {
         if (node[i].type) {
-          node[i].icon = this.getNodeIcon(node[i].type);
+          node[i].icon = this.getNodeIcon(node[i]);
           if (node[i].submenu) {
             this.setNodeIcons(node[i].submenu);
           }
--- a/modules/org.openbravo.utility.cleanup.log/src/org/openbravo/utility/cleanup/log/LogCleanUpProcess.java	Fri Dec 02 11:00:27 2016 +0100
+++ b/modules/org.openbravo.utility.cleanup.log/src/org/openbravo/utility/cleanup/log/LogCleanUpProcess.java	Fri Dec 02 12:32:08 2016 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2013-2015 Openbravo SLU 
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -90,8 +90,7 @@
         long t = System.currentTimeMillis();
         // force reload of log clean up configuration to prevent LazyInitializationException
         config = OBDal.getInstance().get(LogCleanUpConfig.class, config.getId());
-        Entity entity = ModelProvider.getInstance().getEntityByTableId(
-            config.getTable().getId());
+        Entity entity = ModelProvider.getInstance().getEntityByTableId(config.getTable().getId());
 
         if (config.isTruncateTable()) {
           // tables to be truncated don't use CleanEntity
@@ -221,14 +220,14 @@
         }
       }
     } catch (SQLException e1) {
-      log.error("Errer executing vacuum", e1);
-      bgLogger.equals("Error executing vacuum: " + e1.getMessage());
+      log.error("Error executing vacuum", e1);
+      bgLogger.log("Error executing vacuum: " + e1.getMessage());
     } finally {
       // resetting auto commit to properly release DAL trx
       try {
         con.setAutoCommit(false);
       } catch (SQLException e) {
-        log.error("Errer executing vacuum", e);
+        log.error("Error executing vacuum", e);
       }
     }
   }
--- a/src-core/.project	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-core/.project	Fri Dec 02 12:32:08 2016 +0100
@@ -10,6 +10,11 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
Binary file src-db/database/lib/dbsourcemanager.jar has changed
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -80,8 +80,6 @@
     v_QtyPO NUMBER;
     v_QtySO NUMBER;
     v_QuantityOrder NUMBER;
-    v_QuantityOrderPO NUMBER;
-    v_QuantityOrderSO NUMBER;
     v_RDocumentNo VARCHAR2(40) ;
     v_RInOut_ID VARCHAR2(32);
     v_IsStocked NUMBER;
@@ -530,16 +528,12 @@
               v_Qty:=- Cur_InOutLine.MovementQty;
               v_QuantityOrder:=-Cur_InOutLine.QuantityOrder;
             END IF;
-            IF(Cur_InOut.IsSOTrx='N') THEN
+            IF (Cur_InOut.IsSOTrx='N' AND v_isreturndoctype='N') THEN
               v_QtySO:=0;
               v_QtyPO:=Cur_InOutLine.MovementQty;
-              v_QuantityOrderSO:=0;
-              v_QuantityOrderPO:=Cur_InOutLine.QuantityOrder;
             ELSE
               v_QtySO:=Cur_InOutLine.MovementQty;
               v_QtyPO:=0;
-              v_QuantityOrderSO:=Cur_InOutLine.QuantityOrder;
-              v_QuantityOrderPO:=0;
             END IF;
             -- UOM Conversion
             -- Is it a standard stocked product:3
@@ -747,7 +741,7 @@
             END IF;
             v_ResultStr:='UpdateOrderLine';
             IF(Cur_InOutLine.C_OrderLine_ID IS NOT NULL) THEN
-              if(Cur_InOut.ISSOTRX='Y') THEN
+              IF (Cur_InOut.ISSOTRX='Y' OR (Cur_InOut.ISSOTRX='N' AND v_isreturndoctype='Y')) THEN
                 -- Sets DateDelivered with the recent shipment date
                 -- of the shipment/s done for the orderline.
                 SELECT MAX(M.MOVEMENTDATE) INTO v_DateDelivered
@@ -808,6 +802,48 @@
               END IF;
             END IF;
           END LOOP; -- For all InOut Lines
+
+         -- Update the C_Order.IsDelivered flag only for Sales or RTV flows
+         -- This should be extended for other flows too in the future
+         IF (v_isSoTrx='Y' OR (v_isSoTrx='N' AND v_isreturndoctype='Y')) THEN
+           FOR Cur_Order IN
+           (SELECT o.c_order_id
+            FROM C_Order o
+            WHERE EXISTS (SELECT 1
+                          FROM C_ORDERLINE ol
+                          JOIN M_INOUTLINE iol ON iol.C_ORDERLINE_ID = ol.C_ORDERLINE_ID
+                          WHERE ol.C_Order_ID = o.C_Order_ID
+                          AND iol.m_inout_id = CUR_InOut.m_inout_id
+                          )
+           )
+           LOOP
+             IF (v_IsReversedDoc = 'N') THEN
+               -- Normal Scenario
+               UPDATE C_Order o
+               SET IsDelivered = 'Y'
+               WHERE o.c_order_id = Cur_Order.c_order_id
+               AND o.IsDelivered = 'N'
+               AND EXISTS (SELECT 1
+                           FROM C_ORDERLINE ol
+                           WHERE ol.C_Order_ID = o.C_Order_ID
+                           AND ol.c_order_discount_id IS NULL
+                           GROUP BY ol.C_Order_ID
+                           HAVING SUM(ol.QTYORDERED) = SUM(ol.QTYDELIVERED));
+             ELSIF (v_IsReversedDoc = 'Y') THEN
+               -- Void Scenario
+               UPDATE C_Order o
+               SET IsDelivered = 'N'
+               WHERE o.c_order_id = Cur_Order.c_order_id
+               AND o.IsDelivered = 'Y'
+               AND EXISTS (SELECT 1
+                           FROM C_ORDERLINE ol
+                           WHERE ol.C_Order_ID = o.C_Order_ID
+                           AND ol.c_order_discount_id IS NULL
+                           AND ol.QTYORDERED <> ol.QTYDELIVERED);
+             END IF;
+           END LOOP;
+         END IF;
+
           /*******************
           * PO Matching
           ******************/
--- a/src-db/database/model/tables/C_BPARTNER.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/model/tables/C_BPARTNER.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -377,6 +377,14 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="BIRTHPLACE" primaryKey="false" required="false" type="VARCHAR" size="60" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
+      <column name="BIRTHDAY" primaryKey="false" required="false" type="TIMESTAMP" size="7" autoIncrement="false">
+        <default/>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_LANGUAGE" name="AD_LANGUAGE_C_BUSPARTNER">
         <reference local="AD_LANGUAGE" foreign="AD_LANGUAGE"/>
       </foreign-key>
--- a/src-db/database/model/views/M_RM_SHIPMENT_PICK_EDIT.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/model/views/M_RM_SHIPMENT_PICK_EDIT.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -1,4 +1,4 @@
 <?xml version="1.0"?>
   <database name="VIEW M_RM_SHIPMENT_PICK_EDIT">
-    <view name="M_RM_SHIPMENT_PICK_EDIT"><![CDATA[SELECT COALESCE(sd.m_storage_detail_id, '') || ol.c_orderline_id AS m_rm_shipment_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.createdby, ol.created, ol.updatedby, ol.updated, o.documentno AS returnorderno, ol.m_product_id, ol.m_attributesetinstance_id, ol.c_uom_id, (-1) * ol.qtyordered AS returned, (-1) * iol.movementqty AS movementqty, sd.m_locator_id, CASE WHEN sd.m_locator_id IS NULL THEN (-1) * ol.qtyordered ELSE COALESCE(sd.qtyonhand, 0) END AS availableqty, (-1) * (ol.qtyordered - to_number(COALESCE((SELECT to_char(sum(COALESCE(iol3.movementqty, 0))) AS sum FROM m_inoutline iol3 JOIN m_inout io3 ON iol3.m_inout_id = io3.m_inout_id AND io3.processed = 'Y' WHERE iol3.c_orderline_id = ol.c_orderline_id), '0'))) AS pendingqty, iol.m_inout_id, CASE WHEN iol.m_inout_id IS NOT NULL THEN 'Y' ELSE 'N' END AS ob_selected, ol.c_orderline_id, ol.line, iol.m_inoutline_id, p.isstocked, o.c_bpartner_id, ol.c_aum, (-1) * ol.aumqty AS aumqty, ol.c_uom_id AS returneduom, (-1) * m_get_converted_aumqty(ol.m_product_id, ol.qtyordered - to_number(COALESCE((SELECT to_char(sum(COALESCE(iol3.movementqty, 0))) AS sum FROM m_inoutline iol3 JOIN m_inout io3 ON iol3.m_inout_id = io3.m_inout_id AND io3.processed = 'Y' WHERE iol3.c_orderline_id = ol.c_orderline_id), '0')), ol.c_aum) AS pendingaumqty, m_get_converted_aumqty(ol.m_product_id, CASE WHEN sd.m_locator_id IS NULL THEN (-1) * ol.qtyordered ELSE COALESCE(sd.qtyonhand, 0) END, ol.c_aum) AS availableaumqty, m_get_converted_qty(ol.m_product_id, 1, ol.c_aum) AS rate FROM c_orderline ol JOIN c_order o ON o.c_order_id = ol.c_order_id AND o.processed = 'Y' AND o.issotrx = 'N' LEFT JOIN m_storage_detail sd ON sd.m_product_id = ol.m_product_id AND COALESCE(sd.m_attributesetinstance_id, '0') = COALESCE(ol.m_attributesetinstance_id, '0') AND sd.qtyonhand > 0 LEFT JOIN m_locator l ON sd.m_locator_id = l.m_locator_id JOIN m_product p ON p.m_product_id = ol.m_product_id JOIN c_doctype dt ON o.c_doctypetarget_id = dt.c_doctype_id AND dt.isreturn = 'Y' LEFT JOIN (SELECT iol2.m_inoutline_id, iol2.m_inout_id, iol2.movementqty, iol2.c_orderline_id, iol2.ad_org_id, iol2.m_locator_id FROM m_inoutline iol2 JOIN m_inout io2 ON iol2.m_inout_id = io2.m_inout_id AND io2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id AND iol.m_locator_id = sd.m_locator_id WHERE o.docstatus = 'CO']]></view>
+    <view name="M_RM_SHIPMENT_PICK_EDIT"><![CDATA[SELECT COALESCE(sd.m_storage_detail_id, '') || ol.c_orderline_id AS m_rm_shipment_pick_edit_id, ol.ad_client_id, COALESCE(iol.ad_org_id, ol.ad_org_id) AS ad_org_id, ol.isactive, ol.createdby, ol.created, ol.updatedby, ol.updated, o.documentno AS returnorderno, ol.m_product_id, ol.m_attributesetinstance_id, ol.c_uom_id, (-1) * ol.qtyordered AS returned, (-1) * iol.movementqty AS movementqty, sd.m_locator_id, CASE WHEN sd.m_locator_id IS NULL THEN (-1) * ol.qtyordered ELSE COALESCE(sd.qtyonhand, 0) END AS availableqty, (-1) * (ol.qtyordered - ol.qtydelivered) AS pendingqty, iol.m_inout_id, CASE WHEN iol.m_inout_id IS NOT NULL THEN 'Y' ELSE 'N' END AS ob_selected, ol.c_orderline_id, ol.line, iol.m_inoutline_id, p.isstocked, o.c_bpartner_id, l.ad_org_id AS locatororg, ol.c_aum, (-1) * ol.aumqty AS aumqty, ol.c_uom_id AS returneduom, (-1) * m_get_converted_aumqty(ol.m_product_id, ol.qtyordered - to_number(COALESCE((SELECT to_char(sum(COALESCE(iol3.movementqty, 0))) AS sum FROM m_inoutline iol3 JOIN m_inout io3 ON iol3.m_inout_id = io3.m_inout_id AND io3.processed = 'Y' WHERE iol3.c_orderline_id = ol.c_orderline_id), '0')), ol.c_aum) AS pendingaumqty, m_get_converted_aumqty(ol.m_product_id, CASE WHEN sd.m_locator_id IS NULL THEN (-1) * ol.qtyordered ELSE COALESCE(sd.qtyonhand, 0) END, ol.c_aum) AS availableaumqty, m_get_converted_qty(ol.m_product_id, 1, ol.c_aum) AS rate FROM c_orderline ol JOIN c_order o ON o.c_order_id = ol.c_order_id AND o.processed = 'Y' AND o.issotrx = 'N' AND o.isdelivered = 'N' JOIN m_product p ON p.m_product_id = ol.m_product_id LEFT JOIN m_storage_detail sd ON sd.m_product_id = ol.m_product_id AND COALESCE(sd.m_attributesetinstance_id, '0') = COALESCE(ol.m_attributesetinstance_id, '0') AND sd.qtyonhand > 0 JOIN c_doctype dt ON o.c_doctypetarget_id = dt.c_doctype_id AND dt.isreturn = 'Y' LEFT JOIN (SELECT iol2.m_inoutline_id, iol2.m_inout_id, iol2.movementqty, iol2.c_orderline_id, iol2.ad_org_id, iol2.m_locator_id FROM m_inoutline iol2 JOIN m_inout io2 ON iol2.m_inout_id = io2.m_inout_id AND io2.processed = 'N') iol ON iol.c_orderline_id = ol.c_orderline_id AND iol.m_locator_id = sd.m_locator_id LEFT JOIN m_locator l ON sd.m_locator_id = l.m_locator_id WHERE o.docstatus = 'CO' AND ol.qtyordered <> ol.qtydelivered]]></view>
   </database>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -247049,6 +247049,44 @@
 <!--0FA23D0D90E34E8790627C9928566EE3-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--0FA23D0D90E34E8790627C9928566EE3--></AD_COLUMN>
 
+<!--1040A945DD4048AD8D43449847A6EB11--><AD_COLUMN>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_COLUMN_ID><![CDATA[1040A945DD4048AD8D43449847A6EB11]]></AD_COLUMN_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <NAME><![CDATA[Birth Day]]></NAME>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <DESCRIPTION><![CDATA[An anniversary of birth for a business partner.]]></DESCRIPTION>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <HELP><![CDATA[Birthday or Anniversary day]]></HELP>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <COLUMNNAME><![CDATA[Birthday]]></COLUMNNAME>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_TABLE_ID><![CDATA[291]]></AD_TABLE_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <SEQNO><![CDATA[620]]></SEQNO>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_ELEMENT_ID><![CDATA[1891]]></AD_ELEMENT_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <POSITION><![CDATA[96]]></POSITION>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--1040A945DD4048AD8D43449847A6EB11-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--1040A945DD4048AD8D43449847A6EB11--></AD_COLUMN>
+
 <!--1050C23BA102443A86AB2AF85D8F098D--><AD_COLUMN>
 <!--1050C23BA102443A86AB2AF85D8F098D-->  <AD_COLUMN_ID><![CDATA[1050C23BA102443A86AB2AF85D8F098D]]></AD_COLUMN_ID>
 <!--1050C23BA102443A86AB2AF85D8F098D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -265737,7 +265775,7 @@
 <!--4EA73125B044436198DB81CFF08E94D6-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--4EA73125B044436198DB81CFF08E94D6-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--4EA73125B044436198DB81CFF08E94D6-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--4EA73125B044436198DB81CFF08E94D6-->  <POSITION><![CDATA[68]]></POSITION>
+<!--4EA73125B044436198DB81CFF08E94D6-->  <POSITION><![CDATA[69]]></POSITION>
 <!--4EA73125B044436198DB81CFF08E94D6-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--4EA73125B044436198DB81CFF08E94D6-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--4EA73125B044436198DB81CFF08E94D6-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -269066,6 +269104,7 @@
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--53B4B47E0B204E20B8C0F57A27662FEF-->  <POSITION><![CDATA[93]]></POSITION>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--53B4B47E0B204E20B8C0F57A27662FEF-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -276786,6 +276825,42 @@
 <!--57D0B86A8D514F4EB2265B6A683D936A-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--57D0B86A8D514F4EB2265B6A683D936A--></AD_COLUMN>
 
+<!--57E9885AC7E14F158A4CF1F818874AA1--><AD_COLUMN>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_COLUMN_ID><![CDATA[57E9885AC7E14F158A4CF1F818874AA1]]></AD_COLUMN_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <NAME><![CDATA[Birth Place]]></NAME>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <COLUMNNAME><![CDATA[Birthplace]]></COLUMNNAME>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_TABLE_ID><![CDATA[291]]></AD_TABLE_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <SEQNO><![CDATA[610]]></SEQNO>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_ELEMENT_ID><![CDATA[F26D3514DBA84CF2897C720093BF6BEC]]></AD_ELEMENT_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <POSITION><![CDATA[95]]></POSITION>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--57E9885AC7E14F158A4CF1F818874AA1-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--57E9885AC7E14F158A4CF1F818874AA1--></AD_COLUMN>
+
 <!--57F9A2F8FA9341139A285AA0B81F0E76--><AD_COLUMN>
 <!--57F9A2F8FA9341139A285AA0B81F0E76-->  <AD_COLUMN_ID><![CDATA[57F9A2F8FA9341139A285AA0B81F0E76]]></AD_COLUMN_ID>
 <!--57F9A2F8FA9341139A285AA0B81F0E76-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -296359,7 +296434,7 @@
 <!--71F11E61216A4BD8A165B892D5904848-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--71F11E61216A4BD8A165B892D5904848-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--71F11E61216A4BD8A165B892D5904848-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--71F11E61216A4BD8A165B892D5904848-->  <POSITION><![CDATA[69]]></POSITION>
+<!--71F11E61216A4BD8A165B892D5904848-->  <POSITION><![CDATA[70]]></POSITION>
 <!--71F11E61216A4BD8A165B892D5904848-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--71F11E61216A4BD8A165B892D5904848-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--71F11E61216A4BD8A165B892D5904848-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -331900,7 +331975,7 @@
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
-<!--984876F99CCF4C9CA94FD365FD79F834-->  <POSITION><![CDATA[95]]></POSITION>
+<!--984876F99CCF4C9CA94FD365FD79F834-->  <POSITION><![CDATA[94]]></POSITION>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--984876F99CCF4C9CA94FD365FD79F834-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -346616,6 +346691,43 @@
 <!--B651D62716A2B629E040007F01004BB7-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
 <!--B651D62716A2B629E040007F01004BB7--></AD_COLUMN>
 
+<!--B65E754D8494496C87B61CA842B6F598--><AD_COLUMN>
+<!--B65E754D8494496C87B61CA842B6F598-->  <AD_COLUMN_ID><![CDATA[B65E754D8494496C87B61CA842B6F598]]></AD_COLUMN_ID>
+<!--B65E754D8494496C87B61CA842B6F598-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B65E754D8494496C87B61CA842B6F598-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B65E754D8494496C87B61CA842B6F598-->  <NAME><![CDATA[LocatorOrg]]></NAME>
+<!--B65E754D8494496C87B61CA842B6F598-->  <COLUMNNAME><![CDATA[LocatorOrg]]></COLUMNNAME>
+<!--B65E754D8494496C87B61CA842B6F598-->  <AD_TABLE_ID><![CDATA[347B0AA5C3CD4D18910D2FE4990B790E]]></AD_TABLE_ID>
+<!--B65E754D8494496C87B61CA842B6F598-->  <AD_REFERENCE_ID><![CDATA[18]]></AD_REFERENCE_ID>
+<!--B65E754D8494496C87B61CA842B6F598-->  <AD_REFERENCE_VALUE_ID><![CDATA[276]]></AD_REFERENCE_VALUE_ID>
+<!--B65E754D8494496C87B61CA842B6F598-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--B65E754D8494496C87B61CA842B6F598-->  <SEQNO><![CDATA[250]]></SEQNO>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--B65E754D8494496C87B61CA842B6F598-->  <AD_ELEMENT_ID><![CDATA[7125A2F10D07409FBDC9EF761344831D]]></AD_ELEMENT_ID>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--B65E754D8494496C87B61CA842B6F598-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--B65E754D8494496C87B61CA842B6F598-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--B65E754D8494496C87B61CA842B6F598-->  <POSITION><![CDATA[25]]></POSITION>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--B65E754D8494496C87B61CA842B6F598-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--B65E754D8494496C87B61CA842B6F598-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ALLOWSORTING><![CDATA[Y]]></ALLOWSORTING>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ALLOWFILTERING><![CDATA[Y]]></ALLOWFILTERING>
+<!--B65E754D8494496C87B61CA842B6F598-->  <ALLOWED_CROSS_ORG_LINK><![CDATA[N]]></ALLOWED_CROSS_ORG_LINK>
+<!--B65E754D8494496C87B61CA842B6F598--></AD_COLUMN>
+
 <!--B6767E6BD31B48AEA60533DE5F560824--><AD_COLUMN>
 <!--B6767E6BD31B48AEA60533DE5F560824-->  <AD_COLUMN_ID><![CDATA[B6767E6BD31B48AEA60533DE5F560824]]></AD_COLUMN_ID>
 <!--B6767E6BD31B48AEA60533DE5F560824-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -26844,6 +26844,18 @@
 <!--70E55A579FBB43BDB3C4233D9C6729B7-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--70E55A579FBB43BDB3C4233D9C6729B7--></AD_ELEMENT>
 
+<!--7125A2F10D07409FBDC9EF761344831D--><AD_ELEMENT>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <AD_ELEMENT_ID><![CDATA[7125A2F10D07409FBDC9EF761344831D]]></AD_ELEMENT_ID>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <COLUMNNAME><![CDATA[LocatorOrg]]></COLUMNNAME>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <NAME><![CDATA[Locator Organization]]></NAME>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <PRINTNAME><![CDATA[Locator Organization]]></PRINTNAME>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7125A2F10D07409FBDC9EF761344831D-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--7125A2F10D07409FBDC9EF761344831D--></AD_ELEMENT>
+
 <!--722EE1A3B4A4660EE040007F01001A37--><AD_ELEMENT>
 <!--722EE1A3B4A4660EE040007F01001A37-->  <AD_ELEMENT_ID><![CDATA[722EE1A3B4A4660EE040007F01001A37]]></AD_ELEMENT_ID>
 <!--722EE1A3B4A4660EE040007F01001A37-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -34627,6 +34639,18 @@
 <!--F2351D18492C42A6AE6F01F74831D617-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--F2351D18492C42A6AE6F01F74831D617--></AD_ELEMENT>
 
+<!--F26D3514DBA84CF2897C720093BF6BEC--><AD_ELEMENT>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <AD_ELEMENT_ID><![CDATA[F26D3514DBA84CF2897C720093BF6BEC]]></AD_ELEMENT_ID>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <COLUMNNAME><![CDATA[Birthplace]]></COLUMNNAME>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <NAME><![CDATA[Birth Place]]></NAME>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <PRINTNAME><![CDATA[Birth Place]]></PRINTNAME>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--F26D3514DBA84CF2897C720093BF6BEC-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--F26D3514DBA84CF2897C720093BF6BEC--></AD_ELEMENT>
+
 <!--F2D48C18F40D4F1AB4EB9B42BDC76004--><AD_ELEMENT>
 <!--F2D48C18F40D4F1AB4EB9B42BDC76004-->  <AD_ELEMENT_ID><![CDATA[F2D48C18F40D4F1AB4EB9B42BDC76004]]></AD_ELEMENT_ID>
 <!--F2D48C18F40D4F1AB4EB9B42BDC76004-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -14470,18 +14470,19 @@
 <!--1089-->  <AD_TAB_ID><![CDATA[186]]></AD_TAB_ID>
 <!--1089-->  <AD_COLUMN_ID><![CDATA[2177]]></AD_COLUMN_ID>
 <!--1089-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--1089-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--1089-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--1089-->  <DISPLAYLOGIC><![CDATA[@Processed@='Y']]></DISPLAYLOGIC>
 <!--1089-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--1089-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
 <!--1089-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--1089-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--1089-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--1089-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--1089-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
 <!--1089-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--1089-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1089-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--1089-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--1089-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--1089-->  <ISSHOWNINSTATUSBAR><![CDATA[Y]]></ISSHOWNINSTATUSBAR>
 <!--1089-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--1089--></AD_FIELD>
 
@@ -15405,15 +15406,15 @@
 <!--1132-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
 <!--1132-->  <AD_COLUMN_ID><![CDATA[2226]]></AD_COLUMN_ID>
 <!--1132-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--1132-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
-<!--1132-->  <DISPLAYLOGIC><![CDATA[@OrderType@='OB' | @OrderType@='SO' | @Processed@='Y']]></DISPLAYLOGIC>
+<!--1132-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--1132-->  <DISPLAYLOGIC><![CDATA[@Processed@='Y']]></DISPLAYLOGIC>
 <!--1132-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
 <!--1132-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
 <!--1132-->  <SEQNO><![CDATA[140]]></SEQNO>
 <!--1132-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--1132-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--1132-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--1132-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--1132-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
 <!--1132-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--1132-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1132-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
@@ -208693,6 +208694,33 @@
 <!--4B536D8ED0CB480BA1A0D5526FCE202F-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--4B536D8ED0CB480BA1A0D5526FCE202F--></AD_FIELD>
 
+<!--4B5C67AF614F49B69CAE940CC61140AC--><AD_FIELD>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <AD_FIELD_ID><![CDATA[4B5C67AF614F49B69CAE940CC61140AC]]></AD_FIELD_ID>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <NAME><![CDATA[Locator Organization]]></NAME>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <AD_TAB_ID><![CDATA[9195CC43B5A4419195030A4DB17D8737]]></AD_TAB_ID>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <AD_COLUMN_ID><![CDATA[B65E754D8494496C87B61CA842B6F598]]></AD_COLUMN_ID>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <GRID_SEQNO><![CDATA[110]]></GRID_SEQNO>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--4B5C67AF614F49B69CAE940CC61140AC-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--4B5C67AF614F49B69CAE940CC61140AC--></AD_FIELD>
+
 <!--4B6FC57258F7415586F93FCEDB12199F--><AD_FIELD>
 <!--4B6FC57258F7415586F93FCEDB12199F-->  <AD_FIELD_ID><![CDATA[4B6FC57258F7415586F93FCEDB12199F]]></AD_FIELD_ID>
 <!--4B6FC57258F7415586F93FCEDB12199F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -236243,6 +236271,35 @@
 <!--75D3E53684774A14B665838D7CCC33A7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--75D3E53684774A14B665838D7CCC33A7--></AD_FIELD>
 
+<!--75E4E471100E45848F478AF51CDAA9CD--><AD_FIELD>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_FIELD_ID><![CDATA[75E4E471100E45848F478AF51CDAA9CD]]></AD_FIELD_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <NAME><![CDATA[Birthday]]></NAME>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <DESCRIPTION><![CDATA[An anniversary of birth for a business partner.]]></DESCRIPTION>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <HELP><![CDATA[Birthday or Anniversary day]]></HELP>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_TAB_ID><![CDATA[223]]></AD_TAB_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_COLUMN_ID><![CDATA[1040A945DD4048AD8D43449847A6EB11]]></AD_COLUMN_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <SEQNO><![CDATA[250]]></SEQNO>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <GRID_SEQNO><![CDATA[140]]></GRID_SEQNO>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--75E4E471100E45848F478AF51CDAA9CD-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--75E4E471100E45848F478AF51CDAA9CD--></AD_FIELD>
+
 <!--7642953AF81F461AB6A96DA9E7F674E6--><AD_FIELD>
 <!--7642953AF81F461AB6A96DA9E7F674E6-->  <AD_FIELD_ID><![CDATA[7642953AF81F461AB6A96DA9E7F674E6]]></AD_FIELD_ID>
 <!--7642953AF81F461AB6A96DA9E7F674E6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -249758,18 +249815,19 @@
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <AD_TAB_ID><![CDATA[5A5CCFC8359B4D79BA705DC487FE8173]]></AD_TAB_ID>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <AD_COLUMN_ID><![CDATA[2177]]></AD_COLUMN_ID>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--86EE88F76E7C45A095D955A26A7D1ADD-->  <DISPLAYLOGIC><![CDATA[@Processed@='Y']]></DISPLAYLOGIC>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--86EE88F76E7C45A095D955A26A7D1ADD-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--86EE88F76E7C45A095D955A26A7D1ADD-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--86EE88F76E7C45A095D955A26A7D1ADD-->  <ISSHOWNINSTATUSBAR><![CDATA[Y]]></ISSHOWNINSTATUSBAR>
 <!--86EE88F76E7C45A095D955A26A7D1ADD-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--86EE88F76E7C45A095D955A26A7D1ADD--></AD_FIELD>
 
@@ -267875,6 +267933,33 @@
 <!--ADDA9474A23F4C0182BB3BE4EAA6B87C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--ADDA9474A23F4C0182BB3BE4EAA6B87C--></AD_FIELD>
 
+<!--ADE41D125D2143F49177E058C42B3883--><AD_FIELD>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_FIELD_ID><![CDATA[ADE41D125D2143F49177E058C42B3883]]></AD_FIELD_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ADE41D125D2143F49177E058C42B3883-->  <NAME><![CDATA[Birth Place]]></NAME>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_TAB_ID><![CDATA[223]]></AD_TAB_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_COLUMN_ID><![CDATA[57E9885AC7E14F158A4CF1F818874AA1]]></AD_COLUMN_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--ADE41D125D2143F49177E058C42B3883-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--ADE41D125D2143F49177E058C42B3883-->  <SEQNO><![CDATA[260]]></SEQNO>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--ADE41D125D2143F49177E058C42B3883-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--ADE41D125D2143F49177E058C42B3883-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ADE41D125D2143F49177E058C42B3883-->  <GRID_SEQNO><![CDATA[150]]></GRID_SEQNO>
+<!--ADE41D125D2143F49177E058C42B3883-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--ADE41D125D2143F49177E058C42B3883-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--ADE41D125D2143F49177E058C42B3883-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--ADE41D125D2143F49177E058C42B3883-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--ADE41D125D2143F49177E058C42B3883--></AD_FIELD>
+
 <!--ADEA0D5288604FF88E1D4CBD393D1758--><AD_FIELD>
 <!--ADEA0D5288604FF88E1D4CBD393D1758-->  <AD_FIELD_ID><![CDATA[ADEA0D5288604FF88E1D4CBD393D1758]]></AD_FIELD_ID>
 <!--ADEA0D5288604FF88E1D4CBD393D1758-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -300287,20 +300372,21 @@
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <AD_TAB_ID><![CDATA[387B6179438D4C4CB40769A77F4C304C]]></AD_TAB_ID>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <AD_COLUMN_ID><![CDATA[2226]]></AD_COLUMN_ID>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
-<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
-<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <DISPLAYLOGIC><![CDATA[@OrderType@='OB' | @OrderType@='SO' | @OrderType@='PO']]></DISPLAYLOGIC>
+<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <DISPLAYLOGIC><![CDATA[@Processed@='Y']]></DISPLAYLOGIC>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <SEQNO><![CDATA[244]]></SEQNO>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
-<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
-<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <ISSHOWNINSTATUSBAR><![CDATA[Y]]></ISSHOWNINSTATUSBAR>
+<!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <CLIENTCLASS><![CDATA[OBTruncAddMinusDisplay]]></CLIENTCLASS>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--DC5D838BF9554E8FAC7C17F6AB99D877--></AD_FIELD>
 
--- a/src-db/database/sourcedata/AD_TAB.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/sourcedata/AD_TAB.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -17364,7 +17364,7 @@
 <!--9195CC43B5A4419195030A4DB17D8737-->  <UIPATTERN><![CDATA[STD]]></UIPATTERN>
 <!--9195CC43B5A4419195030A4DB17D8737-->  <HQLWHERECLAUSE><![CDATA[COALESCE(e.goodsShipment.id, @MaterialMgmtShipmentInOut.id@) = @MaterialMgmtShipmentInOut.id@
 AND @MaterialMgmtShipmentInOut.businessPartner@ = e.businessPartner.id
-AND e.pending <> 0 AND (e.storageBin is null OR ad_org_isinnaturaltree(@MaterialMgmtShipmentInOut.organization@, (select organization.id from Locator a where a.id = e.storageBin.id), @MaterialMgmtShipmentInOut.client@) = 'Y')]]></HQLWHERECLAUSE>
+AND (e.storageBin is null OR ad_org_isinnaturaltree(@MaterialMgmtShipmentInOut.organization@, locatorOrg, @MaterialMgmtShipmentInOut.client@) = 'Y')]]></HQLWHERECLAUSE>
 <!--9195CC43B5A4419195030A4DB17D8737-->  <HQLORDERBYCLAUSE><![CDATA[obSelected DESC, rMOrderNo, lineNo]]></HQLORDERBYCLAUSE>
 <!--9195CC43B5A4419195030A4DB17D8737-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
 <!--9195CC43B5A4419195030A4DB17D8737-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
--- a/src-db/database/sourcedata/AD_TREENODE.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-db/database/sourcedata/AD_TREENODE.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -733,7 +733,7 @@
 <!--52118BF1A21B4D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A21B4D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A21B4D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A21B4D84E040007F01005FEC-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--52118BF1A21B4D84E040007F01005FEC-->  <SEQNO><![CDATA[130]]></SEQNO>
 <!--52118BF1A21B4D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A21C4D84E040007F01005FEC--><AD_TREENODE>
@@ -898,7 +898,7 @@
 <!--52118BF1A22D4D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A22D4D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A22D4D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A22D4D84E040007F01005FEC-->  <SEQNO><![CDATA[130]]></SEQNO>
+<!--52118BF1A22D4D84E040007F01005FEC-->  <SEQNO><![CDATA[140]]></SEQNO>
 <!--52118BF1A22D4D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A2324D84E040007F01005FEC--><AD_TREENODE>
@@ -1294,7 +1294,7 @@
 <!--52118BF1A2634D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A2634D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A2634D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A2634D84E040007F01005FEC-->  <SEQNO><![CDATA[140]]></SEQNO>
+<!--52118BF1A2634D84E040007F01005FEC-->  <SEQNO><![CDATA[150]]></SEQNO>
 <!--52118BF1A2634D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A2644D84E040007F01005FEC--><AD_TREENODE>
@@ -3439,7 +3439,7 @@
 <!--52118BF1A3614D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A3614D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A3614D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A3614D84E040007F01005FEC-->  <SEQNO><![CDATA[180]]></SEQNO>
+<!--52118BF1A3614D84E040007F01005FEC-->  <SEQNO><![CDATA[190]]></SEQNO>
 <!--52118BF1A3614D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A3624D84E040007F01005FEC--><AD_TREENODE>
@@ -3681,7 +3681,7 @@
 <!--52118BF1A3784D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A3784D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A3784D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A3784D84E040007F01005FEC-->  <SEQNO><![CDATA[190]]></SEQNO>
+<!--52118BF1A3784D84E040007F01005FEC-->  <SEQNO><![CDATA[200]]></SEQNO>
 <!--52118BF1A3784D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A3794D84E040007F01005FEC--><AD_TREENODE>
@@ -3834,7 +3834,7 @@
 <!--52118BF1A5C94D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A5C94D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A5C94D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A5C94D84E040007F01005FEC-->  <SEQNO><![CDATA[170]]></SEQNO>
+<!--52118BF1A5C94D84E040007F01005FEC-->  <SEQNO><![CDATA[180]]></SEQNO>
 <!--52118BF1A5C94D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A5CA4D84E040007F01005FEC--><AD_TREENODE>
@@ -3856,7 +3856,7 @@
 <!--52118BF1A5CB4D84E040007F01005FEC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--52118BF1A5CB4D84E040007F01005FEC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--52118BF1A5CB4D84E040007F01005FEC-->  <PARENT_ID><![CDATA[0]]></PARENT_ID>
-<!--52118BF1A5CB4D84E040007F01005FEC-->  <SEQNO><![CDATA[150]]></SEQNO>
+<!--52118BF1A5CB4D84E040007F01005FEC-->  <SEQNO><![CDATA[160]]></SEQNO>
 <!--52118BF1A5CB4D84E040007F01005FEC--></AD_TREENODE>
 
 <!--52118BF1A5CC4D84E040007F01005FEC--><AD_TREENODE>
--- a/src-test/src/org/openbravo/test/dal/DalTest.java	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-test/src/org/openbravo/test/dal/DalTest.java	Fri Dec 02 12:32:08 2016 +0100
@@ -22,17 +22,23 @@
 
 package org.openbravo.test.dal;
 
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.Matchers.nullValue;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.hibernate.ObjectNotFoundException;
 import org.hibernate.criterion.Restrictions;
 import org.junit.FixMethodOrder;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.ExpectedException;
 import org.junit.runners.MethodSorters;
 import org.openbravo.base.exception.OBSecurityException;
 import org.openbravo.base.model.Property;
@@ -44,6 +50,7 @@
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.ad.system.SystemInformation;
+import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.common.businesspartner.Category;
 import org.openbravo.model.common.businesspartner.CategoryAccounts;
 import org.openbravo.model.common.currency.Currency;
@@ -65,6 +72,9 @@
 public class DalTest extends OBBaseTest {
   private static final Logger log = Logger.getLogger(DalTest.class);
 
+  @Rule
+  public ExpectedException thrown = ExpectedException.none();
+
   /**
    * Test to assert save false in a null char(1) column - Part I
    */
@@ -394,4 +404,29 @@
     final Property property = DalUtil.getProperty("AD_COLUMN", "AD_COLUMN_ID");
     assertNotNull(property);
   }
+
+  @Test
+  public void getInexistentObjShouldBeNull() {
+    BusinessPartner bp = OBDal.getInstance().get(BusinessPartner.class, "DummyId");
+
+    assertThat(bp, is(nullValue()));
+  }
+
+  @Test
+  public void getInexistentObjShouldBeNullEvenIfItWasProxied() {
+    @SuppressWarnings("unused")
+    BusinessPartner bpProxy = OBDal.getInstance().getProxy(BusinessPartner.class, "DummyId");
+    BusinessPartner bp = OBDal.getInstance().get(BusinessPartner.class, "DummyId");
+
+    assertThat(bp, is(nullValue()));
+  }
+
+  @Test
+  public void populatingProxyOfInexistentObjShouldFail() {
+    BusinessPartner bpProxy = OBDal.getInstance().getProxy(BusinessPartner.class, "DummyId");
+
+    thrown.expect(ObjectNotFoundException.class);
+    // getting any property causes proxy population from db
+    bpProxy.getName();
+  }
 }
--- a/src-trl/.project	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-trl/.project	Fri Dec 02 12:32:08 2016 +0100
@@ -10,6 +10,11 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateQtyDelivered.class has changed
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateQtyDeliveredData.class has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdateQtyDelivered.java	Fri Dec 02 12:32:08 2016 +0100
@@ -0,0 +1,60 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.modulescript;
+
+import org.apache.log4j.Logger;
+import org.openbravo.database.ConnectionProvider;
+
+/**
+ * Updates C_Orderline.QtyDelivered and C_Order.IsDelivered columns only for RTV flows. These
+ * columns will be used later on by the RTV shipment P&E.
+ * 
+ * This module script should be extended in the future to update these columns in other flows.
+ */
+public class UpdateQtyDelivered extends ModuleScript {
+
+  private static final Logger log4j = Logger.getLogger(UpdateQtyDelivered.class);
+
+  @Override
+  public void execute() {
+    try {
+      ConnectionProvider cp = getConnectionProvider();
+      log4j.info("This moduleScript can take long to finish. Please be patient...");
+
+      int orderLinesUpdated = UpdateQtyDeliveredData.updateQtyDelivered(cp);
+      if (orderLinesUpdated > 0) {
+        log4j.info("Updated " + orderLinesUpdated + " order lines.");
+      }
+
+      int orderUpdated = UpdateQtyDeliveredData.updateIsDelivered(cp);
+      if (orderUpdated > 0) {
+        log4j.info("Updated " + orderUpdated + " orders.");
+      }
+
+    } catch (Exception e) {
+      handleError(e);
+    }
+  }
+
+  @Override
+  protected ModuleScriptExecutionLimits getModuleScriptExecutionLimits() {
+    return new ModuleScriptExecutionLimits("0", null, new OpenbravoVersion(3, 0, 30668));
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdateQtyDelivered_data.xsql	Fri Dec 02 12:32:08 2016 +0100
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<SqlClass name="UpdateQtyDeliveredData" package="org.openbravo.modulescript">
+  <SqlMethod name="select" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        select 1 as dummy from dual
+      ]]>
+    </Sql>
+  </SqlMethod>
+  <SqlMethod name="updateQtyDelivered" type="preparedStatement" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+     <![CDATA[
+        UPDATE c_orderline ol
+        SET qtydelivered = COALESCE((SELECT SUM(COALESCE(iol.movementqty, 0))
+                                     FROM m_inoutline iol
+                                     JOIN m_inout io ON iol.m_inout_id = io.m_inout_id AND io.processed = 'Y'
+                                     WHERE iol.c_orderline_id = ol.c_orderline_id
+                                     ), 0)
+        WHERE EXISTS (SELECT 1
+                      FROM c_order o
+                      JOIN c_doctype dt ON o.c_doctypetarget_id = dt.c_doctype_id
+                      WHERE o.c_order_id = ol.c_order_id
+                      AND dt.isreturn = 'Y'
+                      AND o.issotrx = 'N'
+                      AND o.processed = 'Y'
+                     )
+        AND ol.qtydelivered = 0
+      ]]>
+    </Sql>
+  </SqlMethod>
+  <SqlMethod name="updateIsDelivered" type="preparedStatement" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+     <![CDATA[
+        UPDATE C_Order o
+        SET IsDelivered = 'Y'
+        WHERE o.IsDelivered = 'N'
+        AND o.processed = 'Y'
+        AND EXISTS (SELECT 1
+                    FROM c_doctype dt, c_orderline ol
+                    WHERE o.c_doctypetarget_id = dt.c_doctype_id
+                    AND o.c_order_id = ol.c_order_id
+                    AND (o.issotrx = 'Y' OR (o.issotrx = 'N' AND dt.isreturn = 'Y'))
+                    AND ol.c_order_discount_id IS NULL
+                    GROUP BY ol.C_Order_ID
+                    HAVING SUM(ol.QTYORDERED) = SUM(ol.QTYDELIVERED)
+                   )
+      ]]>
+    </Sql>
+  </SqlMethod>
+</SqlClass>
--- a/src-wad/.project	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-wad/.project	Fri Dec 02 12:32:08 2016 +0100
@@ -10,6 +10,11 @@
 			<arguments>
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>org.sonarlint.eclipse.core.sonarlintBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
--- a/src-wad/src/org/openbravo/wad/web.xml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src-wad/src/org/openbravo/wad/web.xml	Fri Dec 02 12:32:08 2016 +0100
@@ -12,7 +12,7 @@
     * under the License. 
     * The Original Code is Openbravo ERP. 
     * The Initial Developer of the Original Code is Openbravo SLU
-    * All portions are Copyright (C) 2001-2014 Openbravo SLU 
+    * All portions are Copyright (C) 2001-2016 Openbravo SLU 
     * All Rights Reserved. 
     * Contributor(s):    ______________________________________.
     ************************************************************************
@@ -129,7 +129,6 @@
   <welcome-file-list id="WelcomeFileList">
     <welcome-file>index.jsp</welcome-file>
     <welcome-file>index.html</welcome-file>
-    <welcome-file>index.jws</welcome-file>
   </welcome-file-list>
   
   <session-config>
--- a/src/org/openbravo/costing/CostingMigrationProcess.java	Fri Dec 02 11:00:27 2016 +0100
+++ b/src/org/openbravo/costing/CostingMigrationProcess.java	Fri Dec 02 12:32:08 2016 +0100
@@ -21,6 +21,7 @@
 import java.math.BigDecimal;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -270,7 +271,7 @@
             phqlWhere.toString());
         phql.setFilterOnReadableClients(false);
         phql.setFilterOnReadableOrganization(false);
-        phql.setNamedParameter("date", new Date());
+        phql.setNamedParameter("date", DateUtils.truncate(new Date(), Calendar.DATE));
         phql.setNamedParameter("org", organization);
         phql.setMaxResult(1);
         PeriodControl period = phql.uniqueResult();
@@ -511,6 +512,7 @@
     try {
       while (icls.next()) {
         InventoryCountLine icl = (InventoryCountLine) icls.get(0);
+        OBDal.getInstance().refresh(icl);
         if (!productId.equals(icl.getProduct().getId())) {
           productId = icl.getProduct().getId();
           HashMap<String, BigDecimal> stock = getCurrentValuedStock(productId, curId, orgs, orgId);
@@ -872,9 +874,11 @@
       insert.append(", coalesce(io." + ShipmentInOut.PROPERTY_ACCOUNTINGDATE + ", t."
           + MaterialTransaction.PROPERTY_MOVEMENTDATE + ")");
       insert.append(" from " + MaterialTransaction.ENTITY_NAME + " as t");
+      insert.append(" left join t." + MaterialTransaction.PROPERTY_TRANSACTIONCOSTLIST + " as tc");
       insert.append(" left join t." + MaterialTransaction.PROPERTY_GOODSSHIPMENTLINE + " as iol");
       insert.append(" left join iol." + ShipmentInOutLine.PROPERTY_SHIPMENTRECEIPT + " as io");
       insert.append(" where t." + MaterialTransaction.PROPERTY_TRANSACTIONCOST + " is not null");
+      insert.append(" and tc." + TransactionCost.PROPERTY_ID + " is null");
 
       Query queryInsert = OBDal.getInstance().getSession().createQuery(insert.toString());
       queryInsert.executeUpdate();
--- a/src/org/openbravo/dal/service/OBDal.java	Fri Dec 02 11:00:27 2016 +0100
+++ b/src/org/openbravo/dal/service/OBDal.java	Fri Dec 02 12:32:08 2016 +0100
@@ -25,6 +25,7 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.hibernate.ObjectNotFoundException;
 import org.hibernate.Session;
 import org.hibernate.criterion.Restrictions;
 import org.hibernate.dialect.Dialect;
@@ -295,7 +296,14 @@
    */
   public <T extends Object> T get(Class<T> clazz, Object id) {
     checkReadAccess(clazz);
-    return SessionHandler.getInstance().find(clazz, id);
+    try {
+      return SessionHandler.getInstance().find(clazz, id);
+    } catch (ObjectNotFoundException ignore) {
+      // ObjectNotFoundException is thrown when there was a proxy in cache for this id but the
+      // record does not exist in DB. As if there was no proxy, the same invokation would return
+      // null, let's be consistent and return null also in this case.
+      return null;
+    }
   }
 
   /**
--- a/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.jrxml	Fri Dec 02 11:00:27 2016 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedger.jrxml	Fri Dec 02 12:32:08 2016 +0100
@@ -302,7 +302,7 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="10"/>
+						<font fontName="DejaVu Sans" size="10"/>
 					</textElement>
 					<textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression>
 				</textField>