Fixes Issue 9895: Invoice tax report does not handle currencies.
authorHarikrishnan Raja <harikrishnan.raja@openbravo.com>
Fri, 24 Jul 2009 17:00:02 +0530
changeset 4429 f5acd1a76230
parent 4428 79352d94d13d
child 4430 3677d8736b74
Fixes Issue 9895: Invoice tax report does not handle currencies.
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.html
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.java
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.xml
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceJR.java
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoicePurchase.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoicePurchaseForeign.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSale.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSaleForeign.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice_data.xsql
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.html	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.html	Fri Jul 24 17:00:02 2009 +0530
@@ -63,6 +63,11 @@
 		showJSMessage(7);
 		return false;
 	}
+	if (inputValue(document.frmMain.inpCurrencyId) == null || inputValue(document.frmMain.inpCurrencyId) == "") {
+   		 setWindowElementFocus(document.frmMain.inpCurrencyId);
+ 	 	 showJSMessage(7);
+ 	   	 return false;
+ 	}
 	return true;
 }
 
@@ -288,6 +293,18 @@
                   <td class="Radio_Check_ContentCell"><span class="Checkbox_container_NOT_Focused"><input type="checkbox" name="inpDetalle" value="-1" id="paramDetalle" checked=""></input></span></td>
                   <td class="ContentCell"> </td>
                 </tr>
+                <tr>
+                	<td class="TitleCell"><span class="LabelText">Currency</span></td>
+                 	<td class="Combo_ContentCell">
+  		     			<select name="inpCurrencyId" id="inpCurrencyId" class="ComboKey Combo_OneCell_width" required="true">
+     		      			<option value=""><div id="reportC_Currency_ID"></div></option>
+   		     			</select>
+		   		 	</td> 
+		   		 	<td class="ContentCell"> </td>
+		   		 	<td class="ContentCell"> </td>
+                </tr>
+                
+                
                   <tr>
                     <td colspan="6">
                       <table class="FieldGroup" cellspacing="0" cellpadding="0" border="0">
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.java	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.java	Fri Jul 24 17:00:02 2009 +0530
@@ -45,15 +45,17 @@
   public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
-
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
     if (vars.commandIn("DEFAULT")) {
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId","ReportTaxInvoice|currency", strUserCurrencyId);
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportTaxInvoice|DateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportTaxInvoice|DateTo", "");
       String strOrg = vars.getGlobalVariable("inpOrg", "ReportTaxInvoice|Org", "0");
       String strDetail = vars.getStringParameter("inpDetalle", "-1");
       String strSales = vars.getStringParameter("inpSales", "S");
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales);
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales,strCurrencyId);
     } else if (vars.commandIn("FIND")) {
+      String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId","ReportTaxInvoice|currency");
       String strDateFrom = vars
           .getRequestGlobalVariable("inpDateFrom", "ReportTaxInvoice|DateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportTaxInvoice|DateTo");
@@ -62,8 +64,9 @@
         strOrg = "0";
       String strDetail = vars.getStringParameter("inpDetalle");
       String strSales = vars.getStringParameter("inpSales");
-      printPageDataHtml(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales);
+      printPageDataHtml(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales,strCurrencyId);
     } else if (vars.commandIn("RELATION_XLS")) {
+      String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId","ReportTaxInvoice|currency");
       String strDateFrom = vars
           .getRequestGlobalVariable("inpDateFrom", "ReportTaxInvoice|DateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportTaxInvoice|DateTo");
@@ -72,13 +75,13 @@
         strOrg = "0";
       String strDetail = vars.getStringParameter("inpDetalle");
       String strSales = vars.getStringParameter("inpSales");
-      printPageDataExcel(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales);
+      printPageDataExcel(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales,strCurrencyId);
     } else
       pageError(response);
   }
 
   private void printPageDataHtml(HttpServletResponse response, VariablesSecureApp vars,
-      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales)
+      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales,String strCurrencyId)
       throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
@@ -100,7 +103,7 @@
      * if (strSales.equals("S")) strSalesAux = "Y"; else strSalesAux = "N";
      */
     if (strDateFrom.equals("") && strDateTo.equals("") && strDetail.equals("-1")) {
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales);
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales,strCurrencyId);
     } else if (!strDetail.equals("-1")) {
       if (log4j.isDebugEnabled())
         log4j.debug("****** not datailed");
@@ -109,41 +112,41 @@
       discard[2] = "selEliminarPurchase";
       discard[3] = "selEliminar1Purchase";
       if (strSales.equals("S")) {
-        dataSale = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars, "C_Country_Id",
+        dataSale = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars, "C_Country_Id",
             "ReportTaxInvoice"),
             Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoice"), strDateFrom,
             DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y", Tree.getMembers(this, TreeData
                 .getTreeOrg(this, vars.getClient()), strOrg));
-        data2Sale = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Sale = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
         strSale = Utility.messageBD(this, "Sale", vars.getLanguage());
       } else if (strSales.equals("P")) {
-        dataPurchase = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars,
+        dataPurchase = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
-            Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        data2Purchase = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+            Tree.getMembers(this, TreeData.getTreeOrg(this,vars.getClient()), strOrg));
+        data2Purchase = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
         strPurchase = Utility.messageBD(this, "Purchase", vars.getLanguage());
       } else {
-        dataSale = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars, "C_Country_Id",
+        dataSale = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars, "C_Country_Id",
             "ReportTaxInvoice"),
             Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoice"), strDateFrom,
             DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y", Tree.getMembers(this, TreeData
                 .getTreeOrg(this, vars.getClient()), strOrg));
-        data2Sale = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Sale = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        dataPurchase = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars,
+        dataPurchase = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        data2Purchase = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Purchase = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
@@ -154,41 +157,41 @@
       if (log4j.isDebugEnabled())
         log4j.debug("****** detailed");
       if (strSales.equals("S")) {
-        dataSale = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars, "C_Country_Id",
+        dataSale = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars, "C_Country_Id",
             "ReportTaxInvoice"),
             Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoice"), strDateFrom,
             DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y", Tree.getMembers(this, TreeData
                 .getTreeOrg(this, vars.getClient()), strOrg));
-        data2Sale = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Sale = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
         strSale = Utility.messageBD(this, "Sale", vars.getLanguage());
       } else if (strSales.equals("P")) {
-        dataPurchase = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars,
+        dataPurchase = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        data2Purchase = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Purchase = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
         strPurchase = Utility.messageBD(this, "Purchase", vars.getLanguage());
       } else {
-        dataSale = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars, "C_Country_Id",
+        dataSale = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars, "C_Country_Id",
             "ReportTaxInvoice"),
             Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoice"), strDateFrom,
             DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y", Tree.getMembers(this, TreeData
                 .getTreeOrg(this, vars.getClient()), strOrg));
-        data2Sale = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Sale = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        dataPurchase = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars,
+        dataPurchase = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        data2Purchase = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Purchase = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
@@ -249,7 +252,7 @@
   }
 
   private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
-      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales)
+      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales,String strCurrencyId)
       throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
@@ -485,7 +488,7 @@
    */
 
   private void printPageDataExcel(HttpServletResponse response, VariablesSecureApp vars,
-      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales)
+      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales,String strCurrencyId)
       throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
@@ -520,41 +523,41 @@
       if (log4j.isDebugEnabled())
         log4j.debug("****** detailed");
       if (strSales.equals("S")) {
-        dataSale = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars, "C_Country_Id",
+        dataSale = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars, "C_Country_Id",
             "ReportTaxInvoice"),
             Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoice"), strDateFrom,
             DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y", Tree.getMembers(this, TreeData
                 .getTreeOrg(this, vars.getClient()), strOrg));
-        data2Sale = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Sale = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
         strSale = Utility.messageBD(this, "Sale", vars.getLanguage());
       } else if (strSales.equals("P")) {
-        dataPurchase = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars,
+        dataPurchase = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        data2Purchase = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Purchase = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
         strPurchase = Utility.messageBD(this, "Purchase", vars.getLanguage());
       } else {
-        dataSale = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars, "C_Country_Id",
+        dataSale = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars, "C_Country_Id",
             "ReportTaxInvoice"),
             Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoice"), strDateFrom,
             DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y", Tree.getMembers(this, TreeData
                 .getTreeOrg(this, vars.getClient()), strOrg));
-        data2Sale = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Sale = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        dataPurchase = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars,
+        dataPurchase = ReportTaxInvoiceData.select(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        data2Purchase = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Purchase = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.jrxml	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.jrxml	Fri Jul 24 17:00:02 2009 +0530
@@ -206,7 +206,7 @@
 		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
 	</parameter>
 	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["Report Subtitle"]]></defaultValueExpression>
+		<defaultValueExpression ><![CDATA[""]]></defaultValueExpression>
 	</parameter>
 	<parameter name="SUBREPORT_DIR" isForPrompting="true" class="java.lang.String">
 		<defaultValueExpression ><![CDATA[$P{BASE_DESIGN}+"/org/openbravo/erpCommon/ad_reports/"]]></defaultValueExpression>
@@ -214,6 +214,9 @@
 	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
 		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
 	</parameter>
+	<parameter name="PARAM_CURRENCY" isForPrompting="true" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
+	</parameter>
 	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
 	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
 	<parameter name="SALE" isForPrompting="false" class="java.lang.String"/>
@@ -278,6 +281,9 @@
 					<subreportParameter  name="cCountryId">
 						<subreportParameterExpression><![CDATA[$P{cCountryId}]]></subreportParameterExpression>
 					</subreportParameter>
+					<subreportParameter  name="PARAM_CURRENCY">
+						<subreportParameterExpression><![CDATA[$P{PARAM_CURRENCY}]]></subreportParameterExpression>
+					</subreportParameter>
 					<subreportParameter  name="parDateFrom">
 						<subreportParameterExpression><![CDATA[$P{parDateFrom}]]></subreportParameterExpression>
 					</subreportParameter>
@@ -364,6 +370,9 @@
 					<subreportParameter  name="cCountryId">
 						<subreportParameterExpression><![CDATA[$P{cCountryId}]]></subreportParameterExpression>
 					</subreportParameter>
+					<subreportParameter  name="PARAM_CURRENCY">
+						<subreportParameterExpression><![CDATA[$P{PARAM_CURRENCY}]]></subreportParameterExpression>
+					</subreportParameter>
 					<subreportParameter  name="parDateFrom">
 						<subreportParameterExpression><![CDATA[$P{parDateFrom}]]></subreportParameterExpression>
 					</subreportParameter>
@@ -450,6 +459,9 @@
 					<subreportParameter  name="cCountryId">
 						<subreportParameterExpression><![CDATA[$P{cCountryId}]]></subreportParameterExpression>
 					</subreportParameter>
+					<subreportParameter  name="PARAM_CURRENCY">
+						<subreportParameterExpression><![CDATA[$P{PARAM_CURRENCY}]]></subreportParameterExpression>
+					</subreportParameter>
 					<subreportParameter  name="parDateFrom">
 						<subreportParameterExpression><![CDATA[$P{parDateFrom}]]></subreportParameterExpression>
 					</subreportParameter>
@@ -536,6 +548,9 @@
 					<subreportParameter  name="cCountryId">
 						<subreportParameterExpression><![CDATA[$P{cCountryId}]]></subreportParameterExpression>
 					</subreportParameter>
+					<subreportParameter  name="PARAM_CURRENCY">
+						<subreportParameterExpression><![CDATA[$P{PARAM_CURRENCY}]]></subreportParameterExpression>
+					</subreportParameter>
 					<subreportParameter  name="parDateFrom">
 						<subreportParameterExpression><![CDATA[$P{parDateFrom}]]></subreportParameterExpression>
 					</subreportParameter>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.xml	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice.xml	Fri Jul 24 17:00:02 2009 +0530
