src/org/openbravo/erpCommon/ad_reports/ReportNotPosted_data.xsql
author David Baz Fayos <david.baz@openbravo.com>
Tue, 27 May 2008 15:26:10 +0000
changeset 1044 8691bbc94032
parent 979 36cb9aecf607
child 1605 8a0fe0193bef
permissions -rw-r--r--
Removed old frame parameter of windowTableId
carlos@0
     1
<?xml version="1.0" encoding="UTF-8" ?>
carlos@0
     2
<!--
carlos@0
     3
 *************************************************************************
carlos@0
     4
 * The contents of this file are subject to the Openbravo  Public  License
carlos@0
     5
 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
carlos@0
     6
 * Version 1.1  with a permitted attribution clause; you may not  use this
carlos@0
     7
 * file except in compliance with the License. You  may  obtain  a copy of
carlos@0
     8
 * the License at http://www.openbravo.com/legal/license.html 
carlos@0
     9
 * Software distributed under the License  is  distributed  on  an "AS IS"
carlos@0
    10
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
carlos@0
    11
 * License for the specific  language  governing  rights  and  limitations
carlos@0
    12
 * under the License. 
carlos@0
    13
 * The Original Code is Openbravo ERP. 
carlos@0
    14
 * The Initial Developer of the Original Code is Openbravo SL 
carlos@0
    15
 * All portions are Copyright (C) 2001-2006 Openbravo SL 
carlos@0
    16
 * All Rights Reserved. 
carlos@0
    17
 * Contributor(s):  ______________________________________.
carlos@0
    18
 ************************************************************************
carlos@0
    19
-->
carlos@0
    20
<SqlClass name="ReportNotPostedData" package="org.openbravo.erpCommon.ad_reports">
carlos@0
    21
  <SqlClassComment>Clase ReportNotPostedData</SqlClassComment>
carlos@0
    22
  <SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    23
    <SqlMethodComment>Select for relation</SqlMethodComment>
carlos@0
    24
    <Sql>
carlos@0
    25
    <![CDATA[
carlos@0
    26
        select documentno, dateacct, name as description, GRANDTOTAL  as amount, document as doctype
carlos@0
    27
        from
carlos@979
    28
        (select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)) as name, GRANDTOTAL, 'Sales Invoices' as document
carlos@0
    29
        from c_invoice
carlos@0
    30
        where processed = 'Y'
carlos@0
    31
        and posted = 'N'
carlos@0
    32
        and issotrx = 'Y'
carlos@0
    33
        union
carlos@979
    34
        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)) as name, 0 as GRANDTOTAL, 'Goods Receipts' as document
carlos@0
    35
        from m_inout
carlos@0
    36
        where processed = 'Y'
carlos@0
    37
        and posted = 'N'
carlos@0
    38
        and issotrx = 'N'
carlos@0
    39
        union
carlos@979
    40
        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Bpartner',to_char(C_bpartner_id), TO_CHAR(?)), GRANDTOTAL, 'Purchase Invoices'
carlos@0
    41
        from c_invoice
carlos@0
    42
        where processed = 'Y'
carlos@0
    43
        and posted = 'N'
carlos@0
    44
        and issotrx = 'N'
carlos@0
    45
        union
carlos@979
    46
        select ad_client_id, name, dateacct, ad_column_identifier('C_Cash',to_char(C_Cash_id), TO_CHAR(?)), c_cash.STATEMENTDIFFERENCE, 'Cash Journal'
carlos@0
    47
        from C_Cash
carlos@0
    48
        where processed = 'Y'
carlos@0
    49
        and posted = 'N'
carlos@0
    50
        union
carlos@979
    51
        select ad_client_id, name, statementdate, ad_column_identifier('C_Bankstatement',to_char(C_bankstatement_id), TO_CHAR(?)), STATEMENTDIFFERENCE, 'Bank Statements'
carlos@0
    52
        from c_bankstatement
carlos@0
    53
        where processed = 'Y'
carlos@0
    54
        and posted = 'N'
carlos@0
    55
        union
carlos@979
    56
        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Settlement',to_char(C_Settlement_id), TO_CHAR(?)), generatedamt, 'Manual Settlements'
carlos@0
    57
        from c_Settlement
carlos@0
    58
        where processed = 'Y'
carlos@0
    59
        and posted = 'N'
carlos@0
    60
        and settlementtype = 'I'
carlos@0
    61
        union
carlos@979
    62
        select ad_client_id, documentno, dateacct, ad_column_identifier('C_Settlement',to_char(C_Settlement_id), TO_CHAR(?)), generatedamt, 'Settlements'
carlos@0
    63
        from c_Settlement
carlos@0
    64
        where processed = 'Y'
carlos@0
    65
        and posted = 'N'
carlos@0
    66
        and settlementtype <> 'I'
carlos@0
    67
        union
carlos@979
    68
        select ad_client_id, documentno, dateacct, ad_column_identifier('GL_Journal',to_char(GL_Journal_id), TO_CHAR(?)), totaldr, 'GL Journal'
carlos@0
    69
        from GL_Journal
carlos@0
    70
        where processed = 'Y'
carlos@0
    71
        and posted = 'N') AAA
carlos@423
    72
        where dateacct >= TO_DATE(?)
carlos@423
    73
        and dateacct <= TO_DATE(?)
carlos@423
    74
        and ad_client_ID = TO_NUMBER(?)
carlos@0
    75
        order by  document, dateacct, name
carlos@0
    76
      ]]></Sql>
carlos@979
    77
    <Parameter name="adLanguage"/>
carlos@979
    78
    <Parameter name="adLanguage"/>
carlos@979
    79
    <Parameter name="adLanguage"/>
carlos@979
    80
    <Parameter name="adLanguage"/>
carlos@979
    81
    <Parameter name="adLanguage"/>
carlos@979
    82
    <Parameter name="adLanguage"/>
carlos@979
    83
    <Parameter name="adLanguage"/>
carlos@979
    84
    <Parameter name="adLanguage"/>
carlos@0
    85
    <Parameter name="dateFrom"></Parameter>
carlos@0
    86
    <Parameter name="dateTo"></Parameter>
carlos@0
    87
    <Parameter name="client"></Parameter>
carlos@0
    88
  </SqlMethod>
carlos@0
    89
  <SqlMethod name="set" type="constant" return="multiple">
carlos@0
    90
      <SqlMethodComment>Create a registry</SqlMethodComment>
carlos@0
    91
      <Sql></Sql>
carlos@0
    92
  </SqlMethod>
juanpablo@152
    93
</SqlClass>