Merged back 'multi-currency-reports-review' branch into trunk.
authorRafa Roda Palacios <rafael.roda@openbravo.com>
Thu, 30 Oct 2008 17:30:39 +0000
changeset 1868 b462ce988fa2
parent 1867 a2cb0934dfb0
child 1869 4e17b0ac0acf
Merged back 'multi-currency-reports-review' branch into trunk.
src-db/database/masterdata/C_CURRENCY.xml
src-db/database/model/functions/C_CURRENCY_ISOSYM.xml
src-db/database/model/functions/C_CURRENCY_SYMBOL.xml
src-db/database/model/tables/C_CURRENCY.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_PROCESS_PARA.xml
src-db/database/sourcedata/AD_TEXTINTERFACES.xml
src/org/openbravo/erpCommon/ad_reports/InvoiceCustomerEdition_data.xsql
src/org/openbravo/erpCommon/ad_reports/InvoiceEdition_data.xsql
src/org/openbravo/erpCommon/ad_reports/OrderEdition_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportExpense.html
src/org/openbravo/erpCommon/ad_reports/ReportExpense.java
src/org/openbravo/erpCommon/ad_reports/ReportExpense.xml
src/org/openbravo/erpCommon/ad_reports/ReportExpense_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.xml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesNoComparativeJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerEdition.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerFilterJR.html
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerFilterJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscount.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.html
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscount_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.html
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorFilterJR.html
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorFilterJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorJR.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportInvoices.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoicesEditJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportInvoicesJR.html
src/org/openbravo/erpCommon/ad_reports/ReportInvoicesJR.java
src/org/openbravo/erpCommon/ad_reports/ReportInvoicesJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportInvoices_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesFilterJR.html
src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesFilterJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesJR.java
src/org/openbravo/erpCommon/ad_reports/ReportMaterialDimensionalAnalysesJR_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoiceFilterJR.html
src/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoiceFilterJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoiceJR.java
src/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoiceJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoice_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportParetoProduct.html
src/org/openbravo/erpCommon/ad_reports/ReportParetoProduct.java
src/org/openbravo/erpCommon/ad_reports/ReportParetoProduct.xml
src/org/openbravo/erpCommon/ad_reports/ReportParetoProduct_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportProductionCost.html
src/org/openbravo/erpCommon/ad_reports/ReportProductionCost.java
src/org/openbravo/erpCommon/ad_reports/ReportProductionCost.xml
src/org/openbravo/erpCommon/ad_reports/ReportProductionCost_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportProjectBuildingSite.java
src/org/openbravo/erpCommon/ad_reports/ReportProjectBuildingSiteJR.html
src/org/openbravo/erpCommon/ad_reports/ReportProjectBuildingSiteJR.java
src/org/openbravo/erpCommon/ad_reports/ReportProjectBuildingSiteJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportProjectBuildingSiteJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportProjectBuildingSite_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportProjectProfitabilityJR.html
src/org/openbravo/erpCommon/ad_reports/ReportProjectProfitabilityJR.java
src/org/openbravo/erpCommon/ad_reports/ReportProjectProfitabilityJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportProjectProfitabilityJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportProjectProfitability_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesFilterJR.html
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesFilterJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesJR.java
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseDimensionalAnalysesJR_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportPurchaseOrder.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalyses.fo
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalyses.java
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesEdition.html
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesEdition.xml
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesEditionPDF.xml
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesFilter.html
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesFilter.xml
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalysesPDF.java
src/org/openbravo/erpCommon/ad_reports/ReportRefundSalesDimensionalAnalyses_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java
src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJRFilter.html
src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJRFilter.xml
src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderFilterJR.html
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderFilterJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.html
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.java
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.xml
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoiced_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderJR.java
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.html
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.java
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvided_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJR.java
src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.html
src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJRFilter.xml
src/org/openbravo/erpCommon/ad_reports/ReportShipmentDimensionalAnalyzeJR_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportShipper.html
src/org/openbravo/erpCommon/ad_reports/ReportShipper.java
src/org/openbravo/erpCommon/ad_reports/ReportShipper.xml
src/org/openbravo/erpCommon/ad_reports/ReportShipper_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportToInvoiceConsignment.java
src/org/openbravo/erpCommon/ad_reports/ReportToInvoiceConsignmentJR.html
src/org/openbravo/erpCommon/ad_reports/ReportToInvoiceConsignmentJR.java
src/org/openbravo/erpCommon/ad_reports/ReportToInvoiceConsignmentJR.jrxml
src/org/openbravo/erpCommon/ad_reports/ReportToInvoiceConsignmentJR.xml
src/org/openbravo/erpCommon/ad_reports/ReportToInvoiceConsignment_data.xsql
src/org/openbravo/erpCommon/ad_reports/ReportValuationStock.html
src/org/openbravo/erpCommon/ad_reports/ReportValuationStock.java
src/org/openbravo/erpCommon/ad_reports/ReportValuationStock.xml
src/org/openbravo/erpCommon/ad_reports/ReportValuationStock_data.xsql
src/org/openbravo/erpCommon/ad_reports/SimpleDimensionalComparative.jrxml
src/org/openbravo/erpCommon/ad_reports/SimpleDimensionalNoComparative.jrxml
src/org/openbravo/erpCommon/ad_reports/WeightDimensionalComparative.jrxml
src/org/openbravo/erpCommon/ad_reports/WeightDimensionalNoComparative.jrxml
src/org/openbravo/erpCommon/utility/Utility.java
src/org/openbravo/erpCommon/utility/Utility_data.xsql
--- a/src-db/database/masterdata/C_CURRENCY.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src-db/database/masterdata/C_CURRENCY.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -45,7 +45,7 @@
 <!--102 CREATEDBY-->
 <!--102-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
 <!--102 UPDATED-->
-<!--102-->              <UPDATED><![CDATA[2006-04-04 16:48:24.0]]></UPDATED>
+<!--102-->              <UPDATED><![CDATA[2008-09-01 12:42:38.0]]></UPDATED>
 <!--102 UPDATEDBY-->
 <!--102-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--102 ISO_CODE-->
@@ -60,6 +60,8 @@
 <!--102-->              <COSTINGPRECISION><![CDATA[4]]></COSTINGPRECISION>
 <!--102 PRICEPRECISION-->
 <!--102-->              <PRICEPRECISION><![CDATA[4]]></PRICEPRECISION>
+<!--102 ISSYMBOLRIGHTSIDE-->
+<!--102-->              <ISSYMBOLRIGHTSIDE><![CDATA[Y]]></ISSYMBOLRIGHTSIDE>
 <!--102**************--></C_CURRENCY>
 
 <!--103**************--><C_CURRENCY>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/C_CURRENCY_ISOSYM.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION C_CURRENCY_ISOSYM">
+    <function name="C_CURRENCY_ISOSYM" type="VARCHAR">
+      <parameter name="p_currency_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SL
+* All portions are Copyright (C) 2008 Openbravo SL
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+
+* Test:
+*  SELECT C_CURRENCY_ISOSYM('100') FROM DUAL => (USD-$)
+************************************************************************/
+  v_isocode NVARCHAR2(10);
+  v_symbol NVARCHAR2(10);
+  v_isosymbol NVARCHAR2(30);
+BEGIN
+  v_isosymbol := '(';
+  
+  SELECT ISO_CODE, CURSYMBOL
+  INTO v_isocode, v_symbol 
+  FROM C_CURRENCY WHERE C_CURRENCY_ID = p_currency_id;
+
+  IF (v_isocode IS NOT NULL AND v_symbol IS NOT NULL) THEN
+      v_isosymbol := v_isosymbol || v_isocode || '-' || v_symbol;
+  ELSIF (v_isocode IS NOT NULL) THEN
+      v_isosymbol := v_isosymbol || v_isocode;
+  ELSIF (v_symbol IS NOT NULL) THEN
+      v_isosymbol := v_isosymbol || v_symbol;  
+  END IF;
+
+  v_isosymbol := v_isosymbol || ')';
+  
+  RETURN v_isosymbol;
+END C_CURRENCY_ISOSYM
+]]></body>
+    </function>
+  </database>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-db/database/model/functions/C_CURRENCY_SYMBOL.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION C_CURRENCY_SYMBOL">
+    <function name="C_CURRENCY_SYMBOL" type="VARCHAR">
+      <parameter name="p_currency_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_amount" type="NUMERIC" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_onlysymbol" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+* Version 1.1  with a permitted attribution clause; you may not  use this
+* file except in compliance with the License. You  may  obtain  a copy of
+* the License at http://www.openbravo.com/legal/license.html
+* Software distributed under the License  is  distributed  on  an "AS IS"
+* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+* License for the specific  language  governing  rights  and  limitations
+* under the License.
+* The Original Code is Openbravo ERP.
+* The Initial Developer of the Original Code is Openbravo SL
+* All portions are Copyright (C) 2008 Openbravo SL
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+
+* Test:
+*  SELECT C_CURRENCY_SYMBOL('100', 20000, 'N') FROM DUAL => $ 20000
+*  SELECT C_CURRENCY_SYMBOL('102', 20000, 'Y') FROM DUAL => €
+************************************************************************/
+  v_issymbolright CHAR(1);
+  v_symbol NVARCHAR2(10);
+  v_isocode NVARCHAR2(10);
+  v_amountsymbol NVARCHAR2(60);
+BEGIN
+  v_amountsymbol := p_amount;
+  SELECT ISSYMBOLRIGHTSIDE, CURSYMBOL, ISO_CODE
+  INTO v_issymbolright, v_symbol, v_isocode
+  FROM C_CURRENCY WHERE C_CURRENCY_ID = p_currency_id;
+
+  IF (p_onlysymbol = 'Y') THEN
+    IF (v_symbol IS NULL) THEN
+      v_amountsymbol := v_isocode;
+    ELSE
+      v_amountsymbol := v_symbol;
+    END IF;
+  ELSE     
+    IF (v_issymbolright = 'Y') THEN
+        IF (v_symbol IS NOT NULL) THEN
+          v_amountsymbol := v_amountsymbol || ' ' || v_symbol;
+        ELSE
+          v_amountsymbol := v_amountsymbol || ' ' || v_isocode;
+        END IF;
+    ELSE
+        IF (v_symbol IS NOT NULL) THEN
+          v_amountsymbol := v_symbol || ' ' || v_amountsymbol;
+        ELSE
+          v_amountsymbol := v_isocode || ' ' || v_amountsymbol;
+        END IF;
+    END IF;   
+  END IF;
+  
+  RETURN v_amountsymbol;
+END C_CURRENCY_SYMBOL
+]]></body>
+    </function>
+  </database>
--- a/src-db/database/model/tables/C_CURRENCY.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src-db/database/model/tables/C_CURRENCY.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -57,6 +57,10 @@
         <default><![CDATA[0]]></default>
         <onCreateDefault/>
       </column>
+      <column name="ISSYMBOLRIGHTSIDE" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="C_CURRENCYCLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -521532,6 +521532,73 @@
 <!--521F823119906C29E040007F01001B31-->              <POSITION><![CDATA[1]]></POSITION>
 <!--521F823119906C29E040007F01001B31**************--></AD_COLUMN>
 
+<!--560E1957E5F6E683E040007F0100233C**************--><AD_COLUMN>
+<!--560E1957E5F6E683E040007F0100233C AD_COLUMN_ID-->
+<!--560E1957E5F6E683E040007F0100233C-->              <AD_COLUMN_ID><![CDATA[560E1957E5F6E683E040007F0100233C]]></AD_COLUMN_ID>
+<!--560E1957E5F6E683E040007F0100233C AD_CLIENT_ID-->
+<!--560E1957E5F6E683E040007F0100233C-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--560E1957E5F6E683E040007F0100233C AD_ORG_ID-->
+<!--560E1957E5F6E683E040007F0100233C-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--560E1957E5F6E683E040007F0100233C ISACTIVE-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--560E1957E5F6E683E040007F0100233C CREATED-->
+<!--560E1957E5F6E683E040007F0100233C-->              <CREATED><![CDATA[2008-09-04 09:42:46.0]]></CREATED>
+<!--560E1957E5F6E683E040007F0100233C UPDATED-->
+<!--560E1957E5F6E683E040007F0100233C-->              <UPDATED><![CDATA[2008-09-04 09:45:09.0]]></UPDATED>
+<!--560E1957E5F6E683E040007F0100233C CREATEDBY-->
+<!--560E1957E5F6E683E040007F0100233C-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
+<!--560E1957E5F6E683E040007F0100233C UPDATEDBY-->
+<!--560E1957E5F6E683E040007F0100233C-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--560E1957E5F6E683E040007F0100233C NAME-->
+<!--560E1957E5F6E683E040007F0100233C-->              <NAME><![CDATA[Currency symbol at the right]]></NAME>
+<!--560E1957E5F6E683E040007F0100233C DESCRIPTION-->
+<!--560E1957E5F6E683E040007F0100233C-->              <DESCRIPTION><![CDATA[Indicates if the currency symbol is at the right side of the amount]]></DESCRIPTION>
+<!--560E1957E5F6E683E040007F0100233C HELP-->
+<!--560E1957E5F6E683E040007F0100233C-->              <HELP><![CDATA[A mean to indicate if the currency symbol ($, €, ¥, ...) is placed at the right side of the amount or not. Its default value is 'No'.]]></HELP>
+<!--560E1957E5F6E683E040007F0100233C COLUMNNAME-->
+<!--560E1957E5F6E683E040007F0100233C-->              <COLUMNNAME><![CDATA[Issymbolrightside]]></COLUMNNAME>
+<!--560E1957E5F6E683E040007F0100233C AD_TABLE_ID-->
+<!--560E1957E5F6E683E040007F0100233C-->              <AD_TABLE_ID><![CDATA[141]]></AD_TABLE_ID>
+<!--560E1957E5F6E683E040007F0100233C AD_REFERENCE_ID-->
+<!--560E1957E5F6E683E040007F0100233C-->              <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--560E1957E5F6E683E040007F0100233C FIELDLENGTH-->
+<!--560E1957E5F6E683E040007F0100233C-->              <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--560E1957E5F6E683E040007F0100233C DEFAULTVALUE-->
+<!--560E1957E5F6E683E040007F0100233C-->              <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--560E1957E5F6E683E040007F0100233C ISKEY-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISKEY><![CDATA[N]]></ISKEY>
+<!--560E1957E5F6E683E040007F0100233C ISPARENT-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--560E1957E5F6E683E040007F0100233C ISMANDATORY-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--560E1957E5F6E683E040007F0100233C ISUPDATEABLE-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--560E1957E5F6E683E040007F0100233C ISIDENTIFIER-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--560E1957E5F6E683E040007F0100233C SEQNO-->
+<!--560E1957E5F6E683E040007F0100233C-->              <SEQNO><![CDATA[21]]></SEQNO>
+<!--560E1957E5F6E683E040007F0100233C ISTRANSLATED-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--560E1957E5F6E683E040007F0100233C ISENCRYPTED-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--560E1957E5F6E683E040007F0100233C ISSELECTIONCOLUMN-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--560E1957E5F6E683E040007F0100233C AD_ELEMENT_ID-->
+<!--560E1957E5F6E683E040007F0100233C-->              <AD_ELEMENT_ID><![CDATA[560E22375F1DFE66E040007F01002367]]></AD_ELEMENT_ID>
+<!--560E1957E5F6E683E040007F0100233C ISSESSIONATTR-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--560E1957E5F6E683E040007F0100233C ISSECONDARYKEY-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--560E1957E5F6E683E040007F0100233C ISDESENCRYPTABLE-->
+<!--560E1957E5F6E683E040007F0100233C-->              <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--560E1957E5F6E683E040007F0100233C DEVELOPMENTSTATUS-->
+<!--560E1957E5F6E683E040007F0100233C-->              <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--560E1957E5F6E683E040007F0100233C AD_MODULE_ID-->
+<!--560E1957E5F6E683E040007F0100233C-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--560E1957E5F6E683E040007F0100233C POSITION-->
+<!--560E1957E5F6E683E040007F0100233C-->              <POSITION><![CDATA[15]]></POSITION>
+<!--560E1957E5F6E683E040007F0100233C**************--></AD_COLUMN>
+
 <!--565E56DF64D99042E040007F01002829**************--><AD_COLUMN>
 <!--565E56DF64D99042E040007F01002829 AD_COLUMN_ID-->
 <!--565E56DF64D99042E040007F01002829-->              <AD_COLUMN_ID><![CDATA[565E56DF64D99042E040007F01002829]]></AD_COLUMN_ID>
--- a/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src-db/database/sourcedata/AD_ELEMENT.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -54675,6 +54675,37 @@
 <!--5221067DBEFE52DEE040007F01001FE1-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--5221067DBEFE52DEE040007F01001FE1**************--></AD_ELEMENT>
 
+<!--560E22375F1DFE66E040007F01002367**************--><AD_ELEMENT>
+<!--560E22375F1DFE66E040007F01002367 AD_ELEMENT_ID-->
+<!--560E22375F1DFE66E040007F01002367-->              <AD_ELEMENT_ID><![CDATA[560E22375F1DFE66E040007F01002367]]></AD_ELEMENT_ID>
+<!--560E22375F1DFE66E040007F01002367 AD_CLIENT_ID-->
+<!--560E22375F1DFE66E040007F01002367-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--560E22375F1DFE66E040007F01002367 AD_ORG_ID-->
+<!--560E22375F1DFE66E040007F01002367-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--560E22375F1DFE66E040007F01002367 ISACTIVE-->
+<!--560E22375F1DFE66E040007F01002367-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--560E22375F1DFE66E040007F01002367 CREATED-->
+<!--560E22375F1DFE66E040007F01002367-->              <CREATED><![CDATA[2008-09-04 09:45:15.0]]></CREATED>
+<!--560E22375F1DFE66E040007F01002367 CREATEDBY-->
+<!--560E22375F1DFE66E040007F01002367-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
+<!--560E22375F1DFE66E040007F01002367 UPDATED-->
+<!--560E22375F1DFE66E040007F01002367-->              <UPDATED><![CDATA[2008-09-04 09:45:15.0]]></UPDATED>
+<!--560E22375F1DFE66E040007F01002367 UPDATEDBY-->
+<!--560E22375F1DFE66E040007F01002367-->              <UPDATEDBY><![CDATA[0]]></UPDATEDBY>
+<!--560E22375F1DFE66E040007F01002367 COLUMNNAME-->
+<!--560E22375F1DFE66E040007F01002367-->              <COLUMNNAME><![CDATA[Issymbolrightside]]></COLUMNNAME>
+<!--560E22375F1DFE66E040007F01002367 NAME-->
+<!--560E22375F1DFE66E040007F01002367-->              <NAME><![CDATA[Currency symbol at the right]]></NAME>
+<!--560E22375F1DFE66E040007F01002367 PRINTNAME-->
+<!--560E22375F1DFE66E040007F01002367-->              <PRINTNAME><![CDATA[Currency symbol at the right]]></PRINTNAME>
+<!--560E22375F1DFE66E040007F01002367 DESCRIPTION-->
+<!--560E22375F1DFE66E040007F01002367-->              <DESCRIPTION><![CDATA[Indicates if the currency symbol is at the right side of the amount]]></DESCRIPTION>
+<!--560E22375F1DFE66E040007F01002367 HELP-->
+<!--560E22375F1DFE66E040007F01002367-->              <HELP><![CDATA[A mean to indicate if the currency symbol ($, €, ¥, ...) is placed at the right side of the amount or not. Its default value is 'No'.]]></HELP>
+<!--560E22375F1DFE66E040007F01002367 AD_MODULE_ID-->
+<!--560E22375F1DFE66E040007F01002367-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--560E22375F1DFE66E040007F01002367**************--></AD_ELEMENT>
+
 <!--565E666A61992693E040007F01002851**************--><AD_ELEMENT>
 <!--565E666A61992693E040007F01002851 AD_ELEMENT_ID-->
 <!--565E666A61992693E040007F01002851-->              <AD_ELEMENT_ID><![CDATA[565E666A61992693E040007F01002851]]></AD_ELEMENT_ID>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -405480,6 +405480,57 @@
 <!--521F823119936C29E040007F01001B31-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--521F823119936C29E040007F01001B31**************--></AD_FIELD>
 
+<!--560E1957E5F7E683E040007F0100233C**************--><AD_FIELD>
+<!--560E1957E5F7E683E040007F0100233C AD_FIELD_ID-->
+<!--560E1957E5F7E683E040007F0100233C-->              <AD_FIELD_ID><![CDATA[560E1957E5F7E683E040007F0100233C]]></AD_FIELD_ID>
+<!--560E1957E5F7E683E040007F0100233C AD_CLIENT_ID-->
+<!--560E1957E5F7E683E040007F0100233C-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--560E1957E5F7E683E040007F0100233C AD_ORG_ID-->
+<!--560E1957E5F7E683E040007F0100233C-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--560E1957E5F7E683E040007F0100233C ISACTIVE-->
+<!--560E1957E5F7E683E040007F0100233C-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--560E1957E5F7E683E040007F0100233C CREATED-->
+<!--560E1957E5F7E683E040007F0100233C-->              <CREATED><![CDATA[2008-09-04 09:46:04.0]]></CREATED>
+<!--560E1957E5F7E683E040007F0100233C CREATEDBY-->
+<!--560E1957E5F7E683E040007F0100233C-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
+<!--560E1957E5F7E683E040007F0100233C UPDATED-->
+<!--560E1957E5F7E683E040007F0100233C-->              <UPDATED><![CDATA[2008-09-04 09:51:33.0]]></UPDATED>
+<!--560E1957E5F7E683E040007F0100233C UPDATEDBY-->
+<!--560E1957E5F7E683E040007F0100233C-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--560E1957E5F7E683E040007F0100233C NAME-->
+<!--560E1957E5F7E683E040007F0100233C-->              <NAME><![CDATA[Currency symbol at the right]]></NAME>
+<!--560E1957E5F7E683E040007F0100233C DESCRIPTION-->
+<!--560E1957E5F7E683E040007F0100233C-->              <DESCRIPTION><![CDATA[Indicates if the currency symbol is at the right side of the amount]]></DESCRIPTION>
+<!--560E1957E5F7E683E040007F0100233C HELP-->
+<!--560E1957E5F7E683E040007F0100233C-->              <HELP><![CDATA[A mean to indicate if the currency symbol ($, €, ¥, ...) is placed at the right side of the amount or not. Its default value is 'No'.]]></HELP>
+<!--560E1957E5F7E683E040007F0100233C ISCENTRALLYMAINTAINED-->
+<!--560E1957E5F7E683E040007F0100233C-->              <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--560E1957E5F7E683E040007F0100233C AD_TAB_ID-->
+<!--560E1957E5F7E683E040007F0100233C-->              <AD_TAB_ID><![CDATA[151]]></AD_TAB_ID>
+<!--560E1957E5F7E683E040007F0100233C AD_COLUMN_ID-->
+<!--560E1957E5F7E683E040007F0100233C-->              <AD_COLUMN_ID><![CDATA[560E1957E5F6E683E040007F0100233C]]></AD_COLUMN_ID>
+<!--560E1957E5F7E683E040007F0100233C ISDISPLAYED-->
+<!--560E1957E5F7E683E040007F0100233C-->              <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--560E1957E5F7E683E040007F0100233C DISPLAYLENGTH-->
+<!--560E1957E5F7E683E040007F0100233C-->              <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--560E1957E5F7E683E040007F0100233C ISREADONLY-->
+<!--560E1957E5F7E683E040007F0100233C-->              <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--560E1957E5F7E683E040007F0100233C SEQNO-->
+<!--560E1957E5F7E683E040007F0100233C-->              <SEQNO><![CDATA[65]]></SEQNO>
+<!--560E1957E5F7E683E040007F0100233C ISSAMELINE-->
+<!--560E1957E5F7E683E040007F0100233C-->              <ISSAMELINE><![CDATA[Y]]></ISSAMELINE>
+<!--560E1957E5F7E683E040007F0100233C ISFIELDONLY-->
+<!--560E1957E5F7E683E040007F0100233C-->              <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--560E1957E5F7E683E040007F0100233C ISENCRYPTED-->
+<!--560E1957E5F7E683E040007F0100233C-->              <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--560E1957E5F7E683E040007F0100233C SHOWINRELATION-->
+<!--560E1957E5F7E683E040007F0100233C-->              <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--560E1957E5F7E683E040007F0100233C ISFIRSTFOCUSEDFIELD-->
+<!--560E1957E5F7E683E040007F0100233C-->              <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--560E1957E5F7E683E040007F0100233C AD_MODULE_ID-->
+<!--560E1957E5F7E683E040007F0100233C-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--560E1957E5F7E683E040007F0100233C**************--></AD_FIELD>
+
 <!--565E666A61AB2693E040007F01002851**************--><AD_FIELD>
 <!--565E666A61AB2693E040007F01002851 AD_FIELD_ID-->
 <!--565E666A61AB2693E040007F01002851-->              <AD_FIELD_ID><![CDATA[565E666A61AB2693E040007F01002851]]></AD_FIELD_ID>
--- a/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src-db/database/sourcedata/AD_PROCESS_PARA.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -11002,7 +11002,7 @@
 <!--800056 CREATEDBY-->
 <!--800056-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
 <!--800056 UPDATED-->
-<!--800056-->              <UPDATED><![CDATA[2007-07-31 09:34:17.0]]></UPDATED>
+<!--800056-->              <UPDATED><![CDATA[2008-10-14 19:53:14.0]]></UPDATED>
 <!--800056 UPDATEDBY-->
 <!--800056-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
 <!--800056 NAME-->
@@ -11024,7 +11024,7 @@
 <!--800056 FIELDLENGTH-->
 <!--800056-->              <FIELDLENGTH><![CDATA[20]]></FIELDLENGTH>
 <!--800056 ISMANDATORY-->
-<!--800056-->              <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--800056-->              <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
 <!--800056 ISRANGE-->
 <!--800056-->              <ISRANGE><![CDATA[N]]></ISRANGE>
 <!--800056 AD_ELEMENT_ID-->
@@ -11652,6 +11652,51 @@
 <!--208021A9537641BAB0AFC4294453D59F-->              <AD_ELEMENT_ID><![CDATA[275]]></AD_ELEMENT_ID>
 <!--208021A9537641BAB0AFC4294453D59F**************--></AD_PROCESS_PARA>
 