@@ -54,6 +54,10 @@
   <PARAMETER id="messageBoxID" name="messageType" attribute="class" replace="yy" default="HIDDEN"/>
   <PARAMETER id="messageBoxIDTitle" name="messageTitle" default=""/>
   <PARAMETER id="messageBoxIDMessage" name="messageMessage" default=""/>
+  <PARAMETER id="paramC_Currency_ID" name="ccurrencyid" attribute="value"/>
+  <SUBREPORT id="reportC_Currency_ID" name="reportC_Currency_ID" report="org/openbravo/erpCommon/reference/List">
+    <ARGUMENT name="parameterListSelected" withId="paramC_Currency_ID"/>
+  </SUBREPORT> 
   
   
 </REPORT>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceJR.java	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceJR.java	Fri Jul 24 17:00:02 2009 +0530
@@ -36,6 +36,7 @@
 import org.openbravo.erpCommon.businessUtility.Tree;
 import org.openbravo.erpCommon.businessUtility.TreeData;
 import org.openbravo.erpCommon.businessUtility.WindowTabs;
+import org.openbravo.erpCommon.utility.ComboTableData;
 import org.openbravo.erpCommon.utility.DateTimeData;
 import org.openbravo.erpCommon.utility.LeftTabsBar;
 import org.openbravo.erpCommon.utility.NavigationBar;
@@ -50,23 +51,26 @@
   public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
-
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
     if (vars.commandIn("DEFAULT")) {
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId","ReportTaxInvoiceJR|currency", strUserCurrencyId);
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportTaxInvoiceJR|DateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportTaxInvoiceJR|DateTo", "");
       String strOrg = vars.getGlobalVariable("inpOrg", "ReportTaxInvoiceJR|Org", "");
       String strDetail = vars.getStringParameter("inpDetalle", "-1");
       String strSales = vars.getStringParameter("inpSales", "S");
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales);
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales,strCurrencyId);
     } else if (vars.commandIn("PRINT_HTML")) {
+      String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId","ReportTaxInvoiceJR|currency");
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportTaxInvoiceJR|DateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportTaxInvoiceJR|DateTo");
       String strOrg = vars.getRequestGlobalVariable("inpOrg", "ReportTaxInvoiceJR|Org");
       String strDetail = vars.getStringParameter("inpDetalle");
       String strSales = vars.getStringParameter("inpSales");
-      printPageDataHtml(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales, "html");
+      printPageDataHtml(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales, "html",strCurrencyId);
     } else if (vars.commandIn("PRINT_PDF")) {
+      String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId","ReportTaxInvoiceJR|currency");
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportTaxInvoiceJR|DateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportTaxInvoiceJR|DateTo");
@@ -75,22 +79,23 @@
         strOrg = "0";
       String strDetail = vars.getStringParameter("inpDetalle");
       String strSales = vars.getStringParameter("inpSales");
-      printPageDataHtml(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales, "pdf");
+      printPageDataHtml(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales, "pdf",strCurrencyId);
     } else if (vars.commandIn("RELATION_XLS")) {
+      String strCurrencyId = vars.getRequestGlobalVariable("inpCurrencyId","ReportTaxInvoiceJR|currency");
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportTaxInvoiceJR|DateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportTaxInvoiceJR|DateTo");
       String strOrg = vars.getRequestGlobalVariable("inpOrg", "ReportTaxInvoiceJR|Org");
       String strDetail = vars.getStringParameter("inpDetalle");
       String strSales = vars.getStringParameter("inpSales");
-      printPageDataHtml(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales, "xls");
+      printPageDataHtml(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales, "xls",strCurrencyId);
     } else
       pageError(response);
   }
 
   private void printPageDataHtml(HttpServletResponse response, VariablesSecureApp vars,
       String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales,
-      String strOutput) throws IOException, ServletException {
+      String strOutput,String strCurrencyId) throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
     response.setContentType("text/html; charset=UTF-8");
@@ -105,7 +110,7 @@
      * if (strSales.equals("S")) strSalesAux = "Y"; else strSalesAux = "N";
      */
     if (strDateFrom.equals("") && strDateTo.equals("") && strDetail.equals("-1")) {
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales);
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strOrg, strDetail, strSales,strCurrencyId);
     } else if (!strDetail.equals("-1")) {
       if (log4j.isDebugEnabled())
         log4j.debug("****** not datailed");
@@ -142,6 +147,7 @@
     parameters.put("PURCHASE", strPurchase);
     parameters.put("PARAM_ORG", Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()),
         strOrg));
+    parameters.put("PARAM_CURRENCY", strCurrencyId);
     String strDateFormat;
     strDateFormat = vars.getJavaDateFormat();
     SimpleDateFormat dateFormat = new SimpleDateFormat(strDateFormat);
@@ -185,7 +191,7 @@
   }
 
   private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
-      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales)
+      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales,String strCurrencyId)
       throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
@@ -237,7 +243,18 @@
         xmlDocument.setParameter("messageMessage", myMessage.getMessage());
       }
     }
-
+    xmlDocument.setParameter("ccurrencyid", strCurrencyId);
+    try {
+      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Currency_ID",
+          "", "", Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportTaxInvoiceJR"),
+          Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoiceJR"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportTaxInvoiceJR",
+          strCurrencyId);
+      xmlDocument.setData("reportC_Currency_ID", "liststructure", comboTableData.select(false));
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
     xmlDocument.setParameter("calendar", vars.getLanguage().substring(0, 2));
     xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
     xmlDocument.setParameter("paramLanguage", "defaultLang=\"" + vars.getLanguage() + "\";");
@@ -421,7 +438,7 @@
    */
 
   private void printPageDataExcel(HttpServletResponse response, VariablesSecureApp vars,
-      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales)
+      String strDateFrom, String strDateTo, String strOrg, String strDetail, String strSales,String strCurrencyId)
       throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: dataSheet");
@@ -456,41 +473,41 @@
       if (log4j.isDebugEnabled())
         log4j.debug("****** detailed");
       if (strSales.equals("S")) {
-        dataSale = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars, "C_Country_Id",
+        dataSale = ReportTaxInvoiceData.select(this,strCurrencyId,Utility.getContext(this, vars, "C_Country_Id",
             "ReportTaxInvoice"),
             Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoice"), strDateFrom,
             DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y", Tree.getMembers(this, TreeData
                 .getTreeOrg(this, vars.getClient()), strOrg));
