src/org/openbravo/erpCommon/ad_reports/ReportRefundInvoiceCustomerDimensionalAnalyses_data.xsql
changeset 1605 8a0fe0193bef
parent 573 48f214c7b66e
child 1787 84217f37d788
--- a/src/org/openbravo/erpCommon/ad_reports/ReportRefundInvoiceCustomerDimensionalAnalyses_data.xsql	Wed Sep 03 17:10:52 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportRefundInvoiceCustomerDimensionalAnalyses_data.xsql	Wed Sep 03 17:55:37 2008 +0000
@@ -71,11 +71,11 @@
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'7'"/>
     <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
     <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
-    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
     <Parameter name="cBpartner" optional="true" type="argument" after="AND 1=1" text=" AND C_BPARTNER.C_BPARTNER_ID IN"/>
-    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
     <Parameter name="mProduct" optional="true" type="argument" after="AND 1=1"><![CDATA[ AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
-    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
     <Parameter name="nivel1" type="replace" optional="true" after="UNION ALL SELECT " text="'8'"/>
     <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1 , " text="'9'"/>
     <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2 , " text="'10'"/>
@@ -86,11 +86,11 @@
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN(" text="'14'"/>
     <Parameter name="dateFromRef" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
     <Parameter name="dateToRef" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
-    <Parameter name="cBpartnerGroupId" optional="true" after="AND 2=2"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 2=2"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
     <Parameter name="cBpartner" optional="true" type="argument" after="AND 2=2" text=" AND C_BPARTNER.C_BPARTNER_ID IN"/>
-    <Parameter name="mProductCategoryId" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
     <Parameter name="mProduct" optional="true" type="argument" after="AND 2=2"><![CDATA[ AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
-    <Parameter name="salesrepId" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
     <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, UOMSYMBOL" text=", 1"/>
   </SqlMethod>
   <SqlMethod name="set" type="constant" return="multiple">
@@ -133,11 +133,11 @@
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'7'"/>
     <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
     <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
-    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
     <Parameter name="cBpartner" optional="true" type="argument" after="AND 1=1" text=" AND C_BPARTNER.C_BPARTNER_ID IN"/>
-    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
     <Parameter name="mProduct" optional="true" type="argument" after="AND 1=1"><![CDATA[ AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
-    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.SALESREP_ID = TO_NUMBER(?)]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
     <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, UOMSYMBOL" text=", 1"/>
   </SqlMethod>
   <SqlMethod name="selectBpartner" type="preparedStatement" return="multiple">
@@ -176,7 +176,7 @@
     <![CDATA[
       SELECT C_BP_GROUP.NAME
       FROM C_BP_GROUP
-      WHERE C_BP_GROUP.C_BP_GROUP_ID = TO_NUMBER(?)
+      WHERE C_BP_GROUP.C_BP_GROUP_ID = ?
      ]]></Sql>
     <Parameter name="cBpGroupId"/>
   </SqlMethod>
@@ -187,7 +187,7 @@
     <![CDATA[
       SELECT M_PRODUCT_CATEGORY.NAME
       FROM M_PRODUCT_CATEGORY
-      WHERE M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = TO_NUMBER(?)
+      WHERE M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?
      ]]></Sql>
     <Parameter name="mProductCategoryId"/>
   </SqlMethod>
@@ -198,7 +198,7 @@
     <![CDATA[
       SELECT AD_USER.FIRSTNAME||' '||AD_USER.LASTNAME
       FROM AD_USER
-      WHERE AD_USER.AD_USER_ID = TO_NUMBER(?)
+      WHERE AD_USER.AD_USER_ID = ?
      ]]></Sql>
     <Parameter name="mWarehouseId"/>
   </SqlMethod>
@@ -210,7 +210,7 @@
       SELECT ID, NAME
       FROM (SELECT VALUE AS ID, NAME 
               FROM AD_REF_LIST 
-             WHERE AD_REFERENCE_ID = 800087
+             WHERE AD_REFERENCE_ID = '800087'
              AND AD_REF_LIST.VALUE IN ('1', '2', '3', '4', '5', '6')
              ORDER BY TO_NUMBER(VALUE)) AA
       WHERE 1=1 
@@ -224,7 +224,7 @@
       SELECT ID, NAME
       FROM (SELECT VALUE AS ID, NAME 
               FROM AD_REF_LIST 
-             WHERE AD_REFERENCE_ID = 800087 
+             WHERE AD_REFERENCE_ID = '800087' 
              AND AD_REF_LIST.VALUE IN ('1', '2', '3', '4', '5', '6')
              ORDER BY TO_NUMBER(VALUE)) AA
       WHERE 1=1 
@@ -240,7 +240,7 @@
       FROM (SELECT VALUE AS ID, T.NAME 
               FROM AD_REF_LIST_trl T,
                    AD_REF_LIST     L
-             WHERE l.AD_REFERENCE_ID = 800087
+             WHERE l.AD_REFERENCE_ID = '800087'
                AND l.AD_REF_LIST_ID  = t.AD_REF_LIST_ID
                AND L.VALUE IN ('1', '2', '3', '4', '5', '6')
                AND t.AD_LANGUAGE = ?
@@ -258,7 +258,7 @@
       FROM (SELECT VALUE AS ID, T.NAME 
               FROM AD_REF_LIST_trl T,
                    AD_REF_LIST     L
-             WHERE l.AD_REFERENCE_ID = 800087
+             WHERE l.AD_REFERENCE_ID = '800087'
                AND l.AD_REF_LIST_ID  = t.AD_REF_LIST_ID
                AND L.VALUE IN ('1', '2', '3', '4', '5', '6')
                AND t.AD_LANGUAGE = ?