+<!--3AC22B0F80264CF09D52044F198C75BD**************--><AD_PROCESS_PARA>
+<!--3AC22B0F80264CF09D52044F198C75BD AD_PROCESS_PARA_ID-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <AD_PROCESS_PARA_ID><![CDATA[3AC22B0F80264CF09D52044F198C75BD]]></AD_PROCESS_PARA_ID>
+<!--3AC22B0F80264CF09D52044F198C75BD AD_CLIENT_ID-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3AC22B0F80264CF09D52044F198C75BD AD_ORG_ID-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3AC22B0F80264CF09D52044F198C75BD ISACTIVE-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3AC22B0F80264CF09D52044F198C75BD CREATED-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <CREATED><![CDATA[2008-09-04 11:06:13.0]]></CREATED>
+<!--3AC22B0F80264CF09D52044F198C75BD CREATEDBY-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--3AC22B0F80264CF09D52044F198C75BD UPDATED-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <UPDATED><![CDATA[2008-09-04 11:15:47.0]]></UPDATED>
+<!--3AC22B0F80264CF09D52044F198C75BD UPDATEDBY-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--3AC22B0F80264CF09D52044F198C75BD NAME-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <NAME><![CDATA[Currency]]></NAME>
+<!--3AC22B0F80264CF09D52044F198C75BD DESCRIPTION-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <DESCRIPTION><![CDATA[An accepted medium of monetary exchange that may vary across countries.]]></DESCRIPTION>
+<!--3AC22B0F80264CF09D52044F198C75BD HELP-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <HELP><![CDATA[Indicates the currency to be used when processing this document.]]></HELP>
+<!--3AC22B0F80264CF09D52044F198C75BD AD_PROCESS_ID-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <AD_PROCESS_ID><![CDATA[800171]]></AD_PROCESS_ID>
+<!--3AC22B0F80264CF09D52044F198C75BD SEQNO-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <SEQNO><![CDATA[15]]></SEQNO>
+<!--3AC22B0F80264CF09D52044F198C75BD AD_REFERENCE_ID-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--3AC22B0F80264CF09D52044F198C75BD COLUMNNAME-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <COLUMNNAME><![CDATA[C_Currency_ID]]></COLUMNNAME>
+<!--3AC22B0F80264CF09D52044F198C75BD ISCENTRALLYMAINTAINED-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--3AC22B0F80264CF09D52044F198C75BD FIELDLENGTH-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <FIELDLENGTH><![CDATA[22]]></FIELDLENGTH>
+<!--3AC22B0F80264CF09D52044F198C75BD ISMANDATORY-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--3AC22B0F80264CF09D52044F198C75BD ISRANGE-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--3AC22B0F80264CF09D52044F198C75BD DEFAULTVALUE-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <DEFAULTVALUE><![CDATA[@C_Currency_ID@ ]]></DEFAULTVALUE>
+<!--3AC22B0F80264CF09D52044F198C75BD AD_ELEMENT_ID-->
+<!--3AC22B0F80264CF09D52044F198C75BD-->              <AD_ELEMENT_ID><![CDATA[193]]></AD_ELEMENT_ID>
+<!--3AC22B0F80264CF09D52044F198C75BD**************--></AD_PROCESS_PARA>
+
 <!--7F940C10CC42401DBBCE7834A96DCE61**************--><AD_PROCESS_PARA>
 <!--7F940C10CC42401DBBCE7834A96DCE61 AD_PROCESS_PARA_ID-->
 <!--7F940C10CC42401DBBCE7834A96DCE61-->              <AD_PROCESS_PARA_ID><![CDATA[7F940C10CC42401DBBCE7834A96DCE61]]></AD_PROCESS_PARA_ID>
@@ -11781,6 +11826,51 @@
 <!--AC9ACA128F3B408A832EAEA1892AFE89-->              <AD_ELEMENT_ID><![CDATA[1367]]></AD_ELEMENT_ID>
 <!--AC9ACA128F3B408A832EAEA1892AFE89**************--></AD_PROCESS_PARA>
 
+<!--B8F7FEBD957D4215A414BF284D739C83**************--><AD_PROCESS_PARA>
+<!--B8F7FEBD957D4215A414BF284D739C83 AD_PROCESS_PARA_ID-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <AD_PROCESS_PARA_ID><![CDATA[B8F7FEBD957D4215A414BF284D739C83]]></AD_PROCESS_PARA_ID>
+<!--B8F7FEBD957D4215A414BF284D739C83 AD_CLIENT_ID-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B8F7FEBD957D4215A414BF284D739C83 AD_ORG_ID-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B8F7FEBD957D4215A414BF284D739C83 ISACTIVE-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B8F7FEBD957D4215A414BF284D739C83 CREATED-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <CREATED><![CDATA[2008-09-09 01:22:45.0]]></CREATED>
+<!--B8F7FEBD957D4215A414BF284D739C83 CREATEDBY-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--B8F7FEBD957D4215A414BF284D739C83 UPDATED-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <UPDATED><![CDATA[2008-09-09 01:57:50.0]]></UPDATED>
+<!--B8F7FEBD957D4215A414BF284D739C83 UPDATEDBY-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--B8F7FEBD957D4215A414BF284D739C83 NAME-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <NAME><![CDATA[Currency]]></NAME>
+<!--B8F7FEBD957D4215A414BF284D739C83 DESCRIPTION-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <DESCRIPTION><![CDATA[An accepted medium of monetary exchange that may vary across countries.]]></DESCRIPTION>
+<!--B8F7FEBD957D4215A414BF284D739C83 HELP-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <HELP><![CDATA[Indicates the currency to be used when processing this document.]]></HELP>
+<!--B8F7FEBD957D4215A414BF284D739C83 AD_PROCESS_ID-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <AD_PROCESS_ID><![CDATA[800172]]></AD_PROCESS_ID>
+<!--B8F7FEBD957D4215A414BF284D739C83 SEQNO-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <SEQNO><![CDATA[20]]></SEQNO>
+<!--B8F7FEBD957D4215A414BF284D739C83 AD_REFERENCE_ID-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <AD_REFERENCE_ID><![CDATA[19]]></AD_REFERENCE_ID>
+<!--B8F7FEBD957D4215A414BF284D739C83 COLUMNNAME-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <COLUMNNAME><![CDATA[C_Currency_ID]]></COLUMNNAME>
+<!--B8F7FEBD957D4215A414BF284D739C83 ISCENTRALLYMAINTAINED-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--B8F7FEBD957D4215A414BF284D739C83 FIELDLENGTH-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <FIELDLENGTH><![CDATA[22]]></FIELDLENGTH>
+<!--B8F7FEBD957D4215A414BF284D739C83 ISMANDATORY-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--B8F7FEBD957D4215A414BF284D739C83 ISRANGE-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <ISRANGE><![CDATA[N]]></ISRANGE>
+<!--B8F7FEBD957D4215A414BF284D739C83 DEFAULTVALUE-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <DEFAULTVALUE><![CDATA[@C_Currency_ID@]]></DEFAULTVALUE>
+<!--B8F7FEBD957D4215A414BF284D739C83 AD_ELEMENT_ID-->
+<!--B8F7FEBD957D4215A414BF284D739C83-->              <AD_ELEMENT_ID><![CDATA[193]]></AD_ELEMENT_ID>
+<!--B8F7FEBD957D4215A414BF284D739C83**************--></AD_PROCESS_PARA>
+
 <!--CB8D3FBA02B84AEFB90CB2AD3D5D6FD5**************--><AD_PROCESS_PARA>
 <!--CB8D3FBA02B84AEFB90CB2AD3D5D6FD5 AD_PROCESS_PARA_ID-->
 <!--CB8D3FBA02B84AEFB90CB2AD3D5D6FD5-->              <AD_PROCESS_PARA_ID><![CDATA[CB8D3FBA02B84AEFB90CB2AD3D5D6FD5]]></AD_PROCESS_PARA_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -32119,7 +32119,7 @@
 <!--808055 FILENAME-->
 <!--808055-->              <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoiceJR.jrxml]]></FILENAME>
 <!--808055 ISUSED-->
-<!--808055-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--808055-->              <ISUSED><![CDATA[N]]></ISUSED>
 <!--808055 AD_MODULE_ID-->
 <!--808055-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--808055**************--></AD_TEXTINTERFACES>
@@ -33062,7 +33062,7 @@
 <!--808473 FILENAME-->
 <!--808473-->              <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.jrxml]]></FILENAME>
 <!--808473 ISUSED-->
-<!--808473-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--808473-->              <ISUSED><![CDATA[N]]></ISUSED>
 <!--808473 AD_MODULE_ID-->
 <!--808473-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--808473**************--></AD_TEXTINTERFACES>
@@ -33509,7 +33509,7 @@
 <!--808499 FILENAME-->
 <!--808499-->              <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/WeightDimensionalComparative.jrxml]]></FILENAME>
 <!--808499 ISUSED-->
-<!--808499-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--808499-->              <ISUSED><![CDATA[N]]></ISUSED>
 <!--808499 AD_MODULE_ID-->
 <!--808499-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--808499**************--></AD_TEXTINTERFACES>
@@ -34606,7 +34606,7 @@
 <!--809756 FILENAME-->
 <!--809756-->              <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportProjectProfitabilityJR.jrxml]]></FILENAME>
 <!--809756 ISUSED-->
-<!--809756-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--809756-->              <ISUSED><![CDATA[N]]></ISUSED>
 <!--809756 AD_MODULE_ID-->
 <!--809756-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--809756**************--></AD_TEXTINTERFACES>
@@ -35375,7 +35375,7 @@
 <!--809891 FILENAME-->
 <!--809891-->              <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportOrderNotInvoiceJR.jrxml]]></FILENAME>
 <!--809891 ISUSED-->
-<!--809891-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--809891-->              <ISUSED><![CDATA[N]]></ISUSED>
 <!--809891 AD_MODULE_ID-->
 <!--809891-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--809891**************--></AD_TEXTINTERFACES>
@@ -53948,6 +53948,31 @@
 <!--11F70E8CA2FD11DD8474FF0609901605-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--11F70E8CA2FD11DD8474FF0609901605**************--></AD_TEXTINTERFACES>
 
+<!--25AA0658849611DDB88C001B388C05F0**************--><AD_TEXTINTERFACES>
+<!--25AA0658849611DDB88C001B388C05F0 AD_TEXTINTERFACES_ID-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <AD_TEXTINTERFACES_ID><![CDATA[25AA0658849611DDB88C001B388C05F0]]></AD_TEXTINTERFACES_ID>
+<!--25AA0658849611DDB88C001B388C05F0 AD_CLIENT_ID-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--25AA0658849611DDB88C001B388C05F0 AD_ORG_ID-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--25AA0658849611DDB88C001B388C05F0 ISACTIVE-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--25AA0658849611DDB88C001B388C05F0 CREATED-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <CREATED><![CDATA[2008-09-17 10:53:50.0]]></CREATED>
+<!--25AA0658849611DDB88C001B388C05F0 CREATEDBY-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <CREATEDBY><![CDATA[0]]></CREATEDBY>
+<!--25AA0658849611DDB88C001B388C05F0 UPDATED-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <UPDATED><![CDATA[2008-09-17 10:56:12.0]]></UPDATED>
+<!--25AA0658849611DDB88C001B388C05F0 UPDATEDBY-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--25AA0658849611DDB88C001B388C05F0 TEXT-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <TEXT><![CDATA[Totals]]></TEXT>
+<!--25AA0658849611DDB88C001B388C05F0 ISUSED-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--25AA0658849611DDB88C001B388C05F0 AD_MODULE_ID-->
+<!--25AA0658849611DDB88C001B388C05F0-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--25AA0658849611DDB88C001B388C05F0**************--></AD_TEXTINTERFACES>
+
 <!--272CF5C8A1F411DD8ED1EF26D1098B24**************--><AD_TEXTINTERFACES>
 <!--272CF5C8A1F411DD8ED1EF26D1098B24 AD_TEXTINTERFACES_ID-->
 <!--272CF5C8A1F411DD8ED1EF26D1098B24-->              <AD_TEXTINTERFACES_ID><![CDATA[272CF5C8A1F411DD8ED1EF26D1098B24]]></AD_TEXTINTERFACES_ID>
@@ -54974,6 +54999,56 @@
 <!--584397333323F89EE040007F010152AB-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--584397333323F89EE040007F010152AB**************--></AD_TEXTINTERFACES>
 
+<!--8931B7E0C0774C9798207CE5A9F9B2DD**************--><AD_TEXTINTERFACES>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD AD_TEXTINTERFACES_ID-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <AD_TEXTINTERFACES_ID><![CDATA[8931B7E0C0774C9798207CE5A9F9B2DD]]></AD_TEXTINTERFACES_ID>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD AD_CLIENT_ID-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD AD_ORG_ID-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD ISACTIVE-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD CREATED-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <CREATED><![CDATA[2008-09-18 09:58:39.0]]></CREATED>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD CREATEDBY-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD UPDATED-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <UPDATED><![CDATA[2008-09-18 09:59:42.0]]></UPDATED>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD UPDATEDBY-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD TEXT-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <TEXT><![CDATA[Wgt. Ref.]]></TEXT>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD ISUSED-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD AD_MODULE_ID-->
+<!--8931B7E0C0774C9798207CE5A9F9B2DD-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8931B7E0C0774C9798207CE5A9F9B2DD**************--></AD_TEXTINTERFACES>
+
+<!--8AF50B04D98B452CB02DCE3B554A1F59**************--><AD_TEXTINTERFACES>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 AD_TEXTINTERFACES_ID-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <AD_TEXTINTERFACES_ID><![CDATA[8AF50B04D98B452CB02DCE3B554A1F59]]></AD_TEXTINTERFACES_ID>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 AD_CLIENT_ID-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 AD_ORG_ID-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 ISACTIVE-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 CREATED-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <CREATED><![CDATA[2008-09-30 14:12:45.0]]></CREATED>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 CREATEDBY-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <CREATEDBY><![CDATA[100]]></CREATEDBY>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 UPDATED-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <UPDATED><![CDATA[2008-09-30 14:40:19.0]]></UPDATED>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 UPDATEDBY-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <UPDATEDBY><![CDATA[100]]></UPDATEDBY>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 TEXT-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <TEXT><![CDATA[Currency of the report:]]></TEXT>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 ISUSED-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <ISUSED><![CDATA[Y]]></ISUSED>
+<!--8AF50B04D98B452CB02DCE3B554A1F59 AD_MODULE_ID-->
+<!--8AF50B04D98B452CB02DCE3B554A1F59-->              <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--8AF50B04D98B452CB02DCE3B554A1F59**************--></AD_TEXTINTERFACES>
+
 <!--B0AFC4FC9B5411DD95D8001B388C05F0**************--><AD_TEXTINTERFACES>
 <!--B0AFC4FC9B5411DD95D8001B388C05F0 AD_TEXTINTERFACES_ID-->
 <!--B0AFC4FC9B5411DD95D8001B388C05F0-->              <AD_TEXTINTERFACES_ID><![CDATA[B0AFC4FC9B5411DD95D8001B388C05F0]]></AD_TEXTINTERFACES_ID>
--- a/src/org/openbravo/erpCommon/ad_reports/InvoiceCustomerEdition_data.xsql	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/InvoiceCustomerEdition_data.xsql	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,29 +20,45 @@
 
 
 <SqlClass name="InvoiceCustomerEditionData" package="org.openbravo.erpCommon.ad_reports">
-  <SqlClassComment>Clase InvoiceCustomerEditionData</SqlClassComment>
+  <SqlClassComment>InvoiceCustomerEditionData Class</SqlClassComment>
   <SqlMethod name="select" type="preparedStatement" return="multiple">
