src/org/openbravo/erpCommon/ad_reports/ReportRegisterByVatJR_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="ReportRegisterByVatJRData" 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>
juanpablo@727
    30
    <![CDATA[
juanpablo@727
    31
 select taxreg.name, 
juanpablo@727
    32
	(tax.name||'-'||tax.rate || '%' ) as Aliquota,
juanpablo@727
    33
 	coalesce(taxregline.taxbaseamt,0) as Imponibile, 
juanpablo@727
    34
 	coalesce(taxregline.novatamt,0) as NonImponibile, 
juanpablo@727
    35
 	coalesce(taxregline.exemptamt,0) as Esente , 
juanpablo@727
    36
 	coalesce(taxregline.taxundamt,0) as IvaIndeducibile, 
juanpablo@727
    37
 	coalesce(taxregline.taxamt,0) as Iva, 
juanpablo@727
    38
 	coalesce(taxregline.totalamt,0) as Totale,
juanpablo@727
    39
 	coalesce(taxreg.lastregaccumamt,0) as TotalePrecedente,
juanpablo@727
    40
	case 
juanpablo@727
    41
 	when taxregtyp.issotrx ='Y' then 'Vendita'
juanpablo@727
    42
 	else 'Acquisti'
juanpablo@727
    43
 	end 
juanpablo@727
    44
 	as IsSale
juanpablo@727
    45
 from c_taxregister taxreg, 
juanpablo@727
    46
 c_taxregisterline taxregline , 
juanpablo@727
    47
 c_taxregister_type taxregtyp, 
juanpablo@727
    48
 c_tax tax
juanpablo@727
    49
 where
juanpablo@727
    50
     taxreg.c_taxregister_id = taxregline.c_taxregister_id
juanpablo@727
    51
 and taxreg.c_taxregister_type_id = taxregtyp.c_taxregister_type_id 
juanpablo@727
    52
 and taxregline.c_tax_id = tax.c_tax_id
juanpablo@727
    53
 and 1=1
juanpablo@727
    54
 order by  taxreg.name,(tax.name||'-'||tax.rate || '%' )
eduardo@723
    55
     ]]></Sql>
eduardo@723
    56
    <Parameter name="parDateFrom" optional="true" after="and 1=1"><![CDATA[ and taxregline.invoicedate >= to_date(?,'DD/MM/YYYY') ]]></Parameter>
eduardo@723
    57
    <Parameter name="parDateTo" optional="true" after="and 1=1"><![CDATA[ and taxregline.invoicedate <= to_date(?,'DD/MM/YYYY')]]></Parameter>
juanpablo@727
    58
  </SqlMethod>
juanpablo@727
    59
juanpablo@727
    60
  <SqlMethod name="set" type="constant" return="multiple">
juanpablo@727
    61
      <SqlMethodComment></SqlMethodComment>
juanpablo@727
    62
      <Sql></Sql>
juanpablo@727
    63
  </SqlMethod>
eduardo@723
    64
  
eduardo@723
    65
</SqlClass>