-        data2Sale = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Sale = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
         strSale = Utility.messageBD(this, "Sale", vars.getLanguage());
       } else if (strSales.equals("P")) {
-        dataPurchase = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars,
+        dataPurchase = ReportTaxInvoiceData.select(this,strCurrencyId,Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        data2Purchase = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Purchase = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
         strPurchase = Utility.messageBD(this, "Purchase", vars.getLanguage());
       } else {
-        dataSale = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars, "C_Country_Id",
+        dataSale = ReportTaxInvoiceData.select(this,strCurrencyId,Utility.getContext(this, vars, "C_Country_Id",
             "ReportTaxInvoice"),
             Utility.getContext(this, vars, "#User_Client", "ReportTaxInvoice"), strDateFrom,
             DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y", Tree.getMembers(this, TreeData
                 .getTreeOrg(this, vars.getClient()), strOrg));
-        data2Sale = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Sale = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "Y",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        dataPurchase = ReportTaxInvoiceData.select(this, Utility.getContext(this, vars,
+        dataPurchase = ReportTaxInvoiceData.select(this,strCurrencyId,Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
-        data2Purchase = ReportTaxInvoiceData.selectForeign(this, Utility.getContext(this, vars,
+        data2Purchase = ReportTaxInvoiceData.selectForeign(this,strCurrencyId, Utility.getContext(this, vars,
             "C_Country_Id", "ReportTaxInvoice"), Utility.getContext(this, vars, "#User_Client",
             "ReportTaxInvoice"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"), "N",
             Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg));
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoicePurchase.jrxml	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoicePurchase.jrxml	Fri Jul 24 17:00:02 2009 +0530
@@ -1,163 +1,168 @@
-<?xml version="1.0" encoding="UTF-8"  ?>
-<!-- Created with iReport - A designer for JasperReports -->
-<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
-<jasperReport
-		 name="ReportTaxInvoicePurchase"
-		 columnCount="1"
-		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="535"
-		 pageHeight="842"
-		 columnWidth="535"
-		 columnSpacing="0"
-		 leftMargin="0"
-		 rightMargin="0"
-		 topMargin="0"
-		 bottomMargin="0"
-		 whenNoDataType="NoPages"
-		 isTitleNewPage="false"
-		 isSummaryNewPage="false">
-	<property name="ireport.scriptlethandling" value="0" />
-	<property name="ireport.encoding" value="UTF-8" />
-	<import value="java.util.*" />
-	<import value="net.sf.jasperreports.engine.*" />
-	<import value="net.sf.jasperreports.engine.data.*" />
-
-	<style 
-		name="default"
-		isDefault="false"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="9"
-	>
-	</style>
-	<style 
-		name="Report_Title"
-		isDefault="false"
-		fontName="Bitstream Vera Sans"
-		fontSize="18"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Report_Subtitle"
-		isDefault="false"
-		forecolor="#555555"
-		fontName="Bitstream Vera Sans"
-		fontSize="14"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Total_Field"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#000000"
-		backcolor="#CCCCCC"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Detail_Header"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#FFFFFF"
-		backcolor="#555555"
-		vAlign="Middle"
-	>
-					<box leftPadding="5">					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-	</style>
-	<style 
-		name="GroupHeader_DarkGray"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#FFFFFF"
-		backcolor="#555555"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="14"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="GroupHeader_Gray"
-		isDefault="false"
-		mode="Opaque"
-		backcolor="#999999"
-	>
-	</style>
-	<style 
-		name="Detail_Line"
-		isDefault="false"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="9"
-	>
-
-		<conditionalStyle>
-			<conditionExpression><![CDATA[new Boolean($V{TAXNAME_COUNT}.intValue()%2==1)]]></conditionExpression>
-			<style 
-				name="Detail_Line"
-				isDefault="false"
-				mode="Opaque"
-				backcolor="#CCCCCC"
-				vAlign="Middle"
-				fontName="Bitstream Vera Sans"
-				fontSize="9"
-			>
-			</style>
-		</conditionalStyle>
-	</style>
-	<style 
-		name="Total_Gray"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#000000"
-		backcolor="#CCCCCC"
-	>
-	</style>
-
-	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["(1000000)"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["(0, 1000000)"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="REPORT_TITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["Purchase"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="aux_client" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[$P{USER_CLIENT}.equals("") ? "" : " AND C_INVOICE.AD_CLIENT_ID IN ("+$P{USER_CLIENT}+") "]]></defaultValueExpression>
-	</parameter>
-	<parameter name="aux_org" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[$P{USER_ORG}.equals("") ? "" : " AND C_INVOICE.AD_ORG_ID IN ("+$P{USER_ORG}+") "]]></defaultValueExpression>
-	</parameter>
-	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
-	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
-	<parameter name="PURCHASE" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
+<?xml version="1.0" encoding="UTF-8"  ?>
+<!-- Created with iReport - A designer for JasperReports -->
+<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
+<jasperReport
+		 name="ReportTaxInvoicePurchase"
+		 columnCount="1"
+		 printOrder="Vertical"
+		 orientation="Portrait"
+		 pageWidth="535"
+		 pageHeight="842"
+		 columnWidth="535"
+		 columnSpacing="0"
+		 leftMargin="0"
+		 rightMargin="0"
+		 topMargin="0"
+		 bottomMargin="0"
+		 whenNoDataType="NoPages"
+		 isTitleNewPage="false"
+		 isSummaryNewPage="false">
+	<property name="ireport.scriptlethandling" value="0" />
+	<property name="ireport.encoding" value="UTF-8" />
+	<import value="java.util.*" />
+	<import value="net.sf.jasperreports.engine.*" />
+	<import value="net.sf.jasperreports.engine.data.*" />
+
+	<style 
+		name="default"
+		isDefault="false"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="9"
+	>
+	</style>
+	<style 
+		name="Report_Title"
+		isDefault="false"
+		fontName="Bitstream Vera Sans"
+		fontSize="18"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Report_Subtitle"
+		isDefault="false"
+		forecolor="#555555"
+		fontName="Bitstream Vera Sans"
+		fontSize="14"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Total_Field"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#000000"
+		backcolor="#CCCCCC"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Detail_Header"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#FFFFFF"
+		backcolor="#555555"
+		vAlign="Middle"
+	>
+					<box leftPadding="5">					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+	</style>
+	<style 
+		name="GroupHeader_DarkGray"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#FFFFFF"
+		backcolor="#555555"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="14"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="GroupHeader_Gray"
+		isDefault="false"
+		mode="Opaque"
+		backcolor="#999999"
+	>
+	</style>
+	<style 
+		name="Detail_Line"
+		isDefault="false"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="9"
+	>
+
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($V{TAXNAME_COUNT}.intValue()%2==1)]]></conditionExpression>
+			<style 
+				name="Detail_Line"
+				isDefault="false"
+				mode="Opaque"
+				backcolor="#CCCCCC"
+				vAlign="Middle"
+				fontName="Bitstream Vera Sans"
+				fontSize="9"
+			>
+			</style>
+		</conditionalStyle>
+	</style>
+	<style 
+		name="Total_Gray"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#000000"
+		backcolor="#CCCCCC"
+	>
+	</style>
+
+	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["'1000000'"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["'0','1000000'"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_TITLE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["Purchase"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="aux_client" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[$P{USER_CLIENT}.equals("") ? "" : " AND C_INVOICE.AD_CLIENT_ID IN ("+$P{USER_CLIENT}+") "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="aux_org" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[$P{USER_ORG}.equals("") ? "" : " AND C_INVOICE.AD_ORG_ID IN ("+$P{USER_ORG}+") "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
+	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
+	<parameter name="PURCHASE" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
+	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
+	<parameter name="PARAM_CURRENCY" isForPrompting="true" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["102"]]></defaultValueExpression>
+	</parameter>
 	<queryString><![CDATA[SELECT C_INVOICE.ISSOTRX AS SALES, 'Y' AS NATIONAL, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS REFERENCE, 
       C_INVOICE.DATEINVOICED, C_BPARTNER.NAME AS BPARTNER, LTRIM(RTRIM(C_TAX.NAME, ' '), ' ') AS TAXNAME, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXBASEAMT ELSE C_INVOICETAX.TAXBASEAMT END) AS TAXBASEAMT, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXAMT ELSE C_INVOICETAX.TAXAMT END) AS TAXAMT, '' AS ADTREEID
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID,$P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID))
+      ELSE (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID,$P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXBASEAMT, 
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, $P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID))
+      ELSE (C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, $P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXAMT, '' AS ADTREEID,C_CURRENCY_SYMBOL($P{PARAM_CURRENCY}, 0, 'Y') AS CURRENCY,'' AS SUM_AMOUNT,'' AS Tax_BASE
       FROM C_TAX, C_INVOICETAX, C_INVOICE, C_BPARTNER_LOCATION, C_LOCATION, C_BPARTNER, C_DOCTYPE
       WHERE C_TAX.C_TAX_ID=C_INVOICETAX.C_TAX_ID
       AND C_INVOICETAX.C_INVOICE_ID=C_INVOICE.C_INVOICE_ID
@@ -176,68 +181,71 @@
       AND 1=1 
       GROUP BY COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED, C_TAX.NAME, C_BPARTNER.NAME, C_INVOICE.ISSOTRX
       HAVING SUM(C_INVOICETAX.TAXBASEAMT) <> 0
-      ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED, COALESCE(C_INVOICE.POREFERENCE,  C_INVOICE.DOCUMENTNO)]]></queryString>
-
-	<field name="SALES" class="java.lang.String"/>
-	<field name="NATIONAL" class="java.lang.String"/>
-	<field name="REFERENCE" class="java.lang.String"/>
-	<field name="DATEINVOICED" class="java.sql.Timestamp"/>
-	<field name="BPARTNER" class="java.lang.String"/>
-	<field name="TAXNAME" class="java.lang.String"/>
-	<field name="TAXBASEAMT" class="java.math.BigDecimal"/>
-	<field name="TAXAMT" class="java.math.BigDecimal"/>
-	<field name="ADTREEID" class="java.lang.String"/>
-
-	<variable name="sumTaxBaseAmt" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{TAXBASEAMT}]]></variableExpression>
-	</variable>
-	<variable name="sumImport" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{TAXAMT}]]></variableExpression>
-	</variable>
-
-		<group  name="TAXNAME" >
-			<groupExpression><![CDATA[$F{TAXNAME}]]></groupExpression>
-			<groupHeader>
-			<band height="43"  isSplitAllowed="true" >
-				<staticText>
+      ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED, COALESCE(C_INVOICE.POREFERENCE,  C_INVOICE.DOCUMENTNO)]]></queryString>
+
+	<field name="SALES" class="java.lang.String"/>
+	<field name="NATIONAL" class="java.lang.String"/>
+	<field name="REFERENCE" class="java.lang.String"/>
+	<field name="DATEINVOICED" class="java.sql.Timestamp"/>
+	<field name="BPARTNER" class="java.lang.String"/>
+	<field name="TAXNAME" class="java.lang.String"/>
+	<field name="TAXBASEAMT" class="java.math.BigDecimal"/>
+	<field name="TAXAMT" class="java.math.BigDecimal"/>
+	<field name="ADTREEID" class="java.lang.String"/>
+	<field name="CURRENCY" class="java.lang.String"/>
+	<field name="SUM_AMOUNT" class="java.lang.String"/>
+	<field name="Tax_BASE" class="java.lang.String"/>
+
+	<variable name="sumTaxBaseAmt" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
+		<variableExpression><![CDATA[$F{TAXBASEAMT}]]></variableExpression>
+	</variable>
+	<variable name="sumImport" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
+		<variableExpression><![CDATA[$F{TAXAMT}]]></variableExpression>
+	</variable>
+
+		<group  name="TAXNAME" >
+			<groupExpression><![CDATA[$F{TAXNAME}]]></groupExpression>
+			<groupHeader>
+			<band height="43"  isSplitAllowed="true" >
+				<staticText>
 					<reportElement
 						style="GroupHeader_DarkGray"
 						x="1"
 						y="0"
 						width="100"
 						height="20"
-						key="staticText"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font pdfFontName="Helvetica"/>
-					</textElement>
-				<text><![CDATA[Tax Type]]></text>
-				</staticText>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="staticText"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font pdfFontName="Helvetica"/>
+					</textElement>
+				<text><![CDATA[Tax Type]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="GroupHeader_DarkGray"
 						x="101"
 						y="0"
 						width="433"
 						height="20"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font pdfFontName="Helvetica"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{TAXNAME}]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font pdfFontName="Helvetica"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{TAXNAME}]]></textFieldExpression>
+				</textField>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="1"
@@ -245,12 +253,12 @@
 						height="42"
 						forecolor="#555555"
 						key="line-2"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="1"
@@ -258,117 +266,117 @@
 						height="42"
 						forecolor="#555555"
 						key="line-3"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<staticText>
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="10"
 						y="27"
 						width="90"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Invoice]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Invoice]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="100"
 						y="27"
 						width="70"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Date]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Date]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="170"
 						y="27"
 						width="170"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Business Partner]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Business Partner]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="340"
 						y="27"
 						width="90"
 						height="16"
-						key="element-90"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[Taxable Base]]></text>
-				</staticText>
-				<staticText>
+						key="element-90"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Taxable Base]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="430"
 						y="27"
 						width="90"
 						height="16"
-						key="element-90"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[Amount]]></text>
-				</staticText>
-			</band>
-			</groupHeader>
-			<groupFooter>
-			<band height="25"  isSplitAllowed="true" >
-				<line direction="TopDown">
+						key="element-90"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Amount]]></text>
+				</staticText>
+			</band>
+			</groupHeader>
+			<groupFooter>
+			<band height="25"  isSplitAllowed="true" >
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
@@ -376,12 +384,12 @@
 						height="19"
 						forecolor="#555555"
 						key="line-32"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="0"
@@ -389,152 +397,152 @@
 						height="19"
 						forecolor="#555555"
 						key="line-33"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="19"
 						width="535"
 						height="0"
 						forecolor="#555555"
-						key="line-34"/>
-					<graphicElement stretchType="NoStretch">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<staticText>
+						key="line-34"/>
+					<graphicElement stretchType="NoStretch">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<staticText>
 					<reportElement
 						style="default"
 						x="10"
 						y="1"
 						width="90"
 						height="16"
-						key="staticText-4"/>
-					<box leftPadding="5">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right">
-						<font size="10"/>
-					</textElement>
-				<text><![CDATA[Total:]]></text>
-				</staticText>
-				<line direction="TopDown">
+						key="staticText-4"/>
+					<box leftPadding="5">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right">
+						<font size="10"/>
+					</textElement>
+				<text><![CDATA[Total:]]></text>
+				</staticText>
+				<line direction="TopDown">
 					<reportElement
 						x="10"
 						y="0"
 						width="510"
 						height="0"
 						forecolor="#666666"
-						key="line-37"/>
-					<graphicElement stretchType="NoStretch">
-					<pen lineWidth="0.25" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="line-37"/>
+					<graphicElement stretchType="NoStretch">
+					<pen lineWidth="0.25" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Field"
 						x="100"
 						y="1"
 						width="240"
 						height="16"
-						key="textField-9"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{TAXNAME_COUNT}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-9"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{TAXNAME_COUNT}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Field"
+						x="430"
+						y="1"
+						width="90"
+						height="16"
+						key="textField-12"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0"/>
+					<leftPen lineWidth="0.0"/>
+					<bottomPen lineWidth="0.0"/>
+					<rightPen lineWidth="0.0"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$V{sumImport}.toString()+$F{CURRENCY}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Field"
 						x="340"
 						y="1"
 						width="90"
 						height="16"
-						key="textField-10"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{sumTaxBaseAmt}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Total_Field"
-						x="430"
-						y="1"
-						width="90"
-						height="16"
-						key="textField-11"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{sumImport}]]></textFieldExpression>
-				</textField>
-			</band>
-			</groupFooter>
-		</group>
-		<background>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</background>
-		<title>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</title>
-		<pageHeader>
-			<band height="20"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-13"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0"/>
+					<leftPen lineWidth="0.0"/>
+					<bottomPen lineWidth="0.0"/>
+					<rightPen lineWidth="0.0"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$V{sumTaxBaseAmt}.toString()+$F{CURRENCY}]]></textFieldExpression>
+				</textField>
+			</band>
+			</groupFooter>
+		</group>
+		<background>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</background>
+		<title>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</title>
+		<pageHeader>
+			<band height="20"  isSplitAllowed="true" >
+				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Subtitle"
 						x="0"
 						y="0"
 						width="535"
 						height="20"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$P{PURCHASE}]]></textFieldExpression>
-				</textField>
-			</band>
-		</pageHeader>
-		<columnHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnHeader>
-		<detail>
-			<band height="14"  isSplitAllowed="true" >
-				<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-				<line direction="TopDown">
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$P{PURCHASE}]]></textFieldExpression>
+				</textField>
+			</band>
+		</pageHeader>
+		<columnHeader>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</columnHeader>
+		<detail>
+			<band height="14"  isSplitAllowed="true" >
+				<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="0"
@@ -542,12 +550,12 @@
 						height="14"
 						forecolor="#555555"
 						key="line-16"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
@@ -555,113 +563,113 @@
 						height="14"
 						forecolor="#555555"
 						key="line-17"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="10"
 						y="0"
 						width="90"
 						height="14"
-						key="textField-4"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{REFERENCE}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-4"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{REFERENCE}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="100"
 						y="0"
 						width="70"
 						height="14"