-    <SqlMethodComment>Select for invoice vendor data</SqlMethodComment>
+    <SqlMethodComment>Select for invoice customer data</SqlMethodComment>
     <Sql>
     <![CDATA[
-      SELECT COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS DOCUMENTNO, C_INVOICE.DATEINVOICED AS DATEINVOICED, C_BPARTNER.NAME AS CLIENT_NAME, M_PRODUCT.NAME AS PRODUCT_NAME, SUM(C_INVOICELINE.QTYINVOICED) AS QUANTITYORDER, 
-      C_UOM.NAME AS UOMNAME, C_INVOICELINE.PRICEACTUAL AS PRICEACTUAL, SUM(C_INVOICELINE.LINENETAMT) AS PRICELIST
+      SELECT COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS DOCUMENTNO, C_INVOICE.DATEINVOICED AS DATEINVOICED, 
+      C_BPARTNER.NAME AS CLIENT_NAME, M_PRODUCT.NAME AS PRODUCT_NAME, SUM(C_INVOICELINE.QTYINVOICED) AS QUANTITYORDER, C_UOM.NAME AS UOMNAME, 
+      C_INVOICELINE.PRICEACTUAL AS PRICEACTUAL, 
+      C_CURRENCY_SYMBOL(C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.PRICEACTUAL, 'Y') AS PRICEACTUALSYM,
+	  C_CURRENCY_CONVERT(C_INVOICELINE.PRICEACTUAL, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS CONVPRICEACTUAL,
+      SUM(C_INVOICELINE.LINENETAMT) AS PRICELIST,
+      C_CURRENCY_SYMBOL (C_INVOICE.C_CURRENCY_ID, SUM(C_INVOICELINE.LINENETAMT), 'Y') AS PRICELISTSYM,
+	  SUM(C_CURRENCY_CONVERT(C_INVOICELINE.LINENETAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID)) AS CONVPRICELIST,
+	  C_CURRENCY_SYMBOL(?, '0', 'Y') AS CONVSYM,
+	  C_CURRENCY_ISOSYM(?) AS CONVISOSYM,
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRANSDATE,
+	  C_INVOICE.C_CURRENCY_ID AS TRANSCURRENCYID,
+      C_INVOICELINE.AD_CLIENT_ID AS TRANSCLIENTID, 
+	  C_INVOICELINE.AD_ORG_ID AS TRANSORGID
       FROM C_INVOICE LEFT JOIN C_PROJECT ON C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID 
                      LEFT JOIN C_LOCATION ON C_PROJECT.C_LOCATION_ID = C_LOCATION.C_LOCATION_ID, C_INVOICELINE, M_PRODUCT, C_UOM, C_BPARTNER
       WHERE C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
       AND C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
       AND C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
-      AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
-      
-      
+      AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID      
       AND C_INVOICE.AD_ORG_ID IN ('1')
       AND C_INVOICE.AD_CLIENT_ID IN ('1')
       AND C_INVOICE.ISSOTRX = 'Y'
       AND 1=1
-      GROUP BY C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.NAME, C_INVOICELINE.PRICEACTUAL, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED
+      GROUP BY C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.NAME, C_INVOICELINE.PRICEACTUAL, 
+      COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED,
+      C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID
       ORDER BY C_BPARTNER.NAME, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED
 
      ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
     <Parameter name="adUserOrg" type="replace" optional="true" after="AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[ AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
--- a/src/org/openbravo/erpCommon/ad_reports/InvoiceEdition_data.xsql	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/InvoiceEdition_data.xsql	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,8 +28,20 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
     <![CDATA[
-      SELECT COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS DOCUMENTNO, C_INVOICE.DATEINVOICED AS DATEINVOICED, C_BPARTNER.NAME AS CLIENT_NAME, M_PRODUCT.NAME AS PRODUCT_NAME, SUM(C_INVOICELINE.QTYINVOICED) AS QUANTITYORDER, 
-      C_UOM.NAME AS UOMNAME, C_INVOICELINE.PRICEACTUAL AS PRICEACTUAL, SUM(C_INVOICELINE.LINENETAMT) AS PRICELIST
+      SELECT COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS DOCUMENTNO, C_INVOICE.DATEINVOICED AS DATEINVOICED, 
+      C_BPARTNER.NAME AS CLIENT_NAME, M_PRODUCT.NAME AS PRODUCT_NAME, SUM(C_INVOICELINE.QTYINVOICED) AS QUANTITYORDER, 
+      C_UOM.NAME AS UOMNAME, C_INVOICELINE.PRICEACTUAL AS PRICEACTUAL, 
+      C_CURRENCY_SYMBOL (C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.PRICEACTUAL, 'Y') AS PRICEACTUALSYM,
+	  C_CURRENCY_CONVERT(C_INVOICELINE.PRICEACTUAL, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS CONVPRICEACTUAL,
+      SUM(C_INVOICELINE.LINENETAMT) AS PRICELIST,
+      C_CURRENCY_SYMBOL (C_INVOICE.C_CURRENCY_ID, SUM(C_INVOICELINE.LINENETAMT) , 'Y') AS PRICELISTSYM,
+	  SUM(C_CURRENCY_CONVERT(C_INVOICELINE.LINENETAMT, C_INVOICE.C_CURRENCY_ID, ?, TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID)) AS CONVPRICELIST,
+	  C_CURRENCY_SYMBOL(?, '0', 'Y') AS CONVSYM,
+	  C_CURRENCY_ISOSYM(?) AS CONVISOSYM,
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRANSDATE,
+	  C_INVOICE.C_CURRENCY_ID AS TRANSCURRENCYID,
+      C_INVOICELINE.AD_CLIENT_ID AS TRANSCLIENTID, 
+	  C_INVOICELINE.AD_ORG_ID AS TRANSORGID 
       FROM C_INVOICE, C_INVOICELINE, M_PRODUCT, C_UOM, C_BPARTNER
       WHERE C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
       AND C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
@@ -39,9 +51,15 @@
       AND C_INVOICE.AD_CLIENT_ID IN ('1')
       AND 1=1
       AND C_INVOICE.ISSOTRX = ?
-      GROUP BY C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.NAME, C_INVOICELINE.PRICEACTUAL, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED
+      GROUP BY C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.NAME, C_INVOICELINE.PRICEACTUAL, 
+      COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED,
+      C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID
       ORDER BY C_BPARTNER.NAME, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED
      ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
     <Parameter name="adUserOrg" type="replace" optional="true" after="AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="dateFrom" optional="true" after="1=1"><![CDATA[AND C_INVOICE.DATEINVOICED >= TO_DATE(?)]]></Parameter>
--- a/src/org/openbravo/erpCommon/ad_reports/OrderEdition_data.xsql	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/OrderEdition_data.xsql	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -29,7 +29,19 @@
     <Sql>
     <![CDATA[
       SELECT C_ORDER.DOCUMENTNO AS DOCUMENTNO, C_ORDER.DATEORDERED AS DATEORDERED, C_BPARTNER.NAME AS CLIENT_NAME, SUM(C_ORDERLINE.QTYORDERED) AS QUANTITYORDER, 
-      C_ORDERLINE.PRICEACTUAL AS PRICEACTUAL, SUM(C_ORDERLINE.LINENETAMT) AS PRICELIST, M_PRODUCT.NAME AS PRODUCT_NAME, C_UOM.NAME AS UOMNAME
+      C_ORDERLINE.PRICEACTUAL AS PRICEACTUAL, 
+      C_CURRENCY_SYMBOL (COALESCE(C_ORDERLINE.C_CURRENCY_ID, C_ORDER.C_CURRENCY_ID), C_ORDERLINE.PRICEACTUAL, 'Y') AS PRICEACTUALSYM,	  
+	  C_CURRENCY_CONVERT(C_ORDERLINE.PRICEACTUAL, COALESCE(C_ORDERLINE.C_CURRENCY_ID, C_ORDER.C_CURRENCY_ID), ?, TO_DATE(COALESCE(C_ORDERLINE.DATEORDERED, C_ORDER.DATEORDERED, NOW())), NULL, C_ORDERLINE.AD_CLIENT_ID, C_ORDERLINE.AD_ORG_ID) AS CONVPRICEACTUAL,      
+      SUM(C_ORDERLINE.LINENETAMT) AS PRICELIST,
+      C_CURRENCY_SYMBOL (COALESCE(C_ORDERLINE.C_CURRENCY_ID, C_ORDER.C_CURRENCY_ID), SUM(C_ORDERLINE.LINENETAMT), 'Y') AS PRICELISTSYM,
+	  SUM(C_CURRENCY_CONVERT(C_ORDERLINE.LINENETAMT, COALESCE(C_ORDERLINE.C_CURRENCY_ID, C_ORDER.C_CURRENCY_ID), ?, TO_DATE(COALESCE(C_ORDERLINE.DATEORDERED, C_ORDER.DATEORDERED, NOW())), NULL, C_ORDERLINE.AD_CLIENT_ID, C_ORDERLINE.AD_ORG_ID)) AS CONVPRICELIST, 
+      M_PRODUCT.NAME AS PRODUCT_NAME, C_UOM.NAME AS UOMNAME,
+      C_CURRENCY_SYMBOL(?, '0', 'Y') AS CONVSYM,	  
+	  C_CURRENCY_ISOSYM(?) AS CONVISOSYM,	  
+	  TO_DATE(COALESCE(C_ORDERLINE.DATEORDERED, C_ORDER.DATEORDERED, NOW())) AS TRANSDATE,	  
+	  COALESCE(C_ORDERLINE.C_CURRENCY_ID, C_ORDER.C_CURRENCY_ID) AS TRANSCURRENCYID,      
+	  C_ORDERLINE.AD_CLIENT_ID AS TRANSCLIENTID, 	  
+	  C_ORDERLINE.AD_ORG_ID AS TRANSORGID 
       FROM C_ORDER left join C_PROJECT on C_ORDER.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
                    left join C_LOCATION on C_PROJECT.C_LOCATION_ID = C_LOCATION.C_LOCATION_ID, 
       C_ORDERLINE, C_BPARTNER, M_PRODUCT, C_UOM
@@ -41,13 +53,19 @@
       AND C_ORDER.AD_CLIENT_ID IN ('1')
       AND 1=1
       AND C_ORDER.ISSOTRX = 'Y'
-      GROUP BY C_BPARTNER.NAME, C_ORDER.DOCUMENTNO, M_PRODUCT.NAME,C_ORDERLINE.PRICEACTUAL, C_UOM.NAME, C_ORDER.DATEORDERED
-	ORDER BY C_BPARTNER.NAME, C_ORDER.DOCUMENTNO, M_PRODUCT.NAME,C_ORDERLINE.PRICEACTUAL, C_UOM.NAME, C_ORDER.DATEORDERED
+      GROUP BY C_BPARTNER.NAME, C_ORDER.DOCUMENTNO, M_PRODUCT.NAME,C_ORDERLINE.PRICEACTUAL, C_UOM.NAME, C_ORDER.DATEORDERED,
+      COALESCE(C_ORDERLINE.C_CURRENCY_ID, C_ORDER.C_CURRENCY_ID), TO_DATE(COALESCE(C_ORDERLINE.DATEORDERED, C_ORDER.DATEORDERED, NOW())),
+	  C_ORDERLINE.AD_CLIENT_ID, C_ORDERLINE.AD_ORG_ID
+	  ORDER BY C_BPARTNER.NAME, C_ORDER.DOCUMENTNO, M_PRODUCT.NAME,C_ORDERLINE.PRICEACTUAL, C_UOM.NAME, C_ORDER.DATEORDERED
      ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
     <Parameter name="adUserOrg" type="replace" optional="true" after=" AND C_ORDER.AD_ORG_ID IN (" text="'1'"/>
     <Parameter name="adUserClient" type="replace" optional="true" after=" AND C_ORDER.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="dateFrom" optional="true" after="1=1"><![CDATA[ AND C_ORDER.DATEORDERED >= TO_DATE(?)]]></Parameter>
-    <Parameter name="dateTo" optional="true" after="1=1"><![CDATA[ AND C_ORDER.DATEORDERED < TO_DATE(?)]]></Parameter>
+    <Parameter name="dateTo" optional="true" after="1=1"><![CDATA[ AND C_ORDER.DATEORDERED <= TO_DATE(?)]]></Parameter>
     <Parameter name="mWarehouseId" optional="true" after="1=1"><![CDATA[ AND C_ORDER.M_WAREHOUSE_ID = ?]]></Parameter>
     <Parameter name="cProjectId" optional="true" after="1=1"><![CDATA[ AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
     <Parameter name="projectpublic" optional="true" after="1=1"><![CDATA[ AND C_PROJECT.PUBLICPRIVATE = ?]]></Parameter>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportExpense.html	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportExpense.html	Thu Oct 30 17:30:39 2008 +0000
@@ -55,11 +55,19 @@
 function validate()
 {
 	var frm = document.frmMain;
+	if (frm.inpCurrencyId.value == null || frm.inpCurrencyId.value == "") {
+	  setWindowElementFocus(frm.inpCurrencyId);
+	  showJSMessage(7);
+	  return false;
+	}
+
+	/*
 	if (inputValue(document.frmMain.inpUser) == null || inputValue(document.frmMain.inpUser) == "") {
       document.frmMain.inpUser.focus();
       showJSMessage(7);
       return false;
     }
+    */
 
 	return true;
 }
@@ -342,9 +350,12 @@
 	                      <option value=""></option>
 	                        <div id="reportC_BPartner_ID"></div>
 	                    </SELECT></TD>
-	                  <TD class="ContentCell"></TD>
-	                  <TD class="TitleCell"></TD>
-	                  <TD class="ContentCell"></TD>
+                  <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>
                 </TR>
 				    <tr> 
     					 <TD class="TitleCell"> <SPAN class="LabelText">Time Sheet</SPAN></TD>
@@ -379,7 +390,7 @@
                     <TD class="TitleCell"></TD>
                     <TD class="Button_CenterAlign_ContentCell">
                       <div>
-                        <a class="ButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='View Results in a New Window'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='ButtonLink_active'; return true;" onkeyup="this.className='ButtonLink_focus'; return true;" onclick="openServletNewWindow('FIND', false, 'ReportExpense.html', 'ReportExpense', null, false, '700', '1000', true);return false;" id="buttonHTML">
+                        <a class="ButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='View Results in a New Window'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='ButtonLink_active'; return true;" onkeyup="this.className='ButtonLink_focus'; return true;" onclick="openServletNewWindow('FIND', true, 'ReportExpense.html', 'ReportExpense', null, false, '700', '1000', true);return false;" id="buttonHTML">
                         <table class="Button" onmouseout="this.className='Button';window.status='';return true;" onmouseover="this.className='Button_hover';window.status='HTML_Report';return true;" onmousedown="this.className='Button_active';return true;" onmouseup="this.className='Button';return true;">
                           <tr>
                             <td class="Button_left"><img class="Button_Icon Button_Icon_html" alt="View Results in a New Window" title="View Results in a New Window" src="../../../../../web/images/blank.gif" border=0/></td>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportExpense.java	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportExpense.java	Thu Oct 30 17:30:39 2008 +0000
@@ -35,14 +35,17 @@
   public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
 
-    if (vars.commandIn("DEFAULT")) {
+    //Get user Client's base currency
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
+    if (vars.commandIn("DEFAULT")) {      
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportExpense|dateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportExpense|dateTo", "");
       String strcBpartnerId = vars.getGlobalVariable("inpcBPartnerId", "ReportExpense|cBpartnerId", "");
       String strPartner = vars.getGlobalVariable("inpUser", "ReportExpense|partner", "");
       String strProject = vars.getGlobalVariable("inpcProjectId", "ReportExpense|project", "");
 	    String strExpense = vars.getGlobalVariable("inpExpense", "ReportExpense|expense", "all");
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strcBpartnerId, strPartner, strProject, strExpense);
+	    String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportExpense|currency", strUserCurrencyId);
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strcBpartnerId, strPartner, strProject, strExpense, strCurrencyId);
     } else if (vars.commandIn("DIRECT")) {
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportExpense|dateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportExpense|dateTo", "");
@@ -51,7 +54,8 @@
       String strProject = vars.getGlobalVariable("inpcProjectId", "ReportExpense|project", "");
 	    String strExpense = vars.getGlobalVariable("inpExpense", "ReportExpense|expense", "");
       setHistoryCommand(request, "DIRECT");
-      printPageDataHtml(response, vars, strDateFrom, strDateTo, strcBpartnerId, strPartner, strProject, strExpense);
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportExpense|currency", strUserCurrencyId);
+      printPageDataHtml(response, vars, strDateFrom, strDateTo, strcBpartnerId, strPartner, strProject, strExpense, strCurrencyId);
     } else if (vars.commandIn("FIND")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom", "ReportExpense|dateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportExpense|dateTo");
@@ -60,40 +64,52 @@
       String strProject = vars.getRequestGlobalVariable("inpcProjectId", "ReportExpense|project");
 	    String strExpense = vars.getStringParameter("inpExpense");
       setHistoryCommand(request, "DIRECT");
-      printPageDataHtml(response, vars, strDateFrom, strDateTo, strcBpartnerId, strPartner, strProject, strExpense);
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportExpense|currency", strUserCurrencyId);
+      printPageDataHtml(response, vars, strDateFrom, strDateTo, strcBpartnerId, strPartner, strProject, strExpense, strCurrencyId);
     } else pageError(response);
   }
 
-  void printPageDataHtml(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strPartner, String strProject, String strExpense)
+  void printPageDataHtml(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strPartner, String strProject, String strExpense, String strCurrencyId)
     throws IOException, ServletException {
     if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
     XmlDocument xmlDocument=null;
     ReportExpenseData[] data1 = null;
+    //Checks if there is a conversion rate for each of the transactions of the report
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
    
     if (vars.commandIn("DEFAULT") && strDateFrom.equals("") && strDateTo.equals("") && strcBpartnerId.equals("") && strPartner.equals("")){
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strcBpartnerId, strPartner, strProject, strExpense);
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strcBpartnerId, strPartner, strProject, strExpense, strCurrencyId);
     } else {
-      data1 = ReportExpenseData.select(this, vars.getLanguage(), Utility.getContext(this, vars, "#User_Client", "ReportExpense"), Utility.getContext(this, vars, "#User_Org", "ReportExpense"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strcBpartnerId, strPartner, strProject, (strExpense.equals("time")?"Y":""), (strExpense.equals("expense")?"N":""));
+      String strBaseCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
+      try {        
+        data1 = ReportExpenseData.select(this, strCurrencyId, strBaseCurrencyId, vars.getLanguage(), Utility.getContext(this, vars, "#User_Client", "ReportExpense"), Utility.getContext(this, vars, "#User_Org", "ReportExpense"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strcBpartnerId, strPartner, strProject, (strExpense.equals("time")?"Y":""), (strExpense.equals("expense")?"N":""));
+      } catch(ServletException ex) {
+        myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+      }
     }
-    xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportExpenseEdit").createXmlDocument();
-
-
-    
-
-
-    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
-    xmlDocument.setParameter("paramLanguage", "defaultLang=\"" + vars.getLanguage() + "\";");
-    xmlDocument.setParameter("theme", vars.getTheme());
-
-    xmlDocument.setData("structure1", data1);
-
-    out.println(xmlDocument.print());
-    out.close();
+    strConvRateErrorMsg = myMessage.getMessage();
+    //If a conversion rate is missing for a certain transaction, an error message window pops-up.
+    if(!strConvRateErrorMsg.equals("") && strConvRateErrorMsg != null) {
+      advisePopUp(response, "ERROR", Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()), strConvRateErrorMsg);
+    } else { //Otherwise, the report is launched
+      xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportExpenseEdit").createXmlDocument();
+  
+      xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
+      xmlDocument.setParameter("paramLanguage", "defaultLang=\"" + vars.getLanguage() + "\";");
+      xmlDocument.setParameter("theme", vars.getTheme());
+  
+      xmlDocument.setData("structure1", data1);
+  
+      out.println(xmlDocument.print());
+      out.close();
+    }
   }
   
-  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strPartner, String strProject, String strExpense)
+  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strPartner, String strProject, String strExpense, String strCurrencyId)
     throws IOException, ServletException {
     if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
     response.setContentType("text/html; charset=UTF-8");
@@ -160,6 +176,16 @@
       throw new ServletException(ex);
     }  
 
+    xmlDocument.setParameter("ccurrencyid", strCurrencyId);    
+    try {
+      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Currency_ID", "", "", Utility.getContext(this, vars, "#User_Org", "ReportExpense"), Utility.getContext(this, vars, "#User_Client", "ReportExpense"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportExpense", strCurrencyId);
+      xmlDocument.setData("reportC_Currency_ID","liststructure", comboTableData.select(false));
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
+    
     out.println(xmlDocument.print());
     out.close();
   }
--- a/src/org/openbravo/erpCommon/ad_reports/ReportExpense.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportExpense.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -54,5 +54,8 @@
   <SUBREPORT id="reportC_Project_ID" name="reportC_Project_ID" report="org/openbravo/erpCommon/reference/List">
     <ARGUMENT name="parameterListSelected" withId="paramProject"/>
   </SUBREPORT> 
-  
+  <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/ReportExpense_data.xsql	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportExpense_data.xsql	Thu Oct 30 17:30:39 2008 +0000
@@ -24,11 +24,13 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
     <![CDATA[
-      SELECT CBE.NAME AS EMPLOYEE, (CASE S_L.ISTIMEREPORT WHEN 'Y' THEN S_L.QTY ELSE 0 END) * C_CALCULATECOST_CATSALARY(C_CALCULATE_CATSALARY(s.c_bpartner_id,  (CASE WHEN S_L.DATEEXPENSE IS NULL THEN S.DATEREPORT ELSE S_L.DATEEXPENSE END)), (CASE WHEN S_L.DATEEXPENSE IS NULL THEN S.DATEREPORT ELSE S_L.DATEEXPENSE END)) AS COST, 
+      SELECT C_CURRENCY_ISOSYM(?) AS CONVISOSYM, CBE.NAME AS EMPLOYEE, (CASE S_L.ISTIMEREPORT WHEN 'Y' THEN S_L.QTY ELSE 0 END) * 
+      	  C_CURRENCY_CONVERT(C_CALCULATECOST_CATSALARY(C_CALCULATE_CATSALARY(s.c_bpartner_id,  (CASE WHEN S_L.DATEEXPENSE IS NULL THEN S.DATEREPORT ELSE S_L.DATEEXPENSE END)), (CASE WHEN S_L.DATEEXPENSE IS NULL THEN S.DATEREPORT ELSE S_L.DATEEXPENSE END)),
+      	  ?, ?, (CASE WHEN S_L.DATEEXPENSE IS NULL THEN S.DATEREPORT ELSE S_L.DATEEXPENSE END), NULL, S_L.AD_CLIENT_ID, S_L.AD_ORG_ID) AS COST, 
 	      CBC.NAME AS NAME, (P.VALUE || ' - ' ||P.NAME) AS DESCR, M_PRODUCT.NAME AS PRODUCTNAME, C_UOM.NAME AS UOMNAME,
 	      (CASE S_L.ISTIMEREPORT WHEN 'N' THEN S_L.QTY ELSE 0 END) AS QTY, (CASE S_L.ISTIMEREPORT WHEN 'Y' THEN S_L.QTY ELSE 0 END) AS HORAS, 
 	      (CASE WHEN S_L.DATEEXPENSE IS NULL THEN S.DATEREPORT ELSE S_L.DATEEXPENSE END) AS DATEEXPENSE, 
-	      (CASE WHEN S_L.ISTIMEREPORT ='N' THEN (CASE WHEN S_L.CONVERTEDAMT IS NOT NULL THEN S_L.CONVERTEDAMT ELSE COALESCE(S_L.EXPENSEAMT,0) END) ELSE 0 END) AS INVOICEPRICE, 
+	      (CASE WHEN S_L.ISTIMEREPORT ='N' THEN C_CURRENCY_CONVERT(COALESCE(S_L.EXPENSEAMT,0), S_L.C_CURRENCY_ID, ?, (CASE WHEN S_L.DATEEXPENSE IS NULL THEN S.DATEREPORT ELSE S_L.DATEEXPENSE END), NULL, S_L.AD_CLIENT_ID, S_L.AD_ORG_ID) ELSE 0 END) AS INVOICEPRICE, 
 	      AD_MESSAGE_GET2(S.PROCESSED,?) AS PROCESSED, (CASE WHEN S_L.DESCRIPTION IS NULL THEN S.DESCRIPTION ELSE S_L.DESCRIPTION END) AS DESCRIPTION, S_L.S_TIMEEXPENSELINE_ID, S.DOCUMENTNO
       FROM S_TIMEEXPENSE S, C_BPARTNER CBE, M_PRODUCT, C_UOM, S_TIMEEXPENSELINE S_L
       LEFT JOIN C_PROJECT P ON S_L.C_PROJECT_ID = P.C_PROJECT_ID
@@ -43,6 +45,10 @@
       ORDER BY NAME, DESCR, EMPLOYEE, PRODUCTNAME, DATEEXPENSE DESC
   ]]></Sql>
     <Field name="rownum" value="count"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyBase"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
     <Parameter name="adLanguage"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND S.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="adOrgClient" type="replace" optional="true" after="AND S.AD_ORG_ID IN (" text="'1'"/>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml	Thu Oct 30 17:30:39 2008 +0000
@@ -588,9 +588,31 @@
 		<defaultValueExpression ><![CDATA[new Locale("en","US")]]></defaultValueExpression>
 	</parameter>
 	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<queryString><![CDATA[SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(COST) AS COST, SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(COSTREF) AS COSTREF, SUM(WEIGHT) AS WEIGHT, SUM(WEIGHT_REF) AS WEIGHTREF, '' AS ID, '' AS NAME, UOMSYMBOL
+	<queryString><![CDATA[SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST,
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF, UOMSYMBOL,
+      SUM(CONVAMOUNT) AS CONVAMOUNT,           	        	  
+	  SUM(CONVCOST) AS CONVCOST,                 
+	  SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,
+	  SUM(CONVCOSTREF) AS CONVCOSTREF,
+	  C_CURRENCY_SYMBOL('102', 0, 'Y') AS CONVSYM,	  	  
+	  C_CURRENCY_ISOSYM('102') AS CONVISOSYM,
+      '' AS ID, '' AS NAME, '' AS TRANSCURRENCYID, '' AS TRANSDATE, '' AS TRANSCLIENTID, '' AS TRANSORGID
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST, 
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT_REF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF, UOMSYMBOL,     	  
+	  C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT, 
+	  C_CURRENCY_CONVERT(SUM(COST), '102', '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVCOST,    	  
+	  C_CURRENCY_CONVERT(SUM(LINENETREF), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF, 
+	  C_CURRENCY_CONVERT(SUM(COSTREF), '102', '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVCOSTREF,      
+	  TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID
       FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('16') AS NIVEL8, to_char('18') AS NIVEL9, to_char('20') AS NIVEL10,
-      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COST, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, 0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS COSTREF, 0 AS WEIGHT_REF, C_UOM.UOMSYMBOL
+      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COST, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF, 0 AS COSTREF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICE left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
                      left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID,
            C_INVOICELINE left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
@@ -606,9 +628,16 @@
       AND C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
       AND C_INVOICE.ISSOTRX = 'Y'
       AND C_INVOICE.PROCESSED = 'Y'
+      AND 0=0 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN ('7')
       AND 1=1
       UNION ALL SELECT to_char('8') AS NIVEL1 , to_char('9') AS NIVEL2 , to_char('10') AS NIVEL3 , to_char('11') AS NIVEL4 , to_char('12') AS NIVEL5 , to_char('13') AS NIVEL6 , to_char('14') AS NIVEL7 , to_char('17') AS NIVEL8 , to_char('19') AS NIVEL9 , to_char('21') AS NIVEL10,
-      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS COST, 0 AS COST, C_INVOICELINE.LINENETAMT AS LINENETREF, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COSTREF, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF, C_UOM.UOMSYMBOL
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT, 0 AS COST, 
+      C_INVOICELINE.LINENETAMT AS LINENETREF, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COSTREF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICE left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
                      left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID, 
            C_INVOICELINE left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
@@ -624,11 +653,12 @@
       AND C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
       AND C_INVOICE.ISSOTRX = 'Y'
       AND C_INVOICE.PROCESSED = 'Y'
+      AND 3=3 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN('14')
       AND 2=2
       ORDER BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10) AA
-      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, 1
- HAVING SUM(LINENETAMT)<>0
-$P!{orderBy}]]></queryString>
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, CONVSYM, CONVISOSYM, 1]]></queryString>
 
 	<field name="NIVEL1" class="java.lang.String"/>
 	<field name="NIVEL2" class="java.lang.String"/>
@@ -651,6 +681,12 @@
 	<field name="ID" class="java.lang.String"/>
 	<field name="NAME" class="java.lang.String"/>
 	<field name="UOMSYMBOL" class="java.lang.String"/>
+	<field name="CONVAMOUNT" class="java.math.BigDecimal"/>
+	<field name="CONVCOST" class="java.math.BigDecimal"/>
+	<field name="CONVAMOUNTREF" class="java.math.BigDecimal"/>
+	<field name="CONVCOSTREF" class="java.math.BigDecimal"/>
+	<field name="CONVSYM" class="java.lang.String"/>
+	<field name="CONVISOSYM" class="java.lang.String"/>
 
 	<variable name="QTY_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
 		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
@@ -713,130 +749,130 @@
 		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_TOTAL" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_TOTAL" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNTREF_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="COSTREF_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
-		<variableExpression><![CDATA[$F{COSTREF}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
 	</variable>
 	<variable name="PROFIT_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Nothing">
 		<variableExpression><![CDATA[$V{AMOUNT_SUM1}.subtract($V{COST_SUM1})]]></variableExpression>
@@ -1645,38 +1681,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==2)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-60"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="15"
-						y="0"
-						width="799"
-						height="0"
-						key="line-6">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==2)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -1949,56 +1955,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==3)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-56"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-58"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="30"
-						y="0"
-						width="784"
-						height="0"
-						key="line-7">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==3)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -2286,74 +2244,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==4)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-52"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-53"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-54"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="45"
-						y="0"
-						width="769"
-						height="0"
-						key="line-8">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==4)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -2656,92 +2548,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==5)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-48"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-49"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-50"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-51"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="60"
-						y="0"
-						width="754"
-						height="0"
-						key="line-9">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==5)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -3059,110 +2867,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-44"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-45"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-46"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-47"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="75"
-						y="0"
-						width="739"
-						height="0"
-						key="line-10">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-121"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -3495,128 +3201,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==7)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-122"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="90"
-						y="0"
-						width="724"
-						height="0"
-						key="line-11">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-123"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-124"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-125"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-126"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level6_Line"
-						mode="Opaque"
-						x="75"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-127"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -3964,146 +3550,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==8)]]></printWhenExpression>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="105"
-						y="0"
-						width="709"
-						height="0"
-						key="line-12">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level6_Line"
-						mode="Opaque"
-						x="75"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-128"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-129"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-130"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-131"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-132"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-133"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level7_Line"
-						mode="Opaque"
-						x="90"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-134"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -4466,164 +3914,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==9)]]></printWhenExpression>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="120"
-						y="0"
-						width="694"
-						height="0"
-						key="line-13">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level7_Line"
-						mode="Opaque"
-						x="90"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-135"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level6_Line"
-						mode="Opaque"
-						x="75"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-136"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-137"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-138"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-139"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-140"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-141"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level8_Line"
-						mode="Opaque"
-						x="105"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-142"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -5001,182 +4293,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==10)]]></printWhenExpression>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="135"
-						y="0"
-						width="679"
-						height="0"
-						key="line-14">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level8_Line"
-						mode="Opaque"
-						x="105"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-143"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level7_Line"
-						mode="Opaque"
-						x="90"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-144"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level6_Line"
-						mode="Opaque"
-						x="75"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-145"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-146"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-147"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-148"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-149"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-150"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level9_Line"
-						mode="Opaque"
-						x="120"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-151"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -5569,7 +4687,7 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==11)]]></printWhenExpression>
 			</band>
 			</groupFooter>
@@ -6000,6 +5118,21 @@
 					</textElement>
 				<text><![CDATA[Q. ref]]></text>
 				</staticText>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Header"
+						x="170"
+						y="0"
+						width="52"
+						height="18"
+						key="textField-308"
+						positionType="Float"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center" rotation="None">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
+				</textField>
 				</frame>				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Title"
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java	Thu Oct 30 17:30:39 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -42,7 +42,8 @@
   public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
 
-
+    //Get user Client's base currency
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
     if (vars.commandIn("DEFAULT", "DEFAULT_COMPARATIVE")){
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportInvoiceCustomerDimensionalAnalysesJR|dateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportInvoiceCustomerDimensionalAnalysesJR|dateTo", "");
@@ -62,11 +63,12 @@
       String strMayor = vars.getGlobalVariable("inpMayor", "ReportInvoiceCustomerSalesDimensionalAnalyze|mayor", "");
       String strMenor = vars.getGlobalVariable("inpMenor", "ReportInvoiceCustomerDimensionalAnalyze|menor", "");
       String strPartnerSalesRepId = vars.getGlobalVariable("inpPartnerSalesrepId", "ReportInvoiceCustomerDimensionalAnalysesJR|partnersalesrep", "");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceCustomerDimensionalAnalysesJR|currency", strUserCurrencyId);
       String strComparative = "";
       if (vars.commandIn("DEFAULT_COMPARATIVE")) strComparative = vars.getRequestGlobalVariable("inpComparative", "ReportInvoiceCustomerDimensionalAnalysesJR|comparative");
       else strComparative = vars.getGlobalVariable("inpComparative", "ReportInvoiceCustomerDimensionalAnalysesJR|comparative", "N");
       printPageDataSheet(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown,
-          strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId, strProducttype, strOrder, strMayor, strMenor, strPartnerSalesRepId);
+          strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId, strProducttype, strOrder, strMayor, strMenor, strPartnerSalesRepId, strCurrencyId);
     }else if (vars.commandIn("EDIT_HTML", "EDIT_HTML_COMPARATIVE")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom", "ReportInvoiceCustomerDimensionalAnalysesJR|dateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportInvoiceCustomerDimensionalAnalysesJR|dateTo");
@@ -87,8 +89,9 @@
       String strMenor = vars.getStringParameter("inpMenor", "");
       String strComparative = vars.getStringParameter("inpComparative", "N");
       String strPartnerSalesrepId = vars.getRequestGlobalVariable("inpPartnerSalesrepId", "ReportInvoiceCustomerDimensionalAnalysesJR|partnersalesrep");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceCustomerDimensionalAnalysesJR|currency", strUserCurrencyId);
       printPageHtml(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown,
-          strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId, strProducttype, strOrder, strMayor, strMenor, strPartnerSalesrepId, "html");
+          strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId, strProducttype, strOrder, strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "html");
     }else if (vars.commandIn("EDIT_PDF", "EDIT_PDF_COMPARATIVE")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom", "ReportInvoiceCustomerDimensionalAnalysesJR|dateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportInvoiceCustomerDimensionalAnalysesJR|dateTo");
@@ -109,12 +112,13 @@
       String strMenor = vars.getStringParameter("inpMenor", "");
       String strComparative = vars.getStringParameter("inpComparative", "N");
       String strPartnerSalesrepId = vars.getRequestGlobalVariable("inpPartnerSalesrepId", "ReportInvoiceCustomerDimensionalAnalysesJR|partnersalesrep");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceCustomerDimensionalAnalysesJR|currency", strUserCurrencyId);
       printPageHtml(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown,
-          strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId, strProducttype, strOrder, strMayor, strMenor, strPartnerSalesrepId, "pdf");
+          strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId, strProducttype, strOrder, strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "pdf");
     } else pageErrorPopUp(response);
   }
 
