src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSaleForeign.jrxml
changeset 1271 762533f2593a
parent 1102 d24a59b98fbb
child 1727 cc39bbf87d15
equal deleted inserted replaced
1270:c9b59ec0d21a 1271:762533f2593a
   149 	<parameter name="SALE" isForPrompting="false" class="java.lang.String"/>
   149 	<parameter name="SALE" isForPrompting="false" class="java.lang.String"/>
   150 	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
   150 	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
   151 	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
   151 	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
   152 	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
   152 	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
   153 	<queryString><![CDATA[SELECT C_INVOICE.ISSOTRX AS SALES, 'N' AS NATIONAL, C_INVOICE.DOCUMENTNO AS DOCUMENTNO, C_INVOICE.DATEINVOICED, C_BPARTNER.NAME AS BPARTNER, LTRIM(RTRIM(C_TAX.NAME, ' '), ' ') AS TAXNAME, 
   153 	<queryString><![CDATA[SELECT C_INVOICE.ISSOTRX AS SALES, 'N' AS NATIONAL, C_INVOICE.DOCUMENTNO AS DOCUMENTNO, C_INVOICE.DATEINVOICED, C_BPARTNER.NAME AS BPARTNER, LTRIM(RTRIM(C_TAX.NAME, ' '), ' ') AS TAXNAME, 
   154       SUM(C_INVOICETAX.TAXBASEAMT) AS TAXBASEAMT, SUM(C_INVOICETAX.TAXAMT) AS TAXAMT, '' AS ADTREEID
   154       SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXBASEAMT ELSE C_INVOICETAX.TAXBASEAMT END) AS TAXBASEAMT, 
   155       FROM C_TAX, C_INVOICETAX, C_INVOICE, C_BPARTNER_LOCATION, C_LOCATION, C_BPARTNER
   155       SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXAMT ELSE C_INVOICETAX.TAXAMT END) AS TAXAMT, '' AS ADTREEID
       
   156       FROM C_TAX, C_INVOICETAX, C_INVOICE, C_BPARTNER_LOCATION, C_LOCATION, C_BPARTNER, C_DOCTYPE
   156       WHERE C_TAX.C_TAX_ID=C_INVOICETAX.C_TAX_ID
   157       WHERE C_TAX.C_TAX_ID=C_INVOICETAX.C_TAX_ID
   157       AND C_INVOICETAX.C_INVOICE_ID=C_INVOICE.C_INVOICE_ID
   158       AND C_INVOICETAX.C_INVOICE_ID=C_INVOICE.C_INVOICE_ID
   158       AND C_INVOICE.C_BPARTNER_LOCATION_ID = C_BPARTNER_LOCATION.C_BPARTNER_LOCATION_ID
   159       AND C_INVOICE.C_BPARTNER_LOCATION_ID = C_BPARTNER_LOCATION.C_BPARTNER_LOCATION_ID
   159       AND C_BPARTNER_LOCATION.C_LOCATION_ID = C_LOCATION.C_LOCATION_ID
   160       AND C_BPARTNER_LOCATION.C_LOCATION_ID = C_LOCATION.C_LOCATION_ID
   160       AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
   161       AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
       
   162       AND C_INVOICE.C_DOCTYPE_ID = C_DOCTYPE.C_DOCTYPE_ID
   161       AND C_INVOICE.PROCESSED = 'Y'
   163       AND C_INVOICE.PROCESSED = 'Y'
   162       AND C_INVOICE.ISACTIVE = 'Y'
   164       AND C_INVOICE.ISACTIVE = 'Y'
   163       AND C_INVOICE.ISSOTRX = 'N'
   165       AND C_INVOICE.ISSOTRX = 'N'
   164       AND C_INVOICE.ISSOTRX = 'Y'
   166       AND C_INVOICE.ISSOTRX = 'Y'
   165       AND C_INVOICE.DATEINVOICED >= $P{parDateFrom}
   167       AND C_INVOICE.DATEINVOICED >= $P{parDateFrom}