Included casts for postgre compatibilities in several xsql files
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Thu, 03 Apr 2008 12:05:47 +0000
changeset 589 6526c488d6d6
parent 588 5580af4183fa
child 590 4e3a3fa9548e
Included casts for postgre compatibilities in several xsql files
src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Amt_data.xsql
src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Conversion_data.xsql
src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product_data.xsql
src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionOrder_Order_data.xsql
src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder_data.xsql
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Amt_data.xsql	Thu Apr 03 09:32:06 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Amt_data.xsql	Thu Apr 03 12:05:47 2008 +0000
@@ -29,7 +29,7 @@
       FROM M_Requisition, M_PriceList, C_Currency 
       WHERE M_Requisition.M_PriceList_ID = M_PriceList.M_PriceList_ID
       AND M_PriceList.C_Currency_ID = C_Currency.C_Currency_ID
-      AND M_Requisition.M_Requisition_ID = ?
+      AND M_Requisition.M_Requisition_ID = to_number(?)
     </Sql>
     <Parameter name="mRequisitionId"/>
   </SqlMethod>
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Conversion_data.xsql	Thu Apr 03 09:32:06 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Conversion_data.xsql	Thu Apr 03 12:05:47 2008 +0000
@@ -30,21 +30,21 @@
   <SqlMethod name="initUOMId" type="preparedStatement" return="String" default="">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
-      SELECT C_UOM_ID FROM M_PRODUCT_UOM WHERE M_PRODUCT_UOM_ID = ? 
+      SELECT C_UOM_ID FROM M_PRODUCT_UOM WHERE M_PRODUCT_UOM_ID = to_number(?)
     </Sql>
     <Parameter name="mProductUOMId"/>
   </SqlMethod>
   <SqlMethod name="stdPrecision" type="preparedStatement" return="String" default="0">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
-      SELECT STDPRECISION FROM C_UOM WHERE C_UOM_ID = ? 
+      SELECT STDPRECISION FROM C_UOM WHERE C_UOM_ID = to_number(?)
     </Sql>
     <Parameter name="mProductUOMId"/>
   </SqlMethod>
   <SqlMethod name="multiplyRate" type="preparedStatement" return="String" default="">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
-      SELECT MULTIPLYRATE FROM C_UOM_CONVERSION WHERE C_UOM_ID = ? AND C_UOM_TO_ID = ?
+      SELECT MULTIPLYRATE FROM C_UOM_CONVERSION WHERE C_UOM_ID = to_number(?) AND C_UOM_TO_ID = to_number(?)
     </Sql>
     <Parameter name="mProductUOM"/>
     <Parameter name="mProduct"/>
@@ -52,7 +52,7 @@
   <SqlMethod name="divideRate" type="preparedStatement" return="String" default="">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
-      SELECT DIVIDERATE FROM C_UOM_CONVERSION WHERE C_UOM_ID = ? AND C_UOM_TO_ID = ?
+      SELECT DIVIDERATE FROM C_UOM_CONVERSION WHERE C_UOM_ID = to_number(?) AND C_UOM_TO_ID = to_number(?)
     </Sql>
     <Parameter name="mProduct"/>
     <Parameter name="mProductUOM"/>
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product_data.xsql	Thu Apr 03 09:32:06 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionLine_Product_data.xsql	Thu Apr 03 12:05:47 2008 +0000
@@ -32,14 +32,14 @@
     <Sql>
       SELECT M_Requisition.M_Pricelist_ID as pricelist_version
       FROM M_Requisition
-      WHERE M_Requisition.M_Requisition_ID = ?
+      WHERE M_Requisition.M_Requisition_ID = to_number(?)
     </Sql>
     <Parameter name="mRequisitionId"/>
   </SqlMethod>
   <SqlMethod name="selectPriceListVersion" type="preparedStatement" return="String" default="">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