-						key="textField-5"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.sql.Timestamp"><![CDATA[$F{DATEINVOICED}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-5"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.sql.Timestamp"><![CDATA[$F{DATEINVOICED}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="170"
 						y="0"
 						width="170"
 						height="14"
-						key="textField-6"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{BPARTNER}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-6"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{BPARTNER}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="340"
 						y="0"
 						width="90"
 						height="14"
-						key="textField-7"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXBASEAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXBASEAMT}):new String(" ")]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-7"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXBASEAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXBASEAMT})+$F{CURRENCY}:new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="430"
 						y="0"
 						width="90"
 						height="14"
-						key="textField-8"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXAMT}):new String(" ")]]></textFieldExpression>
-				</textField>
-			</band>
-		</detail>
-		<columnFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnFooter>
-		<pageFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageFooter>
-		<summary>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</summary>
-</jasperReport>
+						key="textField-8"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXAMT})+$F{CURRENCY}:new String(" ")]]></textFieldExpression>
+				</textField>
+			</band>
+		</detail>
+		<columnFooter>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</columnFooter>
+		<pageFooter>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</pageFooter>
+		<summary>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</summary>
+</jasperReport>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoicePurchaseForeign.jrxml	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoicePurchaseForeign.jrxml	Fri Jul 24 17:00:02 2009 +0530
@@ -1,162 +1,167 @@
-<?xml version="1.0" encoding="UTF-8"  ?>
-<!-- Created with iReport - A designer for JasperReports -->
-<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
-<jasperReport
-		 name="ReportTaxInvoicePurchaseForeign"
-		 columnCount="1"
-		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="535"
-		 pageHeight="842"
-		 columnWidth="535"
-		 columnSpacing="0"
-		 leftMargin="0"
-		 rightMargin="0"
-		 topMargin="0"
-		 bottomMargin="0"
-		 whenNoDataType="NoPages"
-		 isTitleNewPage="false"
-		 isSummaryNewPage="false">
-	<property name="ireport.scriptlethandling" value="0" />
-	<property name="ireport.encoding" value="UTF-8" />
-	<import value="java.util.*" />
-	<import value="net.sf.jasperreports.engine.*" />
-	<import value="net.sf.jasperreports.engine.data.*" />
-
-	<style 
-		name="default"
-		isDefault="false"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="9"
-	>
-	</style>
-	<style 
-		name="Report_Title"
-		isDefault="false"
-		fontName="Bitstream Vera Sans"
-		fontSize="18"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Report_Subtitle"
-		isDefault="false"
-		forecolor="#555555"
-		fontName="Bitstream Vera Sans"
-		fontSize="14"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Total_Field"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#000000"
-		backcolor="#CCCCCC"
-		vAlign="Middle"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Detail_Header"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#FFFFFF"
-		backcolor="#555555"
-		vAlign="Middle"
-	>
-					<box leftPadding="5">					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-	</style>
-	<style 
-		name="GroupHeader_DarkGray"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#FFFFFF"
-		backcolor="#555555"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="12"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="GroupHeader_Gray"
-		isDefault="false"
-		mode="Opaque"
-		backcolor="#999999"
-	>
-	</style>
-	<style 
-		name="Detail_Line"
-		isDefault="false"
-		fontName="Bitstream Vera Sans"
-		fontSize="9"
-	>
-
-		<conditionalStyle>
-			<conditionExpression><![CDATA[new Boolean($V{TAXNAME_COUNT}.intValue()%2==1)]]></conditionExpression>
-			<style 
-				name="Detail_Line"
-				isDefault="false"
-				mode="Opaque"
-				backcolor="#CCCCCC"
-				fontName="Bitstream Vera Sans"
-				fontSize="9"
-			>
-			</style>
-		</conditionalStyle>
-	</style>
-	<style 
-		name="Total_Gray"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#000000"
-		backcolor="#CCCCCC"
-	>
-	</style>
-
-	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["(1000000)"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["(0, 1000000)"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="REPORT_TITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["Purchase Foreign"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="aux_client" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[$P{USER_CLIENT}.equals("") ? "" : " AND C_INVOICE.AD_CLIENT_ID IN ("+$P{USER_CLIENT}+") "]]></defaultValueExpression>
-	</parameter>
-	<parameter name="aux_org" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[$P{USER_ORG}.equals("") ? "" : " AND C_INVOICE.AD_ORG_ID IN ("+$P{USER_ORG}+") "]]></defaultValueExpression>
-	</parameter>
-	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
-	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
-	<parameter name="ReportData" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[""]]></defaultValueExpression>
-	</parameter>
-	<parameter name="PURCHASE" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
+<?xml version="1.0" encoding="UTF-8"  ?>
+<!-- Created with iReport - A designer for JasperReports -->
+<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
+<jasperReport
+		 name="ReportTaxInvoicePurchaseForeign"
+		 columnCount="1"
+		 printOrder="Vertical"
+		 orientation="Portrait"
+		 pageWidth="535"
+		 pageHeight="842"
+		 columnWidth="535"
+		 columnSpacing="0"
+		 leftMargin="0"
+		 rightMargin="0"
+		 topMargin="0"
+		 bottomMargin="0"
+		 whenNoDataType="NoPages"
+		 isTitleNewPage="false"
+		 isSummaryNewPage="false">
+	<property name="ireport.scriptlethandling" value="0" />
+	<property name="ireport.encoding" value="UTF-8" />
+	<import value="java.util.*" />
+	<import value="net.sf.jasperreports.engine.*" />
+	<import value="net.sf.jasperreports.engine.data.*" />
+
+	<style 
+		name="default"
+		isDefault="false"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="9"
+	>
+	</style>
+	<style 
+		name="Report_Title"
+		isDefault="false"
+		fontName="Bitstream Vera Sans"
+		fontSize="18"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Report_Subtitle"
+		isDefault="false"
+		forecolor="#555555"
+		fontName="Bitstream Vera Sans"
+		fontSize="14"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Total_Field"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#000000"
+		backcolor="#CCCCCC"
+		vAlign="Middle"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Detail_Header"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#FFFFFF"
+		backcolor="#555555"
+		vAlign="Middle"
+	>
+					<box leftPadding="5">					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+	</style>
+	<style 
+		name="GroupHeader_DarkGray"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#FFFFFF"
+		backcolor="#555555"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="12"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="GroupHeader_Gray"
+		isDefault="false"
+		mode="Opaque"
+		backcolor="#999999"
+	>
+	</style>
+	<style 
+		name="Detail_Line"
+		isDefault="false"
+		fontName="Bitstream Vera Sans"
+		fontSize="9"
+	>
+
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($V{TAXNAME_COUNT}.intValue()%2==1)]]></conditionExpression>
+			<style 
+				name="Detail_Line"
+				isDefault="false"
+				mode="Opaque"
+				backcolor="#CCCCCC"
+				fontName="Bitstream Vera Sans"
+				fontSize="9"
+			>
+			</style>
+		</conditionalStyle>
+	</style>
+	<style 
+		name="Total_Gray"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#000000"
+		backcolor="#CCCCCC"
+	>
+	</style>
+
+	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["'1000000'"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["'0','1000000'"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_TITLE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["Purchase Foreign"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="aux_client" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[$P{USER_CLIENT}.equals("") ? "" : " AND C_INVOICE.AD_CLIENT_ID IN ("+$P{USER_CLIENT}+") "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="aux_org" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[$P{USER_ORG}.equals("") ? "" : " AND C_INVOICE.AD_ORG_ID IN ("+$P{USER_ORG}+") "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
+	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
+	<parameter name="ReportData" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[""]]></defaultValueExpression>
+	</parameter>
+	<parameter name="PURCHASE" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
+	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
+	<parameter name="PARAM_CURRENCY" isForPrompting="true" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["102"]]></defaultValueExpression>
+	</parameter>
 	<queryString><![CDATA[SELECT C_INVOICE.ISSOTRX AS SALES, 'N' AS NATIONAL, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS REFERENCE, C_INVOICE.DATEINVOICED, C_BPARTNER.NAME AS BPARTNER, LTRIM(RTRIM(C_TAX.NAME, ' '), ' ') AS TAXNAME, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXBASEAMT ELSE C_INVOICETAX.TAXBASEAMT END) AS TAXBASEAMT, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXAMT ELSE C_INVOICETAX.TAXAMT END) AS TAXAMT, '' AS ADTREEID
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID,$P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID))
+      ELSE (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID,$P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXBASEAMT, 
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, $P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID))
+      ELSE (C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, $P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXAMT, '' AS ADTREEID,C_CURRENCY_SYMBOL($P{PARAM_CURRENCY}, 0, 'Y') AS CURRENCY,'' AS SUM_AMOUNT,'' AS Tax_BASE
       FROM C_TAX, C_INVOICETAX, C_INVOICE, C_BPARTNER_LOCATION, C_LOCATION, C_BPARTNER, C_DOCTYPE
       WHERE C_TAX.C_TAX_ID=C_INVOICETAX.C_TAX_ID
       AND C_INVOICETAX.C_INVOICE_ID=C_INVOICE.C_INVOICE_ID
@@ -175,68 +180,71 @@
       AND 1=1
       GROUP BY COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_TAX.NAME, C_INVOICE.DATEINVOICED, C_BPARTNER.NAME, C_INVOICE.ISSOTRX
       HAVING SUM(C_INVOICETAX.TAXBASEAMT) <> 0
-      ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED, COALESCE(C_INVOICE.POREFERENCE,  C_INVOICE.DOCUMENTNO)]]></queryString>
-
-	<field name="SALES" class="java.lang.String"/>
-	<field name="NATIONAL" class="java.lang.String"/>
-	<field name="REFERENCE" class="java.lang.String"/>
-	<field name="DATEINVOICED" class="java.sql.Timestamp"/>
-	<field name="BPARTNER" class="java.lang.String"/>
-	<field name="TAXNAME" class="java.lang.String"/>
-	<field name="TAXBASEAMT" class="java.math.BigDecimal"/>
-	<field name="TAXAMT" class="java.math.BigDecimal"/>
-	<field name="ADTREEID" class="java.lang.String"/>
-
-	<variable name="sumTaxBaseAmt" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{TAXBASEAMT}]]></variableExpression>
-	</variable>
-	<variable name="sumImport" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{TAXAMT}]]></variableExpression>
-	</variable>
-
-		<group  name="TAXNAME" >
-			<groupExpression><![CDATA[$F{TAXNAME}]]></groupExpression>
-			<groupHeader>
-			<band height="43"  isSplitAllowed="true" >
-				<staticText>
+      ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED, COALESCE(C_INVOICE.POREFERENCE,  C_INVOICE.DOCUMENTNO)]]></queryString>
+
+	<field name="SALES" class="java.lang.String"/>
+	<field name="NATIONAL" class="java.lang.String"/>
+	<field name="REFERENCE" class="java.lang.String"/>
+	<field name="DATEINVOICED" class="java.sql.Timestamp"/>
+	<field name="BPARTNER" class="java.lang.String"/>
+	<field name="TAXNAME" class="java.lang.String"/>
+	<field name="TAXBASEAMT" class="java.math.BigDecimal"/>
+	<field name="TAXAMT" class="java.math.BigDecimal"/>
+	<field name="ADTREEID" class="java.lang.String"/>
+	<field name="CURRENCY" class="java.lang.String"/>
+	<field name="SUM_AMOUNT" class="java.lang.String"/>
+	<field name="Tax_BASE" class="java.lang.String"/>
+
+	<variable name="sumTaxBaseAmt" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
+		<variableExpression><![CDATA[$F{TAXBASEAMT}]]></variableExpression>
+	</variable>
+	<variable name="sumImport" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
+		<variableExpression><![CDATA[$F{TAXAMT}]]></variableExpression>
+	</variable>
+
+		<group  name="TAXNAME" >
+			<groupExpression><![CDATA[$F{TAXNAME}]]></groupExpression>
+			<groupHeader>
+			<band height="43"  isSplitAllowed="true" >
+				<staticText>
 					<reportElement
 						style="GroupHeader_DarkGray"
 						x="1"
 						y="0"
 						width="100"
 						height="20"
