src/org/openbravo/erpCommon/ad_reports/ReportRegisterLineJR_data.xsql
author David Baz Fayos <david.baz@openbravo.com>
Tue, 27 May 2008 15:26:10 +0000
changeset 1044 8691bbc94032
parent 727 23af88f55124
permissions -rw-r--r--
Removed old frame parameter of windowTableId
eduardo@723
     1
<?xml version="1.0" encoding="UTF-8" ?>
eduardo@723
     2
<!--
eduardo@723
     3
 *************************************************************************
eduardo@723
     4
 * The contents of this file are subject to the Openbravo  Public  License
eduardo@723
     5
 * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
eduardo@723
     6
 * Version 1.1  with a permitted attribution clause; you may not  use this
eduardo@723
     7
 * file except in compliance with the License. You  may  obtain  a copy of
eduardo@723
     8
 * the License at http://www.openbravo.com/legal/license.html 
eduardo@723
     9
 * Software distributed under the License  is  distributed  on  an "AS IS"
eduardo@723
    10
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
eduardo@723
    11
 * License for the specific  language  governing  rights  and  limitations
eduardo@723
    12
 * under the License. 
eduardo@723
    13
 * The Original Code is Openbravo ERP. 
eduardo@723
    14
 * The Initial Developer of the Original Code is Openbravo SL 
eduardo@723
    15
 * All portions are Copyright (C) 2001-2006 Openbravo SL 
eduardo@723
    16
 * All Rights Reserved. 
eduardo@723
    17
 * Contributor(s):  ______________________________________.
eduardo@723
    18
 ************************************************************************
eduardo@723
    19
-->
eduardo@723
    20
eduardo@723
    21
eduardo@723
    22
eduardo@723
    23
<!-- See ReportBankJR_data.xsql for example -->
eduardo@723
    24
eduardo@723
    25
<SqlClass name="ReportRegisterLineJRData" package="org.openbravo.erpCommon.ad_reports">
eduardo@723
    26
  <SqlClassComment></SqlClassComment>
eduardo@723
    27
  <SqlMethod name="select" type="preparedStatement" return="multiple">
eduardo@723
    28
    <SqlMethodComment></SqlMethodComment>
eduardo@723
    29
    <Sql>
eduardo@723
    30
    <![CDATA[
juanpablo@727
    31
 select taxreg.name,taxregline.documentno as DocNum,taxregline.created as RegDate , 
juanpablo@727
    32
 inv.documentno as DocInv, bp.name as RagSoc,
juanpablo@727
    33
 coalesce(taxregline.totalamt,0) as TotAmt, coalesce(taxregline.taxbaseamt,0) as TaxBaseAmt, coalesce(taxregline.exemptamt,0) as ExemptAmt , 
juanpablo@727
    34
 coalesce(taxregline.taxundamt,0) as TaxUndAmt, coalesce(taxregline.taxamt,0) as TaxAmt , (tax.name||'-'||tax.rate || '%') as aliquota
juanpablo@727
    35
 from c_taxregister taxreg , c_taxregisterline taxregline , c_invoicetax invtax, c_invoice inv ,c_bpartner bp, c_tax tax
juanpablo@727
    36
 where taxreg.c_taxregister_id = taxregline.c_taxregister_id 
juanpablo@727
    37
 and taxregline.c_invoicetax_id = invtax.c_invoicetax_id
juanpablo@727
    38
 and inv.c_invoice_id = invtax.c_invoice_id
juanpablo@727
    39
 and inv.c_bpartner_id = bp.c_bpartner_id
juanpablo@727
    40
 and taxregline.c_tax_id = tax.c_tax_id
juanpablo@727
    41
 and 1=1
juanpablo@727
    42
 order by taxreg.name
eduardo@723
    43
     ]]></Sql>
eduardo@723
    44
    <Parameter name="parDateFrom" optional="true" after="and 1=1"><![CDATA[ and taxregline.invoicedate >= to_date(?,'DD/MM/YYYY') ]]></Parameter>
eduardo@723
    45
    <Parameter name="parDateTo" optional="true" after="and 1=1"><![CDATA[ and taxregline.invoicedate <= to_date(?,'DD/MM/YYYY')]]></Parameter> 
juanpablo@727
    46
    <Parameter name="parTaxPaymId" optional="true" after="and 1=1"><![CDATA[ and taxreg.c_taxpayment_id in ( ? )  ]]></Parameter>
juanpablo@727
    47
    <Parameter name="parTaxRegisId" optional="true" after="and 1=1"><![CDATA[ and taxreg.c_taxregister_id in ( ? )  ]]></Parameter>
juanpablo@727
    48
  </SqlMethod>
juanpablo@727
    49
juanpablo@727
    50
  <SqlMethod name="set" type="constant" return="multiple">
juanpablo@727
    51
      <SqlMethodComment></SqlMethodComment>
juanpablo@727
    52
      <Sql></Sql>
juanpablo@727
    53
  </SqlMethod>
eduardo@723
    54
  
eduardo@723
    55
</SqlClass>