details:   https://code.openbravo.com/erp/devel/pi/rev/95f9c5ce6207
changeset: 26136:95f9c5ce6207
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Fri Mar 06 11:21:26 2015 +0100
summary:   Fixes issue 29168
 getCallableResult broken when using null parameters. Removed TEST value for 
default

details:   https://code.openbravo.com/erp/devel/pi/rev/ab393536c4bc
changeset: 26137:ab393536c4bc
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Fri Mar 06 11:31:38 2015 +0100
summary:   Related to issue 28909
can't create orders in Oracle. Created StockUtils class to enable calls to 
M_GET_STOCK_PARAM procedure
getting out params

H : Enter commit message.  Lines beginning with 'HG:' are removed.

diffstat:

 src-core/src/org/openbravo/database/RDBMSIndependent.java   |   2 +-
 src/org/openbravo/materialmgmt/CSResponseGetStockParam.java |  24 ++++
 src/org/openbravo/materialmgmt/StockUtils.java              |  47 ++++++++
 src/org/openbravo/materialmgmt/StockUtils_data.xsql         |  71 +++++++++++++
 4 files changed, 143 insertions(+), 1 deletions(-)

diffs (167 lines):

diff -r d8ec9347e127 -r ab393536c4bc 
src-core/src/org/openbravo/database/RDBMSIndependent.java
--- a/src-core/src/org/openbravo/database/RDBMSIndependent.java Fri Mar 06 
08:51:40 2015 +0100
+++ b/src-core/src/org/openbravo/database/RDBMSIndependent.java Fri Mar 06 
11:31:38 2015 +0100
@@ -73,7 +73,7 @@
           String typeAux = types.elementAt(i);
           if (!typeAux.equalsIgnoreCase("out")) {
             iParameter++;
-            UtilSql.setValue(st, iParameter, 12, "Test", 
parameters.elementAt(i));
+            UtilSql.setValue(st, iParameter, 12, null, 
parameters.elementAt(i));
           }
         }
       }
diff -r d8ec9347e127 -r ab393536c4bc 
src/org/openbravo/materialmgmt/CSResponseGetStockParam.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/materialmgmt/CSResponseGetStockParam.java       Fri Mar 
06 11:31:38 2015 +0100
@@ -0,0 +1,24 @@
+/*
+ *************************************************************************
+ * 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) 2015 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.materialmgmt;
+
+public class CSResponseGetStockParam {
+  String p_result;
+  String p_message;
+}
\ No newline at end of file
diff -r d8ec9347e127 -r ab393536c4bc 
src/org/openbravo/materialmgmt/StockUtils.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/materialmgmt/StockUtils.java    Fri Mar 06 11:31:38 
2015 +0100
@@ -0,0 +1,47 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (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) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.materialmgmt;
+
+import java.math.BigDecimal;
+
+import javax.servlet.ServletException;
+
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.exception.NoConnectionAvailableException;
+import org.openbravo.service.db.DalConnectionProvider;
+
+public class StockUtils {
+  /*
+   * Calls M_GET_STOCK_PARAM and retrieves result in a CSResponseGetStockParam 
object. Records will
+   * be created in M_STOCK_PROPOSAL with AD_PINSTASNCE_ID = uuid (parameter).
+   */
+  public static CSResponseGetStockParam getStock(String uuid, String recordId, 
BigDecimal quantity,
+      String mProductId, String mLocatorId, String mWarehouseId, String 
priorityWarehouseId,
+      String adOrgId, String mAttributeSetInstanceId, String adUserId, String 
adClientId,
+      String warehouseRuleId, String cUomId, String productUomId, String 
adTableId, String auxId,
+      Long lineNo, String processId, String mReservationId, String 
calledFromApp)
+      throws ServletException, NoConnectionAvailableException {
+    return StockUtilsData.getStock(OBDal.getInstance().getConnection(true),
+        new DalConnectionProvider(true), uuid, recordId, quantity != null ? 
quantity.toString()
+            : null, mProductId, mLocatorId, mWarehouseId, priorityWarehouseId, 
adOrgId,
+        mAttributeSetInstanceId, adUserId, adClientId, warehouseRuleId, 
cUomId, productUomId,
+        adTableId, auxId, lineNo != null ? lineNo.toString() : null, 
processId, mReservationId,
+        calledFromApp);
+  }
+}
diff -r d8ec9347e127 -r ab393536c4bc 
src/org/openbravo/materialmgmt/StockUtils_data.xsql
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/materialmgmt/StockUtils_data.xsql       Fri Mar 06 
11:31:38 2015 +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) 2012 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+
+
+<SqlClass name="StockUtilsData" package="org.openbravo.materialmgmt">
+   <SqlClassComment></SqlClassComment>
+   <SqlMethod name="select" type="preparedStatement" return="multiple">
+     <Sql>
+       select 1 as a from dual
+     </Sql>
+   </SqlMethod>
+   <SqlMethod name="getStock" type="callableStatement" connection="true" 
return="object" object="CSResponseGetStockParam">
+      <SqlMethodComment></SqlMethodComment>
+      <Sql><![CDATA[
+        CALL M_GET_STOCK_PARAM(?, ?, to_number(?), 
+        ?, ?, ?, 
+        ?, ?, ?, 
+        ?, ?, ?, 
+        ?, ?, ?, ?,
+        to_number(?), ?, ?, 
+        ?, ?, ?)
+      ]]></Sql>
+      <Parameter name="p_uuid"/>
+      <Parameter name="p_recordid"/>
+      <Parameter name="p_quantity"/>
+      
+      <Parameter name="p_productid"/>
+      <Parameter name="p_locatorid"/>
+      <Parameter name="p_warehouseid"/>
+      
+      <Parameter name="p_prioritywarehouseid"/>
+      <Parameter name="p_orgid"/>
+      <Parameter name="p_attributesetinstanceid"/>
+      
+      <Parameter name="p_ad_user_id"/>
+      <Parameter name="p_clientid"/>
+      <Parameter name="p_warehouse_rule_id"/>
+      
+      <Parameter name="p_uomid"/>
+      <Parameter name="p_productuomid"/>
+      <Parameter name="p_table"/>
+      <Parameter name="p_auxid"/>
+
+      <Parameter name="p_lineno"/>
+      <Parameter name="p_processid"/>
+      <Parameter name="p_reservation_id"/>
+      
+      <Parameter name="p_calledfromapp"/>
+
+      <Parameter name="p_result" type="out"/>
+      <Parameter name="p_message" type="out"/>
+   </SqlMethod>
+   
+</SqlClass>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to