Fixes Issue 25893: The warehouse does not fit with the organization in the Return Material receipt window.
authorPandeeswari Ramakrishnan <pandeeswari.ramakrishnan@openbravo.com>
Wed, 09 Apr 2014 22:38:31 +0530
changeset 22865 2bd8c0fe3cbb
parent 22864 0a5333750ff1
child 22866 c41ba68ffe38
Fixes Issue 25893: The warehouse does not fit with the organization in the Return Material receipt window.
src-db/database/sourcedata/AD_CALLOUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_MODEL_OBJECT.xml
src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
src/org/openbravo/erpCommon/ad_callouts/SE_InOut_Organization.java
--- a/src-db/database/sourcedata/AD_CALLOUT.xml	Fri Apr 11 11:48:50 2014 +0200
+++ b/src-db/database/sourcedata/AD_CALLOUT.xml	Wed Apr 09 22:38:31 2014 +0530
@@ -877,6 +877,16 @@
 <!--46349B602D1C4132B9405A97647069AA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--46349B602D1C4132B9405A97647069AA--></AD_CALLOUT>
 
+<!--4AB185365A514877A227785855B795E3--><AD_CALLOUT>
+<!--4AB185365A514877A227785855B795E3-->  <AD_CALLOUT_ID><![CDATA[4AB185365A514877A227785855B795E3]]></AD_CALLOUT_ID>
+<!--4AB185365A514877A227785855B795E3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4AB185365A514877A227785855B795E3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4AB185365A514877A227785855B795E3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4AB185365A514877A227785855B795E3-->  <NAME><![CDATA[SE_InOut_Organization]]></NAME>
+<!--4AB185365A514877A227785855B795E3-->  <DESCRIPTION><![CDATA[Callout for organization in m_inout]]></DESCRIPTION>
+<!--4AB185365A514877A227785855B795E3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--4AB185365A514877A227785855B795E3--></AD_CALLOUT>
+
 <!--4B3FBD8DE0C045EEB9E540BF4C873B6E--><AD_CALLOUT>
 <!--4B3FBD8DE0C045EEB9E540BF4C873B6E-->  <AD_CALLOUT_ID><![CDATA[4B3FBD8DE0C045EEB9E540BF4C873B6E]]></AD_CALLOUT_ID>
 <!--4B3FBD8DE0C045EEB9E540BF4C873B6E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Fri Apr 11 11:48:50 2014 +0200
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Wed Apr 09 22:38:31 2014 +0530
@@ -55968,6 +55968,7 @@
 <!--3523-->  <ISSESSIONATTR><![CDATA[Y]]></ISSESSIONATTR>
 <!--3523-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
 <!--3523-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--3523-->  <AD_CALLOUT_ID><![CDATA[4AB185365A514877A227785855B795E3]]></AD_CALLOUT_ID>
 <!--3523-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--3523-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3523-->  <POSITION><![CDATA[3]]></POSITION>
@@ -61539,7 +61540,6 @@
 <!--3798-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
 <!--3798-->  <AD_REFERENCE_VALUE_ID><![CDATA[263693E51C7847BF90C897ADB830E2BB]]></AD_REFERENCE_VALUE_ID>
 <!--3798-->  <FIELDLENGTH><![CDATA[22]]></FIELDLENGTH>
-<!--3798-->  <DEFAULTVALUE><![CDATA[@SQL=select coalesce( warehouse,m_warehouse_id) as m_warehouse_id from ad_org_warehouse , (select min(m_warehouse_id) as warehouse from ad_org_warehouse where m_warehouse_id =@m_warehouse_id@ and  ad_org_id = @ad_org_id@) a where ad_org_id = @ad_org_id@ group by m_warehouse_id, priority ,warehouse having min(priority) = priority ]]></DEFAULTVALUE>
 <!--3798-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--3798-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--3798-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Fri Apr 11 11:48:50 2014 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT.xml	Wed Apr 09 22:38:31 2014 +0530
@@ -4622,6 +4622,18 @@
 <!--E9352B3E424544B285B83E9950931164-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
 <!--E9352B3E424544B285B83E9950931164--></AD_MODEL_OBJECT>
 