-						key="staticText"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font pdfFontName="Helvetica"/>
-					</textElement>
-				<text><![CDATA[Tax type]]></text>
-				</staticText>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="staticText"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font pdfFontName="Helvetica"/>
+					</textElement>
+				<text><![CDATA[Tax type]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="GroupHeader_DarkGray"
 						x="101"
 						y="0"
 						width="433"
 						height="20"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font pdfFontName="Helvetica"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{TAXNAME}]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font pdfFontName="Helvetica"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{TAXNAME}]]></textFieldExpression>
+				</textField>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="1"
@@ -244,12 +252,12 @@
 						height="42"
 						forecolor="#555555"
 						key="line-2"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="1"
@@ -257,117 +265,117 @@
 						height="42"
 						forecolor="#555555"
 						key="line-3"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<staticText>
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="10"
 						y="27"
 						width="90"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Invoice]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Invoice]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="100"
 						y="27"
 						width="70"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Date]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Date]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="170"
 						y="27"
 						width="170"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Business Partner]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Business Partner]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="340"
 						y="27"
 						width="90"
 						height="16"
-						key="element-90"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[Taxable base]]></text>
-				</staticText>
-				<staticText>
+						key="element-90"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Taxable base]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="430"
 						y="27"
 						width="90"
 						height="16"
-						key="element-90"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[Import]]></text>
-				</staticText>
-			</band>
-			</groupHeader>
-			<groupFooter>
-			<band height="27"  isSplitAllowed="true" >
-				<line direction="TopDown">
+						key="element-90"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Import]]></text>
+				</staticText>
+			</band>
+			</groupHeader>
+			<groupFooter>
+			<band height="27"  isSplitAllowed="true" >
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
@@ -375,12 +383,12 @@
 						height="22"
 						forecolor="#555555"
 						key="line-32"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="0"
@@ -388,152 +396,152 @@
 						height="22"
 						forecolor="#555555"
 						key="line-33"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="22"
 						width="535"
 						height="0"
 						forecolor="#555555"
-						key="line-34"/>
-					<graphicElement stretchType="NoStretch">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<staticText>
+						key="line-34"/>
+					<graphicElement stretchType="NoStretch">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<staticText>
 					<reportElement
 						style="default"
 						x="10"
 						y="1"
 						width="90"
 						height="16"
-						key="staticText-4"/>
-					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right">
-						<font fontName="Bitstream Vera Sans"/>
-					</textElement>
-				<text><![CDATA[Total:]]></text>
-				</staticText>
-				<line direction="TopDown">
+						key="staticText-4"/>
+					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<text><![CDATA[Total:]]></text>
+				</staticText>
+				<line direction="TopDown">
 					<reportElement
 						x="10"
 						y="0"
 						width="510"
 						height="0"
 						forecolor="#666666"
-						key="line-37"/>
-					<graphicElement stretchType="NoStretch">
-					<pen lineWidth="0.25" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="line-37"/>
+					<graphicElement stretchType="NoStretch">
+					<pen lineWidth="0.25" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Field"
 						x="100"
 						y="1"
 						width="240"
 						height="16"
-						key="textField-14"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans" size="10"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{TAXNAME_COUNT}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-14"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="10"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{TAXNAME_COUNT}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Field"
+						x="430"
+						y="1"
+						width="90"
+						height="16"
+						key="textField-17"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0"/>
+					<leftPen lineWidth="0.0"/>
+					<bottomPen lineWidth="0.0"/>
+					<rightPen lineWidth="0.0"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$V{sumImport}.toString()+$F{CURRENCY}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Field"
 						x="340"
 						y="1"
 						width="90"
 						height="16"
-						key="textField-15"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans" pdfFontName="Helvetica" size="10" isBold="false"/>
-					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{sumTaxBaseAmt}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Total_Field"
-						x="430"
-						y="1"
-						width="90"
-						height="16"
-						key="textField-16"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans" pdfFontName="Helvetica" size="10" isBold="false"/>
-					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{sumImport}]]></textFieldExpression>
-				</textField>
-			</band>
-			</groupFooter>
-		</group>
-		<background>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</background>
-		<title>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</title>
-		<pageHeader>
-			<band height="20"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-18"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0"/>
+					<leftPen lineWidth="0.0"/>
+					<bottomPen lineWidth="0.0"/>
+					<rightPen lineWidth="0.0"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$V{sumTaxBaseAmt}.toString()+$F{CURRENCY}]]></textFieldExpression>
+				</textField>
+			</band>
+			</groupFooter>
+		</group>
+		<background>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</background>
+		<title>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</title>
+		<pageHeader>
+			<band height="20"  isSplitAllowed="true" >
+				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Subtitle"
 						x="2"
 						y="0"
 						width="533"
 						height="20"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$P{PURCHASE}]]></textFieldExpression>
-				</textField>
-			</band>
-		</pageHeader>
-		<columnHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnHeader>
-		<detail>
-			<band height="14"  isSplitAllowed="true" >
-				<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-				<line direction="TopDown">
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$P{PURCHASE}]]></textFieldExpression>
+				</textField>
+			</band>
+		</pageHeader>
+		<columnHeader>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</columnHeader>
+		<detail>
+			<band height="14"  isSplitAllowed="true" >
+				<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="0"
@@ -541,12 +549,12 @@
 						height="14"
 						forecolor="#555555"
 						key="line-16"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
@@ -554,12 +562,12 @@
 						height="14"
 						forecolor="#555555"
 						key="line-17"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="10"
@@ -567,18 +575,18 @@
 						width="90"
 						height="14"
 						key="textField-9"
-						stretchType="RelativeToBandHeight"/>
-					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{REFERENCE}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						stretchType="RelativeToBandHeight"/>
+					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{REFERENCE}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="100"
@@ -586,18 +594,18 @@
 						width="70"
 						height="14"
 						key="textField-10"
-						stretchType="RelativeToBandHeight"/>
-					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.sql.Timestamp"><![CDATA[$F{DATEINVOICED}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						stretchType="RelativeToBandHeight"/>
+					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.sql.Timestamp"><![CDATA[$F{DATEINVOICED}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="170"
@@ -605,18 +613,18 @@
 						width="170"
 						height="14"
 						key="textField-11"
-						stretchType="RelativeToBandHeight"/>
-					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{BPARTNER}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						stretchType="RelativeToBandHeight"/>
+					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{BPARTNER}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="340"
@@ -624,18 +632,18 @@
 						width="90"
 						height="14"
 						key="textField-12"
-						stretchType="RelativeToBandHeight"/>
-					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXBASEAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXBASEAMT}):new String(" ")]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						stretchType="RelativeToBandHeight"/>
+					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXBASEAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXBASEAMT})+$F{CURRENCY}:new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="430"
@@ -643,29 +651,29 @@
 						width="90"
 						height="14"
 						key="textField-13"
