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