+<!--ED0B6D2FC3014C3A84A186A3269B1221--><AD_MODEL_OBJECT>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <AD_MODEL_OBJECT_ID><![CDATA[ED0B6D2FC3014C3A84A186A3269B1221]]></AD_MODEL_OBJECT_ID>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <ACTION><![CDATA[C]]></ACTION>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <CLASSNAME><![CDATA[org.openbravo.erpCommon.ad_callouts.SE_InOut_Organization]]></CLASSNAME>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <AD_CALLOUT_ID><![CDATA[4AB185365A514877A227785855B795E3]]></AD_CALLOUT_ID>
+<!--ED0B6D2FC3014C3A84A186A3269B1221-->  <OBJECT_TYPE><![CDATA[S]]></OBJECT_TYPE>
+<!--ED0B6D2FC3014C3A84A186A3269B1221--></AD_MODEL_OBJECT>
+
 <!--EF8E7CE2324E425FB840AD1DCBD8054B--><AD_MODEL_OBJECT>
 <!--EF8E7CE2324E425FB840AD1DCBD8054B-->  <AD_MODEL_OBJECT_ID><![CDATA[EF8E7CE2324E425FB840AD1DCBD8054B]]></AD_MODEL_OBJECT_ID>
 <!--EF8E7CE2324E425FB840AD1DCBD8054B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Fri Apr 11 11:48:50 2014 +0200
+++ b/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml	Wed Apr 09 22:38:31 2014 +0530
@@ -4400,6 +4400,16 @@
 <!--D31E38655CA14D6992BB7E1A8DB8180A-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
 <!--D31E38655CA14D6992BB7E1A8DB8180A--></AD_MODEL_OBJECT_MAPPING>
 
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F--><AD_MODEL_OBJECT_MAPPING>
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[D7609AF5FD7C44B1B96632F8DE1A8C5F]]></AD_MODEL_OBJECT_MAPPING_ID>
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F-->  <AD_MODEL_OBJECT_ID><![CDATA[ED0B6D2FC3014C3A84A186A3269B1221]]></AD_MODEL_OBJECT_ID>
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F-->  <MAPPINGNAME><![CDATA[/ad_callouts/SE_InOut_Organization.html]]></MAPPINGNAME>
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F-->  <ISDEFAULT><![CDATA[Y]]></ISDEFAULT>
+<!--D7609AF5FD7C44B1B96632F8DE1A8C5F--></AD_MODEL_OBJECT_MAPPING>
+
 <!--DB172103A6DC44A19FD33A89993A1E4F--><AD_MODEL_OBJECT_MAPPING>
 <!--DB172103A6DC44A19FD33A89993A1E4F-->  <AD_MODEL_OBJECT_MAPPING_ID><![CDATA[DB172103A6DC44A19FD33A89993A1E4F]]></AD_MODEL_OBJECT_MAPPING_ID>
 <!--DB172103A6DC44A19FD33A89993A1E4F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_InOut_Organization.java	Wed Apr 09 22:38:31 2014 +0530
@@ -0,0 +1,54 @@
+/*
+ *************************************************************************
+ * 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) 2014 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.erpCommon.ad_callouts;
+
+import javax.servlet.ServletException;
+
+import org.openbravo.data.FieldProvider;
+import org.openbravo.erpCommon.utility.ComboTableData;
+import org.openbravo.erpCommon.utility.Utility;
+
+public class SE_InOut_Organization extends SimpleCallout {
+
+  private static final long serialVersionUID = 1L;
+
+  @Override
+  protected void execute(CalloutInfo info) throws ServletException {
+    String strIsSOTrx = Utility.getContext(this, info.vars, "isSOTrx", info.getWindowId());
+    String strOrgId = info.vars.getStringParameter("inpadOrgId");
+    FieldProvider[] td = null;
+    try {
+      ComboTableData comboTableData = new ComboTableData(info.vars, this, "18", "M_Warehouse_ID",
+          "197", strIsSOTrx.equals("Y") ? "C4053C0CD3DC420A9924F24FC1F860A0" : "",
+          Utility.getReferenceableOrg(info.vars, info.vars.getStringParameter("inpadOrgId")),
+          Utility.getContext(this, info.vars, "#User_Client", info.getWindowId()), 0);
+      Utility.fillSQLParameters(this, info.vars, null, comboTableData, info.getWindowId(), "");
+      td = comboTableData.select(false);
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
+
+    if (td != null && td.length > 0) {
+      info.addResult("inpmWarehouseId", td[0].getField("id"));
+    } else {
+      info.addResult("inpmWarehouseId", null);
+    }
+  }
+}