-						stretchType="RelativeToBandHeight"/>
-					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXAMT}):new String(" ")]]></textFieldExpression>
-				</textField>
-			</band>
-		</detail>
-		<columnFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnFooter>
-		<pageFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageFooter>
-		<summary>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</summary>
-</jasperReport>
+						stretchType="RelativeToBandHeight"/>
+					<box leftPadding="5" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXAMT})+$F{CURRENCY}:new String(" ")]]></textFieldExpression>
+				</textField>
+			</band>
+		</detail>
+		<columnFooter>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</columnFooter>
+		<pageFooter>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</pageFooter>
+		<summary>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</summary>
+</jasperReport>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSale.jrxml	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSale.jrxml	Fri Jul 24 17:00:02 2009 +0530
@@ -1,162 +1,167 @@
-<?xml version="1.0" encoding="UTF-8"  ?>
-<!-- Created with iReport - A designer for JasperReports -->
-<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
-<jasperReport
-		 name="ReportTaxInvoiceSale"
-		 columnCount="1"
-		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="535"
-		 pageHeight="842"
-		 columnWidth="535"
-		 columnSpacing="0"
-		 leftMargin="0"
-		 rightMargin="0"
-		 topMargin="0"
-		 bottomMargin="0"
-		 whenNoDataType="NoPages"
-		 isTitleNewPage="false"
-		 isSummaryNewPage="false">
-	<property name="ireport.scriptlethandling" value="0" />
-	<property name="ireport.encoding" value="UTF-8" />
-	<import value="java.util.*" />
-	<import value="net.sf.jasperreports.engine.*" />
-	<import value="net.sf.jasperreports.engine.data.*" />
-
-	<style 
-		name="default"
-		isDefault="false"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="10"
-	>
-	</style>
-	<style 
-		name="Report_Title"
-		isDefault="false"
-		fontName="Bitstream Vera Sans"
-		fontSize="18"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Report_Subtitle"
-		isDefault="false"
-		forecolor="#555555"
-		fontName="Bitstream Vera Sans"
-		fontSize="14"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Total_Field"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#000000"
-		backcolor="#CCCCCC"
-		vAlign="Middle"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Detail_Header"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#FFFFFF"
-		backcolor="#555555"
-		vAlign="Middle"
-	>
-					<box leftPadding="5">					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-	</style>
-	<style 
-		name="GroupHeader_DarkGray"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#FFFFFF"
-		backcolor="#555555"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="14"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="GroupHeader_Gray"
-		isDefault="false"
-		mode="Opaque"
-		backcolor="#999999"
-	>
-	</style>
-	<style 
-		name="Detail_Line"
-		isDefault="false"
-		fontName="Bitstream Vera Sans"
-		fontSize="9"
-	>
-
-		<conditionalStyle>
-			<conditionExpression><![CDATA[new Boolean($V{TAXNAME_COUNT}.intValue()%2==1)]]></conditionExpression>
-			<style 
-				name="Detail_Line"
-				isDefault="false"
-				mode="Opaque"
-				backcolor="#CCCCCC"
-				fontName="Bitstream Vera Sans"
-				fontSize="9"
-			>
-			</style>
-		</conditionalStyle>
-	</style>
-	<style 
-		name="Total_Gray"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#000000"
-		backcolor="#CCCCCC"
-	>
-	</style>
-
-	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["(1000000)"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["(0, 1000000)"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="REPORT_TITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["Sale"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="aux_client" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[$P{USER_CLIENT}.equals("") ? " " : " AND C_INVOICE.AD_CLIENT_ID IN ("+$P{USER_CLIENT}+") "]]></defaultValueExpression>
-	</parameter>
-	<parameter name="aux_org" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[$P{USER_ORG}.equals("") ? " " : " AND C_INVOICE.AD_ORG_ID IN ("+$P{USER_ORG}+") "]]></defaultValueExpression>
-	</parameter>
-	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
-	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
-	<parameter name="ReportData" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[""]]></defaultValueExpression>
-	</parameter>
-	<parameter name="SALE" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
+<?xml version="1.0" encoding="UTF-8"  ?>
+<!-- Created with iReport - A designer for JasperReports -->
+<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
+<jasperReport
+		 name="ReportTaxInvoiceSale"
+		 columnCount="1"
+		 printOrder="Vertical"
+		 orientation="Portrait"
+		 pageWidth="535"
+		 pageHeight="842"
+		 columnWidth="535"
+		 columnSpacing="0"
+		 leftMargin="0"
+		 rightMargin="0"
+		 topMargin="0"
+		 bottomMargin="0"
+		 whenNoDataType="NoPages"
+		 isTitleNewPage="false"
+		 isSummaryNewPage="false">
+	<property name="ireport.scriptlethandling" value="0" />
+	<property name="ireport.encoding" value="UTF-8" />
+	<import value="java.util.*" />
+	<import value="net.sf.jasperreports.engine.*" />
+	<import value="net.sf.jasperreports.engine.data.*" />
+
+	<style 
+		name="default"
+		isDefault="false"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="10"
+	>
+	</style>
+	<style 
+		name="Report_Title"
+		isDefault="false"
+		fontName="Bitstream Vera Sans"
+		fontSize="18"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Report_Subtitle"
+		isDefault="false"
+		forecolor="#555555"
+		fontName="Bitstream Vera Sans"
+		fontSize="14"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Total_Field"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#000000"
+		backcolor="#CCCCCC"
+		vAlign="Middle"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Detail_Header"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#FFFFFF"
+		backcolor="#555555"
+		vAlign="Middle"
+	>
+					<box leftPadding="5">					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+	</style>
+	<style 
+		name="GroupHeader_DarkGray"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#FFFFFF"
+		backcolor="#555555"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="14"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="GroupHeader_Gray"
+		isDefault="false"
+		mode="Opaque"
+		backcolor="#999999"
+	>
+	</style>
+	<style 
+		name="Detail_Line"
+		isDefault="false"
+		fontName="Bitstream Vera Sans"
+		fontSize="9"
+	>
+
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($V{TAXNAME_COUNT}.intValue()%2==1)]]></conditionExpression>
+			<style 
+				name="Detail_Line"
+				isDefault="false"
+				mode="Opaque"
+				backcolor="#CCCCCC"
+				fontName="Bitstream Vera Sans"
+				fontSize="9"
+			>
+			</style>
+		</conditionalStyle>
+	</style>
+	<style 
+		name="Total_Gray"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#000000"
+		backcolor="#CCCCCC"
+	>
+	</style>
+
+	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["'1000000'"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["'0','1000000'"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_TITLE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["Sale"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="aux_client" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[$P{USER_CLIENT}.equals("") ? " " : " AND C_INVOICE.AD_CLIENT_ID IN ("+$P{USER_CLIENT}+") "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="aux_org" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[$P{USER_ORG}.equals("") ? " " : " AND C_INVOICE.AD_ORG_ID IN ("+$P{USER_ORG}+") "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
+	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
+	<parameter name="ReportData" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[""]]></defaultValueExpression>
+	</parameter>
+	<parameter name="SALE" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
+	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
+	<parameter name="PARAM_CURRENCY" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["102"]]></defaultValueExpression>
+	</parameter>
 	<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, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXBASEAMT ELSE C_INVOICETAX.TAXBASEAMT END) AS TAXBASEAMT, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXAMT ELSE C_INVOICETAX.TAXAMT END) AS TAXAMT, '' AS ADTREEID
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID,$P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID))
+       ELSE (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID,$P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXBASEAMT, 
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, $P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID))
+       ELSE (C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, $P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXAMT, '' AS ADTREEID,C_CURRENCY_SYMBOL($P{PARAM_CURRENCY}, 0, 'Y') AS CURRENCY,'' AS SUM_AMOUNT,'' AS Tax_BASE
       FROM C_TAX, C_INVOICETAX, C_INVOICE, C_BPARTNER_LOCATION, C_LOCATION, C_BPARTNER, C_DOCTYPE
       WHERE C_TAX.C_TAX_ID=C_INVOICETAX.C_TAX_ID
       AND C_INVOICETAX.C_INVOICE_ID=C_INVOICE.C_INVOICE_ID
@@ -170,73 +175,79 @@
       AND C_LOCATION.C_COUNTRY_ID = $P{cCountryId}
       AND C_INVOICE.DATEINVOICED >= $P{parDateFrom}
       AND C_INVOICE.DATEINVOICED < $P{parDateTo}
-      AND 1=1 $P!{aux_client} 
-      AND 1=1 $P!{aux_org}
+	AND 1=1 $P!{aux_client} 
+AND 1=1 $P!{aux_org}
       AND 1=1 
       GROUP BY C_INVOICE.DOCUMENTNO, C_INVOICE.DATEINVOICED, C_TAX.NAME, C_BPARTNER.NAME, C_INVOICE.ISSOTRX
       HAVING SUM(C_INVOICETAX.TAXBASEAMT) <> 0
-      ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED]]></queryString>
-
-	<field name="SALES" class="java.lang.String"/>
-	<field name="NATIONAL" class="java.lang.String"/>
-	<field name="DOCUMENTNO" class="java.lang.String"/>
-	<field name="DATEINVOICED" class="java.sql.Timestamp"/>
-	<field name="BPARTNER" class="java.lang.String"/>
-	<field name="TAXNAME" class="java.lang.String"/>
-	<field name="TAXBASEAMT" class="java.math.BigDecimal"/>
-	<field name="TAXAMT" class="java.math.BigDecimal"/>
-	<field name="ADTREEID" class="java.lang.String"/>
-
-	<variable name="sumTaxBaseAmt" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{TAXBASEAMT}]]></variableExpression>
-	</variable>
-	<variable name="sumImport" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{TAXAMT}]]></variableExpression>
-	</variable>
-
-		<group  name="TAXNAME" >
-			<groupExpression><![CDATA[$F{TAXNAME}]]></groupExpression>
-			<groupHeader>
-			<band height="44"  isSplitAllowed="true" >
-				<staticText>
+      ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED]]></queryString>
+
+	<field name="SALES" class="java.lang.String"/>
+	<field name="NATIONAL" class="java.lang.String"/>
+	<field name="DOCUMENTNO" class="java.lang.String"/>
+	<field name="DATEINVOICED" class="java.sql.Timestamp"/>
+	<field name="BPARTNER" class="java.lang.String"/>
+	<field name="TAXNAME" class="java.lang.String"/>
+	<field name="TAXBASEAMT" class="java.math.BigDecimal"/>
+	<field name="TAXAMT" class="java.math.BigDecimal"/>
+	<field name="ADTREEID" class="java.lang.String"/>
+	<field name="CURRENCY" class="java.lang.String"/>
+	<field name="SUM_AMOUNT" class="java.lang.String"/>
+	<field name="Tax_BASE" class="java.lang.String"/>
+
+	<variable name="sumTaxBaseAmt" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
+		<variableExpression><![CDATA[$F{TAXBASEAMT}]]></variableExpression>
+	</variable>
+	<variable name="sumImport" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
+		<variableExpression><![CDATA[$F{TAXAMT}]]></variableExpression>
+	</variable>
+	<variable name="sumAmount" class="java.lang.String" resetType="Report" calculation="Nothing">
+		<variableExpression><![CDATA[$V{sumImport}.toString()]]></variableExpression>
+	</variable>
+
+		<group  name="TAXNAME" >
+			<groupExpression><![CDATA[$F{TAXNAME}]]></groupExpression>
+			<groupHeader>
+			<band height="44"  isSplitAllowed="true" >
+				<staticText>
 					<reportElement
 						style="GroupHeader_DarkGray"
 						x="1"
 						y="0"
 						width="100"
 						height="20"
-						key="staticText"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font pdfFontName="Helvetica"/>
-					</textElement>
-				<text><![CDATA[Tax Type]]></text>
-				</staticText>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="staticText"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font pdfFontName="Helvetica"/>
+					</textElement>
+				<text><![CDATA[Tax Type]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="GroupHeader_DarkGray"
 						x="101"
 						y="0"
 						width="433"
 						height="20"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font pdfFontName="Helvetica"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{TAXNAME}]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font pdfFontName="Helvetica"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{TAXNAME}]]></textFieldExpression>
+				</textField>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="1"
@@ -244,12 +255,12 @@
 						height="43"
 						forecolor="#555555"
 						key="line-2"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="1"
@@ -257,117 +268,117 @@
 						height="43"
 						forecolor="#555555"
 						key="line-3"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<staticText>
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="10"
 						y="28"
 						width="90"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Invoice]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Invoice]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="100"
 						y="28"
 						width="70"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Date]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Date]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="170"
 						y="28"
 						width="170"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Business Partner]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Business Partner]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="340"
 						y="28"
 						width="90"
 						height="16"
-						key="element-90"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[Taxable Base]]></text>
-				</staticText>
-				<staticText>
+						key="element-90"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Taxable Base]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="430"
 						y="28"
 						width="90"
 						height="16"
-						key="element-90"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[Amount]]></text>
-				</staticText>
-			</band>
-			</groupHeader>
-			<groupFooter>
-			<band height="25"  isSplitAllowed="true" >
-				<line direction="TopDown">
+						key="element-90"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Amount]]></text>
+				</staticText>
+			</band>
+			</groupHeader>
+			<groupFooter>
+			<band height="25"  isSplitAllowed="true" >
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
@@ -375,12 +386,12 @@
 						height="20"
 						forecolor="#555555"
 						key="line-32"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="0"
@@ -388,152 +399,152 @@
 						height="20"
 						forecolor="#555555"
 						key="line-33"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="20"
 						width="535"
 						height="0"
 						forecolor="#555555"
-						key="line-34"/>
-					<graphicElement stretchType="NoStretch">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<staticText>
+						key="line-34"/>
+					<graphicElement stretchType="NoStretch">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<staticText>
 					<reportElement
 						style="default"
 						x="10"
 						y="1"
 						width="90"
 						height="16"
-						key="staticText-4"/>
-					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right">
-						<font fontName="Bitstream Vera Sans"/>
-					</textElement>
-				<text><![CDATA[Total:]]></text>
-				</staticText>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="staticText-4"/>
+					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<text><![CDATA[Total:]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Field"
 						x="100"
 						y="1"
 						width="240"
 						height="16"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{TAXNAME_COUNT}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{TAXNAME_COUNT}]]></textFieldExpression>
+				</textField>
+				<line direction="TopDown">
+					<reportElement
+						x="10"
+						y="0"
+						width="510"
+						height="0"
+						forecolor="#666666"
+						key="line-37"/>
+					<graphicElement stretchType="NoStretch">
+					<pen lineWidth="0.25" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Field"
+						x="430"
+						y="1"
+						width="90"
+						height="16"
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0"/>
+					<leftPen lineWidth="0.0"/>
+					<bottomPen lineWidth="0.0"/>
+					<rightPen lineWidth="0.0"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$V{sumImport}.toString()+$F{CURRENCY}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Field"
 						x="340"
 						y="1"
 						width="90"
 						height="16"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{sumTaxBaseAmt}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Total_Field"
-						x="430"
-						y="1"
-						width="90"
-						height="16"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{sumImport}]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						x="10"
-						y="0"
-						width="510"
-						height="0"
-						forecolor="#666666"
-						key="line-37"/>
-					<graphicElement stretchType="NoStretch">
-					<pen lineWidth="0.25" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-			</band>
-			</groupFooter>
-		</group>
-		<background>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</background>
-		<title>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</title>
-		<pageHeader>
-			<band height="20"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0"/>
+					<leftPen lineWidth="0.0"/>
+					<bottomPen lineWidth="0.0"/>
+					<rightPen lineWidth="0.0"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$V{sumTaxBaseAmt}.toString()+$F{CURRENCY}]]></textFieldExpression>
+				</textField>
+			</band>
+			</groupFooter>
+		</group>
+		<background>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</background>
+		<title>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</title>
+		<pageHeader>
+			<band height="20"  isSplitAllowed="true" >
+				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Subtitle"
 						x="0"
 						y="0"
 						width="535"
 						height="20"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$P{SALE}]]></textFieldExpression>
-				</textField>
-			</band>
-		</pageHeader>
-		<columnHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnHeader>
-		<detail>
-			<band height="14"  isSplitAllowed="true" >
-				<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-				<line direction="TopDown">
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$P{SALE}]]></textFieldExpression>
+				</textField>
+			</band>
+		</pageHeader>
+		<columnHeader>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</columnHeader>
+		<detail>
+			<band height="14"  isSplitAllowed="true" >
+				<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="0"
@@ -541,12 +552,12 @@
 						height="14"
 						forecolor="#555555"
 						key="line-16"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
@@ -554,113 +565,113 @@
 						height="14"
 						forecolor="#555555"
 						key="line-17"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="10"
 						y="0"
 						width="90"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{DOCUMENTNO}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{DOCUMENTNO}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="100"
 						y="0"
 						width="70"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.sql.Timestamp"><![CDATA[$F{DATEINVOICED}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.sql.Timestamp"><![CDATA[$F{DATEINVOICED}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="170"
 						y="0"
 						width="170"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{BPARTNER}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{BPARTNER}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="340"
 						y="0"
 						width="90"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXBASEAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXBASEAMT}):new String(" ")]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXBASEAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXBASEAMT})+$F{CURRENCY}:new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="430"
 						y="0"
 						width="90"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXAMT}):new String(" ")]]></textFieldExpression>