-  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strsalesrepId, String strcProjectId, String strProducttype, String strOrder, String strMayor, String strMenor, String strPartnerSalesrepId) throws IOException, ServletException {
+  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strsalesrepId, String strcProjectId, String strProducttype, String strOrder, String strMayor, String strMenor, String strPartnerSalesrepId, String strCurrencyId) throws IOException, ServletException {
     if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
     String discard[]={"selEliminarHeader1"};
     if (strComparative.equals("Y")) {
@@ -232,6 +236,16 @@
     } catch (Exception ex) {
       throw new ServletException(ex);
     }
+    
+    xmlDocument.setParameter("ccurrencyid", strCurrencyId);    
+    try {
+      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Currency_ID", "", "", Utility.getContext(this, vars, "#User_Org", "ReportInvoiceCustomerDimensionalAnalysesJR"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceCustomerDimensionalAnalysesJR"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoiceCustomerDimensionalAnalysesJR", strCurrencyId);
+      xmlDocument.setData("reportC_Currency_ID","liststructure", comboTableData.select(false));
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
 
 
     if (vars.getLanguage().equals("en_US")) {
@@ -248,7 +262,7 @@
     out.close();
   }
 
-  void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strsalesrepId, String strcProjectId, String strProducttype, String strOrder, String strMayor, String strMenor, String strPartnerSalesrepId, String strOutput) throws IOException, ServletException{
+  void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strsalesrepId, String strcProjectId, String strProducttype, String strOrder, String strMayor, String strMenor, String strPartnerSalesrepId, String strCurrencyId, String strOutput) throws IOException, ServletException{
     if (log4j.isDebugEnabled()) log4j.debug("Output: print html");
     String strOrderby = "";
     String[] discard = {"", "", "", "", "","", "", "", "", ""};
@@ -373,9 +387,9 @@
         if (strOrder.equals("Normal")){
           strOrderby = " ORDER BY NIVEL"+k;
         } else if (strOrder.equals("Amountasc")){
-          strOrderby = " ORDER BY AMOUNT ASC";
+          strOrderby = " ORDER BY CONVAMOUNT ASC";
         } else if (strOrder.equals("Amountdesc")){
-          strOrderby = " ORDER BY AMOUNT DESC";
+          strOrderby = " ORDER BY CONVAMOUNT DESC";
         } else{
           strOrderby = "1";
         }
@@ -383,9 +397,9 @@
         if (strOrder.equals("Normal")){
           strOrderby += "NIVEL"+k;
         } else if (strOrder.equals("Amountasc")){
-          strOrderby += "AMOUNT ASC";
+          strOrderby += "CONVAMOUNT ASC";
         } else if (strOrder.equals("Amountdesc")){
-          strOrderby += "AMOUNT DESC";
+          strOrderby += "CONVAMOUNT DESC";
         } else{
           strOrderby = "1";
         }
@@ -395,36 +409,59 @@
       strOrderby = " ORDER BY 1";
     }
     String strHaving = "";
-    if (!strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) > "+strMayor+" AND SUM(LINENETAMT) < "+strMenor;}
-    else if (!strMayor.equals("") && strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) > "+strMayor;}
-    else if (strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) < "+strMenor;}
-    else{ strHaving = " HAVING SUM(LINENETAMT) <> 0 OR SUM(LINENETREF) <> 0";}
+    if (!strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING (SUM(CONVAMOUNT) > "+strMayor+" AND SUM(CONVAMOUNT) < "+strMenor+")";}
+    else if (!strMayor.equals("") && strMenor.equals("")) {strHaving = " HAVING (SUM(CONVAMOUNT) > "+strMayor+")";}
+    else if (strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING (SUM(CONVAMOUNT) < "+strMenor+")";}
+    else{ strHaving = " HAVING (SUM(CONVAMOUNT) <> 0 OR SUM(CONVAMOUNTREF) <> 0)";}
     strOrderby = strHaving + strOrderby;
-    String strReportPath;
+    
+    //Checks if there is a conversion rate for each of the transactions of the report
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
+    String strBaseCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
     if (strComparative.equals("Y")){
-      strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml";
-      data = ReportInvoiceCustomerDimensionalAnalysesJRData.select(this, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8], strTextShow[9], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId, strcProjectId, strProducttype, strDateFromRef, DateTimeData.nDaysAfter(this, strDateToRef,"1"), strOrderby);
+      try {
+        data = ReportInvoiceCustomerDimensionalAnalysesJRData.select(this, strCurrencyId, strBaseCurrencyId, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8], strTextShow[9], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId, strcProjectId, strProducttype, strDateFromRef, DateTimeData.nDaysAfter(this, strDateToRef,"1"), strOrderby);
+      } catch(ServletException ex) {
+        myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+      }
     } else {
-      strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesNoComparativeJR.jrxml";
-      data = ReportInvoiceCustomerDimensionalAnalysesJRData.selectNoComparative(this, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8], strTextShow[9], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId, strcProjectId, strProducttype, strOrderby);
+      try {
+        data = ReportInvoiceCustomerDimensionalAnalysesJRData.selectNoComparative(this, strCurrencyId, strBaseCurrencyId, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8], strTextShow[9], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId, strcProjectId, strProducttype, strOrderby);
+      } catch(ServletException ex) {
+        myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+      }
     }
-
-    HashMap<String, Object> parameters = new HashMap<String, Object>();
-    parameters.put("LEVEL1_LABEL", strLevelLabel[0]);
-    parameters.put("LEVEL2_LABEL", strLevelLabel[1]);
-    parameters.put("LEVEL3_LABEL", strLevelLabel[2]);
-    parameters.put("LEVEL4_LABEL", strLevelLabel[3]);
-    parameters.put("LEVEL5_LABEL", strLevelLabel[4]);
-    parameters.put("LEVEL6_LABEL", strLevelLabel[5]);
-    parameters.put("LEVEL7_LABEL", strLevelLabel[6]);
-    parameters.put("LEVEL8_LABEL", strLevelLabel[7]);
-    parameters.put("LEVEL9_LABEL", strLevelLabel[8]);
-    parameters.put("LEVEL10_LABEL", strLevelLabel[9]);
-    parameters.put("DIMENSIONS", new Integer(intOrder));
-    parameters.put("REPORT_TITLE", classInfo.name);
-    parameters.put("REPORT_SUBTITLE", strTitle);
-    parameters.put("PRODUCT_LEVEL", new Integer(intProductLevel));
-    renderJR(vars, response, strReportPath, strOutput, parameters, data, null );
+    strConvRateErrorMsg = myMessage.getMessage();
+    //If a conversion rate is missing for a certain transaction, an error message window pops-up.
+    if(!strConvRateErrorMsg.equals("") && strConvRateErrorMsg != null) {
+      advisePopUp(response, "ERROR", Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()), strConvRateErrorMsg);      
+    } else { //Otherwise, the report is launched
+      String strReportPath;
+      if (strComparative.equals("Y")){
+        strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml";
+      } else {
+        strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesNoComparativeJR.jrxml";
+      }
+  
+      HashMap<String, Object> parameters = new HashMap<String, Object>();
+      parameters.put("LEVEL1_LABEL", strLevelLabel[0]);
+      parameters.put("LEVEL2_LABEL", strLevelLabel[1]);
+      parameters.put("LEVEL3_LABEL", strLevelLabel[2]);
+      parameters.put("LEVEL4_LABEL", strLevelLabel[3]);
+      parameters.put("LEVEL5_LABEL", strLevelLabel[4]);
+      parameters.put("LEVEL6_LABEL", strLevelLabel[5]);
+      parameters.put("LEVEL7_LABEL", strLevelLabel[6]);
+      parameters.put("LEVEL8_LABEL", strLevelLabel[7]);
+      parameters.put("LEVEL9_LABEL", strLevelLabel[8]);
+      parameters.put("LEVEL10_LABEL", strLevelLabel[9]);
+      parameters.put("DIMENSIONS", new Integer(intOrder));
+      parameters.put("REPORT_TITLE", classInfo.name);
+      parameters.put("REPORT_SUBTITLE", strTitle);
+      parameters.put("PRODUCT_LEVEL", new Integer(intProductLevel));
+      renderJR(vars, response, strReportPath, strOutput, parameters, data, null );
+    }
   }
 
   public String getServletInfo() {
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html	Thu Oct 30 17:30:39 2008 +0000
@@ -13,7 +13,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SL
- * All portions are Copyright (C) 2001-2006 Openbravo SL
+ * All portions are Copyright (C) 2001-2008 Openbravo SL
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -54,6 +54,11 @@
 function validate(action)
 {
 	var frm = document.frmMain;
+	if (frm.inpCurrencyId.value == null || frm.inpCurrencyId.value == "") {
+	    setWindowElementFocus(frm.inpCurrencyId);
+	    showJSMessage(7);
+	    return false;
+	}
 	if (frm.inpDateFrom.value == null || frm.inpDateFrom.value == "") {
 		setWindowElementFocus(frm.inpDateFrom);
 		showJSMessage(7);
@@ -347,8 +352,12 @@
                   <TD class="TitleCell"><SPAN class="LabelText">Less Than</SPAN></TD>
                   <TD class="TextBox_ContentCell"> <INPUT dojoType="openbravo:RealNumberTextbox" greaterThan="paramMayor" class="TextBox_OneCell_width" type="text" name="inpMenor" maxlength="10" id="paramMenor" value=""></INPUT><script>djConfig.searchIds.push("paramMenor");</script>
                   </TD>
-                  <TD class="TitleCell"></TD>
-                  <TD class="ContentCell"></TD>
+                  <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>
                 </TR>
                 <TR>
                   <td colspan="6">
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
 * under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SL 
-* All portions are Copyright (C) 2001-2006 Openbravo SL 
+* All portions are Copyright (C) 2001-2008 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
@@ -102,5 +102,9 @@
   <SUBREPORT id="reportPartnerSalesRep_ID" name="reportPartnerSalesRep_ID" report="org/openbravo/erpCommon/reference/List">
     <ARGUMENT name="parameterListSelected" withId="paramPartnerSalesRepId"/>
   </SUBREPORT>
+  <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> 
   <DISCARD id="discard"/>
 </REPORT>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_data.xsql	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_data.xsql	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -24,9 +24,31 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
     <![CDATA[
-      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(COST) AS COST, SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(COSTREF) AS COSTREF, SUM(WEIGHT) AS WEIGHT, SUM(WEIGHT_REF) AS WEIGHTREF, '' AS ID, '' AS NAME, UOMSYMBOL
+      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST,
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF, UOMSYMBOL,
+      SUM(CONVAMOUNT) AS CONVAMOUNT,           	        	  
+	  SUM(CONVCOST) AS CONVCOST,                 
+	  SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,
+	  SUM(CONVCOSTREF) AS CONVCOSTREF,
+	  C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,	  	  
+	  C_CURRENCY_ISOSYM(?) AS CONVISOSYM,
+      '' AS ID, '' AS NAME, '' AS TRANSCURRENCYID, '' AS TRANSDATE, '' AS TRANSCLIENTID, '' AS TRANSORGID
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST, 
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT_REF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF, UOMSYMBOL,     	  
+	  C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT, 
+	  C_CURRENCY_CONVERT(SUM(COST), ?, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVCOST,    	  
+	  C_CURRENCY_CONVERT(SUM(LINENETREF), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF, 
+	  C_CURRENCY_CONVERT(SUM(COSTREF), ?, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVCOSTREF,      
+	  TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID
       FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('16') AS NIVEL8, to_char('18') AS NIVEL9, to_char('20') AS NIVEL10,
-      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COST, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, 0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS COSTREF, 0 AS WEIGHT_REF, C_UOM.UOMSYMBOL
+      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COST, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF, 0 AS COSTREF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICE left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
                      left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID,
            C_INVOICELINE left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
@@ -42,11 +64,16 @@
       AND C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
       AND C_INVOICE.ISSOTRX = 'Y'
       AND C_INVOICE.PROCESSED = 'Y'
-      AND 0=0 AND AD_ORG.AD_ORG_ID IN ('1')
+      AND 0=0 AND C_INVOICE.AD_ORG_ID IN ('1')
       AND C_INVOICE.AD_CLIENT_ID IN ('7')
       AND 1=1
       UNION ALL SELECT to_char('8') AS NIVEL1 , to_char('9') AS NIVEL2 , to_char('10') AS NIVEL3 , to_char('11') AS NIVEL4 , to_char('12') AS NIVEL5 , to_char('13') AS NIVEL6 , to_char('14') AS NIVEL7 , to_char('17') AS NIVEL8 , to_char('19') AS NIVEL9 , to_char('21') AS NIVEL10,
-      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS COST, 0 AS COST, C_INVOICELINE.LINENETAMT AS LINENETREF, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COSTREF, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF, C_UOM.UOMSYMBOL
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT, 0 AS COST, 
+      C_INVOICELINE.LINENETAMT AS LINENETREF, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COSTREF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICE left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
                      left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID, 
            C_INVOICELINE left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
@@ -62,12 +89,21 @@
       AND C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
       AND C_INVOICE.ISSOTRX = 'Y'
       AND C_INVOICE.PROCESSED = 'Y'
-      AND 3=3 AND AD_ORG.AD_ORG_ID IN ('1')
+      AND 3=3 AND C_INVOICE.AD_ORG_ID IN ('1')
       AND C_INVOICE.AD_CLIENT_ID IN('14')
       AND 2=2
       ORDER BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10) AA
-      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, CONVSYM, CONVISOSYM, 1
      ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyBase"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyBase"/>
+	<Parameter name="cCurrencyConv"/>
     <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
     <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
     <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
@@ -78,7 +114,7 @@
     <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7, to_char(" text="'16'"/>
     <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8, to_char(" text="'18'"/>
     <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9, to_char(" text="'20'"/>
-    <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND AD_ORG.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'7'"/>
     <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
     <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
@@ -100,7 +136,7 @@
     <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7 , to_char(" text="'17'"/>
     <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8 , to_char(" text="'19'"/>
     <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9 , to_char(" text="'21'"/>
-    <Parameter name="adOrgId" optional="true" type="replace" after="AND 3=3 AND AD_ORG.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 3=3 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN(" text="'14'"/>
     <Parameter name="dateFromRef" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
     <Parameter name="dateToRef" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
@@ -112,7 +148,7 @@
     <Parameter name="partnerSalesrepId" optional="true" after="AND 2=2"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
     <Parameter name="cProjectId" optional="true" after="AND 2=2"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
     <Parameter name="producttype" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
-    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL" text=", 1"/>
+    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, CONVSYM, CONVISOSYM" text=", 1"/>
   </SqlMethod>
   <SqlMethod name="set" type="constant" return="multiple">
       <SqlMethodComment></SqlMethodComment>
@@ -122,9 +158,30 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
     <![CDATA[
-      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(COST) AS COST, SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT) AS WEIGHT, SUM(WEIGHT_REF) AS WEIGHTREF, '' AS ID, '' AS NAME, UOMSYMBOL
+      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10,
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST, 
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, UOMSYMBOL,
+      SUM(CONVAMOUNT) AS CONVAMOUNT,  
+      SUM(CONVCOST) AS CONVCOST,               
+	  SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,
+	  SUM(CONVCOSTREF) AS CONVCOSTREF,           
+	  C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,      	  
+	  C_CURRENCY_ISOSYM(?) AS CONVISOSYM
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST,
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT_REF) AS WEIGHTREF, UOMSYMBOL,
+      C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT,
+      C_CURRENCY_CONVERT(SUM(COST), ?, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVCOST,
+	  0 AS CONVAMOUNTREF,
+	  0 AS CONVCOSTREF,
+      TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID
       FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('9') AS NIVEL8, to_char('10') AS NIVEL9, to_char('11') AS NIVEL10,
-      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COST, 0 AS LINENETREF, 0 AS QTYINVOICEDREF, C_UOM.UOMSYMBOL, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, 0 AS WEIGHT_REF
+      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COST,
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICE left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
                      left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID,
            C_INVOICELINE left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
@@ -140,12 +197,18 @@
       AND C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
       AND C_INVOICE.ISSOTRX = 'Y'
       AND C_INVOICE.PROCESSED = 'Y'
-      AND AD_ORG.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_ORG_ID IN ('1')
       AND C_INVOICE.AD_CLIENT_ID IN ('7')
       AND 1=1
       ORDER BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10) AA
-      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, CONVSYM, CONVISOSYM, 1
      ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyBase"/>
+	<Parameter name="cCurrencyConv"/>
     <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
     <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
     <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
@@ -156,7 +219,7 @@
     <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7, to_char(" text="'9'"/>
     <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8, to_char(" text="'10'"/>
     <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9, to_char(" text="'11'"/>
-    <Parameter name="adOrgId" optional="true" type="replace" after="AND AD_ORG.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'7'"/>
     <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
     <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
@@ -168,7 +231,7 @@
     <Parameter name="partnerSalesrepId" optional="true" after="AND 1=1"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
     <Parameter name="cProjectId" optional="true" after="AND 1=1"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
     <Parameter name="producttype" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
-    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL" text=", 1"/>
+    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, CONVSYM, CONVISOSYM" text=", 1"/>
   </SqlMethod>
   <SqlMethod name="selectTotal" type="preparedStatement" return="String" default="0">
     <SqlMethodComment></SqlMethodComment>
@@ -371,5 +434,4 @@
      <Parameter name="lang"/> 
      <Parameter name="shown" optional="true" type="argument" after="WHERE 1=1 "><![CDATA[AND ID IN]]></Parameter>
   </SqlMethod>
-
 </SqlClass>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesNoComparativeJR.jrxml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesNoComparativeJR.jrxml	Thu Oct 30 17:30:39 2008 +0000
@@ -585,10 +585,30 @@
 		<defaultValueExpression ><![CDATA[new Locale("en","US")]]></defaultValueExpression>
 	</parameter>
 	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<queryString><![CDATA[SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(COST) AS COST, SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT) AS WEIGHT, SUM(WEIGHT_REF) AS WEIGHTREF, '' AS ID, '' AS NAME, UOMSYMBOL
-      FROM (SELECT to_char(C_BP_GROUP.NAME) AS NIVEL1, to_char(AD_COLUMN_IDENTIFIER(to_char('C_Bpartner'), to_char( C_BPARTNER.C_BPARTNER_ID), to_char( 'en_US'))) AS NIVEL2, to_char(C_PROJECT.NAME
-) AS NIVEL3, to_char(M_PRODUCT_CATEGORY.NAME) AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('9') AS NIVEL8, to_char('10') AS NIVEL9, to_char('11') AS NIVEL10,
-      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COST, 0 AS LINENETREF, 0 AS QTYINVOICEDREF, C_UOM.UOMSYMBOL, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, 0 AS WEIGHT_REF
+	<queryString><![CDATA[SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10,
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST, 
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, UOMSYMBOL,
+      SUM(CONVAMOUNT) AS CONVAMOUNT,  
+      SUM(CONVCOST) AS CONVCOST,               
+	  SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,
+	  SUM(CONVCOSTREF) AS CONVCOSTREF,           
+	  C_CURRENCY_SYMBOL('102', 0, 'Y') AS CONVSYM,      	  
+	  C_CURRENCY_ISOSYM('102') AS CONVISOSYM
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST,
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT_REF) AS WEIGHTREF, UOMSYMBOL,
+      C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT,
+      C_CURRENCY_CONVERT(SUM(COST), '102', '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVCOST,
+	  0 AS CONVAMOUNTREF,
+	  0 AS CONVCOSTREF,
+      TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID
+      FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('9') AS NIVEL8, to_char('10') AS NIVEL9, to_char('11') AS NIVEL10,
+      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, M_GET_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, NULL)*C_INVOICELINE.QTYINVOICED AS COST,
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICE left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
                      left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID,
            C_INVOICELINE left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
@@ -604,11 +624,12 @@
       AND C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
       AND C_INVOICE.ISSOTRX = 'Y'
       AND C_INVOICE.PROCESSED = 'Y'
-      AND AD_ORG.AD_ORG_ID IN ('1000000')
-      AND C_INVOICE.AD_CLIENT_ID IN ('1000000')
+      AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN ('7')
       AND 1=1
       ORDER BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10) AA
-      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, 1]]></queryString>
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, UOMSYMBOL, CONVSYM, CONVISOSYM, 1]]></queryString>
 
 	<field name="NIVEL1" class="java.lang.String"/>
 	<field name="NIVEL2" class="java.lang.String"/>
@@ -630,6 +651,12 @@
 	<field name="ID" class="java.lang.String"/>
 	<field name="NAME" class="java.lang.String"/>
 	<field name="UOMSYMBOL" class="java.lang.String"/>
+	<field name="CONVAMOUNT" class="java.math.BigDecimal"/>
+	<field name="CONVCOST" class="java.math.BigDecimal"/>
+	<field name="CONVAMOUNTREF" class="java.math.BigDecimal"/>
+	<field name="CONVCOSTREF" class="java.math.BigDecimal"/>
+	<field name="CONVSYM" class="java.lang.String"/>
+	<field name="CONVISOSYM" class="java.lang.String"/>
 
 	<variable name="QTY_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
 		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
@@ -662,67 +689,67 @@
 		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_TOTAL" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL5" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL6" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL7" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL8" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL9" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="AMOUNT_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL10" calculation="Sum">
-		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL5" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL6" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL7" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL8" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL9" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="COST_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="LEVEL10" calculation="Sum">
-		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
 	</variable>
 	<variable name="PROFIT_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Nothing">
 		<variableExpression><![CDATA[$V{AMOUNT_SUM1}.subtract($V{COST_SUM1})]]></variableExpression>
@@ -856,15 +883,6 @@
 					</textElement>
 				<text><![CDATA[Total:]]></text>
 				</staticText>
-				<line direction="TopDown">
-					<reportElement
-						x="0"
-						y="0"
-						width="483"
-						height="0"
-						key="line-3"/>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Header"
@@ -963,6 +981,15 @@
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{WEIGHT_TOTAL}!=null)?$P{NUMBERFORMAT}.format($V{WEIGHT_TOTAL}):new String(" ")]]></textFieldExpression>
 				</textField>
+				<line direction="TopDown">
+					<reportElement
+						x="0"
+						y="0"
+						width="483"
+						height="0"
+						key="line-5"/>
+					<graphicElement stretchType="NoStretch"/>
+				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -1098,38 +1125,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==2)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-60"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="15"
-						y="0"
-						width="468"
-						height="0"
-						key="line-6">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==2)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -1280,56 +1277,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==3)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-56"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-58"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="30"
-						y="0"
-						width="453"
-						height="0"
-						key="line-7">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==3)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -1495,74 +1444,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==4)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-52"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-53"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-54"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="45"
-						y="0"
-						width="438"
-						height="0"
-						key="line-8">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==4)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -1743,92 +1626,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==5)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-48"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-49"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-50"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-51"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="60"
-						y="0"
-						width="423"
-						height="0"
-						key="line-9">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==5)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
 			</band>
 			</groupFooter>
 		</group>
@@ -2024,110 +1823,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-44"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-45"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-46"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-47"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="75"
-						y="0"
-						width="408"
-						height="0"
-						key="line-10">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-121"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -2338,128 +2035,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==7)]]></printWhenExpression>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-122"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="90"
-						y="0"
-						width="393"
-						height="0"
-						key="line-11">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-123"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-124"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-125"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-126"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level6_Line"
-						mode="Opaque"
-						x="75"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-127"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -2685,146 +2262,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==8)]]></printWhenExpression>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="105"
-						y="0"
-						width="378"
-						height="0"
-						key="line-12">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level6_Line"
-						mode="Opaque"
-						x="75"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-128"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-129"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-130"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-131"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-132"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-133"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level7_Line"
-						mode="Opaque"
-						x="90"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-134"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -3065,164 +2504,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==9)]]></printWhenExpression>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="120"
-						y="0"
-						width="363"
-						height="0"
-						key="line-13">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level7_Line"
-						mode="Opaque"
-						x="90"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-135"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level6_Line"
-						mode="Opaque"
-						x="75"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-136"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-137"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-138"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-139"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-140"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-141"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level8_Line"
-						mode="Opaque"
-						x="105"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-142"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -3478,182 +2761,8 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==10)]]></printWhenExpression>
-				<line direction="TopDown">
-					<reportElement
-						style="Detail_Border"
-						x="135"
-						y="0"
-						width="348"
-						height="0"
-						key="line-14">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==6)]]></printWhenExpression>
-						</reportElement>
-					<graphicElement stretchType="NoStretch"/>
-				</line>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level8_Line"
-						mode="Opaque"
-						x="105"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-143"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level7_Line"
-						mode="Opaque"
-						x="90"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-144"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level6_Line"
-						mode="Opaque"
-						x="75"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-145"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level5_Line"
-						mode="Opaque"
-						x="60"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-146"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=6)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level1_Line"
-						mode="Opaque"
-						x="0"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-147"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=2)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level3_Line"
-						mode="Opaque"
-						x="30"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-148"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=4)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level2_Line"
-						mode="Opaque"
-						x="15"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-149"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=3)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level4_Line"
-						mode="Opaque"
-						x="45"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-150"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=5)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Level9_Line"
-						mode="Opaque"
-						x="120"
-						y="0"
-						width="15"
-						height="5"
-						key="textField-151"
-						stretchType="RelativeToBandHeight">
-							<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()>=7)]]></printWhenExpression>
-						</reportElement>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement rotation="None">
-						<font/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[]]></textFieldExpression>
-				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -3924,7 +3033,7 @@
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="5"  isSplitAllowed="true" >
+			<band height="0"  isSplitAllowed="true" >
 				<printWhenExpression><![CDATA[new Boolean($P{DIMENSIONS}.intValue()==11)]]></printWhenExpression>
 			</band>
 			</groupFooter>
@@ -4191,6 +3300,21 @@
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[(($P{DIMENSIONS}.compareTo(new Integer(10))>=0)?"10":"")]]></textFieldExpression>
 				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Header"
+						x="150"
+						y="0"
+						width="52"
+						height="19"
+						key="textField-210"
+						positionType="Float"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center" rotation="None">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
+				</textField>
 				</frame>				<textField isStretchWithOverflow="true" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Title"
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerEdition.java	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerEdition.java	Thu Oct 30 17:30:39 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -206,7 +206,9 @@
     XmlDocument xmlDocument=null;
     xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerEdition").createXmlDocument();
     InvoiceCustomerEditionData[] data = null;
-    data = InvoiceCustomerEditionData.select(this, Utility.getContext(this, vars, "#User_Org", "InvoiceCustomerFilter"), Utility.getContext(this, vars, "#User_Client", "InvoiceCustomerFilter"), strdateFrom, strdateTo, strcBpartnerId, strcProjectId, strmCategoryId, strProjectkind, strProjectphase, strProjectstatus, strProjectpublic, strcRegionId, strSalesRep, strProduct);
+    //Get user Client's base currency
+    String strCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
+    data = InvoiceCustomerEditionData.select(this, strCurrencyId, Utility.getContext(this, vars, "#User_Org", "InvoiceCustomerFilter"), Utility.getContext(this, vars, "#User_Client", "InvoiceCustomerFilter"), strdateFrom, strdateTo, strcBpartnerId, strcProjectId, strmCategoryId, strProjectkind, strProjectphase, strProjectstatus, strProjectpublic, strcRegionId, strSalesRep, strProduct);
     xmlDocument.setData("structure1", data);
 
     xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
@@ -224,7 +226,9 @@
     XmlDocument xmlDocument=null;
     xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerEdition_Pdf").createXmlDocument();
     InvoiceCustomerEditionData[] data = null;
