src/org/openbravo/erpCommon/ad_reports/ReportDebtPaymentTrack_data.xsql
author David Baz Fayos <david.baz@openbravo.com>
Tue, 27 May 2008 15:26:10 +0000
changeset 1044 8691bbc94032
parent 0 0247c26f10c6
child 2396 8b8e476017ec
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-2007 Openbravo SL 
carlos@0
    16
 * All Rights Reserved. 
carlos@0
    17
 * Contributor(s):  ______________________________________.
carlos@0
    18
 ************************************************************************
carlos@0
    19
-->
carlos@0
    20
carlos@0
    21
carlos@0
    22
carlos@0
    23
carlos@0
    24
carlos@0
    25
<SqlClass name="ReportDebtPaymentTrackData" package="org.openbravo.erpCommon.ad_reports">
carlos@0
    26
  <SqlClassComment></SqlClassComment>
carlos@0
    27
  <SqlMethod name="select" type="preparedStatement" return="multiple">
carlos@0
    28
    <SqlMethodComment></SqlMethodComment>
carlos@0
    29
    <Sql>
carlos@0
    30
    <![CDATA[
carlos@0
    31
      select A.tipo, A.DocType, A.documentno, A.name, A.datetrx, replace(replace(A.description,chr(10),'|'),chr(13),'|') as description,
carlos@0
    32
      A.amount, A.dateplanned,replace(replace(A.obs,chr(10),'|'),chr(13),'|') as obs,
carlos@0
    33
      COALESCE(B.initialamount,0) as bp_amt, COALESCE(C.initialamount,0) as ppa_amt , A.amt_doc_bp, A.amt_doc_ppa, A.URL, A.ID
carlos@0
    34
      from
carlos@0
    35
        (select AD_MESSAGE_GET2('PTR_INVOICE', ?) as tipo, 'I' as DocType, i.documentno, bp.c_bpartner_id, bp.name, i.dateinvoiced as dateTrx, max(dp.description) as description, 
carlos@0
    36
        sum((CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END)) as amount, max(dp.dateplanned) as dateplanned, 
carlos@0
    37
        to_char(i.description) as obs, sum((CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END)) as amt_doc_bp, 0 as amt_doc_ppa,
carlos@0
    38
        (CASE i.issotrx WHEN 'N' THEN '../PurchaseInvoice/Header_Relation.html?Command=DIRECT' ELSE '../SalesInvoice/Header_Relation.html?Command=DIRECT' END) as URL, 'inpcInvoiceId=' || i.c_invoice_id as id
carlos@0
    39
        from c_debt_payment dp, c_invoice i, c_bpartner bp
carlos@0
    40
        where dp.c_invoice_id = i.c_invoice_id
carlos@0
    41
        AND DP.AD_Client_ID IN ('1') 
carlos@0
    42
        AND DP.AD_Org_ID IN ('1') 
carlos@0
    43
        and dp.c_bpartner_id = bp.c_bpartner_id
carlos@0
    44
        and 1=1
carlos@0
    45
        group by i.documentno, bp.c_bpartner_id, bp.name, i.dateinvoiced, to_char(i.description), i.issotrx, i.c_invoice_id
carlos@0
    46
      union all
carlos@0
    47
        select AD_MESSAGE_GET2('PTR_MANUAL', ?), 'M' as DocType, s.documentno, bp.c_bpartner_id, bp.name, s.dateTrx as dateTrx, dp.description, 
carlos@0
    48
        (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount, dp.dateplanned,
carlos@0
    49
        s.description as obs, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amt_doc_bp, 0 as amt_doc_ppa,
carlos@0
    50
        '../ManualSettlement/CreatePayment_Relation.html?Command=DIRECT' AS URL, 'inpcDebtPaymentId=' || dp.C_DEBT_PAYMENT_ID as id
carlos@0
    51
        from c_debt_payment dp, c_settlement s, c_bpartner bp
carlos@0
    52
        where dp.c_settlement_generate_id = s.c_settlement_id
carlos@0
    53
        AND DP.AD_Client_iD IN ('2') 
carlos@0
    54
        AND DP.AD_Org_iD IN ('2')
carlos@0
    55
        and dp.c_bpartner_id = bp.c_bpartner_id
carlos@0
    56
        and dp.ismanual='Y'
carlos@0
    57
        and dp.isValid='Y'
carlos@0
    58
        and 2=2
carlos@0
    59
      union all
carlos@0
    60
        select AD_MESSAGE_GET2('PTR_CP_UNPAID', ?), 'C' as DocType, s.documentno, bp.c_bpartner_id, bp.name, s.dateTrx as dateTrx, dp.description, 
carlos@0
    61
        (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount, dp.dateplanned,
carlos@0
    62
        s.description as obs, (CASE dp.isreceipt WHEN 'Y' THEN -dp.amount ELSE dp.amount END) as amt_doc_bp, 0 as amt_doc_ppa,
carlos@0
    63
        '../Settlement/CancelledPayments_Relation.html?Command=DIRECT' as URL, 'inpcDebtPaymentId=' || dp.C_DEBT_PAYMENT_ID as id
carlos@0
    64
        from c_debt_payment dp, c_settlement s, c_bpartner bp
carlos@0
    65
        where dp.c_settlement_cancel_id = s.c_settlement_id
carlos@0
    66
        AND dP.AD_Client_ID IN ('3') 
carlos@0
    67
        AND dP.AD_Org_ID IN ('3') 
carlos@0
    68
        and dp.c_bpartner_id = bp.c_bpartner_id
carlos@0
    69
        and dp.cancel_processed='Y'
carlos@0
    70
        and dp.isPaid='N'
carlos@0
    71
        and 3=3
carlos@0
    72
      union all
carlos@0
    73
        select AD_MESSAGE_GET2('PTR_CP_PAID', ?), 'A' as DocType, s.documentno, bp.c_bpartner_id, bp.name, s.dateTrx as dateTrx, dp.description, 
carlos@0
    74
        (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount, dp.dateplanned,
carlos@0
    75
        s.description as obs, (CASE dp.isreceipt WHEN 'Y' THEN -dp.amount ELSE dp.amount END) as amt_doc_bp, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amt_doc_ppa,
carlos@0
    76
        '../Settlement/CancelledPayments_Relation.html?Command=DIRECT' as URL, 'inpcDebtPaymentId=' || dp.C_DEBT_PAYMENT_ID as id
carlos@0
    77
        from c_debt_payment dp, c_settlement s, c_bpartner bp
carlos@0
    78
        where dp.c_settlement_cancel_id = s.c_settlement_id
carlos@0
    79
        AND Dp.AD_Client_ID IN ('4') 
carlos@0
    80
        AND Dp.AD_Org_ID IN ('4') 
carlos@0
    81
        and dp.c_bpartner_id = bp.c_bpartner_id
carlos@0
    82
        and dp.cancel_processed='Y'
carlos@0
    83
        and dp.isPaid='Y'
carlos@0
    84
        and 4=4
carlos@0
    85
      union all
carlos@0
    86
        select AD_MESSAGE_GET2('PTR_GP_UNPAID',?), 'G' as DocType, s.documentno, bp.c_bpartner_id, bp.name, s.dateTrx as dateTrx, dp.description, 
carlos@0
    87
        (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount, dp.dateplanned,
carlos@0
    88
        s.description as obs, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amt_doc_bp, 0 as amt_doc_ppa,
carlos@0
    89
        '../Settlement/CreatedPayments_Relation.html?Command=DIRECT' as URL, 'inpcDebtPaymentId=' || dp.C_DEBT_PAYMENT_ID as id
carlos@0
    90
        from c_debt_payment dp, c_settlement s, c_bpartner bp
carlos@0
    91
        where dp.c_settlement_generate_id = s.c_settlement_id
carlos@0
    92
        AND DP.aD_Client_ID IN ('5') 
carlos@0
    93
        AND DP.aD_Org_ID IN ('5') 
carlos@0
    94
        and dp.c_bpartner_id = bp.c_bpartner_id
carlos@0
    95
        and dp.generate_processed='Y'
carlos@0
    96
        and ismanual='N'
carlos@0
    97
        and (dp.isPaid='N' or dp.c_settlement_cancel_id is not null)
carlos@0
    98
        and 5=5	
carlos@0
    99
      union all
carlos@0
   100
        select AD_MESSAGE_GET2('PTR_GP_PAID', ?), 'J' as DocType, s.documentno, bp.c_bpartner_id, bp.name, s.dateTrx as dateTrx, dp.description, 
carlos@0
   101
        (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount, dp.dateplanned,
carlos@0
   102
        s.description as obs, 0 as amt_doc_bp, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amt_doc_ppa,
carlos@0
   103
        '../Settlement/CreatedPayments_Relation.html?Command=DIRECT' as URL, 'inpcDebtPaymentId=' || dp.C_DEBT_PAYMENT_ID as id
carlos@0
   104
        from c_debt_payment dp, c_settlement s, c_bpartner bp
carlos@0
   105
        where dp.c_settlement_generate_id = s.c_settlement_id
carlos@0
   106
        AND DP.Ad_Client_ID IN ('6') 
carlos@0
   107
        AND DP.Ad_Org_ID IN ('6')
carlos@0
   108
        and dp.c_bpartner_id = bp.c_bpartner_id
carlos@0
   109
        and dp.generate_processed='Y'
carlos@0
   110
        and dp.isPaid='Y' and dp.c_settlement_cancel_id is null
carlos@0
   111
        and 6=6
carlos@0
   112
      union all
carlos@0
   113
        select AD_MESSAGE_GET2('PTR_RP_CASH', ?), 'K' as DocType, c.name as documentno, bp.c_bpartner_id, bp.name, c.dateacct as dateTrx, dp.description, 
carlos@0
   114
        (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount, dp.dateplanned,
carlos@0
   115
        to_char(c.description) as obs, 0 as amt_doc_bp, (CASE dp.isreceipt WHEN 'Y' THEN -dp.amount ELSE dp.amount END) as amt_doc_ppa,
carlos@0
   116
        '../CashJournal/Lines_Relation.html?Command=DIRECT' as URL, 'inpcCashlineId=' || cl.C_CASHLINE_ID as id
carlos@0
   117
        from c_debt_payment dp, c_cash c, c_cashline cl, c_bpartner bp
carlos@0
   118
        where dp.c_cashline_id = cl.c_cashline_id
carlos@0
   119
        AND DP.AD_client_ID IN ('7') 
carlos@0
   120
        AND DP.AD_org_ID IN ('7')
carlos@0
   121
        and cl.c_cash_id = c.c_cash_id
carlos@0
   122
        and dp.c_bpartner_id = bp.c_bpartner_id
carlos@0
   123
        and c.processed='Y'
carlos@0
   124
        and 7=7
carlos@0
   125
      union all
carlos@0
   126
        select AD_MESSAGE_GET2('PTR_RP_BANK', ?), 'B' as DocType, b.name as documentno, bp.c_bpartner_id, bp.name, bl.dateacct as dateTrx, dp.description, 
carlos@0
   127
        (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount, dp.dateplanned,
carlos@0
   128
        to_char(b.description) as obs, 0 as amt_doc_bp, (CASE dp.isreceipt WHEN 'Y' THEN -dp.amount ELSE dp.amount END) as amt_doc_ppa,
carlos@0
   129
        '../BankStatement/Lines_Relation.html?Command=DIRECT' as URL, 'inpcBankstatementlineId=' || bl.C_BANKSTATEMENTLINE_ID as id
carlos@0
   130
        from c_debt_payment dp, c_bankstatement b, c_bankstatementline bl, c_bpartner bp
carlos@0
   131
        where dp.c_bankstatementline_id = bl.c_bankstatementline_id
carlos@0
   132
        AND DP.AD_CLient_ID IN ('8') 
carlos@0
   133
        AND DP.AD_ORg_ID IN ('8')
carlos@0
   134
        and bl.c_bankstatement_id = b.c_bankstatement_id
carlos@0
   135
        and dp.c_bpartner_id = bp.c_bpartner_id
carlos@0
   136
        and b.processed='Y'
carlos@0
   137
        and 8=8) A left join
carlos@0
   138
(select c_bpartner_id, sum(amount) as initialamount from
carlos@0
   139
        (select i.c_bpartner_id, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   140
        from c_debt_payment dp, c_invoice i
carlos@0
   141
        where dp.c_invoice_id = i.c_invoice_id
carlos@0
   142
        and i.dateacct < TO_DATE(?)
carlos@0
   143
        AND DP.AD_ClIent_ID IN ('9') 
carlos@0
   144
        AND DP.AD_OrG_ID IN ('9')
carlos@0
   145
      union all
carlos@0
   146
        select dp.c_bpartner_id, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   147
        from c_debt_payment dp, c_settlement s
carlos@0
   148
        where dp.c_settlement_generate_id = s.c_settlement_id
carlos@0
   149
        and dp.ismanual='Y'
carlos@0
   150
        and dp.isValid='Y'
carlos@0
   151
        and s.dateacct < TO_DATE(?)
carlos@0
   152
        AND DP.AD_CLIENT_ID IN ('10') 
carlos@0
   153
        AND DP.AD_ORG_ID IN ('10')
carlos@0
   154
      union all
carlos@0
   155
        select dp.c_bpartner_id, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   156
        from c_debt_payment dp, c_settlement s
carlos@0
   157
        where dp.c_settlement_generate_id = s.c_settlement_id
carlos@0
   158
        and dp.generate_processed='Y'
carlos@0
   159
        and ismanual='N'
carlos@0
   160
        and (dp.isPaid='N' or dp.c_settlement_cancel_id is not null)
carlos@0
   161
        and s.dateacct < TO_DATE(?)
carlos@0
   162
        AND dP.AD_CLIENT_ID IN ('11') 
carlos@0
   163
        AND dP.AD_ORG_ID IN ('11')
carlos@0
   164
      union all	
carlos@0
   165
        select dp.c_bpartner_id, -(CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   166
        from c_debt_payment dp, c_settlement s
carlos@0
   167
        where dp.c_settlement_cancel_id = s.c_settlement_id
carlos@0
   168
        and dp.cancel_processed='Y'
carlos@0
   169
        and dp.isPaid='N'
carlos@0
   170
        and s.dateacct < TO_DATE(?)
carlos@0
   171
        AND Dp.AD_CLIENT_ID IN ('12') 
carlos@0
   172
        AND Dp.AD_ORG_ID IN ('12')
carlos@0
   173
      union all
carlos@0
   174
        select dp.c_bpartner_id, -(CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   175
        from c_debt_payment dp, c_settlement s
carlos@0
   176
        where dp.c_settlement_cancel_id = s.c_settlement_id
carlos@0
   177
        and dp.cancel_processed='Y'
carlos@0
   178
        and dp.isPaid='Y'
carlos@0
   179
        and s.dateacct < TO_DATE(?)
carlos@0
   180
        AND DP.aD_CLIENT_ID IN ('13') 
carlos@0
   181
        AND DP.aD_ORG_ID IN ('13')) AAA
carlos@0
   182
      group by c_bpartner_id) B on A.c_bpartner_id =B.c_bpartner_id
carlos@0
   183
      left join
carlos@0
   184
        (select c_bpartner_id, sum(amount) as initialamount from
carlos@0
   185
        (select dp.c_bpartner_id, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   186
        from c_debt_payment dp, c_settlement s
carlos@0
   187
        where dp.c_settlement_cancel_id = s.c_settlement_id
carlos@0
   188
        and dp.cancel_processed='Y'
carlos@0
   189
        and dp.isPaid='Y'
carlos@0
   190
        and s.dateacct < TO_DATE(?)
carlos@0
   191
        AND DP.Ad_CLIENT_ID IN ('14') 
carlos@0
   192
        AND DP.Ad_ORG_ID IN ('14')
carlos@0
   193
      union all
carlos@0
   194
        select dp.c_bpartner_id, (CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   195
        from c_debt_payment dp, c_settlement s
carlos@0
   196
        where dp.c_settlement_generate_id = s.c_settlement_id
carlos@0
   197
        and dp.generate_processed='Y'
carlos@0
   198
        and dp.isPaid='Y' and dp.c_settlement_cancel_id is null
carlos@0
   199
        and s.dateacct < TO_DATE(?)
carlos@0
   200
        AND DP.AD_cLIENT_ID IN ('15') 
carlos@0
   201
        AND DP.AD_oRG_ID IN ('15')
carlos@0
   202
      union all	
carlos@0
   203
        select dp.c_bpartner_id, -(CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   204
        from c_debt_payment dp, c_cash c, c_cashline cl
carlos@0
   205
        where dp.c_cashline_id = cl.c_cashline_id
carlos@0
   206
        and cl.c_cash_id = c.c_cash_id
carlos@0
   207
        and c.processed='Y'
carlos@0
   208
        and c.dateacct < TO_DATE(?)
carlos@0
   209
        AND DP.AD_ClIENT_ID IN ('16') 
carlos@0
   210
        AND DP.AD_Org_id IN ('16')
carlos@0
   211
      union all
carlos@0
   212
        select dp.c_bpartner_id, -(CASE dp.isreceipt WHEN 'Y' THEN dp.amount ELSE -dp.amount END) as amount
carlos@0
   213
        from c_debt_payment dp, c_bankstatement b, c_bankstatementline bl
carlos@0
   214
        where dp.c_bankstatementline_id = bl.c_bankstatementline_id
carlos@0
   215
        and bl.c_bankstatement_id = b.c_bankstatement_id
carlos@0
   216
        and b.processed='Y'
carlos@0
   217
        and bl.dateacct < TO_DATE(?)
carlos@0
   218
        AND DP.AD_CLiENT_ID IN ('17') 
carlos@0
   219
        AND DP.AD_ORg_id in ('17')
carlos@0
   220
        ) BBB
carlos@0
   221
        group by c_bpartner_id) C on A.c_bpartner_id = C.c_bpartner_id
carlos@0
   222
      WHERE A.datetrx >= TO_DATE(?)
carlos@0
   223
      AND 9=9
carlos@0
   224
      AND A.DocType in ('1')
carlos@0
   225
      order by A.name, A.datetrx, A.documentno
carlos@0
   226
      ]]></Sql>
carlos@0
   227
    <Field name="rownum" value="count"/>
carlos@0
   228
    <Parameter name="adLanguage" />
carlos@0
   229
    <Parameter name="adLanguage" />
carlos@0
   230
    <Parameter name="adLanguage" />
carlos@0
   231
    <Parameter name="adLanguage" />
carlos@0
   232
    <Parameter name="adLanguage" />
carlos@0
   233
    <Parameter name="adLanguage" />
carlos@0
   234
    <Parameter name="adLanguage" />
carlos@0
   235
    <Parameter name="adLanguage" />
carlos@0
   236
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_Client_ID IN (" text="'1'"/>
carlos@0
   237
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_Org_ID IN (" text="'1'"/>      
carlos@0
   238
    <Parameter name="cBpartnerId" optional="true" type="argument" after="and 1=1"><![CDATA[ and bp.c_bpartner_id in]]></Parameter>
carlos@0
   239
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_Client_iD IN (" text="'2'"/>
carlos@0
   240
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_Org_iD IN (" text="'2'"/>  
carlos@0
   241
    <Parameter name="cBpartnerId" optional="true" type="argument" after="and 2=2"><![CDATA[ and bp.c_bpartner_id in]]></Parameter>
carlos@0
   242
    <Parameter name="adUserClient" type="replace" optional="true" after="dP.AD_Client_ID IN (" text="'3'"/>
carlos@0
   243
    <Parameter name="adUserOrg" type="replace" optional="true" after="dP.AD_Org_ID IN (" text="'3'"/>  
carlos@0
   244
    <Parameter name="cBpartnerId" optional="true" type="argument" after="and 3=3"><![CDATA[ and bp.c_bpartner_id in]]></Parameter>
carlos@0
   245
    <Parameter name="adUserClient" type="replace" optional="true" after="Dp.AD_Client_ID IN (" text="'4'"/>
carlos@0
   246
    <Parameter name="adUserOrg" type="replace" optional="true" after="Dp.AD_Org_ID IN (" text="'4'"/>  
carlos@0
   247
    <Parameter name="cBpartnerId" optional="true" type="argument" after="and 4=4"><![CDATA[ and bp.c_bpartner_id in]]></Parameter>
carlos@0
   248
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.aD_Client_ID IN (" text="'5'"/>
carlos@0
   249
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.aD_Org_ID IN (" text="'5'"/>
carlos@0
   250
    <Parameter name="cBpartnerId" optional="true" type="argument" after="and 5=5"><![CDATA[ and bp.c_bpartner_id in]]></Parameter>
carlos@0
   251
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.Ad_Client_ID IN (" text="'6'"/>
carlos@0
   252
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.Ad_Org_ID IN (" text="'6'"/>
carlos@0
   253
    <Parameter name="cBpartnerId" optional="true" type="argument" after="and 6=6"><![CDATA[ and bp.c_bpartner_id in]]></Parameter>
carlos@0
   254
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_client_ID IN (" text="'7'"/>
carlos@0
   255
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_org_ID IN (" text="'7'"/>
carlos@0
   256
    <Parameter name="cBpartnerId" optional="true" type="argument" after="and 7=7"><![CDATA[ and bp.c_bpartner_id in]]></Parameter>
carlos@0
   257
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_CLient_ID IN (" text="'8'"/>
carlos@0
   258
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_ORg_ID IN (" text="'8'"/>
carlos@0
   259
    <Parameter name="cBpartnerId" optional="true" type="argument" after="and 8=8"><![CDATA[ and bp.c_bpartner_id in]]></Parameter>
carlos@0
   260
    <Parameter name="dateFrom"/>
carlos@0
   261
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_ClIent_ID IN (" text="'9'"/>
carlos@0
   262
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_OrG_ID IN (" text="'9'"/>
carlos@0
   263
    <Parameter name="dateFrom"/>
carlos@0
   264
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_CLIENT_ID IN (" text="'10'"/>
carlos@0
   265
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_ORG_ID IN (" text="'10'"/>
carlos@0
   266
    <Parameter name="dateFrom"/>
carlos@0
   267
    <Parameter name="adUserClient" type="replace" optional="true" after="dP.AD_CLIENT_ID IN (" text="'11'"/>
carlos@0
   268
    <Parameter name="adUserOrg" type="replace" optional="true" after="dP.AD_ORG_ID IN (" text="'11'"/>
carlos@0
   269
    <Parameter name="dateFrom"/>
carlos@0
   270
    <Parameter name="adUserClient" type="replace" optional="true" after="Dp.AD_CLIENT_ID IN (" text="'12'"/>
carlos@0
   271
    <Parameter name="adUserOrg" type="replace" optional="true" after="Dp.AD_ORG_ID IN (" text="'12'"/>
carlos@0
   272
    <Parameter name="dateFrom"/>
carlos@0
   273
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.aD_CLIENT_ID IN (" text="'13'"/>
carlos@0
   274
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.aD_ORG_ID IN (" text="'13'"/>
carlos@0
   275
    <Parameter name="dateFrom"/>
carlos@0
   276
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.Ad_CLIENT_ID IN (" text="'14'"/>
carlos@0
   277
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.Ad_ORG_ID IN (" text="'14'"/>
carlos@0
   278
    <Parameter name="dateFrom"/>
carlos@0
   279
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_cLIENT_ID IN (" text="'15'"/>
carlos@0
   280
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_oRG_ID IN (" text="'15'"/>
carlos@0
   281
    <Parameter name="dateFrom"/>
carlos@0
   282
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_ClIENT_ID IN (" text="'16'"/>
carlos@0
   283
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_Org_id IN (" text="'16'"/>
carlos@0
   284
    <Parameter name="dateFrom"/>
carlos@0
   285
    <Parameter name="adUserClient" type="replace" optional="true" after="DP.AD_CLiENT_ID IN (" text="'17'"/>
carlos@0
   286
    <Parameter name="adUserOrg" type="replace" optional="true" after="DP.AD_ORg_id in (" text="'17'"/>
carlos@0
   287
    <Parameter name="dateFrom"/>
carlos@0
   288
    <Parameter name="dateTo" optional="true" after="AND 9=9"><![CDATA[ and A.datetrx < TO_DATE(?)]]></Parameter>
carlos@0
   289
    <Parameter name="moreThan" optional="true" after="AND 9=9"><![CDATA[ and A.amount > ?]]></Parameter>
carlos@0
   290
    <Parameter name="lessThan" optional="true" after="AND 9=9"><![CDATA[ and A.amount < ?]]></Parameter>
carlos@0
   291
    <Parameter name="docTypes" optional="true" type="replace" after="AND A.DocType in (" text="'1'"/>
carlos@0
   292
  </SqlMethod>
carlos@0
   293
  <SqlMethod name="set" type="constant" return="multiple">
carlos@0
   294
      <SqlMethodComment></SqlMethodComment>
carlos@0
   295
      <Sql></Sql>
carlos@0
   296
  </SqlMethod>
carlos@0
   297
</SqlClass>