-				</textField>
-			</band>
-		</detail>
-		<columnFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnFooter>
-		<pageFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageFooter>
-		<summary>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</summary>
-</jasperReport>
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXAMT})+$F{CURRENCY}:new String(" ")]]></textFieldExpression>
+				</textField>
+			</band>
+		</detail>
+		<columnFooter>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</columnFooter>
+		<pageFooter>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</pageFooter>
+		<summary>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</summary>
+</jasperReport>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSaleForeign.jrxml	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoiceSaleForeign.jrxml	Fri Jul 24 17:00:02 2009 +0530
@@ -1,165 +1,170 @@
-<?xml version="1.0" encoding="UTF-8"  ?>
-<!-- Created with iReport - A designer for JasperReports -->
-<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
-<jasperReport
-		 name="ReportTaxInvoiceSaleForeign"
-		 columnCount="1"
-		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="535"
-		 pageHeight="842"
-		 columnWidth="535"
-		 columnSpacing="0"
-		 leftMargin="0"
-		 rightMargin="0"
-		 topMargin="0"
-		 bottomMargin="0"
-		 whenNoDataType="NoPages"
-		 isTitleNewPage="false"
-		 isSummaryNewPage="false">
-	<property name="ireport.scriptlethandling" value="0" />
-	<property name="ireport.encoding" value="UTF-8" />
-	<import value="java.util.*" />
-	<import value="net.sf.jasperreports.engine.*" />
-	<import value="net.sf.jasperreports.engine.data.*" />
-
-	<style 
-		name="default"
-		isDefault="false"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="10"
-	>
-	</style>
-	<style 
-		name="Report_Title"
-		isDefault="false"
-		fontName="Bitstream Vera Sans"
-		fontSize="18"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Report_Subtitle"
-		isDefault="false"
-		forecolor="#555555"
-		fontName="Bitstream Vera Sans"
-		fontSize="14"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Total_Field"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#000000"
-		backcolor="#CCCCCC"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="Detail_Header"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#FFFFFF"
-		backcolor="#555555"
-		vAlign="Middle"
-	>
-					<box leftPadding="5">					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-	</style>
-	<style 
-		name="GroupHeader_DarkGray"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#FFFFFF"
-		backcolor="#555555"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="14"
-	>
-					<box leftPadding="5"></box>
-	</style>
-	<style 
-		name="GroupHeader_Gray"
-		isDefault="false"
-		mode="Opaque"
-		backcolor="#999999"
-	>
-	</style>
-	<style 
-		name="Detail_Line"
-		isDefault="false"
-		vAlign="Middle"
-		fontName="Bitstream Vera Sans"
-		fontSize="9"
-	>
-
-		<conditionalStyle>
-			<conditionExpression><![CDATA[new Boolean($V{TAXNAME_COUNT}.intValue()%2==1)]]></conditionExpression>
-			<style 
-				name="Detail_Line"
-				isDefault="false"
-				mode="Opaque"
-				backcolor="#CCCCCC"
-				vAlign="Middle"
-				fontName="Bitstream Vera Sans"
-				fontSize="9"
-			>
-			</style>
-		</conditionalStyle>
-	</style>
-	<style 
-		name="Total_Gray"
-		isDefault="false"
-		mode="Opaque"
-		forecolor="#000000"
-		backcolor="#CCCCCC"
-	>
-	</style>
-
-	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["(1000000)"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["(0, 1000000)"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="REPORT_TITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["Sale Foreign"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="aux_client" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[$P{USER_CLIENT}.equals("") ? "" : " AND C_INVOICE.AD_CLIENT_ID IN ("+$P{USER_CLIENT}+") "]]></defaultValueExpression>
-	</parameter>
-	<parameter name="aux_org" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[$P{USER_ORG}.equals("") ? "" : " AND C_INVOICE.AD_ORG_ID IN ("+$P{USER_ORG}+") "]]></defaultValueExpression>
-	</parameter>
-	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
-		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
-	</parameter>
-	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
-	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
-	<parameter name="ReportData" isForPrompting="false" class="java.lang.String">
-		<defaultValueExpression ><![CDATA[""]]></defaultValueExpression>
-	</parameter>
-	<parameter name="SALE" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
+<?xml version="1.0" encoding="UTF-8"  ?>
+<!-- Created with iReport - A designer for JasperReports -->
+<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
+<jasperReport
+		 name="ReportTaxInvoiceSaleForeign"
+		 columnCount="1"
+		 printOrder="Vertical"
+		 orientation="Portrait"
+		 pageWidth="535"
+		 pageHeight="842"
+		 columnWidth="535"
+		 columnSpacing="0"
+		 leftMargin="0"
+		 rightMargin="0"
+		 topMargin="0"
+		 bottomMargin="0"
+		 whenNoDataType="NoPages"
+		 isTitleNewPage="false"
+		 isSummaryNewPage="false">
+	<property name="ireport.scriptlethandling" value="0" />
+	<property name="ireport.encoding" value="UTF-8" />
+	<import value="java.util.*" />
+	<import value="net.sf.jasperreports.engine.*" />
+	<import value="net.sf.jasperreports.engine.data.*" />
+
+	<style 
+		name="default"
+		isDefault="false"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="10"
+	>
+	</style>
+	<style 
+		name="Report_Title"
+		isDefault="false"
+		fontName="Bitstream Vera Sans"
+		fontSize="18"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Report_Subtitle"
+		isDefault="false"
+		forecolor="#555555"
+		fontName="Bitstream Vera Sans"
+		fontSize="14"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Total_Field"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#000000"
+		backcolor="#CCCCCC"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="Detail_Header"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#FFFFFF"
+		backcolor="#555555"
+		vAlign="Middle"
+	>
+					<box leftPadding="5">					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+	</style>
+	<style 
+		name="GroupHeader_DarkGray"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#FFFFFF"
+		backcolor="#555555"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="14"
+	>
+					<box leftPadding="5"></box>
+	</style>
+	<style 
+		name="GroupHeader_Gray"
+		isDefault="false"
+		mode="Opaque"
+		backcolor="#999999"
+	>
+	</style>
+	<style 
+		name="Detail_Line"
+		isDefault="false"
+		vAlign="Middle"
+		fontName="Bitstream Vera Sans"
+		fontSize="9"
+	>
+
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($V{TAXNAME_COUNT}.intValue()%2==1)]]></conditionExpression>
+			<style 
+				name="Detail_Line"
+				isDefault="false"
+				mode="Opaque"
+				backcolor="#CCCCCC"
+				vAlign="Middle"
+				fontName="Bitstream Vera Sans"
+				fontSize="9"
+			>
+			</style>
+		</conditionalStyle>
+	</style>
+	<style 
+		name="Total_Gray"
+		isDefault="false"
+		mode="Opaque"
+		forecolor="#000000"
+		backcolor="#CCCCCC"
+	>
+	</style>
+
+	<parameter name="ATTACH" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="BASE_WEB" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="BASE_DESIGN" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="LANGUAGE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["en_US"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_CLIENT" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["'1000000'"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_ORG" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["'0','1000000'"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_TITLE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["REPORT TITLE"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["Sale Foreign"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="aux_client" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[$P{USER_CLIENT}.equals("") ? "" : " AND C_INVOICE.AD_CLIENT_ID IN ("+$P{USER_CLIENT}+") "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="aux_org" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[$P{USER_ORG}.equals("") ? "" : " AND C_INVOICE.AD_ORG_ID IN ("+$P{USER_ORG}+") "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="cCountryId" isForPrompting="true" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["100"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="parDateFrom" isForPrompting="true" class="java.util.Date"/>
+	<parameter name="parDateTo" isForPrompting="true" class="java.util.Date"/>
+	<parameter name="ReportData" isForPrompting="false" class="java.lang.String">
+		<defaultValueExpression ><![CDATA[""]]></defaultValueExpression>
+	</parameter>
+	<parameter name="SALE" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="DETAIL" isForPrompting="false" class="java.lang.String"/>
+	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
+	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
+	<parameter name="PARAM_CURRENCY" isForPrompting="true" class="java.lang.String">
+		<defaultValueExpression ><![CDATA["102"]]></defaultValueExpression>
+	</parameter>
 	<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, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXBASEAMT ELSE C_INVOICETAX.TAXBASEAMT END) AS TAXBASEAMT, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXAMT ELSE C_INVOICETAX.TAXAMT END) AS TAXAMT, '' AS ADTREEID
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID,$P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID))
+      ELSE (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID,$P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXBASEAMT, 
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, $P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID))
+      ELSE (C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, $P{PARAM_CURRENCY}, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXAMT, '' AS ADTREEID,C_CURRENCY_SYMBOL($P{PARAM_CURRENCY}, 0, 'Y') AS CURRENCY,'' AS SUM_AMOUNT,'' AS Tax_BASE
       FROM C_TAX, C_INVOICETAX, C_INVOICE, C_BPARTNER_LOCATION, C_LOCATION, C_BPARTNER, C_DOCTYPE
       WHERE C_TAX.C_TAX_ID=C_INVOICETAX.C_TAX_ID
       AND C_INVOICETAX.C_INVOICE_ID=C_INVOICE.C_INVOICE_ID
@@ -178,68 +183,71 @@
       AND 1=1
       GROUP BY C_INVOICE.DOCUMENTNO, C_TAX.NAME, C_INVOICE.DATEINVOICED, C_BPARTNER.NAME, C_INVOICE.ISSOTRX
       HAVING SUM(C_INVOICETAX.TAXBASEAMT) <> 0
-      ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED]]></queryString>
-
-	<field name="SALES" class="java.lang.String"/>
-	<field name="NATIONAL" class="java.lang.String"/>
-	<field name="DOCUMENTNO" class="java.lang.String"/>
-	<field name="DATEINVOICED" class="java.sql.Timestamp"/>
-	<field name="BPARTNER" class="java.lang.String"/>
-	<field name="TAXNAME" class="java.lang.String"/>
-	<field name="TAXBASEAMT" class="java.math.BigDecimal"/>
-	<field name="TAXAMT" class="java.math.BigDecimal"/>
-	<field name="ADTREEID" class="java.lang.String"/>
-
-	<variable name="sumTaxBaseAmt" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{TAXBASEAMT}]]></variableExpression>
-	</variable>
-	<variable name="sumImport" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{TAXAMT}]]></variableExpression>
-	</variable>
-
-		<group  name="TAXNAME" >
-			<groupExpression><![CDATA[$F{TAXNAME}]]></groupExpression>
-			<groupHeader>
-			<band height="44"  isSplitAllowed="true" >
-				<staticText>
+      ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED]]></queryString>
+
+	<field name="SALES" class="java.lang.String"/>
+	<field name="NATIONAL" class="java.lang.String"/>
+	<field name="DOCUMENTNO" class="java.lang.String"/>
+	<field name="DATEINVOICED" class="java.sql.Timestamp"/>
+	<field name="BPARTNER" class="java.lang.String"/>
+	<field name="TAXNAME" class="java.lang.String"/>
+	<field name="TAXBASEAMT" class="java.math.BigDecimal"/>
+	<field name="TAXAMT" class="java.math.BigDecimal"/>
+	<field name="ADTREEID" class="java.lang.String"/>
+	<field name="CURRENCY" class="java.lang.String"/>
+	<field name="SUM_AMOUNT" class="java.lang.String"/>
+	<field name="Tax_BASE" class="java.lang.String"/>
+
+	<variable name="sumTaxBaseAmt" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
+		<variableExpression><![CDATA[$F{TAXBASEAMT}]]></variableExpression>
+	</variable>
+	<variable name="sumImport" class="java.math.BigDecimal" resetType="Group" resetGroup="TAXNAME" calculation="Sum">
+		<variableExpression><![CDATA[$F{TAXAMT}]]></variableExpression>
+	</variable>
+
+		<group  name="TAXNAME" >
+			<groupExpression><![CDATA[$F{TAXNAME}]]></groupExpression>
+			<groupHeader>
+			<band height="44"  isSplitAllowed="true" >
+				<staticText>
 					<reportElement
 						style="GroupHeader_DarkGray"
 						x="1"
 						y="0"
 						width="100"
 						height="20"
