src/org/openbravo/erpCommon/ad_reports/ReportGeneralLedgerJournal_data.xsql
changeset 20474 bb419c9b4257
parent 18518 4eb028c733a4
child 21883 eacc27c826cc
equal deleted inserted replaced
20473:ee752250a37d 20474:bb419c9b4257
    10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
    11  * License for the specific  language  governing  rights  and  limitations
    11  * License for the specific  language  governing  rights  and  limitations
    12  * under the License.
    12  * under the License.
    13  * The Original Code is Openbravo ERP.
    13  * The Original Code is Openbravo ERP.
    14  * The Initial Developer of the Original Code is Openbravo SLU
    14  * The Initial Developer of the Original Code is Openbravo SLU
    15  * All portions are Copyright (C) 2001-2012 Openbravo SLU
    15  * All portions are Copyright (C) 2001-2013 Openbravo SLU
    16  * All Rights Reserved.
    16  * All Rights Reserved.
    17  * Contributor(s):  ______________________________________.
    17  * Contributor(s):  ______________________________________.
    18  ************************************************************************
    18  ************************************************************************
    19 -->
    19 -->
    20 
    20 
   198                          left join FACT_ACCT F on F.AD_TABLE_ID = T.AD_TABLE_ID
   198                          left join FACT_ACCT F on F.AD_TABLE_ID = T.AD_TABLE_ID
   199                          left join AD_WINDOW W on TB.AD_WINDOW_ID = W.AD_WINDOW_ID 
   199                          left join AD_WINDOW W on TB.AD_WINDOW_ID = W.AD_WINDOW_ID 
   200         WHERE F.AD_CLIENT_ID IN ('1')
   200         WHERE F.AD_CLIENT_ID IN ('1')
   201         AND F.AD_ORG_ID IN('1')
   201         AND F.AD_ORG_ID IN('1')
   202         AND 1=1
   202         AND 1=1
       
   203         AND F.fact_acct_group_id = ?
   203         AND (CASE (SELECT MAX(ISSOTRX) FROM C_DOCTYPE D 
   204         AND (CASE (SELECT MAX(ISSOTRX) FROM C_DOCTYPE D 
   204         WHERE D.DOCBASETYPE = F.DOCBASETYPE) WHEN 'N' THEN COALESCE(T.PO_WINDOW_ID, T.AD_WINDOW_ID) ELSE T.AD_WINDOW_ID END) = W.AD_WINDOW_ID 
   205         WHERE D.DOCBASETYPE = F.DOCBASETYPE) WHEN 'N' THEN COALESCE(T.PO_WINDOW_ID, T.AD_WINDOW_ID) ELSE T.AD_WINDOW_ID END) = W.AD_WINDOW_ID 
   205         GROUP BY F.DATEACCT, F.FACT_ACCT_GROUP_ID) AA
   206         GROUP BY F.DATEACCT, F.FACT_ACCT_GROUP_ID) AA
   206         WHERE (DATEACCT< TO_DATE(?) OR (DATEACCT=to_date(?) AND FACT_ACCT_GROUP_ID < ?))
   207         WHERE (DATEACCT< TO_DATE(?) OR (DATEACCT=to_date(?) AND FACT_ACCT_GROUP_ID < ?))
   207       ]]></Sql>
   208       ]]></Sql>
   208     <Parameter name="adUserClient" type="replace" optional="true" after="WHERE F.AD_CLIENT_ID IN (" text="'1'"/>
   209     <Parameter name="adUserClient" type="replace" optional="true" after="WHERE F.AD_CLIENT_ID IN (" text="'1'"/>
   209     <Parameter name="adUserOrg" type="replace" optional="true" after="AND F.AD_ORG_ID IN(" text="'1'"/>
   210     <Parameter name="adUserOrg" type="replace" optional="true" after="AND F.AD_ORG_ID IN(" text="'1'"/>
   210     <Parameter name="table" optional="true" after="AND 1=1"><![CDATA[ AND f.ad_table_Id = ?]]></Parameter>
   211     <Parameter name="table" optional="true" after="AND 1=1"><![CDATA[ AND f.ad_table_Id = ?]]></Parameter>
   211     <Parameter name="record" optional="true" after="AND 1=1"><![CDATA[ AND f.record_Id = ?]]></Parameter>
   212     <Parameter name="record" optional="true" after="AND 1=1"><![CDATA[ AND f.record_Id = ?]]></Parameter>
       
   213     <Parameter name="factAcctGroup"/>
   212     <Parameter name="dateAcct"/>
   214     <Parameter name="dateAcct"/>
   213     <Parameter name="dateAcct"/>
   215     <Parameter name="dateAcct"/>
   214     <Parameter name="factAcctGroupId"/>
   216     <Parameter name="factAcctGroupId"/>
   215   </SqlMethod>
   217   </SqlMethod>
   216   <SqlMethod name="selectDirect2" type="preparedStatement" return="multiple">
   218   <SqlMethod name="selectDirect2" type="preparedStatement" return="multiple">