-      SELECT GET_PRICELIST_VERSION(?, to_date(?)) as pricelist_version
+      SELECT GET_PRICELIST_VERSION(to_number(?), to_date(?)) as pricelist_version
       FROM DUAL
     </Sql>
     <Parameter name="mPriceListId"/>
@@ -48,9 +48,9 @@
   <SqlMethod name="getPrices" type="preparedStatement" return="Multiple">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
-      SELECT BOM_PRICELIMIT(?, ?) AS pricelimit,
-             BOM_PRICELIST(?, ?) AS pricelist,
-             BOM_PRICESTD(?, ?) AS pricestd
+      SELECT BOM_PRICELIMIT(to_number(?), to_number(?)) AS pricelimit,
+             BOM_PRICELIST(to_number(?), to_number(?)) AS pricelist,
+             BOM_PRICESTD(to_number(?), to_number(?)) AS pricestd
       FROM DUAL
     </Sql>
     <Parameter name="mProductId"/>
@@ -65,7 +65,7 @@
     <Sql>
       SELECT (CASE COUNT(*) WHEN 0 THEN 0 ELSE 1 END) AS TOTAL 
       FROM M_PRODUCT_UOM 
-      WHERE M_PRODUCT_ID = ?
+      WHERE M_PRODUCT_ID = to_number(?)
     </Sql>
     <Parameter name="mProductId"/>
   </SqlMethod>
@@ -74,7 +74,7 @@
     <Sql>
       SELECT description 
       FROM M_AttributeSetInstance 
-      WHERE M_AttributeSetInstance_ID = ? 
+      WHERE M_AttributeSetInstance_ID = to_number(?) 
     </Sql>
     <Parameter name="mAttributesetinstanceId"/>
   </SqlMethod>
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionOrder_Order_data.xsql	Thu Apr 03 09:32:06 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_RequisitionOrder_Order_data.xsql	Thu Apr 03 12:05:47 2008 +0000
@@ -33,7 +33,7 @@
       SELECT M_REQUISITIONLINE.QTY - COALESCE(SUM(M_REQUISITIONORDER.QTY),0) AS REQUIRED
       FROM M_REQUISITIONLINE LEFT JOIN M_REQUISITIONORDER 
                              ON M_REQUISITIONLINE.M_REQUISITIONLINE_ID = M_REQUISITIONORDER.M_REQUISITIONLINE_ID
-      WHERE M_REQUISITIONLINE.M_REQUISITIONLINE_ID = ?
+      WHERE M_REQUISITIONLINE.M_REQUISITIONLINE_ID = to_number(?)
       GROUP BY M_REQUISITIONLINE.QTY
     </Sql>
     <Parameter name="mRequisitionLineId"/>
@@ -43,7 +43,7 @@
     <Sql>
       SELECT QTYORDERED
       FROM C_ORDERLINE
-      WHERE C_ORDERLINE_ID = ?
+      WHERE C_ORDERLINE_ID = to_number(?)
     </Sql>
     <Parameter name="mOrderLineId"/>
   </SqlMethod>
--- a/src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder_data.xsql	Thu Apr 03 09:32:06 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder_data.xsql	Thu Apr 03 12:05:47 2008 +0000
@@ -209,7 +209,7 @@
       <![CDATA[
         SELECT AD_ORG.AD_ORG_ID AS PADRE, M_WAREHOUSE.M_WAREHOUSE_ID AS ID, M_WAREHOUSE.NAME AS NAME
         FROM M_WAREHOUSE, AD_ORG
-        WHERE AD_ISORGINCLUDED(AD_ORG.AD_ORG_ID, M_WAREHOUSE.AD_ORG_ID, ?) <> -1
+        WHERE AD_ISORGINCLUDED(AD_ORG.AD_ORG_ID, M_WAREHOUSE.AD_ORG_ID, to_number(?)) <> -1
           AND AD_ORG.AD_ORG_ID IN ('1')
           AND M_WAREHOUSE.AD_CLIENT_ID IN ('1')
         ORDER BY PADRE, NAME