-    data = InvoiceCustomerEditionData.select(this, Utility.getContext(this, vars, "#User_Org", "InvoiceCustomerFilter"), Utility.getContext(this, vars, "#User_Client", "InvoiceCustomerFilter"), strdateFrom, strdateTo, strcBpartnerId, strcProjectId, strmCategoryId, strProjectkind, strProjectphase, strProjectstatus, strProjectpublic, strcRegionId, strSalesRep, strProduct);
+    //Get user Client's base currency
+    String strCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
+    data = InvoiceCustomerEditionData.select(this, strCurrencyId, Utility.getContext(this, vars, "#User_Org", "InvoiceCustomerFilter"), Utility.getContext(this, vars, "#User_Client", "InvoiceCustomerFilter"), strdateFrom, strdateTo, strcBpartnerId, strcProjectId, strmCategoryId, strProjectkind, strProjectphase, strProjectstatus, strProjectpublic, strcRegionId, strSalesRep, strProduct);
     xmlDocument.setData("structure1", data);
     String strResult = xmlDocument.print();
     if (log4j.isDebugEnabled()) log4j.debug(strResult);
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerFilterJR.html	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerFilterJR.html	Thu Oct 30 17:30:39 2008 +0000
@@ -13,7 +13,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SL
- * All portions are Copyright (C) 2007 Openbravo SL
+ * All portions are Copyright (C) 2007-2008 Openbravo SL
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -54,6 +54,11 @@
 function validate()
 {
 	var frm = document.frmMain;
+	if (frm.inpCurrencyId.value == null || frm.inpCurrencyId.value == "") {
+	    setWindowElementFocus(frm.inpCurrencyId);
+	    showJSMessage(7);
+	    return false;
+	}
 	if (frm.inpDateFrom.value == null || frm.inpDateFrom.value == "") {
 		setWindowElementFocus(frm.inpDateFrom);
 		showJSMessage(7);
@@ -261,7 +266,6 @@
                       </TR>
                     </TABLE>
                  </TD>
-                    <TD class="ContentCell"></TD>
                   <TD class="TitleCell"><SPAN class="LabelText">To Date</SPAN></TD>
                   <TD class="TextBox_btn_ContentCell">
                     <TABLE border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
@@ -283,10 +287,15 @@
                       </TR>
                     </TABLE>
                   </TD>
-                    <TD class="ContentCell"></TD>
-                      </TR>
-                      <TR>
-		<TD class="TitleCell"><SPAN class="LabelText">Project</SPAN></TD>
+                  <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>
+                  </TR>
+                  <TR>
+				  <TD class="TitleCell"><SPAN class="LabelText">Project</SPAN></TD>
                   <TD class="TextBox_btn_ContentCell" colspan="2">
                     <TABLE border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
                       <TR>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerFilterJR.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerFilterJR.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -77,7 +77,9 @@
   <SUBREPORT id="reportCBPartnerId_IN" name="reportCBPartnerId_IN" report="org/openbravo/erpCommon/reference/List">
     <ARGUMENT name="parameterListSelected" withId="paramVacio"/>
   </SUBREPORT>
-
-
+  <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>
   <DISCARD id="discard"/>
 </REPORT>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.java	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.java	Thu Oct 30 17:30:39 2008 +0000
@@ -36,8 +36,9 @@
 
   public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
-
-
+    
+    //Get user Client's base currency
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
     if (vars.commandIn("DEFAULT")){
       String strdateFrom = vars.getGlobalVariable("inpDateFrom", "ReportInvoiceCustomerJR|DateFrom", "");
       String strdateTo = vars.getGlobalVariable("inpDateTo", "ReportInvoiceCustomerJR|DateTo", "");
@@ -51,7 +52,8 @@
       String strProjectpublic = vars.getGlobalVariable("inpProjectpublic", "ReportInvoiceCustomerJR|Projectpublic", "");
       String strSalesRep = vars.getGlobalVariable("inpSalesRepId", "ReportInvoiceCustomerJR|SalesRepId", "");
       String strcRegionId = vars.getInGlobalVariable("inpcRegionId", "ReportInvoiceCustomerJR|cRegionId", "");
-      printPageDataSheet(response, vars, strdateFrom, strdateTo, strcProjectId, strcBpartnerId, strmCategoryId, strProjectkind, strProjectstatus, strProjectphase, strProduct, strProjectpublic, strSalesRep, strcRegionId);
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceCustomerJR|currency", strUserCurrencyId);
+      printPageDataSheet(response, vars, strdateFrom, strdateTo, strcProjectId, strcBpartnerId, strmCategoryId, strProjectkind, strProjectstatus, strProjectphase, strProduct, strProjectpublic, strSalesRep, strcRegionId, strCurrencyId);
     }else if (vars.commandIn("EDIT_HTML","EDIT_PDF")) {
       String strdateFrom = vars.getRequestGlobalVariable("inpDateFrom", "ReportInvoiceCustomerJR|DateFrom");
       String strdateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportInvoiceCustomerJR|DateTo");
@@ -65,11 +67,12 @@
       String strProjectpublic = vars.getRequestGlobalVariable("inpProjectpublic", "ReportInvoiceCustomerJR|Projectpublic");
       String strSalesRep = vars.getRequestGlobalVariable("inpSalesRepId", "ReportInvoiceCustomerJR|SalesRepId");
       String strcRegionId = vars.getRequestInGlobalVariable("inpcRegionId", "ReportInvoiceCustomerJR|cRegionId");
-      printPageHtml(response, vars, strdateFrom, strdateTo, strcProjectId, strcBpartnerId, strmCategoryId, strProjectkind, strProjectstatus, strProjectphase, strProduct, strProjectpublic, strSalesRep, strcRegionId);
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceCustomerJR|currency", strUserCurrencyId);
+      printPageHtml(response, vars, strdateFrom, strdateTo, strcProjectId, strcBpartnerId, strmCategoryId, strProjectkind, strProjectstatus, strProjectphase, strProduct, strProjectpublic, strSalesRep, strcRegionId, strCurrencyId);
    } else pageErrorPopUp(response);
   }
 
-  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strdateFrom, String strdateTo, String strcProjectId, String strcBpartnerId, String strmCategoryId, String strProjectkind, String strProjectstatus, String strProjectphase, String strProduct, String strProjectpublic, String strSalesRep, String strcRegionId) throws IOException, ServletException {
+  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strdateFrom, String strdateTo, String strcProjectId, String strcBpartnerId, String strmCategoryId, String strProjectkind, String strProjectstatus, String strProjectphase, String strProduct, String strProjectpublic, String strSalesRep, String strcRegionId, String strCurrencyId) throws IOException, ServletException {
     if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
 
 
@@ -174,6 +177,16 @@
       throw new ServletException(ex);
     }
 
+    xmlDocument.setParameter("ccurrencyid", strCurrencyId);    
+    try {
+      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Currency_ID", "", "", Utility.getContext(this, vars, "#User_Org", "ReportInvoiceCustomerJR"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceCustomerJR"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoiceCustomerJR", strCurrencyId);
+      xmlDocument.setData("reportC_Currency_ID","liststructure", comboTableData.select(false));
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
+    
     xmlDocument.setData("reportCBPartnerId_IN", "liststructure", ReportProjectBuildingSiteData.selectBpartner(this, Utility.getContext(this, vars, "#User_Org", ""), Utility.getContext(this, vars, "#User_Client", ""), strcBpartnerId));
     xmlDocument.setData("reportMProductId_IN", "liststructure", ReportProjectBuildingSiteData.selectMproduct(this, Utility.getContext(this, vars, "#User_Org", ""), Utility.getContext(this, vars, "#User_Client", ""), strProduct));
 
@@ -190,21 +203,35 @@
     out.close();
   }
 
-  void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strdateFrom, String strdateTo, String strcProjectId, String strcBpartnerId, String strmCategoryId, String strProjectkind, String strProjectstatus, String strProjectphase, String strProduct, String strProjectpublic, String strSalesRep, String strcRegionId) throws IOException, ServletException{
+  void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strdateFrom, String strdateTo, String strcProjectId, String strcBpartnerId, String strmCategoryId, String strProjectkind, String strProjectstatus, String strProjectphase, String strProduct, String strProjectpublic, String strSalesRep, String strcRegionId, String strCurrencyId) throws IOException, ServletException{
     if (log4j.isDebugEnabled()) log4j.debug("Output: print html");
    
     InvoiceCustomerEditionData[] data = null;
-    data = InvoiceCustomerEditionData.select(this, Utility.getContext(this, vars, "#User_Org", "InvoiceCustomerFilter"), Utility.getContext(this, vars, "#User_Client", "InvoiceCustomerFilter"), strdateFrom, strdateTo, strcBpartnerId, strcProjectId, strmCategoryId, strProjectkind, strProjectphase, strProjectstatus, strProjectpublic, strcRegionId, strSalesRep, strProduct);
-  
-    String strOutput = vars.commandIn("EDIT_HTML")?"html":"pdf";
-    String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.jrxml";
-    
-    String strSubTitle = "";
-    strSubTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " "+strdateFrom+" " + Utility.messageBD(this, "To", vars.getLanguage()) + " "+strdateTo;
-    
-    HashMap<String, Object> parameters = new HashMap<String, Object>();
-    parameters.put("REPORT_TITLE", classInfo.name);
-    parameters.put("REPORT_SUBTITLE", strSubTitle);
-    renderJR(vars, response, strReportName, strOutput, parameters, data, null );
+
+    //Checks if there is a conversion rate for each of the transactions of the report
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
+    try {
+      data = InvoiceCustomerEditionData.select(this, strCurrencyId, Utility.getContext(this, vars, "#User_Org", "InvoiceCustomerFilter"), Utility.getContext(this, vars, "#User_Client", "InvoiceCustomerFilter"), strdateFrom, strdateTo, strcBpartnerId, strcProjectId, strmCategoryId, strProjectkind, strProjectphase, strProjectstatus, strProjectpublic, strcRegionId, strSalesRep, strProduct);
+    } catch(ServletException ex) {
+      myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+    }
+    strConvRateErrorMsg = myMessage.getMessage();
+    //If a conversion rate is missing for a certain transaction, an error message window pops-up.
+    if(!strConvRateErrorMsg.equals("") && strConvRateErrorMsg != null) {
+      advisePopUp(response, "ERROR", Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()), strConvRateErrorMsg);      
+    } else { //Launch the report as usual, calling the JRXML file
+      String strOutput = vars.commandIn("EDIT_HTML")?"html":"pdf";
+      String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.jrxml";
+      
+      String strSubTitle = "";
+      strSubTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " "+strdateFrom+" " + Utility.messageBD(this, "To", vars.getLanguage()) + " "+strdateTo;
+      
+      HashMap<String, Object> parameters = new HashMap<String, Object>();
+      parameters.put("REPORT_TITLE", classInfo.name);
+      parameters.put("REPORT_SUBTITLE", strSubTitle);
+      renderJR(vars, response, strReportName, strOutput, parameters, data, null );
+    }
   }
 }
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.jrxml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerJR.jrxml	Thu Oct 30 17:30:39 2008 +0000
@@ -5,10 +5,10 @@
 		 name="ReportInvoiceCustomerJR"
 		 columnCount="1"
 		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="595"
-		 pageHeight="842"
-		 columnWidth="535"
+		 orientation="Landscape"
+		 pageWidth="842"
+		 pageHeight="595"
+		 columnWidth="782"
 		 columnSpacing="0"
 		 leftMargin="30"
 		 rightMargin="30"
@@ -194,17 +194,33 @@
 	</parameter>
 	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
 	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
-	<queryString><![CDATA[SELECT COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS DOCUMENTNO, C_INVOICE.DATEINVOICED AS DATEINVOICED, C_BPARTNER.NAME AS CLIENT_NAME, M_PRODUCT.NAME AS PRODUCT_NAME, SUM(C_INVOICELINE.QTYINVOICED) AS QUANTITYORDER, 
-      C_UOM.NAME AS UOMNAME, C_INVOICELINE.PRICEACTUAL AS PRICEACTUAL, SUM(C_INVOICELINE.LINENETAMT) AS PRICELIST
+	<queryString><![CDATA[SELECT COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS DOCUMENTNO, C_INVOICE.DATEINVOICED AS DATEINVOICED, 
+      C_BPARTNER.NAME AS CLIENT_NAME, M_PRODUCT.NAME AS PRODUCT_NAME, SUM(C_INVOICELINE.QTYINVOICED) AS QUANTITYORDER, C_UOM.NAME AS UOMNAME, 
+      C_INVOICELINE.PRICEACTUAL AS PRICEACTUAL, 
+      C_CURRENCY_SYMBOL (C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.PRICEACTUAL, 'Y') AS PRICEACTUALSYM,
+	  C_CURRENCY_CONVERT(C_INVOICELINE.PRICEACTUAL, C_INVOICE.C_CURRENCY_ID, '102', TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS CONVPRICEACTUAL,
+      SUM(C_INVOICELINE.LINENETAMT) AS PRICELIST,
+      C_CURRENCY_SYMBOL (C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.LINENETAMT, 'Y') AS PRICELISTSYM,
+	  SUM(C_CURRENCY_CONVERT(C_INVOICELINE.LINENETAMT, C_INVOICE.C_CURRENCY_ID, '102', TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID)) AS CONVPRICELIST,
+	  C_CURRENCY_SYMBOL('102', '0', 'Y') AS CONVSYM,
+	  C_CURRENCY_ISOSYM('102') AS CONVISOSYM,
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRANSDATE,
+	  C_INVOICE.C_CURRENCY_ID AS TRANSCURRENCYID,
+      C_INVOICELINE.AD_CLIENT_ID AS TRANSCLIENTID, 
+	  C_INVOICELINE.AD_ORG_ID AS TRANSORGID
       FROM C_INVOICE LEFT JOIN C_PROJECT ON C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID 
                      LEFT JOIN C_LOCATION ON C_PROJECT.C_LOCATION_ID = C_LOCATION.C_LOCATION_ID, C_INVOICELINE, M_PRODUCT, C_UOM, C_BPARTNER
       WHERE C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
       AND C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
       AND C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
-      AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+      AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID      
+      AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN ('1')
       AND C_INVOICE.ISSOTRX = 'Y'
       AND 1=1
-      GROUP BY C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.NAME, C_INVOICELINE.PRICEACTUAL, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED
+      GROUP BY C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.NAME, C_INVOICELINE.PRICEACTUAL, 
+      COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED,
+      C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID, C_INVOICELINE.LINENETAMT
       ORDER BY C_BPARTNER.NAME, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED]]></queryString>
 
 	<field name="DOCUMENTNO" class="java.lang.String"/>
@@ -215,9 +231,15 @@
 	<field name="UOMNAME" class="java.lang.String"/>
 	<field name="PRICEACTUAL" class="java.math.BigDecimal"/>
 	<field name="PRICELIST" class="java.math.BigDecimal"/>
+	<field name="CONVPRICELIST" class="java.math.BigDecimal"/>
+	<field name="CONVPRICEACTUAL" class="java.math.BigDecimal"/>
+	<field name="PRICEACTUALSYM" class="java.lang.String"/>
+	<field name="CONVSYM" class="java.lang.String"/>
+	<field name="CONVISOSYM" class="java.lang.String"/>
+	<field name="PRICELISTSYM" class="java.lang.String"/>
 
 	<variable name="DetailFieldTotal" class="java.math.BigDecimal" resetType="Group" resetGroup="CLIENT_NAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{PRICELIST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVPRICELIST}]]></variableExpression>
 	</variable>
 	<variable name="TotalQty" class="java.math.BigDecimal" resetType="Group" resetGroup="CLIENT_NAME" calculation="Sum">
 		<variableExpression><![CDATA[$F{QUANTITYORDER}]]></variableExpression>
@@ -246,7 +268,7 @@
 						style="GroupHeader_DarkGray"
 						x="108"
 						y="0"
-						width="427"
+						width="598"
 						height="24"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" topPadding="2" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -257,7 +279,7 @@
 				</textField>
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="706"
 						y="0"
 						width="0"
 						height="24"
@@ -283,10 +305,10 @@
 				</line>
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="706"
 						y="0"
 						width="0"
-						height="24"
+						height="25"
 						forecolor="#555555"
 						key="line-33"
 						stretchType="RelativeToBandHeight"/>
@@ -296,7 +318,7 @@
 					<reportElement
 						x="0"
 						y="24"
-						width="535"
+						width="706"
 						height="0"
 						forecolor="#555555"
 						key="line-34"/>
@@ -322,7 +344,7 @@
 						mode="Opaque"
 						x="275"
 						y="2"
-						width="255"
+						width="407"
 						height="18"
 						key="textField-13"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="4" rightBorder="None" rightBorderColor="#000000" rightPadding="4" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -345,6 +367,21 @@
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{TotalQty}!=null)?$P{NUMBERFORMAT}.format($V{TotalQty}):new String(" ")]]></textFieldExpression>
 				</textField>
+				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Group" evaluationGroup="CLIENT_NAME"  hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Field"
+						mode="Opaque"
+						x="682"
+						y="2"
+						width="22"
+						height="18"
+						key="textField-19"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="4" rightBorder="None" rightBorderColor="#000000" rightPadding="4" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font pdfFontName="Helvetica-Bold"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -368,7 +405,7 @@
 				</textField>
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="706"
 						y="0"
 						width="0"
 						height="48"
@@ -393,7 +430,7 @@
 						style="Detail_Header"
 						x="420"
 						y="10"
-						width="115"
+						width="286"
 						height="16"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" topPadding="2" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -412,7 +449,7 @@
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
 					<textElement>
-						<font/>
+						<font size="8"/>
 					</textElement>
 				<text><![CDATA[Article]]></text>
 				</staticText>
@@ -424,9 +461,9 @@
 						width="80"
 						height="16"
 						key="element-90"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="4" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right">
-						<font pdfFontName="Helvetica-Bold"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
 					</textElement>
 				<text><![CDATA[Quantity]]></text>
 				</staticText>
@@ -439,8 +476,8 @@
 						height="16"
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement>
-						<font/>
+					<textElement textAlignment="Center">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
 					</textElement>
 				<text><![CDATA[UOM]]></text>
 				</staticText>
@@ -453,28 +490,14 @@
 						height="16"
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="4" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right">
-						<font pdfFontName="Helvetica-Bold"/>
+					<textElement textAlignment="Center">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
 					</textElement>
 				<text><![CDATA[Price	]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="446"
-						y="32"
-						width="85"
-						height="16"
-						key="element-90"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="4" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right">
-						<font pdfFontName="Helvetica-Bold"/>
-					</textElement>
-				<text><![CDATA[Total]]></text>
-				</staticText>
-				<staticText>
-					<reportElement
-						style="Detail_Header"
 						x="328"
 						y="10"
 						width="92"
@@ -511,6 +534,76 @@
 						key="line-39"/>
 					<graphicElement stretchType="NoStretch"/>
 				</line>
+				<staticText>
+					<reportElement
+						style="Detail_Header"
+						x="446"
+						y="32"
+						width="41"
+						height="16"
+						key="element-91"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="4" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
+					</textElement>
+				<text><![CDATA[Price	]]></text>
+				</staticText>
+				<staticText>
+					<reportElement
+						style="Detail_Header"
+						x="621"
+						y="32"
+						width="36"
+						height="16"
+						key="element-92"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="4" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
+					</textElement>
+				<text><![CDATA[Total]]></text>
+				</staticText>
+				<staticText>
+					<reportElement
+						style="Detail_Header"
+						x="536"
+						y="32"
+						width="85"
+						height="16"
+						key="element-93"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="2" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="4" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
+					</textElement>
+				<text><![CDATA[Total]]></text>
+				</staticText>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Header"
+						x="487"
+						y="32"
+						width="49"
+						height="16"
+						key="textField-23"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Header"
+						x="657"
+						y="32"
+						width="49"
+						height="16"
+						key="textField-24"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
+				</textField>
 			</band>
 			</groupHeader>
 			<groupFooter>
@@ -528,7 +621,7 @@
 				</line>
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="706"
 						y="0"
 						width="0"
 						height="15"
@@ -542,7 +635,7 @@
 						style="Report_Footer"
 						x="20"
 						y="0"
-						width="511"
+						width="686"
 						height="0"
 						forecolor="#555555"
 						key="line-37"/>
@@ -564,7 +657,7 @@
 						style="Report_Footer"
 						x="10"
 						y="10"
-						width="525"
+						width="696"
 						height="0"
 						forecolor="#555555"
 						key="line-41"/>
@@ -589,7 +682,7 @@
 						mode="Transparent"
 						x="0"
 						y="0"
-						width="535"
+						width="705"
 						height="20"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -602,7 +695,7 @@
 					<reportElement
 						x="0"
 						y="20"
-						width="535"
+						width="706"
 						height="0"
 						key="line-1"/>
 					<graphicElement stretchType="NoStretch" pen="1Point"/>
@@ -612,7 +705,7 @@
 						style="Report_Subtitle"
 						x="0"
 						y="20"
-						width="535"
+						width="705"
 						height="20"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -631,7 +724,7 @@
 			<band height="16"  isSplitAllowed="true" >
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="706"
 						y="0"
 						width="0"
 						height="16"
@@ -661,7 +754,7 @@
 						key="textField-8"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#555555"/>
 					<textElement verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="12"/>
+						<font fontName="Times-Roman" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{PRODUCT_NAME}!=null)?$F{PRODUCT_NAME}:new String(" ")]]></textFieldExpression>
 				</textField>
@@ -673,9 +766,9 @@
 						width="80"
 						height="16"
 						key="textField-9"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#555555"/>
 					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="12"/>
+						<font fontName="Times-Roman" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{QUANTITYORDER}!=null)?$P{NUMBERFORMAT}.format($F{QUANTITYORDER}):new String(" ")]]></textFieldExpression>
 				</textField>
@@ -688,8 +781,8 @@
 						height="16"
 						key="textField-10"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#555555"/>
-					<textElement verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="12"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{UOMNAME}!=null)?$F{UOMNAME}:new String(" ")]]></textFieldExpression>
 				</textField>
@@ -698,29 +791,15 @@
 						style="Detail_Line"
 						x="356"
 						y="0"
-						width="90"
+						width="66"
 						height="16"
 						key="textField-11"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
 					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="12"/>
+						<font fontName="Times-Roman" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{PRICEACTUAL}!=null)?$P{NUMBERFORMAT}.format($F{PRICEACTUAL}):new String(" ")]]></textFieldExpression>
 				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						style="Detail_Line"
-						x="446"
-						y="0"
-						width="85"
-						height="16"
-						key="textField-12"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="1Point" rightBorderColor="#555555" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font fontName="Times-Roman" size="12"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{PRICELIST}!=null)?$P{NUMBERFORMAT}.format($F{PRICELIST}):new String(" ")]]></textFieldExpression>
-				</textField>
 				<line direction="TopDown">
 					<reportElement
 						style="Report_Footer"
@@ -732,6 +811,104 @@
 						key="line-38"/>
 					<graphicElement stretchType="NoStretch"/>
 				</line>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="446"
+						y="0"
+						width="66"
+						height="16"
+						key="textField-15"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{CONVPRICEACTUAL}!=null)?$P{NUMBERFORMAT}.format($F{CONVPRICEACTUAL}):new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="621"
+						y="0"
+						width="61"
+						height="16"
+						key="textField-16"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="None" rightBorderColor="#555555" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{CONVPRICELIST}!=null)?$P{NUMBERFORMAT}.format($F{CONVPRICELIST}):new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="536"
+						y="0"
+						width="61"
+						height="16"
+						key="textField-17"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#555555" leftPadding="2" rightBorder="None" rightBorderColor="#555555" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[($F{PRICELIST}!=null)?$P{NUMBERFORMAT}.format($F{PRICELIST}):new String(" ")]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="682"
+						y="0"
+						width="24"
+						height="16"
+						key="textField-18"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#555555" leftPadding="2" rightBorder="1Point" rightBorderColor="#555555" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="597"
+						y="0"
+						width="24"
+						height="16"
+						key="textField-20"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#555555" leftPadding="2" rightBorder="1Point" rightBorderColor="#555555" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{PRICELISTSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="512"
+						y="0"
+						width="24"
+						height="16"
+						key="textField-21"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#555555" leftPadding="2" rightBorder="1Point" rightBorderColor="#555555" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="422"
+						y="0"
+						width="24"
+						height="16"
+						key="textField-22"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#555555" leftPadding="2" rightBorder="1Point" rightBorderColor="#555555" rightPadding="4" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Times-Roman" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{PRICEACTUALSYM}]]></textFieldExpression>
+				</textField>
 			</band>
 		</detail>
 		<columnFooter>
@@ -743,7 +920,7 @@
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="402"
+						x="573"
 						y="4"
 						width="95"
 						height="16"
@@ -757,7 +934,7 @@
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Report_Footer"
-						x="499"
+						x="670"
 						y="4"
 						width="36"
 						height="16"
@@ -774,7 +951,7 @@
 					<reportElement
 						x="0"
 						y="1"
-						width="535"
+						width="706"
 						height="0"
 						forecolor="#000000"
 						key="line"/>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscount.java	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscount.java	Thu Oct 30 17:30:39 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -27,8 +27,6 @@
 import javax.servlet.*;
 import javax.servlet.http.*;
 