-						key="staticText"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font pdfFontName="Helvetica"/>
-					</textElement>
-				<text><![CDATA[Tax type]]></text>
-				</staticText>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="staticText"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font pdfFontName="Helvetica"/>
+					</textElement>
+				<text><![CDATA[Tax type]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="GroupHeader_DarkGray"
 						x="101"
 						y="0"
 						width="433"
 						height="20"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font pdfFontName="Helvetica"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{TAXNAME}]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font pdfFontName="Helvetica"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{TAXNAME}]]></textFieldExpression>
+				</textField>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="1"
@@ -247,12 +255,12 @@
 						height="43"
 						forecolor="#555555"
 						key="line-2"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="1"
@@ -260,117 +268,117 @@
 						height="43"
 						forecolor="#555555"
 						key="line-3"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<staticText>
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="10"
 						y="28"
 						width="90"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Invoice]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Invoice]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="100"
 						y="28"
 						width="70"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Date]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Date]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="170"
 						y="28"
 						width="170"
 						height="16"
-						key="element-90">
-							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-						</reportElement>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<text><![CDATA[Business Partner]]></text>
-				</staticText>
-				<staticText>
+						key="element-90">
+							<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+						</reportElement>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<text><![CDATA[Business Partner]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="340"
 						y="28"
 						width="90"
 						height="16"
-						key="element-90"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[Taxable Base]]></text>
-				</staticText>
-				<staticText>
+						key="element-90"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Taxable Base]]></text>
+				</staticText>
+				<staticText>
 					<reportElement
 						style="Detail_Header"
 						x="430"
 						y="28"
 						width="90"
 						height="16"
-						key="element-90"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<text><![CDATA[Amount]]></text>
-				</staticText>
-			</band>
-			</groupHeader>
-			<groupFooter>
-			<band height="28"  isSplitAllowed="true" >
-				<line direction="TopDown">
+						key="element-90"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<text><![CDATA[Amount]]></text>
+				</staticText>
+			</band>
+			</groupHeader>
+			<groupFooter>
+			<band height="28"  isSplitAllowed="true" >
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
@@ -378,12 +386,12 @@
 						height="20"
 						forecolor="#555555"
 						key="line-32"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="0"
@@ -391,152 +399,152 @@
 						height="20"
 						forecolor="#555555"
 						key="line-33"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="20"
 						width="535"
 						height="0"
 						forecolor="#555555"
-						key="line-34"/>
-					<graphicElement stretchType="NoStretch">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<staticText>
+						key="line-34"/>
+					<graphicElement stretchType="NoStretch">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<staticText>
 					<reportElement
 						style="default"
 						x="10"
 						y="1"
 						width="90"
 						height="16"
-						key="staticText-4"/>
-					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right">
-						<font fontName="Bitstream Vera Sans"/>
-					</textElement>
-				<text><![CDATA[Total:]]></text>
-				</staticText>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="staticText-4"/>
+					<box>					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<text><![CDATA[Total:]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Field"
 						x="100"
 						y="1"
 						width="240"
 						height="16"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{TAXNAME_COUNT}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{TAXNAME_COUNT}]]></textFieldExpression>
+				</textField>
+				<line direction="TopDown">
+					<reportElement
+						x="10"
+						y="0"
+						width="510"
+						height="0"
+						forecolor="#666666"
+						key="line-37"/>
+					<graphicElement stretchType="NoStretch">
+					<pen lineWidth="0.25" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Field"
+						x="430"
+						y="1"
+						width="90"
+						height="16"
+						key="textField-1"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0"/>
+					<leftPen lineWidth="0.0"/>
+					<bottomPen lineWidth="0.0"/>
+					<rightPen lineWidth="0.0"/>
+</box>
+					<textElement textAlignment="Right">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$V{sumImport}.toString()+$F{CURRENCY}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Field"
 						x="340"
 						y="1"
 						width="90"
 						height="16"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{sumTaxBaseAmt}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="#,##0.00" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Total_Field"
-						x="430"
-						y="1"
-						width="90"
-						height="16"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.math.BigDecimal"><![CDATA[$V{sumImport}]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						x="10"
-						y="0"
-						width="510"
-						height="0"
-						forecolor="#666666"
-						key="line-37"/>
-					<graphicElement stretchType="NoStretch">
-					<pen lineWidth="0.25" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-			</band>
-			</groupFooter>
-		</group>
-		<background>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</background>
-		<title>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</title>
-		<pageHeader>
-			<band height="20"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField-2"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0"/>
+					<leftPen lineWidth="0.0"/>
+					<bottomPen lineWidth="0.0"/>
+					<rightPen lineWidth="0.0"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$V{sumTaxBaseAmt}.toString()+$F{CURRENCY}]]></textFieldExpression>
+				</textField>
+			</band>
+			</groupFooter>
+		</group>
+		<background>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</background>
+		<title>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</title>
+		<pageHeader>
+			<band height="20"  isSplitAllowed="true" >
+				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Subtitle"
 						x="0"
 						y="0"
 						width="535"
 						height="20"
-						key="textField"/>
-					<box leftPadding="5">					<pen lineWidth="0.0"/>
-					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement>
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$P{SALE}]]></textFieldExpression>
-				</textField>
-			</band>
-		</pageHeader>
-		<columnHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnHeader>
-		<detail>
-			<band height="14"  isSplitAllowed="true" >
-				<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
-				<line direction="TopDown">
+						key="textField"/>
+					<box leftPadding="5">					<pen lineWidth="0.0"/>
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement>
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$P{SALE}]]></textFieldExpression>
+				</textField>
+			</band>
+		</pageHeader>
+		<columnHeader>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</columnHeader>
+		<detail>
+			<band height="14"  isSplitAllowed="true" >
+				<printWhenExpression><![CDATA[new Boolean($P{DETAIL}.equals("Y"))]]></printWhenExpression>
+				<line direction="TopDown">
 					<reportElement
 						x="534"
 						y="0"
@@ -544,12 +552,12 @@
 						height="14"
 						forecolor="#555555"
 						key="line-16"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<line direction="TopDown">
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
@@ -557,113 +565,113 @@
 						height="14"
 						forecolor="#555555"
 						key="line-17"
-						stretchType="RelativeToBandHeight"/>
-					<graphicElement stretchType="RelativeToBandHeight">
-					<pen lineWidth="2.0" lineStyle="Solid"/>
-</graphicElement>
-				</line>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight">
+					<pen lineWidth="2.0" lineStyle="Solid"/>
+</graphicElement>
+				</line>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="10"
 						y="0"
 						width="90"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans" size="10"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{DOCUMENTNO}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="10"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{DOCUMENTNO}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="100"
 						y="0"
 						width="70"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="10"/>
-					</textElement>
-				<textFieldExpression   class="java.sql.Timestamp"><![CDATA[$F{DATEINVOICED}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="10"/>
+					</textElement>
+				<textFieldExpression   class="java.sql.Timestamp"><![CDATA[$F{DATEINVOICED}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="170"
 						y="0"
 						width="170"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="10"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{BPARTNER}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="10"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{BPARTNER}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="340"
 						y="0"
 						width="90"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="10"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXBASEAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXBASEAMT}):new String(" ")]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="10"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXBASEAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXBASEAMT})+$F{CURRENCY}:new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
 						x="430"
 						y="0"
 						width="90"
 						height="14"
-						key="textField"/>
-					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
-					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-					<bottomPen lineWidth="0.0" lineColor="#000000"/>
-					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
-</box>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans" size="10"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXAMT}):new String(" ")]]></textFieldExpression>
-				</textField>
-			</band>
-		</detail>
-		<columnFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnFooter>
-		<pageFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageFooter>
-		<summary>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</summary>
-</jasperReport>
+						key="textField"/>
+					<box leftPadding="2" rightPadding="2">					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+					<bottomPen lineWidth="0.0" lineColor="#000000"/>
+					<rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#666666"/>
+</box>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="10"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TAXAMT}!=null)?$P{NUMBERFORMAT}.format($F{TAXAMT})+$F{CURRENCY}:new String(" ")]]></textFieldExpression>
+				</textField>
+			</band>
+		</detail>
+		<columnFooter>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</columnFooter>
+		<pageFooter>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</pageFooter>
+		<summary>
+			<band height="0"  isSplitAllowed="true" >
+			</band>
+		</summary>
+</jasperReport>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice_data.xsql	Fri Jul 24 15:15:31 2009 +0530
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTaxInvoice_data.xsql	Fri Jul 24 17:00:02 2009 +0530
@@ -25,8 +25,9 @@
     <Sql>
     <![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, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXBASEAMT ELSE C_INVOICETAX.TAXBASEAMT END) AS TAXBASEAMT, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXAMT ELSE C_INVOICETAX.TAXAMT END) AS TAXAMT, '' AS ADTREEID
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) 
+      ELSE C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID) END) AS TAXBASEAMT, 
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * ( C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) ELSE ( C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXAMT,'' AS ADTREEID
       FROM C_TAX, C_INVOICETAX, C_INVOICE, C_BPARTNER_LOCATION, C_LOCATION, C_BPARTNER, C_DOCTYPE
       WHERE C_TAX.C_TAX_ID=C_INVOICETAX.C_TAX_ID
       AND C_INVOICETAX.C_INVOICE_ID=C_INVOICE.C_INVOICE_ID
@@ -45,7 +46,11 @@
       HAVING SUM(C_INVOICETAX.TAXBASEAMT) <> 0
       ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED
      ]]></Sql>
-     <Parameter name="cCountryId"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCountryId"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="parDateFrom" optional="true" after="AND 1=1"><![CDATA[ AND C_INVOICE.DATEINVOICED >= TO_DATE(?)]]></Parameter>
     <Parameter name="parDateTo" optional="true" after="AND 1=1"><![CDATA[ AND C_INVOICE.DATEINVOICED < TO_DATE(?)]]></Parameter>
@@ -76,8 +81,9 @@
     <![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, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXBASEAMT ELSE C_INVOICETAX.TAXBASEAMT END) AS TAXBASEAMT, 
-      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * C_INVOICETAX.TAXAMT ELSE C_INVOICETAX.TAXAMT END) AS TAXAMT, '' AS ADTREEID
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * (C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) 
+      ELSE C_CURRENCY_CONVERT(C_INVOICETAX.TAXBASEAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID) END) AS TAXBASEAMT, 
+      SUM(CASE WHEN DOCBASETYPE IN ('ARC','APC') THEN -1 * ( C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) ELSE ( C_CURRENCY_CONVERT(C_INVOICETAX.TAXAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICETAX.AD_CLIENT_ID, C_INVOICETAX.AD_ORG_ID)) END) AS TAXAMT,'' AS ADTREEID
       FROM C_TAX, C_INVOICETAX, C_INVOICE, C_BPARTNER_LOCATION, C_LOCATION, C_BPARTNER, C_DOCTYPE
       WHERE C_TAX.C_TAX_ID=C_INVOICETAX.C_TAX_ID
       AND C_INVOICETAX.C_INVOICE_ID=C_INVOICE.C_INVOICE_ID
@@ -96,6 +102,10 @@
       HAVING SUM(C_INVOICETAX.TAXBASEAMT) <> 0
       ORDER BY C_TAX.NAME, C_INVOICE.DATEINVOICED
      ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
     <Parameter name="cCountryId"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="parDateFrom" optional="true" after="AND 1=1"><![CDATA[ AND C_INVOICE.DATEINVOICED >= TO_DATE(?)]]></Parameter>