-import org.openbravo.erpCommon.utility.DateTimeData;
-
 public class ReportInvoiceDiscount extends HttpSecureAppServlet {
   private static final long serialVersionUID = 1L;
 
@@ -61,8 +59,10 @@
     xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
     xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
     xmlDocument.setParameter("theme", vars.getTheme());
-
-    xmlDocument.setData("structure1", ReportInvoiceDiscountData.select(this, Utility.getContext(this, vars, "#User_Client", "ReportInvoiceDiscount"), Utility.getContext(this, vars, "#User_Org", "ReportInvoiceDiscount"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strcBpartnerId, (strDiscount.equals("N"))?"":"discount"));
+    
+    //Get user Client's base currency
+    String strCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
+    xmlDocument.setData("structure1", ReportInvoiceDiscountData.select(this, strCurrencyId, Utility.getContext(this, vars, "#User_Client", "ReportInvoiceDiscount"), Utility.getContext(this, vars, "#User_Org", "ReportInvoiceDiscount"), strDateFrom, strDateTo, strcBpartnerId, (strDiscount.equals("N"))?"":"discount"));
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
     out.println(xmlDocument.print());
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.html	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.html	Thu Oct 30 17:30:39 2008 +0000
@@ -13,7 +13,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SL
- * All portions are Copyright (C) 2001-2006 Openbravo SL
+ * All portions are Copyright (C) 2001-2008 Openbravo SL
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -54,6 +54,11 @@
 function validate()
 {
 	var frm = document.frmMain;
+	if (frm.inpCurrencyId.value == null || frm.inpCurrencyId.value == "") {
+	    setWindowElementFocus(frm.inpCurrencyId);
+	    showJSMessage(7);
+	    return false;
+	}
 	if (frm.inpDateFrom.value == null || frm.inpDateFrom.value == "") {
 		setWindowElementFocus(frm.inpDateFrom);
 		showJSMessage(7);
@@ -252,7 +257,6 @@
                       </TR>
                     </TABLE>
                  </TD>
-                    <TD class="TitleCell"></TD>
                   <TD class="TitleCell"><SPAN class="LabelText">To Date</SPAN></TD>
                   <TD class="TextBox_btn_ContentCell">
                     <TABLE border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
@@ -274,6 +278,12 @@
                       </TR>
                     </TABLE>
                   </TD>
+                  <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>
                 </TR>
                 <TR>
                   <TD class="TitleCell"><SPAN class="LabelText">Business Partner</SPAN></TD>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.java	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.java	Thu Oct 30 17:30:39 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,49 +28,66 @@
 import javax.servlet.http.*;
 import java.util.HashMap;
 
-import org.openbravo.erpCommon.utility.DateTimeData;
-
 public class ReportInvoiceDiscountJR extends HttpSecureAppServlet {
   private static final long serialVersionUID = 1L;
 
   public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
 
-
+    //Get user Client's base currency
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
     if (vars.commandIn("DEFAULT")){
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportInvoiceDiscountJR|dateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportInvoiceDiscountJR|dateTo", "");
       String strcBpartnerId = vars.getInGlobalVariable("inpcBPartnerId_IN", "ReportInvoiceDiscountJR|partner", "");
       String strDiscount = vars.getGlobalVariable("inpDiscount", "ReportInvoiceDiscountJR|discount", "N");
-      printPageDataSheet(response, vars, strDateFrom, strDateTo, strcBpartnerId, strDiscount);
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceDiscountJR|currency", strUserCurrencyId);
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strcBpartnerId, strCurrencyId, strDiscount);
+      
     } else if (vars.commandIn("FIND")) {
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportInvoiceDiscountJR|dateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportInvoiceDiscountJR|dateTo", "");
       String strcBpartnerId = vars.getRequestInGlobalVariable("inpcBPartnerId_IN", "ReportInvoiceDiscountJR|partner");
       String strDiscount = vars.getRequestGlobalVariable("inpDiscount", "ReportInvoiceDiscountJR|discount");
-      printPageDataHtml(response, vars, strDateFrom, strDateTo, strcBpartnerId, strDiscount);
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceDiscountJR|currency", strUserCurrencyId);
+      printPageDataHtml(response, vars, strDateFrom, strDateTo, strcBpartnerId, strDiscount, strCurrencyId);
     } else pageError(response);
   }
 
-  void printPageDataHtml(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strDiscount) throws IOException, ServletException {
+  void printPageDataHtml(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strDiscount, String strCurrencyId) throws IOException, ServletException {
     if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
  
     if (strDiscount.equals("")) strDiscount = "N";
-
-	 String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.jrxml";
-	 String strOutput = "html";
-      if (strOutput.equals("pdf")) response.setHeader("Content-disposition", "inline; filename=ReportInvoiceDiscountEdit.pdf");
-      ReportInvoiceDiscountData[] data =  ReportInvoiceDiscountData.select(this, Utility.getContext(this, vars, "#User_Client", "ReportInvoiceDiscountJR"), Utility.getContext(this, vars, "#User_Org", "ReportInvoiceDiscountJR"), strDateFrom,DateTimeData.nDaysAfter(this, strDateTo,"1"), strcBpartnerId, (strDiscount.equals("N"))?"":"discount");
-        HashMap<String, Object> parameters = new HashMap<String, Object>();
+    
+    String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.jrxml";
+    String strOutput = "html";
+    if (strOutput.equals("pdf")) response.setHeader("Content-disposition", "inline; filename=ReportInvoiceDiscountEdit.pdf");
+    
+    //Checks if there is a conversion rate for each of the transactions of the report
+    ReportInvoiceDiscountData[] data = null;
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
+    try {
+      data =  ReportInvoiceDiscountData.select(this, strCurrencyId, Utility.getContext(this, vars, "#User_Client", "ReportInvoiceDiscountJR"), Utility.getContext(this, vars, "#User_Org", "ReportInvoiceDiscountJR"), strDateFrom, strDateTo, strcBpartnerId, (strDiscount.equals("N"))?"":"discount");
+    } catch(ServletException ex) {
+      myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+    }
+    strConvRateErrorMsg = myMessage.getMessage();
+    //If a conversion rate is missing for a certain transaction, an error message window pops-up.
+    if(!strConvRateErrorMsg.equals("") && strConvRateErrorMsg != null) {
+      advisePopUp(response, "ERROR", Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()), strConvRateErrorMsg);      
+    } else { //Launch the report as usual, calling the JRXML file
+      HashMap<String, Object> parameters = new HashMap<String, Object>();
       parameters.put("REPORT_TITLE", classInfo.name);
-	  String strSubTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " "+strDateFrom+" " + Utility.messageBD(this, "To", vars.getLanguage()) + " "+strDateTo;
-	  parameters.put("REPORT_SUBTITLE", strSubTitle);
-    
+  	  String strSubTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " "+strDateFrom+" " + Utility.messageBD(this, "To", vars.getLanguage()) + " "+strDateTo;
+  	  parameters.put("REPORT_SUBTITLE", strSubTitle);
+      
       renderJR(vars, response, strReportName, strOutput, parameters, data, null );
-
+    }
   }
   
-  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strDiscount) throws IOException, ServletException {
+  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strCurrencyId, String strDiscount) throws IOException, ServletException {
     if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
     
     XmlDocument xmlDocument=null;
@@ -114,60 +131,23 @@
     xmlDocument.setParameter("discount", strDiscount);
     xmlDocument.setData("reportCBPartnerId_IN", "liststructure", ReportInvoiceDiscountData.selectBpartner(this, Utility.getContext(this, vars, "#User_Org", "ReportInvoiceDiscountJR"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceDiscountJR"), strcBpartnerId));
     
+    xmlDocument.setParameter("ccurrencyid", strCurrencyId);    
+    try {
+      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Currency_ID", "", "", Utility.getContext(this, vars, "#User_Org", "ReportInvoiceDiscountJR"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceDiscountJR"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoiceDiscountJR", strCurrencyId);
+      xmlDocument.setData("reportC_Currency_ID","liststructure", comboTableData.select(false));
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
+
+    
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
     out.println(xmlDocument.print());
     out.close();
   }
 
-  
-  /*void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnerId, String strDiscount) throws IOException, ServletException {
-    if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
-    String discard[]={"discard"};
-    XmlDocument xmlDocument=null;
-    if (strDiscount.equals("")) strDiscount = "N";
-    xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscount").createXmlDocument();
-
-    ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportInvoiceDiscountReportInvoiceDiscount", false, "", "", "",false, "ad_reports",  strReplaceWith, false,  true);
-    toolbar.prepareSimpleToolBarTemplate();
-    xmlDocument.setParameter("toolbar", toolbar.toString());
-    try {
-      WindowTabs tabs = new WindowTabs(this, vars, "org.openbravo.erpCommon.ad_reports.ReportInvoiceDiscount");
-      xmlDocument.setParameter("parentTabContainer", tabs.parentTabs());
-      xmlDocument.setParameter("mainTabContainer", tabs.mainTabs());
-      xmlDocument.setParameter("childTabContainer", tabs.childTabs());
-      xmlDocument.setParameter("theme", vars.getTheme());
-      NavigationBar nav = new NavigationBar(this, vars.getLanguage(), "ReportInvoiceDiscount.html", classInfo.id, classInfo.type, strReplaceWith, tabs.breadcrumb());
-      xmlDocument.setParameter("navigationBar", nav.toString());
-      LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "ReportInvoiceDiscount.html", strReplaceWith);
-      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
-    } catch (Exception ex) {
-      throw new ServletException(ex);
-    }
-    {
-      OBError myMessage = vars.getMessage("ReportInvoiceDiscount");
-      vars.removeMessage("ReportInvoiceDiscount");
-      if (myMessage!=null) {
-        xmlDocument.setParameter("messageType", myMessage.getType());
-        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
-        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
-      }
-    }
-
-    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
-    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
-    xmlDocument.setParameter("dateFrom", strDateFrom);
-    xmlDocument.setParameter("dateTo", strDateTo);
-    xmlDocument.setParameter("discount", strDiscount);
-    xmlDocument.setData("reportCBPartnerId_IN", "liststructure", ReportInvoiceDiscountData.selectBpartner(this, Utility.getContext(this, vars, "#User_Org", "ReportInvoiceDiscount"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceDiscount"), strcBpartnerId));
-    xmlDocument.setData("structure1", ReportInvoiceDiscountData.select(this, Utility.getContext(this, vars, "#User_Client", "ReportInvoiceDiscount"), Utility.getContext(this, vars, "#User_Org", "ReportInvoiceDiscount"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strcBpartnerId, (strDiscount.equals("N"))?"":"discount"));
-    response.setContentType("text/html; charset=UTF-8");
-    PrintWriter out = response.getWriter();
-    out.println(xmlDocument.print());
-    out.close();
-  }*/
-
-
   public String getServletInfo() {
     return "Servlet ReportInvoiceDiscount. This Servlet was made by Pablo Sarobe";
   } // end of getServletInfo() method
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.jrxml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.jrxml	Thu Oct 30 17:30:39 2008 +0000
@@ -5,10 +5,10 @@
 		 name="ReportInvoiceDiscountJR"
 		 columnCount="1"
 		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="595"
-		 pageHeight="842"
-		 columnWidth="535"
+		 orientation="Landscape"
+		 pageWidth="842"
+		 pageHeight="595"
+		 columnWidth="782"
 		 columnSpacing="0"
 		 leftMargin="30"
 		 rightMargin="30"
@@ -125,30 +125,46 @@
 	<parameter name="REPORT_SUBTITLE" isForPrompting="false" class="java.lang.String"/>
 	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
 	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
-	<queryString><![CDATA[SELECT C_BPARTNER_ID as ID, NAME, PRODUCTNAME, QTY,UOM, ROUND(TOTALLINE/QTY,3) AS PRICEACTUAL, TOTALLINE, ROUND(TOTALLINEDISCOUNT/QTY,3) AS REALPRICE, TOTALLINEDISCOUNT,
-        (ROUND((ROUND(TOTALLINE/QTY,3)-ROUND(TOTALLINEDISCOUNT/QTY,3))/ROUND(TOTALLINE/QTY,3),2))*100 AS DISCOUNT,
-        (CASE (ROUND((ROUND(TOTALLINE/QTY,3)-ROUND(TOTALLINEDISCOUNT/QTY,3))/ROUND(TOTALLINE/QTY,3),2))*100 WHEN 0 THEN 'DerechaMedio' ELSE 'BordesRojoClaro' END) AS CLASS_DESIGN,
-        WEIGHT
-        FROM (
-        SELECT C_BPARTNER.C_BPARTNER_ID, C_BPARTNER.NAME, M_PRODUCT.NAME AS PRODUCTNAME, C_UOM.UOMSYMBOL AS UOM, SUM(C_INVOICELINE.QTYINVOICED) AS QTY, ROUND(SUM(LINENETAMT),2) AS TOTALLINE, 
-        ROUND(SUM(LINENETAMT*(1-COALESCE(DISCOUNTPERUNIT,0))),2) AS TOTALLINEDISCOUNT, SUM(C_INVOICELINE.QTYINVOICED)*COALESCE(M_PRODUCT.WEIGHT,0) AS WEIGHT
-        FROM C_INVOICELINE left join
-          (SELECT C_INVOICE_ID, DISCOUNTLINES/(TOTALLINES+DISCOUNTLINES) AS DISCOUNTPERUNIT 
-          FROM (SELECT I.C_INVOICE_ID, I.TOTALLINES, -SUM(LINENETAMT) AS DISCOUNTLINES FROM C_INVOICE I, C_INVOICELINE IL 
-          WHERE I.C_INVOICE_ID = IL.C_INVOICE_ID 
-          AND IL.C_INVOICE_DISCOUNT_ID IS NOT NULL 
-          GROUP BY I.C_INVOICE_ID, I.TOTALLINES) BB) A on C_INVOICELINE.C_INVOICE_ID = A.C_INVOICE_ID
-          left join C_INVOICE on C_INVOICELINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID,
-        M_PRODUCT, C_BPARTNER,  C_UOM
-        WHERE  C_INVOICELINE.C_INVOICE_DISCOUNT_ID IS NULL
-        AND C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
-        AND M_PRODUCT.C_UOM_ID = C_UOM.C_UOM_ID
-        AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
-        AND C_INVOICE.ISSOTRX='Y'
-	AND PRICEACTUAL<>0
-	 GROUP BY C_BPARTNER.C_BPARTNER_ID, C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.UOMSYMBOL, M_PRODUCT.WEIGHT) AA
-        WHERE QTY<>0
-	ORDER BY NAME]]></queryString>
+	<queryString><![CDATA[SELECT C_BPARTNER_ID as ID, NAME, PRODUCTNAME, QTY,UOM, ROUND(C_DIVIDE(TOTALLINE,QTY),3) AS PRICEACTUAL, TOTALLINE, 
+	ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3) AS REALPRICE, TOTALLINEDISCOUNT,        
+	(ROUND(C_DIVIDE((ROUND(C_DIVIDE(TOTALLINE,QTY),3)-ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3)),ROUND(C_DIVIDE(TOTALLINE,QTY),3)),2))*100 AS DISCOUNT,        
+	(CASE (ROUND(C_DIVIDE((ROUND(C_DIVIDE(TOTALLINE,QTY),3)-ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3)),ROUND(C_DIVIDE(TOTALLINE,QTY),3)),2))*100 WHEN 0 THEN '' ELSE '' END)  AS CLASS_DESIGN,        
+	WEIGHT,	TRCURRENCYID AS TRANSCURRENCYID, TRDATE AS TRANSDATE,	TRCLIENTID AS TRANSCLIENTID, TRORGID AS TRANSORGID,
+	C_CURRENCY_SYMBOL('102', 0, 'Y') AS CONVSYM, C_CURRENCY_ISOSYM('102') AS CONVISOSYM
+	FROM (SELECT C_BPARTNER.C_BPARTNER_ID, C_BPARTNER.NAME, M_PRODUCT.NAME AS PRODUCTNAME, C_UOM.UOMSYMBOL AS UOM, SUM(C_INVOICELINE.QTYINVOICED) AS QTY, 
+	C_CURRENCY_CONVERT(ROUND(SUM(LINENETAMT),2), C_INVOICE.C_CURRENCY_ID, '102',  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS TOTALLINE,         
+	C_CURRENCY_CONVERT(ROUND(SUM(LINENETAMT*(1-COALESCE(DISCOUNTPERUNIT,0))),2), C_INVOICE.C_CURRENCY_ID, '102',  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS TOTALLINEDISCOUNT, 
+	SUM(C_INVOICELINE.QTYINVOICED)*COALESCE(M_PRODUCT.WEIGHT,0) AS WEIGHT,
+	C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+	TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+	C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID, 
+	C_INVOICELINE.AD_ORG_ID AS TRORGID      
+	FROM C_INVOICELINE left join          
+	(SELECT C_INVOICE_ID, DISCOUNTLINES/(TOTALLINES+DISCOUNTLINES) AS DISCOUNTPERUNIT           
+	FROM (SELECT I.C_INVOICE_ID, 
+	C_CURRENCY_CONVERT(I.TOTALLINES, I.C_CURRENCY_ID, '102',  TO_DATE(COALESCE(I.DATEINVOICED, NOW())), NULL, I.AD_CLIENT_ID, I.AD_ORG_ID) AS TOTALLINES, 
+	C_CURRENCY_CONVERT(-SUM(LINENETAMT), I.C_CURRENCY_ID, '102',  TO_DATE(COALESCE(I.DATEINVOICED, NOW())), NULL, IL.AD_CLIENT_ID, IL.AD_ORG_ID) AS DISCOUNTLINES
+	FROM C_INVOICE I, C_INVOICELINE IL           
+	WHERE I.C_INVOICE_ID = IL.C_INVOICE_ID AND IL.C_INVOICE_DISCOUNT_ID IS NOT NULL           
+	GROUP BY I.C_INVOICE_ID, I.TOTALLINES, I.C_CURRENCY_ID, I.DATEINVOICED, I.AD_CLIENT_ID, I.AD_ORG_ID, IL.AD_CLIENT_ID, IL.AD_ORG_ID) BB) A on C_INVOICELINE.C_INVOICE_ID = A.C_INVOICE_ID
+    left join C_INVOICE on C_INVOICELINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID,
+    M_PRODUCT, C_BPARTNER,  C_UOM
+    WHERE  C_INVOICELINE.C_INVOICE_DISCOUNT_ID IS NULL
+    AND C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+    AND M_PRODUCT.C_UOM_ID = C_UOM.C_UOM_ID
+    AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+    AND C_INVOICE.ISSOTRX='Y'
+    AND C_INVOICE.AD_CLIENT_ID IN ('1')
+    AND C_INVOICE.AD_ORG_ID IN ('1')
+    AND PRICEACTUAL<>0
+    AND C_INVOICE.DATEINVOICED >= to_date(?)
+    AND C_INVOICE.DATEINVOICED <= to_date(?)
+    AND 1=1
+    GROUP BY C_BPARTNER.C_BPARTNER_ID, C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.UOMSYMBOL, M_PRODUCT.WEIGHT, 
+    C_INVOICE.C_CURRENCY_ID, C_INVOICE.DATEINVOICED, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AA
+    WHERE QTY<>0
+    AND 2=2
+    ORDER BY NAME]]></queryString>
 
 	<field name="ID" class="java.math.BigDecimal"/>
 	<field name="NAME" class="java.lang.String"/>
@@ -162,6 +178,8 @@
 	<field name="DISCOUNT" class="java.math.BigDecimal"/>
 	<field name="CLASS_DESIGN" class="java.lang.String"/>
 	<field name="WEIGHT" class="java.math.BigDecimal"/>
+	<field name="CONVSYM" class="java.lang.String"/>
+	<field name="CONVISOSYM" class="java.lang.String"/>
 
 	<variable name="totalWeight" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
 		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
@@ -191,7 +209,7 @@
 						style="GroupHeader_DarkGray"
 						x="0"
 						y="0"
-						width="535"
+						width="781"
 						height="23"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" topPadding="2" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -213,7 +231,7 @@
 				</line>
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="781"
 						y="0"
 						width="0"
 						height="67"
@@ -226,28 +244,28 @@
 					<reportElement
 						style="Detail_Header"
 						mode="Opaque"
-						x="331"
+						x="404"
 						y="50"
 						width="57"
 						height="16"
 						key="element-90"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Center">
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<text><![CDATA[Amt.]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="444"
+						x="616"
 						y="50"
 						width="57"
 						height="16"
 						key="element-90"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Center">
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<text><![CDATA[Real Amt.]]></text>
 				</staticText>
@@ -256,110 +274,180 @@
 						style="Detail_Header"
 						x="3"
 						y="50"
-						width="142"
+						width="153"
 						height="16"
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement>
-						<font fontName="Bitstream Vera Sans"/>
+					<textElement verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<text><![CDATA[Article]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="145"
+						x="156"
 						y="50"
-						width="45"
+						width="51"
 						height="16"
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left">
-						<font fontName="Bitstream Vera Sans"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<text><![CDATA[Quantity]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="190"
+						x="207"
 						y="50"
-						width="27"
+						width="33"
 						height="16"
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement>
-						<font fontName="Bitstream Vera Sans"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
-				<text><![CDATA[#]]></text>
+				<text><![CDATA[UOM]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="217"
+						x="240"
 						y="50"
-						width="57"
+						width="58"
 						height="16"
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left">
-						<font fontName="Bitstream Vera Sans"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<text><![CDATA[Weight]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="274"
+						x="298"
 						y="50"
 						width="57"
 						height="16"
 						key="element-90"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement>
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<text><![CDATA[Avg. Pr.]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="501"
+						x="722"
 						y="50"
-						width="33"
+						width="34"
 						height="16"
 						key="element-90"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Center">
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<text><![CDATA[Disc.]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"
-						x="388"
+						x="510"
 						y="50"
-						width="56"
+						width="57"
 						height="16"
 						key="element-90"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Center">
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<text><![CDATA[Avg. Net Pr.]]></text>
 				</staticText>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Header"
+						x="673"
+						y="50"
+						width="49"
+						height="16"
+						key="textField-8"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Header"
+						x="567"
+						y="50"
+						width="49"
+						height="16"
+						key="textField-10"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Header"
+						x="461"
+						y="50"
+						width="49"
+						height="16"
+						key="textField-12"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Header"
+						x="355"
+						y="50"
+						width="49"
+						height="16"
+						key="textField-14"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#555555"/>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVISOSYM}]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement
+						style="Detail_Header"
+						x="756"
+						y="50"
+						width="24"
+						height="16"
+						key="element-91"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Left" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<text><![CDATA[%]]></text>
+				</staticText>
 			</band>
 			</groupHeader>
 			<groupFooter>
-			<band height="30"  isSplitAllowed="true" >
+			<band height="42"  isSplitAllowed="true" >
 				<elementGroup><!--  Start: 1 !-->
 				<line direction="TopDown">
 					<reportElement
 						x="0"
 						y="0"
 						width="0"
-						height="30"
+						height="41"
 						forecolor="#555555"
 						key="line-32"
 						stretchType="RelativeToBandHeight"/>
@@ -368,10 +456,10 @@
 				</elementGroup><!-- End 1 !-->
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="781"
 						y="0"
 						width="0"
-						height="30"
+						height="41"
 						forecolor="#555555"
 						key="line-33"
 						stretchType="RelativeToBandHeight"/>
@@ -379,10 +467,10 @@
 				</line>
 				<line direction="TopDown">
 					<reportElement
-						x="1"
-						y="29"
-						width="534"
-						height="0"
+						x="0"
+						y="41"
+						width="782"
+						height="1"
 						forecolor="#555555"
 						key="line-34"/>
 					<graphicElement stretchType="NoStretch" pen="2Point"/>
@@ -405,13 +493,13 @@
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Gray"
-						x="331"
+						x="298"
 						y="8"
-						width="113"
+						width="189"
 						height="16"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement>
+					<textElement textAlignment="Right">
 						<font fontName="Bitstream Vera Sans"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{totalLineDetail}!=null)?$P{NUMBERFORMAT}.format($V{totalLineDetail}):new String(" ")]]></textFieldExpression>
@@ -421,11 +509,11 @@
 						style="Total_Gray"
 						x="217"
 						y="8"
-						width="114"
+						width="81"
 						height="16"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement>
+					<textElement textAlignment="Right">
 						<font fontName="Bitstream Vera Sans"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{totalWeightDetail}!=null)?$P{NUMBERFORMAT}.format($V{totalWeightDetail}):new String(" ")]]></textFieldExpression>
@@ -433,13 +521,13 @@
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Gray"
-						x="444"
+						x="510"
 						y="8"
-						width="89"
+						width="188"
 						height="16"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement>
+					<textElement textAlignment="Right">
 						<font fontName="Bitstream Vera Sans"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{totalLineDiscountDetail}!=null)?$P{NUMBERFORMAT}.format($V{totalLineDiscountDetail}):new String(" ")]]></textFieldExpression>
@@ -448,11 +536,53 @@
 					<reportElement
 						x="3"
 						y="0"
-						width="531"
+						width="777"
 						height="0"
 						key="line-35"/>
 					<graphicElement stretchType="NoStretch"/>
 				</line>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Gray"
+						x="487"
+						y="8"
+						width="23"
+						height="16"
+						key="textField-16"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Gray"
+						x="698"
+						y="8"
+						width="23"
+						height="16"
+						key="textField-17"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement
+						style="Total_Gray"
+						x="721"
+						y="8"
+						width="58"
+						height="16"
+						key="staticText-10"/>
+					<box topBorder="None" topBorderColor="#000000" topPadding="2" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center" verticalAlignment="Bottom">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<text><![CDATA[]]></text>
+				</staticText>
 			</band>
 			</groupFooter>
 		</group>
@@ -472,7 +602,7 @@
 						mode="Transparent"
 						x="0"
 						y="7"
-						width="535"
+						width="780"
 						height="30"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -485,7 +615,7 @@
 					<reportElement
 						x="0"
 						y="38"
-						width="535"
+						width="780"
 						height="0"
 						key="line-1"/>
 					<graphicElement stretchType="NoStretch" pen="2Point"/>
@@ -494,7 +624,7 @@
 					<reportElement
 						x="0"
 						y="39"
-						width="535"
+						width="780"
 						height="21"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -513,7 +643,7 @@
 			<band height="16"  isSplitAllowed="true" >
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="781"
 						y="0"
 						width="0"
 						height="16"
@@ -536,30 +666,30 @@
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
-						x="332"
+						x="404"
 						y="0"
-						width="57"
+						width="82"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TOTALLINE}!=null)?$P{NUMBERFORMAT}.format($F{TOTALLINE}):new String(" ")]]></textFieldExpression>
 				</textField>
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
-						x="445"
+						x="616"
 						y="0"
-						width="56"
+						width="82"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{TOTALLINEDISCOUNT}!=null)?$P{NUMBERFORMAT}.format($F{TOTALLINEDISCOUNT}):new String(" ")]]></textFieldExpression>
 				</textField>
@@ -568,88 +698,88 @@
 						style="Detail_Line"
 						x="3"
 						y="0"
-						width="142"
+						width="153"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="Thin" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
 					<textElement verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[$F{PRODUCTNAME}]]></textFieldExpression>
 				</textField>
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
-						x="145"
+						x="156"
 						y="0"
-						width="45"
+						width="51"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{QTY}!=null)?$P{NUMBERFORMAT}.format($F{QTY}):new String(" ")]]></textFieldExpression>
 				</textField>
 				<textField isStretchWithOverflow="true" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
-						x="190"
+						x="207"
 						y="0"
-						width="28"
+						width="34"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[$F{UOM}]]></textFieldExpression>
 				</textField>
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
-						x="218"
+						x="241"
 						y="0"
 						width="57"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{WEIGHT}!=null)?$P{NUMBERFORMAT}.format($F{WEIGHT}):new String(" ")]]></textFieldExpression>
 				</textField>
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
-						x="275"
+						x="298"
 						y="0"
-						width="57"
+						width="82"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{PRICEACTUAL}!=null)?$P{NUMBERFORMAT}.format($F{PRICEACTUAL}):new String(" ")]]></textFieldExpression>
 				</textField>
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Detail_Line"
-						x="501"
+						x="722"
 						y="0"
-						width="33"
+						width="58"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{DISCOUNT}!=null)?$P{NUMBERFORMAT}.format($F{DISCOUNT}):new String(" ")]]></textFieldExpression>
 				</textField>
@@ -657,18 +787,78 @@
 					<reportElement
 						style="Detail_Line"
 						mode="Opaque"
-						x="389"
+						x="510"
 						y="0"
-						width="56"
+						width="82"
 						height="16"
 						key="textField"
 						stretchType="RelativeToBandHeight"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font fontName="Bitstream Vera Sans"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="None" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Right" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($F{REALPRICE}!=null)?$P{NUMBERFORMAT}.format($F{REALPRICE}):new String(" ")]]></textFieldExpression>
 				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="698"
+						y="0"
+						width="24"
+						height="16"
+						key="textField-9"
+						stretchType="RelativeToBandHeight"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="592"
+						y="0"
+						width="24"
+						height="16"
+						key="textField-11"
+						stretchType="RelativeToBandHeight"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="486"
+						y="0"
+						width="24"
+						height="16"
+						key="textField-13"
+						stretchType="RelativeToBandHeight"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Detail_Line"
+						x="380"
+						y="0"
+						width="24"
+						height="16"
+						key="textField-15"
+						stretchType="RelativeToBandHeight"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="2" rightBorder="1Point" rightBorderColor="#000000" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center" verticalAlignment="Middle">
+						<font fontName="Bitstream Vera Sans" size="8"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
 			</band>
 		</detail>
 		<columnFooter>
@@ -679,20 +869,20 @@
 			<band height="27"  isSplitAllowed="true" >
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
-						x="400"
+						x="645"
 						y="4"
 						width="95"
 						height="19"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
+					<textElement textAlignment="Right" verticalAlignment="Bottom">
 						<font fontName="Helvetica" size="10"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
 				</textField>
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
-						x="499"
+						x="744"
 						y="4"
 						width="36"
 						height="19"
@@ -700,7 +890,7 @@
 						backcolor="#FFFFFF"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle" rotation="None" lineSpacing="Single">
+					<textElement textAlignment="Left" verticalAlignment="Bottom" rotation="None" lineSpacing="Single">
 						<font fontName="Helvetica" pdfFontName="Helvetica" size="10" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="CP1252" isStrikeThrough="false" />
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
@@ -709,7 +899,7 @@
 					<reportElement
 						x="0"
 						y="1"
-						width="535"
+						width="782"
 						height="0"
 						forecolor="#000000"
 						key="line"/>
@@ -717,26 +907,26 @@
 				</line>
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
-						x="277"
+						x="379"
 						y="4"
 						width="69"
 						height="19"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement verticalAlignment="Middle">
+					<textElement verticalAlignment="Bottom">
 						<font fontName="Times-Roman" size="10"/>
 					</textElement>
 				<textFieldExpression   class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
 				</textField>
 				<staticText>
 					<reportElement
-						x="213"
+						x="315"
 						y="4"
 						width="60"
 						height="19"
 						key="staticText-1"/>
 					<box topBorder="None" topBorderColor="#000000" topPadding="2" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right">
+					<textElement textAlignment="Right" verticalAlignment="Bottom">
 						<font/>
 					</textElement>
 				<text><![CDATA[Printed on]]></text>
@@ -765,11 +955,11 @@
 						style="Total_Gray"
 						x="217"
 						y="6"
-						width="114"
+						width="81"
 						height="16"
 						key="textField-2"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left">
+					<textElement textAlignment="Right">
 						<font fontName="Bitstream Vera Sans"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{totalWeight}!=null)?$P{NUMBERFORMAT}.format($V{totalWeight}):new String(" ")]]></textFieldExpression>
@@ -777,13 +967,13 @@
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Gray"
-						x="331"
+						x="298"
 						y="6"
-						width="113"
+						width="189"
 						height="16"
 						key="textField-3"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left">
+					<textElement textAlignment="Right">
 						<font fontName="Bitstream Vera Sans"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{totalLine}!=null)?$P{NUMBERFORMAT}.format($V{totalLine}):new String(" ")]]></textFieldExpression>
@@ -791,17 +981,59 @@
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Gray"
-						x="444"
+						x="510"
 						y="6"
-						width="89"
+						width="188"
 						height="16"
 						key="textField-4"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left">
+					<textElement textAlignment="Right">
 						<font fontName="Bitstream Vera Sans"/>
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{totalLineDetail}!=null)?$P{NUMBERFORMAT}.format($V{totalLineDetail}):new String(" ")]]></textFieldExpression>
 				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Gray"
+						x="487"
+						y="6"
+						width="23"
+						height="16"
+						key="textField-19"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Gray"
+						x="698"
+						y="6"
+						width="23"
+						height="16"
+						key="textField-20"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
+				<staticText>
+					<reportElement
+						style="Total_Gray"
+						x="721"
+						y="6"
+						width="60"
+						height="16"
+						key="staticText-9"/>
+					<box topBorder="None" topBorderColor="#000000" topPadding="2" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center" verticalAlignment="Bottom">
+						<font fontName="Bitstream Vera Sans"/>
+					</textElement>
+				<text><![CDATA[]]></text>
+				</staticText>
 			</band>
 		</summary>
 </jasperReport>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscountJR.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
 * under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SL 
-* All portions are Copyright (C) 2001-2006 Openbravo SL 
+* All portions are Copyright (C) 2001-2008 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
@@ -42,6 +42,8 @@
       <SUBREPORT id="reportCBPartnerId_IN" name="reportCBPartnerId_IN" report="org/openbravo/erpCommon/reference/List">
       <ARGUMENT name="parameterListSelected" withId="paramVacio"/>
     </SUBREPORT>
-
-  
+  <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/ReportInvoiceDiscount_data.xsql	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceDiscount_data.xsql	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,37 +28,53 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
     <![CDATA[
-	SELECT C_BPARTNER_ID as ID, NAME, PRODUCTNAME, QTY,UOM, ROUND(C_DIVIDE(TOTALLINE,QTY),3) AS PRICEACTUAL, TOTALLINE, ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3) AS REALPRICE, TOTALLINEDISCOUNT,
-        (ROUND(C_DIVIDE((ROUND(C_DIVIDE(TOTALLINE,QTY),3)-ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3)),ROUND(C_DIVIDE(TOTALLINE,QTY),3)),2))*100 AS DISCOUNT,
-        (CASE (ROUND(C_DIVIDE((ROUND(C_DIVIDE(TOTALLINE,QTY),3)-ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3)),ROUND(C_DIVIDE(TOTALLINE,QTY),3)),2))*100 WHEN 0 THEN '' ELSE '' END)  AS CLASS_DESIGN,
-        WEIGHT
-        FROM (
-        SELECT C_BPARTNER.C_BPARTNER_ID, C_BPARTNER.NAME, M_PRODUCT.NAME AS PRODUCTNAME, C_UOM.UOMSYMBOL AS UOM, SUM(C_INVOICELINE.QTYINVOICED) AS QTY, ROUND(SUM(LINENETAMT),2) AS TOTALLINE, 
-        ROUND(SUM(LINENETAMT*(1-COALESCE(DISCOUNTPERUNIT,0))),2) AS TOTALLINEDISCOUNT, SUM(C_INVOICELINE.QTYINVOICED)*COALESCE(M_PRODUCT.WEIGHT,0) AS WEIGHT
-        FROM C_INVOICELINE left join
-          (SELECT C_INVOICE_ID, DISCOUNTLINES/(TOTALLINES+DISCOUNTLINES) AS DISCOUNTPERUNIT 
-          FROM (SELECT I.C_INVOICE_ID, I.TOTALLINES, -SUM(LINENETAMT) AS DISCOUNTLINES FROM C_INVOICE I, C_INVOICELINE IL 
-          WHERE I.C_INVOICE_ID = IL.C_INVOICE_ID 
-          AND IL.C_INVOICE_DISCOUNT_ID IS NOT NULL 
-          GROUP BY I.C_INVOICE_ID, I.TOTALLINES) BB) A on C_INVOICELINE.C_INVOICE_ID = A.C_INVOICE_ID
-          left join C_INVOICE on C_INVOICELINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID,
-        M_PRODUCT, C_BPARTNER,  C_UOM
-        WHERE  C_INVOICELINE.C_INVOICE_DISCOUNT_ID IS NULL
-        AND C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
-        AND M_PRODUCT.C_UOM_ID = C_UOM.C_UOM_ID
-        AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
-        AND C_INVOICE.ISSOTRX='Y'
-        AND C_INVOICE.AD_CLIENT_ID IN ('1')
-        AND C_INVOICE.AD_ORG_ID IN ('1')
-        AND PRICEACTUAL<>0
-        AND C_INVOICE.DATEINVOICED >= to_date(?)
-        AND C_INVOICE.DATEINVOICED <= to_date(?)
-        AND 1=1
-        GROUP BY C_BPARTNER.C_BPARTNER_ID, C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.UOMSYMBOL, M_PRODUCT.WEIGHT) AA
-        WHERE QTY<>0
-        AND 2=2
-        ORDER BY NAME
+	SELECT C_BPARTNER_ID as ID, NAME, PRODUCTNAME, QTY,UOM, ROUND(C_DIVIDE(TOTALLINE,QTY),3) AS PRICEACTUAL, TOTALLINE, 
+	ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3) AS REALPRICE, TOTALLINEDISCOUNT,        
+	(ROUND(C_DIVIDE((ROUND(C_DIVIDE(TOTALLINE,QTY),3)-ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3)),ROUND(C_DIVIDE(TOTALLINE,QTY),3)),2))*100 AS DISCOUNT,        
+	(CASE (ROUND(C_DIVIDE((ROUND(C_DIVIDE(TOTALLINE,QTY),3)-ROUND(C_DIVIDE(TOTALLINEDISCOUNT,QTY),3)),ROUND(C_DIVIDE(TOTALLINE,QTY),3)),2))*100 WHEN 0 THEN '' ELSE '' END)  AS CLASS_DESIGN,        
+	WEIGHT,	TRCURRENCYID AS TRANSCURRENCYID, TRDATE AS TRANSDATE,	TRCLIENTID AS TRANSCLIENTID, TRORGID AS TRANSORGID,
+	C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM, C_CURRENCY_ISOSYM(?) AS CONVISOSYM
+	FROM (SELECT C_BPARTNER.C_BPARTNER_ID, C_BPARTNER.NAME, M_PRODUCT.NAME AS PRODUCTNAME, C_UOM.UOMSYMBOL AS UOM, SUM(C_INVOICELINE.QTYINVOICED) AS QTY, 
+	C_CURRENCY_CONVERT(ROUND(SUM(LINENETAMT),2), C_INVOICE.C_CURRENCY_ID, ?,  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS TOTALLINE,         
+	C_CURRENCY_CONVERT(ROUND(SUM(LINENETAMT*(1-COALESCE(DISCOUNTPERUNIT,0))),2), C_INVOICE.C_CURRENCY_ID, ?,  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS TOTALLINEDISCOUNT, 
+	SUM(C_INVOICELINE.QTYINVOICED)*COALESCE(M_PRODUCT.WEIGHT,0) AS WEIGHT,
+	C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+	TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+	C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID, 
+	C_INVOICELINE.AD_ORG_ID AS TRORGID      
+	FROM C_INVOICELINE left join          
+	(SELECT C_INVOICE_ID, DISCOUNTLINES/(TOTALLINES+DISCOUNTLINES) AS DISCOUNTPERUNIT           
+	FROM (SELECT I.C_INVOICE_ID, 
+	C_CURRENCY_CONVERT(I.TOTALLINES, I.C_CURRENCY_ID, ?,  TO_DATE(COALESCE(I.DATEINVOICED, NOW())), NULL, I.AD_CLIENT_ID, I.AD_ORG_ID) AS TOTALLINES, 
+	C_CURRENCY_CONVERT(-SUM(LINENETAMT), I.C_CURRENCY_ID, ?,  TO_DATE(COALESCE(I.DATEINVOICED, NOW())), NULL, IL.AD_CLIENT_ID, IL.AD_ORG_ID) AS DISCOUNTLINES
+	FROM C_INVOICE I, C_INVOICELINE IL           
+	WHERE I.C_INVOICE_ID = IL.C_INVOICE_ID AND IL.C_INVOICE_DISCOUNT_ID IS NOT NULL           
+	GROUP BY I.C_INVOICE_ID, I.TOTALLINES, I.C_CURRENCY_ID, I.DATEINVOICED, I.AD_CLIENT_ID, I.AD_ORG_ID, IL.AD_CLIENT_ID, IL.AD_ORG_ID) BB) A on C_INVOICELINE.C_INVOICE_ID = A.C_INVOICE_ID
+    left join C_INVOICE on C_INVOICELINE.C_INVOICE_ID = C_INVOICE.C_INVOICE_ID,
+    M_PRODUCT, C_BPARTNER,  C_UOM
+    WHERE  C_INVOICELINE.C_INVOICE_DISCOUNT_ID IS NULL
+    AND C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+    AND M_PRODUCT.C_UOM_ID = C_UOM.C_UOM_ID
+    AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+    AND C_INVOICE.ISSOTRX='Y'
+    AND C_INVOICE.AD_CLIENT_ID IN ('1')
+    AND C_INVOICE.AD_ORG_ID IN ('1')
+    AND PRICEACTUAL<>0
+    AND C_INVOICE.DATEINVOICED >= to_date(?)
+    AND C_INVOICE.DATEINVOICED <= to_date(?)
+    AND 1=1
+    GROUP BY C_BPARTNER.C_BPARTNER_ID, C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.UOMSYMBOL, M_PRODUCT.WEIGHT, 
+    C_INVOICE.C_CURRENCY_ID, C_INVOICE.DATEINVOICED, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AA
+    WHERE QTY<>0
+    AND 2=2
+    ORDER BY NAME
       ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
     <Parameter name="adUserClient" type="replace" optional="true" after="C_INVOICE.AD_CLIENT_ID IN (" text="'1'"/>
     <Parameter name="adUserOrg" type="replace" optional="true" after="C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
     <Parameter name="datefrom"/>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.html	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.html	Thu Oct 30 17:30:39 2008 +0000
@@ -13,7 +13,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SL
- * All portions are Copyright (C) 2001-2006 Openbravo SL
+ * All portions are Copyright (C) 2001-2008 Openbravo SL
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -54,7 +54,11 @@
 function validate(action)
 {
 	var frm = document.frmMain;
-	if (frm.inpDateFrom.value == null || frm.inpDateFrom.value == "") {
+	if (frm.inpCurrencyId.value == null || frm.inpCurrencyId.value == "") {
+	    setWindowElementFocus(frm.inpCurrencyId);
+	    showJSMessage(7);
+	    return false;
+	}else if (frm.inpDateFrom.value == null || frm.inpDateFrom.value == "") {
 		setWindowElementFocus(frm.inpDateFrom);
 		showJSMessage(7);
 		return false;
@@ -345,8 +349,12 @@
                   <TD class="TitleCell"><SPAN class="LabelText">Less Than</SPAN></TD>
                   <TD class="TextBox_ContentCell"> <INPUT dojoType="openbravo:RealNumberTextbox" greaterThan="paramMayor" class="TextBox_OneCell_width" type="text" name="inpMenor" maxlength="10" id="paramMenor" value=""></INPUT><script>djConfig.searchIds.push("paramMenor");</script>
                   </TD>
-                  <TD class="TitleCell"></TD>
-                  <TD class="ContentCell"></TD>
+                  <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>    
                 </TR>
                 <TR>
                   <td colspan="6">
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesFilterJR.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
 * under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SL 
-* All portions are Copyright (C) 2001-2006 Openbravo SL 
+* All portions are Copyright (C) 2001-2008 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
@@ -54,6 +54,7 @@
   <PARAMETER id="paramMayor" name="mayor" attribute="value"/>
   <PARAMETER id="paramMenor" name="menor" attribute="value"/>
   <PARAMETER id="paramreportProducttype" name="producttype"/>
+  <PARAMETER id="paramC_Currency_ID" name="ccurrencyid" attribute="value"/>
   <PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
   <PARAMETER id="tdleftTabs" name="leftTabs" default=""/>
   <PARAMETER id="paramParentTabContainer" name="parentTabContainer" default=" "/>
@@ -91,5 +92,8 @@
   <SUBREPORT id="reportProducttype" name="reportProductType" report="org/openbravo/erpCommon/reference/List">
     <ARGUMENT name="parameterListSelected" withId="paramreportProducttype"/>
   </SUBREPORT>
+  <SUBREPORT id="reportC_Currency_ID" name="reportC_Currency_ID" report="org/openbravo/erpCommon/reference/List">
+    <ARGUMENT name="parameterListSelected" withId="paramC_Currency_ID"/>
+  </SUBREPORT>
   <DISCARD id="discard"/>
 </REPORT>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR.java	Thu Oct 30 17:30:39 2008 +0000
@@ -19,8 +19,6 @@
 
 package org.openbravo.erpCommon.ad_reports;
 
-import org.openbravo.erpCommon.utility.ToolBar;
-
 import org.openbravo.erpCommon.utility.*;
 import org.openbravo.erpCommon.businessUtility.WindowTabs;
 import org.openbravo.erpCommon.businessUtility.Tree;
@@ -45,7 +43,8 @@
   public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
 
-
+    //Get user Client's base currency
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
     if (vars.commandIn("DEFAULT", "DEFAULT_COMPARATIVE")){
       String strDateFrom = vars.getGlobalVariable("inpDateFrom", "ReportInvoiceVendorDimensionalAnalysesJR|dateFrom", "");
       String strDateTo = vars.getGlobalVariable("inpDateTo", "ReportInvoiceVendorDimensionalAnalysesJR|dateTo", "");
@@ -62,10 +61,11 @@
       String strMayor = vars.getGlobalVariable("inpMayor", "ReportInvoiceVendorDimensionalAnalysesJR|mayor", "");
       String strMenor = vars.getGlobalVariable("inpMenor", "ReportInvoiceVendorDimensionalAnalysesJR|menor", "");
       String strProducttype = vars.getGlobalVariable("inpProducttype", "ReportInvoiceVendorDimensionalAnalysesJR|producttype", "");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceVendorDimensionalAnalysesJR|currency", strUserCurrencyId);
       String strComparative = "";
       if (vars.commandIn("DEFAULT_COMPARATIVE")) strComparative = vars.getRequestGlobalVariable("inpComparative", "ReportInvoiceVendorDimensionalAnalysesJR|comparative");
       else strComparative = vars.getGlobalVariable("inpComparative", "ReportInvoiceVendorDimensionalAnalysesJR|comparative", "N");
-      printPageDataSheet(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype);
+      printPageDataSheet(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype, strCurrencyId);
     }else if (vars.commandIn("EDIT_HTML", "EDIT_HTML_COMPARATIVE")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom", "ReportInvoiceVendorDimensionalAnalysesJR|dateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportInvoiceVendorDimensionalAnalysesJR|dateTo");
@@ -83,7 +83,8 @@
       String strMenor = vars.getStringParameter("inpMenor", "");
       String strProducttype = vars.getRequestGlobalVariable("inpProducttype", "ReportInvoiceVendorDimensionalAnalysesJR|producttype");
       String strComparative = vars.getStringParameter("inpComparative", "N");
-      printPageHtml(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype, "html");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceVendorDimensionalAnalysesJR|currency", strUserCurrencyId);
+      printPageHtml(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype, strCurrencyId, "html");
     }else if (vars.commandIn("EDIT_PDF", "EDIT_PDF_COMPARATIVE")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom", "ReportInvoiceVendorDimensionalAnalysesJR|dateFrom");
       String strDateTo = vars.getRequestGlobalVariable("inpDateTo", "ReportInvoiceVendorDimensionalAnalysesJR|dateTo");
@@ -101,11 +102,12 @@
       String strMenor = vars.getStringParameter("inpMenor", "");
       String strProducttype = vars.getRequestGlobalVariable("inpProducttype", "ReportInvoiceVendorDimensionalAnalysesJR|producttype");
       String strComparative = vars.getStringParameter("inpComparative", "N");
-      printPageHtml(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype, "pdf");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceVendorDimensionalAnalysesJR|currency", strUserCurrencyId);
+      printPageHtml(response, vars, strComparative, strDateFrom, strDateTo, strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown, strShown, strDateFromRef, strDateToRef, strOrg, strOrder, strMayor, strMenor, strProducttype, strCurrencyId, "pdf");
     } else pageErrorPopUp(response);
   }
 
-  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strOrder, String strMayor, String strMenor, String strProducttype) throws IOException, ServletException {
+  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strOrder, String strMayor, String strMenor, String strProducttype, String strCurrencyId) throws IOException, ServletException {
     if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
     String discard[]={"selEliminarHeader1"};
     if (strComparative.equals("Y")) {
@@ -156,10 +158,6 @@
     xmlDocument.setParameter("dateToRef", strDateToRef);
     xmlDocument.setParameter("dateToRefdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
     xmlDocument.setParameter("dateToRefsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-    /*xmlDocument.setParameter("paramBPartnerId", strcBpartnerId);
-      xmlDocument.setParameter("bPartnerDescription", ReportInvoiceVendorDimensionalAnalysesJRData.selectBpartner(this, strcBpartnerId));
-      xmlDocument.setParameter("mProduct", strmProductId);
-      xmlDocument.setParameter("productDescription", ReportInvoiceVendorDimensionalAnalysesJRData.selectMproduct(this, strmProductId));*/
     xmlDocument.setParameter("cBpGroupId", strPartnerGroup);
     xmlDocument.setParameter("mProductCategoryId", strProductCategory);
     xmlDocument.setParameter("adOrgId", strOrg);
@@ -200,7 +198,16 @@
     } catch (Exception ex) {
       throw new ServletException(ex);
     }
-
+    
+    xmlDocument.setParameter("ccurrencyid", strCurrencyId);    
+    try {
+      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Currency_ID", "", "", Utility.getContext(this, vars, "#User_Org", "ReportInvoiceVendorDimensionalAnalysesJR"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoiceVendorDimensionalAnalysesJR", strCurrencyId);
+      xmlDocument.setData("reportC_Currency_ID","liststructure", comboTableData.select(false));
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
 
     if (vars.getLanguage().equals("en_US")) {
       xmlDocument.setData("structure1", ReportInvoiceVendorDimensionalAnalysesJRData.selectNotShown(this, strShown)); 
@@ -216,7 +223,7 @@
     out.close();
   }
 
-  void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strOrder, String strMayor, String strMenor, String strProducttype, String strOutput) throws IOException, ServletException{
+  void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo, String strPartnerGroup, String strcBpartnerId, String strProductCategory, String strmProductId, String strNotShown, String strShown, String strDateFromRef, String strDateToRef, String strOrg, String strOrder, String strMayor, String strMenor, String strProducttype, String strCurrencyId, String strOutput) throws IOException, ServletException{
     if (log4j.isDebugEnabled()) log4j.debug("Output: print html");
     String strOrderby = "";
     String[] discard = {"", "", "", "", ""};
@@ -301,9 +308,9 @@
         if (strOrder.equals("Normal")){
           strOrderby = " ORDER BY NIVEL"+k;
         } else if (strOrder.equals("Amountasc")){
-          strOrderby = " ORDER BY AMOUNT ASC";
+          strOrderby = " ORDER BY CONVAMOUNT ASC";
         } else if (strOrder.equals("Amountdesc")){
-          strOrderby = " ORDER BY AMOUNT DESC";
+          strOrderby = " ORDER BY CONVAMOUNT DESC";
         } else{
           strOrderby = "1";
         }
@@ -311,9 +318,9 @@
         if (strOrder.equals("Normal")){
           strOrderby += "NIVEL"+k;
         } else if (strOrder.equals("Amountasc")){
-          strOrderby += "AMOUNT ASC";
+          strOrderby += "CONVAMOUNT ASC";
         } else if (strOrder.equals("Amountdesc")){
-          strOrderby += "AMOUNT DESC";
+          strOrderby += "CONVAMOUNT DESC";
         } else{
           strOrderby = "1";
         }
@@ -323,48 +330,58 @@
       strOrderby = " ORDER BY 1";
     }
     String strHaving = "";
-    if (!strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) > "+strMayor+" AND SUM(LINENETAMT) < "+strMenor;}
-    else if (!strMayor.equals("") && strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) > "+strMayor;}
-    else if (strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING SUM(LINENETAMT) < "+strMenor;}
-    else{ strHaving = " HAVING SUM(LINENETAMT) <> 0 OR SUM(LINENETREF) <> 0";}
+    if (!strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING (SUM(CONVAMOUNT) > "+strMayor+" AND SUM(CONVAMOUNT) < "+strMenor+")";}
+    else if (!strMayor.equals("") && strMenor.equals("")) {strHaving = " HAVING (SUM(CONVAMOUNT) > "+strMayor+")";}
+    else if (strMayor.equals("") && !strMenor.equals("")) {strHaving = " HAVING (SUM(CONVAMOUNT) < "+strMenor+")";}
+    else{ strHaving = " HAVING (SUM(CONVAMOUNT) <> 0 OR SUM(CONVAMOUNTREF) <> 0)";}
     strOrderby = strHaving + strOrderby;
-    String strReportPath = "";
+    
+    //Checks if there is a conversion rate for each of the transactions of the report
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
     if (strComparative.equals("Y")){
-      strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/SimpleDimensionalComparative.jrxml";
-      data = ReportInvoiceVendorDimensionalAnalysesJRData.select(this, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strProducttype, strDateFromRef, DateTimeData.nDaysAfter(this, strDateToRef,"1"), strOrderby);
+      try {
+        data = ReportInvoiceVendorDimensionalAnalysesJRData.select(this, strCurrencyId, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strProducttype, strDateFromRef, DateTimeData.nDaysAfter(this, strDateToRef,"1"), strOrderby);
+      } catch(ServletException ex) {
+        myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+      }
     } else {
-      strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/SimpleDimensionalNoComparative.jrxml";
-      data = ReportInvoiceVendorDimensionalAnalysesJRData.selectNoComparative(this, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strProducttype, strOrderby);
+      try {
+        data = ReportInvoiceVendorDimensionalAnalysesJRData.selectNoComparative(this, strCurrencyId, strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4], Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorDimensionalAnalysesJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strProducttype, strOrderby);
+      } catch(ServletException ex) {
+        myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+      }
     }
-    if (data.length == 0 || data == null){
-      data = ReportInvoiceVendorDimensionalAnalysesJRData.set();
+    strConvRateErrorMsg = myMessage.getMessage();
+    //If a conversion rate is missing for a certain transaction, an error message window pops-up.
+    if(!strConvRateErrorMsg.equals("") && strConvRateErrorMsg != null) {
+      advisePopUp(response, "ERROR", Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()), strConvRateErrorMsg);      
+    } else { //Otherwise, the report is launched
+      String strReportPath = "";
+      if (strComparative.equals("Y")){
+        strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/SimpleDimensionalComparative.jrxml";
+      } else {
+        strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/SimpleDimensionalNoComparative.jrxml";
+      }
+      if (data.length == 0 || data == null){
+        data = ReportInvoiceVendorDimensionalAnalysesJRData.set();
+      }
+  
+      HashMap<String, Object> parameters = new HashMap<String, Object>();
+      parameters.put("LEVEL1_LABEL", strLevelLabel[0]);
+      parameters.put("LEVEL2_LABEL", strLevelLabel[1]);
+      parameters.put("LEVEL3_LABEL", strLevelLabel[2]);
+      parameters.put("LEVEL4_LABEL", strLevelLabel[3]);
+      parameters.put("LEVEL5_LABEL", strLevelLabel[4]);
+      parameters.put("DIMENSIONS", new Integer(intDiscard));
+      parameters.put("REPORT_TITLE", classInfo.name);
+      parameters.put("REPORT_SUBTITLE", strTitle);
+      parameters.put("PRODUCT_LEVEL", new Integer(intProductLevel));
+      renderJR(vars, response, strReportPath, strOutput, parameters, data, null );
     }
-
-    HashMap<String, Object> parameters = new HashMap<String, Object>();
-    parameters.put("LEVEL1_LABEL", strLevelLabel[0]);
-    parameters.put("LEVEL2_LABEL", strLevelLabel[1]);
-    parameters.put("LEVEL3_LABEL", strLevelLabel[2]);
-    parameters.put("LEVEL4_LABEL", strLevelLabel[3]);
-    parameters.put("LEVEL5_LABEL", strLevelLabel[4]);
-    parameters.put("DIMENSIONS", new Integer(intDiscard));
-    parameters.put("REPORT_TITLE", classInfo.name);
-    parameters.put("REPORT_SUBTITLE", strTitle);
-    parameters.put("PRODUCT_LEVEL", new Integer(intProductLevel));
-    renderJR(vars, response, strReportPath, strOutput, parameters, data, null );
   }
 
-  /*void printPagePdf(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnetId, String strmWarehouseId, String strcProjectId, String strissotrx) throws IOException, ServletException{
-    if (log4j.isDebugEnabled()) log4j.debug("Output: print pdf");
-    XmlDocument xmlDocument=null;
-    xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportSalesOrderEdition_Pdf").createXmlDocument();
-    OrderEditionData[] data = null;
-    data = OrderEditionData.select(this, Utility.getContext(this, vars, "#User_Org", "SalesOrderFilter"), Utility.getContext(this, vars, "#User_Client", "SalesOrderFilter"), strdateFrom, strdateTo, strcBpartnetId, strmWarehouseId, strcProjectId, strissotrx);
-    xmlDocument.setData("structure1", data);
-    String strResult = xmlDocument.print();
-    if (log4j.isDebugEnabled()) log4j.debug(strResult);
-    renderFO(strResult, response);
-    }*/
-
   public String getServletInfo() {
     return "Servlet ReportInvoiceVendorDimensionalAnalysesJR. This Servlet was made by Jon Alegría";
   } // end of getServletInfo() method
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR_data.xsql	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorDimensionalAnalysesJR_data.xsql	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -24,9 +24,27 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
     <![CDATA[
-      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, '' AS ID, '' AS NAME, UOMSYMBOL
+      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5,
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY,
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, UOMSYMBOL,
+      SUM(CONVAMOUNT) AS CONVAMOUNT,           	        	  
+	  SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,
+	  C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,	  	  
+	  C_CURRENCY_ISOSYM(?) AS CONVISOSYM,
+	  '' AS ID, '' AS NAME, '' AS TRANSCURRENCYID, '' AS TRANSDATE, '' AS TRANSCLIENTID, '' AS TRANSORGID
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, 
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY,
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, UOMSYMBOL,     
+	  C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT,  	  
+	  C_CURRENCY_CONVERT(SUM(LINENETREF), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF,       
+	  TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID
       FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, 
-            C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, 0 AS LINENETREF, 0 AS QTYINVOICEDREF, C_UOM.UOMSYMBOL
+      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICELINE left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
                          left join C_UOM     on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
                          left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID,
@@ -40,7 +58,12 @@
       AND C_INVOICE.AD_CLIENT_ID IN ('6')
       AND 1=1
       UNION ALL SELECT to_char('7') AS NIVEL1 , to_char('8') AS NIVEL2 , to_char('9') AS NIVEL3 , to_char('10') AS NIVEL4 , to_char('11') AS NIVEL5, 
-      0 AS LINENETAMT, 0 AS QTYINVOICED, C_INVOICELINE.LINENETAMT AS LINENETREF, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF, C_UOM.UOMSYMBOL
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 
+      C_INVOICELINE.LINENETAMT AS LINENETREF, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICELINE left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
                          left join C_UOM     on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
                          left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID,
@@ -53,9 +76,14 @@
       AND 3=3 AND C_INVOICE.AD_ORG_ID IN ('1')
       AND C_INVOICE.AD_CLIENT_ID IN('12')
       AND 2=2) AA
-      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL, 1
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL, CONVSYM, CONVISOSYM, 1
      ]]></Sql>
-     <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
+    <Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+    <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
     <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
     <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
     <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3, to_char(" text="'4'"/>
@@ -83,7 +111,7 @@
     <Parameter name="mProductCategoryId" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
     <Parameter name="mProductId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
     <Parameter name="producttype" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
-    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL" text=", 1"/>
+    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL, CONVSYM, CONVISOSYM" text=", 1"/>
   </SqlMethod>
   <SqlMethod name="set" type="constant" return="multiple">
       <SqlMethodComment></SqlMethodComment>
@@ -93,9 +121,26 @@
     <SqlMethodComment></SqlMethodComment>
     <Sql>
     <![CDATA[
-      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, '' AS ID, '' AS NAME, UOMSYMBOL
+      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5,
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY,
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, UOMSYMBOL,
+      SUM(CONVAMOUNT) AS CONVAMOUNT, 
+      SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,          
+	  C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,  
+	  C_CURRENCY_ISOSYM(?) AS CONVISOSYM
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, 
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY,
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, UOMSYMBOL,     
+	  C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT,
+	  0 AS CONVAMOUNTREF,
+      TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID
       FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, 
-      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, 0 AS LINENETREF, 0 AS QTYINVOICEDREF, C_UOM.UOMSYMBOL
+      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+	  C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+	  C_INVOICELINE.AD_ORG_ID AS TRORGID
       FROM C_INVOICELINE left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
                          left join C_UOM     on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID 
                          left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID,
@@ -108,9 +153,13 @@
       AND 0=0 AND C_INVOICE.AD_ORG_ID IN ('1')
       AND C_INVOICE.AD_CLIENT_ID IN ('6')
       AND 1=1) AA
-      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL, 1
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL, CONVSYM, CONVISOSYM, 1
      ]]></Sql>
-     <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
+    <Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+	<Parameter name="cCurrencyConv"/>
+    <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
     <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
     <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
     <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3, to_char(" text="'4'"/>
@@ -124,7 +173,7 @@
     <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
     <Parameter name="mProductId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
     <Parameter name="producttype" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
-    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL" text=", 1"/>
+    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, UOMSYMBOL, CONVSYM, CONVISOSYM" text=", 1"/>
   </SqlMethod>
   <SqlMethod name="selectBpartner" type="preparedStatement" return="multiple">
     <SqlMethodComment></SqlMethodComment>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorFilterJR.html	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorFilterJR.html	Thu Oct 30 17:30:39 2008 +0000
@@ -13,7 +13,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SL
- * All portions are Copyright (C) 2007 Openbravo SL
+ * All portions are Copyright (C) 2007-2008 Openbravo SL
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -54,7 +54,12 @@
 function validate()
 {
 	var frm = document.frmMain;
-	if (frm.inpDateFrom.value == null || frm.inpDateFrom.value == "") {
+	if (frm.inpCurrencyId.value == null || frm.inpCurrencyId.value == "") {
+	    setWindowElementFocus(frm.inpCurrencyId);
+	    showJSMessage(7);
+	    return false;
+	}
+	/*if (frm.inpDateFrom.value == null || frm.inpDateFrom.value == "") {
 		setWindowElementFocus(frm.inpDateFrom);
 		showJSMessage(7);
 		return false;
@@ -62,7 +67,7 @@
 		setWindowElementFocus(frm.inpDateTo);
 		showJSMessage(7);
 		return false;
-	}
+	}*/
 	return true;
 }
 
@@ -258,7 +263,6 @@
                       </TR>
                     </TABLE>
                  </TD>
-                  <TD class="TitleCell"></TD>
                   <TD class="TitleCell"><SPAN class="LabelText">To Date</SPAN></TD>
                   <TD class="TextBox_btn_ContentCell">
                     <TABLE border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
@@ -280,9 +284,14 @@
                       </TR>
                     </TABLE>
                   </TD>
-                  <TD class="ContentCell"> </TD>
+                  <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>    
                 </TR>
-    		<TR> 
+    		    <TR> 
                   <TD class="TitleCell"><SPAN class="LabelText">Business Partner</SPAN></TD>
                   <TD class="TextBox_btn_ContentCell" colspan="2">
                     <TABLE border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
@@ -348,7 +357,7 @@
                     <TD class="TitleCell"></TD>
                     <TD class="Button_CenterAlign_ContentCell">
                       <div>
-                        <a class="ButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='View Results in a New Window'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='ButtonLink_active'; return true;" onkeyup="this.className='ButtonLink_focus'; return true;" onclick="openServletNewWindow('EDIT_HTML', false, 'ReportInvoiceVendorFilterJR.html', 'ReportInvoiceVendorFilterJR', null, false, '700', '1000', true);return false;" id="buttonHTML">
+                        <a class="ButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='View Results in a New Window'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='ButtonLink_active'; return true;" onkeyup="this.className='ButtonLink_focus'; return true;" onclick="openServletNewWindow('EDIT_HTML', true, 'ReportInvoiceVendorFilterJR.html', 'ReportInvoiceVendorFilterJR', null, false, '700', '1000', true);return false;" id="buttonHTML">
                         <table class="Button" onmouseout="this.className='Button';window.status='';return true;" onmouseover="this.className='Button_hover';window.status='HTML_Report';return true;" onmousedown="this.className='Button_active';return true;" onmouseup="this.className='Button';return true;">
                           <tr>
                             <td class="Button_left"><img class="Button_Icon Button_Icon_html" alt="View Results in a New Window" title="View Results in a New Window" src="../../../../../web/images/blank.gif" border=0/></td>
@@ -361,7 +370,7 @@
                     </TD>
                     <TD class="Button_CenterAlign_ContentCell">
                       <div>
-                        <a class="ButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Export Results to PDF Format'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='ButtonLink_active'; return true;" onkeyup="this.className='ButtonLink_focus'; return true;" onclick="openServletNewWindow('EDIT_PDF', false, 'ReportInvoiceVendorFilterJR.html', 'ReportInvoiceVendorFilterJR', null, false, '700', '1000', true);return false;">
+                        <a class="ButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Export Results to PDF Format'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='ButtonLink_active'; return true;" onkeyup="this.className='ButtonLink_focus'; return true;" onclick="openServletNewWindow('EDIT_PDF', true, 'ReportInvoiceVendorFilterJR.html', 'ReportInvoiceVendorFilterJR', null, false, '700', '1000', true);return false;">
                         <table class="Button" onmouseout="this.className='Button';window.status='';return true;" onmouseover="this.className='Button_hover';window.status='PDF_Report';return true;" onmousedown="this.className='Button_active';return true;" onmouseup="this.className='Button';return true;">
                           <tr>
                             <td class="Button_left"><img class="Button_Icon Button_Icon_pdf" alt="Export Results to PDF Format" title="Export Results to PDF Format" src="../../../../../web/images/blank.gif" border=0/></td>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorFilterJR.xml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorFilterJR.xml	Thu Oct 30 17:30:39 2008 +0000
@@ -12,7 +12,7 @@
 * under the License. 
 * The Original Code is Openbravo ERP. 
 * The Initial Developer of the Original Code is Openbravo SL 
-* All portions are Copyright (C) 2007 Openbravo SL 
+* All portions are Copyright (C) 2007-2008 Openbravo SL 
 * All Rights Reserved. 
 * Contributor(s):  ______________________________________.
 ************************************************************************
@@ -33,6 +33,7 @@
   <PARAMETER id="paramM_WAREHOUSE_ID" name="mWarehouseId" attribute=""/>
   <PARAMETER id="C_PROJECT_ID" name="cProjectId" attribute="value"/>
   <PARAMETER id="C_PROJECT_ID_D" name="projectName" attribute="value"/>
+  <PARAMETER id="paramC_Currency_ID" name="ccurrencyid" attribute="value"/>
   <PARAMETER id="paramCSS" name="theme" attribute="href" replace="Default"/>
   <PARAMETER id="tdleftTabs" name="leftTabs" default=""/>
   <PARAMETER id="paramParentTabContainer" name="parentTabContainer" default=" "/>
@@ -45,5 +46,8 @@
   <SUBREPORT id="reportM_WAREHOUSEID" name="reportM_WAREHOUSEID" report="org/openbravo/erpCommon/reference/List">
     <ARGUMENT name="parameterListSelected" withId="paramM_WAREHOUSE_ID"/>
   </SUBREPORT>
+  <SUBREPORT id="reportC_Currency_ID" name="reportC_Currency_ID" report="org/openbravo/erpCommon/reference/List">
+    <ARGUMENT name="parameterListSelected" withId="paramC_Currency_ID"/>
+  </SUBREPORT>
   <DISCARD id="discard"/>
 </REPORT>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorJR.java	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorJR.java	Thu Oct 30 17:30:39 2008 +0000
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2001-2006 Openbravo SL 
+ * All portions are Copyright (C) 2001-2008 Openbravo SL 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -35,22 +35,25 @@
   public void doPost (HttpServletRequest request, HttpServletResponse response) throws IOException,ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
 
-
+    //Get user Client's base currency
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
     if (vars.commandIn("DEFAULT")){
       String strDateFrom = vars.getStringParameter("inpDateFrom", "");
       String strDateTo = vars.getStringParameter("inpDateTo", "");
-      printPageDataSheet(response, vars, strDateFrom, strDateTo);
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceVendorJR|currency", strUserCurrencyId);
+      printPageDataSheet(response, vars, strDateFrom, strDateTo, strCurrencyId);
     }else if (vars.commandIn("EDIT_HTML","EDIT_PDF")) {
       String strDateFrom = vars.getStringParameter("inpDateFrom");
       String strDateTo = vars.getStringParameter("inpDateTo");
       String strcBpartnetId = vars.getStringParameter("inpcBPartnerId");
       String strcProjectId = vars.getStringParameter("inpcProjectId");
       String strissotrx = "N";
-      printPageHtml(response, vars, strDateFrom, strDateTo, strcBpartnetId, strcProjectId ,strissotrx);
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoiceVendorJR|currency", strUserCurrencyId);
+      printPageHtml(response, vars, strDateFrom, strDateTo, strcBpartnetId, strcProjectId, strissotrx, strCurrencyId);
     } else pageErrorPopUp(response);
   }
 
-  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo) throws IOException, ServletException {
+  void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strCurrencyId) throws IOException, ServletException {
     if (log4j.isDebugEnabled()) log4j.debug("Output: dataSheet");
     XmlDocument xmlDocument=null;
     xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorFilterJR").createXmlDocument();
@@ -104,6 +107,16 @@
     } catch (Exception ex) {
       throw new ServletException(ex);
     }
+    
+    xmlDocument.setParameter("ccurrencyid", strCurrencyId);
+    try {
+       ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Currency_ID", "", "", Utility.getContext(this, vars, "#User_Org", "ReportInvoiceVendorJR"), Utility.getContext(this, vars, "#User_Client", "ReportInvoiceVendorJR"), 0);
+       Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoiceVendorJR", strCurrencyId);
+       xmlDocument.setData("reportC_Currency_ID","liststructure", comboTableData.select(false));
+       comboTableData = null;
+    } catch (Exception ex) {
+       throw new ServletException(ex);
+    }
 
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
@@ -111,21 +124,34 @@
     out.close();
   }
 
-  void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnetId, String strcProjectId, String strissotrx) throws IOException, ServletException{
+  void printPageHtml(HttpServletResponse response, VariablesSecureApp vars, String strDateFrom, String strDateTo, String strcBpartnetId, String strcProjectId, String strissotrx, String strCurrencyId) throws IOException, ServletException{
 
     if (log4j.isDebugEnabled()) log4j.debug("Output: print html");
     
     InvoiceEditionData[] data = null;
-    data = InvoiceEditionData.select(this, Utility.getContext(this, vars, "#User_Org", "InvoiceVendorJR"), Utility.getContext(this, vars, "#User_Client", "InvoiceVendorJR"), strDateFrom, strDateTo, strcBpartnetId, strcProjectId, strissotrx);
-        
-    String strOutput = vars.commandIn("EDIT_HTML")?"html":"pdf";
-    String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorJR.jrxml";
-    
-    HashMap<String, Object> parameters = new HashMap<String, Object>();
-    parameters.put("Title", classInfo.name);
-    //parameters.put("Subtitle",strSubtitle);
-    renderJR(vars, response, strReportName, strOutput, parameters, data, null );
 
+    //Checks if there is a conversion rate for each of the transactions of the report
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
+    try {
+      data = InvoiceEditionData.select(this, strCurrencyId, Utility.getContext(this, vars, "#User_Org", "InvoiceVendorJR"), Utility.getContext(this, vars, "#User_Client", "InvoiceVendorJR"), strDateFrom, DateTimeData.nDaysAfter(this, strDateTo,"1"), strcBpartnetId, strcProjectId, strissotrx);
+    } catch(ServletException ex) {
+      myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
+    }
+    strConvRateErrorMsg = myMessage.getMessage();
+    //If a conversion rate is missing for a certain transaction, an error message window pops-up.
+    if(!strConvRateErrorMsg.equals("") && strConvRateErrorMsg != null) {
+      advisePopUp(response, "ERROR", Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()), strConvRateErrorMsg);      
+    } else { //Launch the report as usual, calling the JRXML file
+      String strOutput = vars.commandIn("EDIT_HTML")?"html":"pdf";
+      String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorJR.jrxml";
+      
+      HashMap<String, Object> parameters = new HashMap<String, Object>();
+      parameters.put("Title", classInfo.name);
+      //parameters.put("Subtitle",strSubtitle);
+      renderJR(vars, response, strReportName, strOutput, parameters, data, null );
+    } 
   }
 
  
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorJR.jrxml	Thu Oct 30 10:10:27 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceVendorJR.jrxml	Thu Oct 30 17:30:39 2008 +0000
@@ -5,10 +5,10 @@
 		 name="ReportInvoiceVendorJR"
 		 columnCount="1"
 		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="595"
-		 pageHeight="842"
-		 columnWidth="535"
+		 orientation="Landscape"
+		 pageWidth="842"
+		 pageHeight="595"
+		 columnWidth="782"
 		 columnSpacing="0"
 		 leftMargin="30"
 		 rightMargin="30"
@@ -203,17 +203,32 @@
 	</parameter>
 	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
 	<parameter name="LOCALE" isForPrompting="false" class="java.util.Locale"/>
-	<queryString><![CDATA[SELECT COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS DOCUMENTNO, C_INVOICE.DATEINVOICED AS DATEINVOICED, C_BPARTNER.NAME AS CLIENT_NAME, M_PRODUCT.NAME AS PRODUCT_NAME, SUM(C_INVOICELINE.QTYINVOICED) AS QUANTITYORDER, 
-      C_UOM.NAME AS UOMNAME, C_INVOICELINE.PRICEACTUAL AS PRICEACTUAL, SUM(C_INVOICELINE.LINENETAMT) AS PRICELIST
-      FROM C_INVOICE LEFT JOIN C_PROJECT ON C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID 
-                     LEFT JOIN C_LOCATION ON C_PROJECT.C_LOCATION_ID = C_LOCATION.C_LOCATION_ID, C_INVOICELINE, M_PRODUCT, C_UOM, C_BPARTNER
-      WHERE C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+	<queryString><![CDATA[SELECT COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO) AS DOCUMENTNO, C_INVOICE.DATEINVOICED AS DATEINVOICED, 
+      C_BPARTNER.NAME AS CLIENT_NAME, M_PRODUCT.NAME AS PRODUCT_NAME, SUM(C_INVOICELINE.QTYINVOICED) AS QUANTITYORDER, 
+      C_UOM.NAME AS UOMNAME, C_INVOICELINE.PRICEACTUAL AS PRICEACTUAL, 
+      C_CURRENCY_SYMBOL (C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.PRICEACTUAL, 'Y') AS PRICEACTUALSYM,
+	  C_CURRENCY_CONVERT(C_INVOICELINE.PRICEACTUAL, C_INVOICE.C_CURRENCY_ID, '102', TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID) AS CONVPRICEACTUAL,
+      SUM(C_INVOICELINE.LINENETAMT) AS PRICELIST,
+      C_CURRENCY_SYMBOL (C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.LINENETAMT, 'Y') AS PRICELISTSYM,
+	  SUM(C_CURRENCY_CONVERT(C_INVOICELINE.LINENETAMT, C_INVOICE.C_CURRENCY_ID, '102', TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())), NULL, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID)) AS CONVPRICELIST,
+	  C_CURRENCY_SYMBOL('102', '0', 'Y') AS CONVSYM,
+	  C_CURRENCY_ISOSYM('102') AS CONVISOSYM,
+	  TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRANSDATE,
+	  C_INVOICE.C_CURRENCY_ID AS TRANSCURRENCYID,
+      C_INVOICELINE.AD_CLIENT_ID AS TRANSCLIENTID, 
+	  C_INVOICELINE.AD_ORG_ID AS TRANSORGID 
+      FROM C_INVOICE, C_INVOICELINE, M_PRODUCT, C_UOM, C_BPARTNER
+      WHERE C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+      AND C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
       AND C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
       AND C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
-      AND C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
-      AND C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN ('1')
       AND 1=1
-      GROUP BY C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.NAME, C_INVOICELINE.PRICEACTUAL, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED
+      AND C_INVOICE.ISSOTRX = 'N'
+      GROUP BY C_BPARTNER.NAME, M_PRODUCT.NAME, C_UOM.NAME, C_INVOICELINE.PRICEACTUAL, 
+      COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED,
+      C_INVOICE.C_CURRENCY_ID, C_INVOICELINE.AD_CLIENT_ID, C_INVOICELINE.AD_ORG_ID, C_INVOICELINE.LINENETAMT
       ORDER BY C_BPARTNER.NAME, COALESCE(C_INVOICE.POREFERENCE, C_INVOICE.DOCUMENTNO), C_INVOICE.DATEINVOICED]]></queryString>
 
 	<field name="DOCUMENTNO" class="java.lang.String"/>
@@ -224,9 +239,14 @@
 	<field name="UOMNAME" class="java.lang.String"/>
 	<field name="PRICEACTUAL" class="java.math.BigDecimal"/>
 	<field name="PRICELIST" class="java.math.BigDecimal"/>
+	<field name="PRICEACTUALSYM" class="java.lang.String"/>
+	<field name="CONVPRICEACTUAL" class="java.math.BigDecimal"/>
+	<field name="CONVSYM" class="java.lang.String"/>
+	<field name="CONVPRICELIST" class="java.math.BigDecimal"/>
+	<field name="CONVISOSYM" class="java.lang.String"/>
 
 	<variable name="DetailFieldTotal" class="java.math.BigDecimal" resetType="Group" resetGroup="CLIENT_NAME" calculation="Sum">
-		<variableExpression><![CDATA[$F{PRICELIST}]]></variableExpression>
+		<variableExpression><![CDATA[$F{CONVPRICELIST}]]></variableExpression>
 	</variable>
 	<variable name="TotalQty" class="java.math.BigDecimal" resetType="Group" resetGroup="CLIENT_NAME" calculation="Sum">
 		<variableExpression><![CDATA[$F{QUANTITYORDER}]]></variableExpression>
@@ -241,7 +261,7 @@
 						style="GroupHeader_DarkGray"
 						x="1"
 						y="0"
-						width="534"
+						width="705"
 						height="23"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" topPadding="2" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -253,9 +273,9 @@
 				<line direction="TopDown">
 					<reportElement
 						x="0"
-						y="1"
+						y="0"
 						width="0"
-						height="32"
+						height="33"
 						forecolor="#555555"
 						key="line-2"
 						stretchType="RelativeToBandHeight"/>
@@ -263,10 +283,10 @@
 				</line>
 				<line direction="TopDown">
 					<reportElement
-						x="535"
-						y="1"
+						x="706"
+						y="0"
 						width="0"
-						height="32"
+						height="33"
 						forecolor="#555555"
 						key="line-3"
 						stretchType="RelativeToBandHeight"/>
@@ -289,7 +309,7 @@
 				</line>
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="706"
 						y="0"
 						width="0"
 						height="19"
@@ -302,7 +322,7 @@
 					<reportElement
 						x="0"
 						y="19"
-						width="535"
+						width="707"
 						height="0"
 						forecolor="#555555"
 						key="line-34"/>
@@ -311,7 +331,7 @@
 				<staticText>
 					<reportElement
 						style="Report_Data_Label"
-						x="249"
+						x="429"
 						y="0"
 						width="186"
 						height="16"
@@ -325,9 +345,9 @@
 				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
 					<reportElement
 						style="Total_Gray"
-						x="435"
+						x="615"
 						y="0"
-						width="89"
+						width="65"
 						height="16"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -336,6 +356,20 @@
 					</textElement>
 				<textFieldExpression   class="java.lang.String"><![CDATA[($V{DetailFieldTotal}!=null)?$P{NUMBERFORMAT}.format($V{DetailFieldTotal}):new String(" ")]]></textFieldExpression>
 				</textField>
+				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
+					<reportElement
+						style="Total_Gray"
+						x="680"
+						y="0"
+						width="23"
+						height="16"
+						key="textField-13"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font/>
+					</textElement>
+				<textFieldExpression   class="java.lang.String"><![CDATA[$F{CONVSYM}]]></textFieldExpression>
+				</textField>
 			</band>
 			</groupFooter>
 		</group>
@@ -348,7 +382,7 @@
 						style="GroupHeader_DarkGray"
 						x="11"
 						y="0"
-						width="524"
+						width="695"
 						height="23"
 						key="textField"/>
 					<box topBorder="None" topBorderColor="#000000" topPadding="2" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
@@ -359,7 +393,7 @@
 				</textField>
 				<line direction="TopDown">
 					<reportElement
-						x="535"
+						x="706"
 						y="0"
 						width="0"
 						height="64"
@@ -417,7 +451,7 @@
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
 					<textElement>
-						<font/>
+						<font pdfFontName="Helvetica-Bold" size="8"/>
 					</textElement>
 				<text><![CDATA[Article]]></text>
 				</staticText>
@@ -430,8 +464,8 @@
 						height="16"
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement>
-						<font/>
+					<textElement textAlignment="Center">
+						<font size="8"/>
 					</textElement>
 				<text><![CDATA[Quantity]]></text>
 				</staticText>
@@ -444,36 +478,92 @@
 						height="16"
 						key="element-90"/>
 					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="1Point" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
+					<textElement textAlignment="Center">
+						<font pdfFontName="Helvetica-Bold" size="8"/>
+					</textElement>
+				<text><![CDATA[Price	]]></text>
+				</staticText>
+				<line direction="TopDown">
+					<reportElement
+						x="10"
+						y="0"
+						width="0"
+						height="64"
+						forecolor="#555555"
+						key="line-42"
+						stretchType="RelativeToBandHeight"/>
+					<graphicElement stretchType="RelativeToBandHeight" pen="2Point"/>
+				</line>
+				<staticText>
+					<reportElement
+						style="Detail_Header"
+						x="435"
+						y="48"
+						width="37"
+						height="16"
+						key="element-91"/>
+					<box topBorder="None" topBorderColor="#000000" leftBorder="1Point" leftBorderColor="#FFFFFF" leftPadding="5" rightBorder="None" rightBorderColor="#FFFFFF" rightPadding="2" bottomBorder="None" bottomBorderColor="#000000"/>
 					<textElement textAlignment="Right">
-						<font pdfFontName="Helvetica-Bold"/>
+						<font pdfFontName="Helvetica-Bold" size="8"/>
 					</textElement>
 				<text><![CDATA[Price	]]></text>
 				</staticText>
 				<staticText>
 					<reportElement
 						style="Detail_Header"</