Related to issue 34806: Backed out changeset 3d0a5d2000e4
authorMark <markmm82@gmail.com>
Tue, 17 Jan 2017 09:56:58 -0500
changeset 31489 3794b4067abb
parent 31488 a09d6ae570dd
child 31490 b7dc8dff230a
Related to issue 34806: Backed out changeset 3d0a5d2000e4

Backed out this patch due to some code formats errors.
src/org/openbravo/erpCommon/ad_reports/ReportInvoicesJR.java
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.java
src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoicesJR.java	Fri Jan 13 12:25:24 2017 -0500
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoicesJR.java	Tue Jan 17 09:56:58 2017 -0500
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2017 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -39,211 +39,212 @@
 import org.openbravo.xmlEngine.XmlDocument;
 
 public class ReportInvoicesJR extends HttpSecureAppServlet {
-	private static final long serialVersionUID = 1L;
+  private static final long serialVersionUID = 1L;
 
-	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
-	    ServletException {
-		VariablesSecureApp vars = new VariablesSecureApp(request);
+  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 strC_BPartner_ID = vars.getGlobalVariable("inpcBPartnerId",
-			    "ReportInvoices|C_BPartner_ID", "");
-			String strM_Product_ID = vars.getGlobalVariable("inpmProductId",
-			    "ReportInvoices|M_Product_ID", "");
-			String strDateFrom = vars.getGlobalVariable("inpDateInvoiceFrom", "ReportInvoices|DateFrom",
-			    "");
-			String strDateTo = vars.getGlobalVariable("inpDateInvoiceTo", "ReportInvoices|DateTo", "");
-			String strDocumentNo = vars.getGlobalVariable("inpInvoicedocumentno",
-			    "ReportInvoices|DocumentNo", "");
-			String strOrder = vars.getGlobalVariable("inpOrder", "ReportInvoices|Order", "SalesOrder");
-			String strC_BpGroup_ID = vars.getGlobalVariable("inpcBpGroupId",
-			    "ReportInvoices|C_BpGroup_ID", "");
-			String strM_Product_Category_ID = vars.getGlobalVariable("inpmProductCategoryId",
-			    "ReportInvoices|M_Product_Category_ID", "");
-			String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoices|currency",
-			    strUserCurrencyId);
-			printPageDataSheet(response, vars, strC_BPartner_ID, strM_Product_ID, strDateFrom, strDateTo,
-			    strDocumentNo, strOrder, strC_BpGroup_ID, strM_Product_Category_ID, strCurrencyId);
-		} else if (vars.commandIn("FIND")) {
-			String strC_BPartner_ID = vars.getRequestGlobalVariable("inpcBPartnerId",
-			    "ReportInvoices|C_BPartner_ID");
-			String strM_Product_ID = vars.getRequestGlobalVariable("inpmProductId",
-			    "ReportInvoices|M_Product_ID");
-			String strDateFrom = vars.getRequestGlobalVariable("inpDateInvoiceFrom",
-			    "ReportInvoices|DateFrom");
-			String strDateTo = vars.getRequestGlobalVariable("inpDateInvoiceTo", "ReportInvoices|DateTo");
-			String strDocumentNo = vars.getRequestGlobalVariable("inpInvoicedocumentno",
-			    "ReportInvoices|DocumentNo");
-			String strOrder = vars.getGlobalVariable("inpOrder", "ReportInvoices|Order");
-			String strC_BpGroup_ID = vars.getRequestGlobalVariable("inpcBpGroupId",
-			    "ReportInvoices|C_BpGroup_ID");
-			String strM_Product_Category_ID = vars.getRequestGlobalVariable("inpmProductCategoryId",
-			    "ReportInvoices|M_Product_Category_ID");
-			String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoices|currency",
-			    strUserCurrencyId);
-			printPageDataHtml(request, response, vars, strC_BPartner_ID, strM_Product_ID, strDateFrom,
-			    strDateTo, strDocumentNo, strOrder, strC_BpGroup_ID, strM_Product_Category_ID,
-			    strCurrencyId);
-		} else
-			pageError(response);
-	}
+    // Get user Client's base currency
+    String strUserCurrencyId = Utility.stringBaseCurrencyId(this, vars.getClient());
+    if (vars.commandIn("DEFAULT")) {
+      String strC_BPartner_ID = vars.getGlobalVariable("inpcBPartnerId",
+          "ReportInvoices|C_BPartner_ID", "");
+      String strM_Product_ID = vars.getGlobalVariable("inpmProductId",
+          "ReportInvoices|M_Product_ID", "");
+      String strDateFrom = vars.getGlobalVariable("inpDateInvoiceFrom", "ReportInvoices|DateFrom",
+          "");
+      String strDateTo = vars.getGlobalVariable("inpDateInvoiceTo", "ReportInvoices|DateTo", "");
+      String strDocumentNo = vars.getGlobalVariable("inpInvoicedocumentno",
+          "ReportInvoices|DocumentNo", "");
+      String strOrder = vars.getGlobalVariable("inpOrder", "ReportInvoices|Order", "SalesOrder");
+      String strC_BpGroup_ID = vars.getGlobalVariable("inpcBpGroupId",
+          "ReportInvoices|C_BpGroup_ID", "");
+      String strM_Product_Category_ID = vars.getGlobalVariable("inpmProductCategoryId",
+          "ReportInvoices|M_Product_Category_ID", "");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoices|currency",
+          strUserCurrencyId);
+      printPageDataSheet(response, vars, strC_BPartner_ID, strM_Product_ID, strDateFrom, strDateTo,
+          strDocumentNo, strOrder, strC_BpGroup_ID, strM_Product_Category_ID, strCurrencyId);
+    } else if (vars.commandIn("FIND")) {
+      String strC_BPartner_ID = vars.getRequestGlobalVariable("inpcBPartnerId",
+          "ReportInvoices|C_BPartner_ID");
+      String strM_Product_ID = vars.getRequestGlobalVariable("inpmProductId",
+          "ReportInvoices|M_Product_ID");
+      String strDateFrom = vars.getRequestGlobalVariable("inpDateInvoiceFrom",
+          "ReportInvoices|DateFrom");
+      String strDateTo = vars.getRequestGlobalVariable("inpDateInvoiceTo", "ReportInvoices|DateTo");
+      String strDocumentNo = vars.getRequestGlobalVariable("inpInvoicedocumentno",
+          "ReportInvoices|DocumentNo");
+      String strOrder = vars.getGlobalVariable("inpOrder", "ReportInvoices|Order");
+      String strC_BpGroup_ID = vars.getRequestGlobalVariable("inpcBpGroupId",
+          "ReportInvoices|C_BpGroup_ID");
+      String strM_Product_Category_ID = vars.getRequestGlobalVariable("inpmProductCategoryId",
+          "ReportInvoices|M_Product_Category_ID");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId", "ReportInvoices|currency",
+          strUserCurrencyId);
+      printPageDataHtml(request, response, vars, strC_BPartner_ID, strM_Product_ID, strDateFrom,
+          strDateTo, strDocumentNo, strOrder, strC_BpGroup_ID, strM_Product_Category_ID,
+          strCurrencyId);
+    } else
+      pageError(response);
+  }
 
-	private void printPageDataHtml(HttpServletRequest request, HttpServletResponse response,
-	    VariablesSecureApp vars, String strC_BPartner_ID, String strM_Product_ID, String strDateFrom,
-	    String strDateTo, String strDocumentNo, String strOrder, String strC_BpGroup_ID,
-	    String strM_Product_Category_ID, String strCurrencyId) throws IOException, ServletException {
-		if (log4j.isDebugEnabled())
-			log4j.debug("Output: dataSheet");
-		response.setContentType("text/html; charset=UTF-8");
+  private void printPageDataHtml(HttpServletRequest request, HttpServletResponse response,
+      VariablesSecureApp vars, String strC_BPartner_ID, String strM_Product_ID, String strDateFrom,
+      String strDateTo, String strDocumentNo, String strOrder, String strC_BpGroup_ID,
+      String strM_Product_Category_ID, String strCurrencyId) throws IOException, ServletException {
+    if (log4j.isDebugEnabled())
+      log4j.debug("Output: dataSheet");
+    response.setContentType("text/html; charset=UTF-8");
 
-		String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoicesEditJR.jrxml";
-		String strOutput = "html";
-		response.setHeader("Content-disposition", "inline; filename=ReportInvoicesEdit.html");
+    String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoicesEditJR.jrxml";
+    String strOutput = "html";
+    response.setHeader("Content-disposition", "inline; filename=ReportInvoicesEdit.html");
 
-		// Checks if there is a conversion rate for each of the transactions of
-		// the report
-		ReportInvoicesData[] data = null;
-		String strConvRateErrorMsg = "";
-		OBError myMessage = null;
-		myMessage = new OBError();
-		try {
-			data = ReportInvoicesData.select(this, strCurrencyId, Utility.getContext(this, vars,
-			    "#User_Client", "ReportInvoices"), Utility.getContext(this, vars, "#AccessibleOrgTree",
-			    "ReportInvoices"), strC_BpGroup_ID, strM_Product_Category_ID, strC_BPartner_ID,
-			    strM_Product_ID, strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"),
-			    strDocumentNo, (strOrder.equals("PurchaseOrder")) ? "" : "sales", (strOrder
-			        .equals("PurchaseOrder")) ? "purchase" : "");
-		} 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(request, response, "ERROR",
-			    Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()),
-			    strConvRateErrorMsg);
-		} else { // Launch the report as usual, calling the JRXML file
-			String strSubTitle = "";
-			strSubTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " " + strDateFrom + " "
-			    + Utility.messageBD(this, "To", vars.getLanguage()) + " " + strDateTo;
+    // Checks if there is a conversion rate for each of the transactions of
+    // the report
+    ReportInvoicesData[] data = null;
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
+    try {
+      data = ReportInvoicesData.select(this, strCurrencyId,
+          Utility.getContext(this, vars, "#User_Client", "ReportInvoices"),
+          Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportInvoices"), strC_BpGroup_ID,
+          strM_Product_Category_ID, strC_BPartner_ID, strM_Product_ID, strDateFrom,
+          DateTimeData.nDaysAfter(this, strDateTo, "1"), strDocumentNo,
+          (strOrder.equals("PurchaseOrder")) ? "" : "sales",
+          (strOrder.equals("PurchaseOrder")) ? "purchase" : "");
+    } 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(request, response, "ERROR",
+          Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()),
+          strConvRateErrorMsg);
+    } else { // Launch the report as usual, calling the JRXML file
+      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_SUBTITLE", strSubTitle);
+      HashMap<String, Object> parameters = new HashMap<String, Object>();
+      parameters.put("REPORT_SUBTITLE", strSubTitle);
 
-			renderJR(vars, response, strReportName, strOutput, parameters, data, null);
-		}
-	}
+      renderJR(vars, response, strReportName, strOutput, parameters, data, null);
+    }
+  }
 
-	private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
-	    String strC_BPartner_ID, String strM_Product_ID, String strDateFrom, String strDateTo,
-	    String strDocumentNo, String strOrder, String strC_BpGroup_ID,
-	    String strM_Product_Category_ID, String strCurrencyId) throws IOException, ServletException {
-		if (log4j.isDebugEnabled())
-			log4j.debug("Output: dataSheet");
-		response.setContentType("text/html; charset=UTF-8");
-		PrintWriter out = response.getWriter();
+  private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
+      String strC_BPartner_ID, String strM_Product_ID, String strDateFrom, String strDateTo,
+      String strDocumentNo, String strOrder, String strC_BpGroup_ID,
+      String strM_Product_Category_ID, 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;
-		xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportInvoicesJR")
-		    .createXmlDocument();
+    XmlDocument xmlDocument = null;
+    xmlDocument = xmlEngine.readXmlTemplate("org/openbravo/erpCommon/ad_reports/ReportInvoicesJR")
+        .createXmlDocument();
 
-		ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportInvoicesJR", 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.ReportInvoicesJR");
-			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(), "ReportInvoicesJR.html",
-			    classInfo.id, classInfo.type, strReplaceWith, tabs.breadcrumb());
-			xmlDocument.setParameter("navigationBar", nav.toString());
-			LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "ReportInvoicesJR.html",
-			    strReplaceWith);
-			xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
-		} catch (Exception ex) {
-			throw new ServletException(ex);
-		}
-		{
-			OBError myMessage = vars.getMessage("ReportInvoices");
-			vars.removeMessage("ReportInvoices");
-			if (myMessage != null) {
-				xmlDocument.setParameter("messageType", myMessage.getType());
-				xmlDocument.setParameter("messageTitle", myMessage.getTitle());
-				xmlDocument.setParameter("messageMessage", myMessage.getMessage());
-			}
-		}
+    ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportInvoicesJR", 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.ReportInvoicesJR");
+      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(), "ReportInvoicesJR.html",
+          classInfo.id, classInfo.type, strReplaceWith, tabs.breadcrumb());
+      xmlDocument.setParameter("navigationBar", nav.toString());
+      LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(), "ReportInvoicesJR.html",
+          strReplaceWith);
+      xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
+    {
+      OBError myMessage = vars.getMessage("ReportInvoices");
+      vars.removeMessage("ReportInvoices");
+      if (myMessage != null) {
+        xmlDocument.setParameter("messageType", myMessage.getType());
+        xmlDocument.setParameter("messageTitle", myMessage.getTitle());
+        xmlDocument.setParameter("messageMessage", myMessage.getMessage());
+      }
+    }
 
-		xmlDocument.setParameter("calendar", vars.getLanguage().substring(0, 2));
-		xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
-		xmlDocument.setParameter("paramLanguage", "defaultLang=\"" + vars.getLanguage() + "\";");
-		xmlDocument.setParameter("paramBPartnerId", strC_BPartner_ID);
-		xmlDocument.setParameter("paramMProductId", strM_Product_ID);
-		xmlDocument.setParameter("dateFrom", strDateFrom);
-		xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-		xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-		xmlDocument.setParameter("dateTo", strDateTo);
-		xmlDocument.setParameter("dateTodisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-		xmlDocument.setParameter("dateTosaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-		xmlDocument.setParameter("paramDocumentNo", strDocumentNo);
-		xmlDocument.setParameter("paramCBpGroupID", strC_BpGroup_ID);
-		xmlDocument.setParameter("paramMProductCategoryID", strM_Product_Category_ID);
-		xmlDocument.setParameter("sales", strOrder);
-		xmlDocument.setParameter("purchase", strOrder);
-		xmlDocument.setParameter("paramBPartnerDescription",
-		    ReportInvoicesData.bPartnerDescription(this, strC_BPartner_ID));
-		xmlDocument.setParameter("paramMProductIDDES",
-		    ReportInvoicesData.mProductDescription(this, strM_Product_ID));
+    xmlDocument.setParameter("calendar", vars.getLanguage().substring(0, 2));
+    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
+    xmlDocument.setParameter("paramLanguage", "defaultLang=\"" + vars.getLanguage() + "\";");
+    xmlDocument.setParameter("paramBPartnerId", strC_BPartner_ID);
+    xmlDocument.setParameter("paramMProductId", strM_Product_ID);
+    xmlDocument.setParameter("dateFrom", strDateFrom);
+    xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateTo", strDateTo);
+    xmlDocument.setParameter("dateTodisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateTosaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("paramDocumentNo", strDocumentNo);
+    xmlDocument.setParameter("paramCBpGroupID", strC_BpGroup_ID);
+    xmlDocument.setParameter("paramMProductCategoryID", strM_Product_Category_ID);
+    xmlDocument.setParameter("sales", strOrder);
+    xmlDocument.setParameter("purchase", strOrder);
+    xmlDocument.setParameter("paramBPartnerDescription",
+        ReportInvoicesData.bPartnerDescription(this, strC_BPartner_ID));
+    xmlDocument.setParameter("paramMProductIDDES",
+        ReportInvoicesData.mProductDescription(this, strM_Product_ID));
 
-		try {
-			ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_BP_Group_ID",
-			    "", "", Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportInvoices"),
-			    Utility.getContext(this, vars, "#User_Client", "ReportInvoices"), 0);
-			Utility
-			    .fillSQLParameters(this, vars, null, comboTableData, "ReportInvoices", strC_BpGroup_ID);
-			xmlDocument.setData("reportC_Bp_Group", "liststructure", comboTableData.select(false));
-			comboTableData = null;
-		} catch (Exception ex) {
-			throw new ServletException(ex);
-		}
+    try {
+      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_BP_Group_ID",
+          "", "", Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportInvoices"),
+          Utility.getContext(this, vars, "#User_Client", "ReportInvoices"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoices",
+          strC_BpGroup_ID);
+      xmlDocument.setData("reportC_Bp_Group", "liststructure", comboTableData.select(false));
+      comboTableData = null;
+    } catch (Exception ex) {
+      throw new ServletException(ex);
+    }
 
-		try {
-			ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
-			    "M_Product_Category_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
-			        "ReportInvoices"), Utility.getContext(this, vars, "#User_Client", "ReportInvoices"),
-			    0);
-			Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoices",
-			    strM_Product_Category_ID);
-			xmlDocument
-			    .setData("reportM_Product_Category", "liststructure", comboTableData.select(false));
-			comboTableData = null;
-		} catch (Exception ex) {
-			throw new ServletException(ex);
-		}
+    try {
+      ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
+          "M_Product_Category_ID", "", "",
+          Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportInvoices"),
+          Utility.getContext(this, vars, "#User_Client", "ReportInvoices"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoices",
+          strM_Product_Category_ID);
+      xmlDocument.setData("reportM_Product_Category", "liststructure",
+          comboTableData.select(false));
+      comboTableData = null;
+    } 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, "#AccessibleOrgTree", "ReportInvoices"),
-			    Utility.getContext(this, vars, "#User_Client", "ReportInvoices"), 0);
-			Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoices", strCurrencyId);
-			xmlDocument.setData("reportC_Currency_ID", "liststructure", comboTableData.select(false));
-			comboTableData = null;
-		} 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, "#AccessibleOrgTree", "ReportInvoices"),
+          Utility.getContext(this, vars, "#User_Client", "ReportInvoices"), 0);
+      Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportInvoices", 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();
-	}
+    out.println(xmlDocument.print());
+    out.close();
+  }
 
-	public String getServletInfo() {
-		return "Servlet ReportInvoices. This Servlet was made by Pablo Sarobe";
-	} // end of getServletInfo() method
+  public String getServletInfo() {
+    return "Servlet ReportInvoices. This Servlet was made by Pablo Sarobe";
+  } // end of getServletInfo() method
 }
--- a/src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.java	Fri Jan 13 12:25:24 2017 -0500
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.java	Tue Jan 17 09:56:58 2017 -0500
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2017 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -39,296 +39,296 @@
 import org.openbravo.xmlEngine.XmlDocument;
 
 public class ReportSalesOrderInvoicedJasper extends HttpSecureAppServlet {
-	private static final long serialVersionUID = 1L;
+  private static final long serialVersionUID = 1L;
 
-	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
-	    ServletException {
-		VariablesSecureApp vars = new VariablesSecureApp(request);
+  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", "");
-			String strcBpartnerId = vars.getStringParameter("inpcBPartnerId", "");
-			String strmWarehouseId = vars.getStringParameter("inpmWarehouseId", "");
-			String strcProjectId = vars.getStringParameter("inpcProjectId", "");
-			String strmCategoryId = vars.getStringParameter("inpProductCategory", "");
-			String strProjectkind = vars.getStringParameter("inpProjectkind", "");
-			String strcRegionId = vars.getStringParameter("inpcRegionId", "");
-			String strProjectpublic = vars.getStringParameter("inpProjectpublic", "");
-			String strProduct = vars.getStringParameter("inpProductId", "");
-			String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
-			    "ReportSalesOrderInvoicedJasper|currency", strUserCurrencyId);
-			printPageDataSheet(response, vars, strdateFrom, strdateTo, strcBpartnerId, strmWarehouseId,
-			    strcProjectId, strmCategoryId, strProjectkind, strcRegionId, strProjectpublic,
-			    strProduct, strCurrencyId);
-		} else if (vars.commandIn("FIND")) {
-			String strdateFrom = vars.getStringParameter("inpDateFrom");
-			String strdateTo = vars.getStringParameter("inpDateTo");
-			String strcBpartnerId = vars.getStringParameter("inpcBPartnerId");
-			String strmWarehouseId = vars.getStringParameter("inpmWarehouseId");
-			String strcProjectId = vars.getStringParameter("inpcProjectId");
-			String strmCategoryId = vars.getStringParameter("inpProductCategory");
-			String strProjectkind = vars.getStringParameter("inpProjectkind");
-			String strcRegionId = vars.getStringParameter("inpcRegionId");
-			String strProjectpublic = vars.getStringParameter("inpProjectpublic");
-			String strProduct = vars.getStringParameter("inpmProductId");
-			String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
-			    "ReportSalesOrderInvoicedJasper|currency", strUserCurrencyId);
-			printPageDataSheetJasper(request, response, vars, strdateFrom, strdateTo, strcBpartnerId,
-			    strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
-			    strProjectpublic, strProduct, strCurrencyId);
-		} else
-			pageErrorPopUp(response);
-	}
+    // 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", "");
+      String strcBpartnerId = vars.getStringParameter("inpcBPartnerId", "");
+      String strmWarehouseId = vars.getStringParameter("inpmWarehouseId", "");
+      String strcProjectId = vars.getStringParameter("inpcProjectId", "");
+      String strmCategoryId = vars.getStringParameter("inpProductCategory", "");
+      String strProjectkind = vars.getStringParameter("inpProjectkind", "");
+      String strcRegionId = vars.getStringParameter("inpcRegionId", "");
+      String strProjectpublic = vars.getStringParameter("inpProjectpublic", "");
+      String strProduct = vars.getStringParameter("inpProductId", "");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
+          "ReportSalesOrderInvoicedJasper|currency", strUserCurrencyId);
+      printPageDataSheet(response, vars, strdateFrom, strdateTo, strcBpartnerId, strmWarehouseId,
+          strcProjectId, strmCategoryId, strProjectkind, strcRegionId, strProjectpublic,
+          strProduct, strCurrencyId);
+    } else if (vars.commandIn("FIND")) {
+      String strdateFrom = vars.getStringParameter("inpDateFrom");
+      String strdateTo = vars.getStringParameter("inpDateTo");
+      String strcBpartnerId = vars.getStringParameter("inpcBPartnerId");
+      String strmWarehouseId = vars.getStringParameter("inpmWarehouseId");
+      String strcProjectId = vars.getStringParameter("inpcProjectId");
+      String strmCategoryId = vars.getStringParameter("inpProductCategory");
+      String strProjectkind = vars.getStringParameter("inpProjectkind");
+      String strcRegionId = vars.getStringParameter("inpcRegionId");
+      String strProjectpublic = vars.getStringParameter("inpProjectpublic");
+      String strProduct = vars.getStringParameter("inpmProductId");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
+          "ReportSalesOrderInvoicedJasper|currency", strUserCurrencyId);
+      printPageDataSheetJasper(request, response, vars, strdateFrom, strdateTo, strcBpartnerId,
+          strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
+          strProjectpublic, strProduct, strCurrencyId);
+    } else
+      pageErrorPopUp(response);
+  }
 
-	private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
-	    String strdateFrom, String strdateTo, String strcBpartnerId, String strmWarehouseId,
-	    String strcProjectId, String strmCategoryId, String strProjectkind, String strcRegionId,
-	    String strProjectpublic, String strProduct, String strCurrencyId) throws IOException,
-	    ServletException {
-		if (log4j.isDebugEnabled())
-			log4j.debug("Output: dataSheet");
-		String discard[] = { "sectionPartner" };
-		String strTitle = "";
-		XmlDocument xmlDocument = null;
-		if (vars.commandIn("DEFAULT")) {
-			xmlDocument = xmlEngine.readXmlTemplate(
-			    "org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper").createXmlDocument();
+  private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
+      String strdateFrom, String strdateTo, String strcBpartnerId, String strmWarehouseId,
+      String strcProjectId, String strmCategoryId, String strProjectkind, String strcRegionId,
+      String strProjectpublic, String strProduct, String strCurrencyId) throws IOException,
+      ServletException {
+    if (log4j.isDebugEnabled())
+      log4j.debug("Output: dataSheet");
+    String discard[] = { "sectionPartner" };
+    String strTitle = "";
+    XmlDocument xmlDocument = null;
+    if (vars.commandIn("DEFAULT")) {
+      xmlDocument = xmlEngine.readXmlTemplate(
+          "org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper").createXmlDocument();
 
-			ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportSalesOrderInvoicedJasper",
-			    false, "", "", "", false, "ad_reports", strReplaceWith, false, true);
-			toolbar.prepareSimpleToolBarTemplate();
-			xmlDocument.setParameter("toolbar", toolbar.toString());
+      ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportSalesOrderInvoicedJasper",
+          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.ReportSalesOrderInvoicedJasper");
-				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(),
-				    "ReportSalesOrderInvoicedJasper.html", classInfo.id, classInfo.type, strReplaceWith,
-				    tabs.breadcrumb());
-				xmlDocument.setParameter("navigationBar", nav.toString());
-				LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(),
-				    "ReportSalesOrderInvoicedJasper.html", strReplaceWith);
-				xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
-			{
-				OBError myMessage = vars.getMessage("ReportSalesOrderInvoicedJasper");
-				vars.removeMessage("ReportSalesOrderInvoicedJasper");
-				if (myMessage != null) {
-					xmlDocument.setParameter("messageType", myMessage.getType());
-					xmlDocument.setParameter("messageTitle", myMessage.getTitle());
-					xmlDocument.setParameter("messageMessage", myMessage.getMessage());
-				}
-			}
+      try {
+        WindowTabs tabs = new WindowTabs(this, vars,
+            "org.openbravo.erpCommon.ad_reports.ReportSalesOrderInvoicedJasper");
+        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(),
+            "ReportSalesOrderInvoicedJasper.html", classInfo.id, classInfo.type, strReplaceWith,
+            tabs.breadcrumb());
+        xmlDocument.setParameter("navigationBar", nav.toString());
+        LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(),
+            "ReportSalesOrderInvoicedJasper.html", strReplaceWith);
+        xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
+      {
+        OBError myMessage = vars.getMessage("ReportSalesOrderInvoicedJasper");
+        vars.removeMessage("ReportSalesOrderInvoicedJasper");
+        if (myMessage != null) {
+          xmlDocument.setParameter("messageType", myMessage.getType());
+          xmlDocument.setParameter("messageTitle", myMessage.getTitle());
+          xmlDocument.setParameter("messageMessage", myMessage.getMessage());
+        }
+      }
 
-			xmlDocument.setParameter("calendar", vars.getLanguage().substring(0, 2));
-			xmlDocument.setParameter("dateFrom", strdateFrom);
-			xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-			xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-			xmlDocument.setParameter("dateTo", strdateTo);
-			xmlDocument.setParameter("dateTodisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-			xmlDocument.setParameter("dateTosaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-			xmlDocument.setParameter("paramBPartnerId", strcBpartnerId);
-			xmlDocument.setParameter("mWarehouseId", strmWarehouseId);
-			xmlDocument.setParameter("cProjectId", strcProjectId);
-			xmlDocument.setParameter("mProductCategoryId", strmCategoryId);
-			xmlDocument.setParameter("cProjectKind", strProjectkind);
-			xmlDocument.setParameter("cRegionId", strcRegionId);
-			xmlDocument.setParameter("cProjectPublic", strProjectpublic);
-			xmlDocument.setParameter("projectName",
-			    ReportSalesOrderInvoicedData.selectProject(this, strcProjectId));
-			xmlDocument.setParameter("paramBPartnerDescription",
-			    ReportSalesOrderInvoicedData.bPartnerDescription(this, strcBpartnerId));
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
-				    "M_Warehouse_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
-				        "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderInvoicedJasper"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData,
-				    "ReportSalesOrderInvoicedJasper", strmWarehouseId);
-				xmlDocument.setData("reportM_WAREHOUSEID", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      xmlDocument.setParameter("calendar", vars.getLanguage().substring(0, 2));
+      xmlDocument.setParameter("dateFrom", strdateFrom);
+      xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+      xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+      xmlDocument.setParameter("dateTo", strdateTo);
+      xmlDocument.setParameter("dateTodisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+      xmlDocument.setParameter("dateTosaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+      xmlDocument.setParameter("paramBPartnerId", strcBpartnerId);
+      xmlDocument.setParameter("mWarehouseId", strmWarehouseId);
+      xmlDocument.setParameter("cProjectId", strcProjectId);
+      xmlDocument.setParameter("mProductCategoryId", strmCategoryId);
+      xmlDocument.setParameter("cProjectKind", strProjectkind);
+      xmlDocument.setParameter("cRegionId", strcRegionId);
+      xmlDocument.setParameter("cProjectPublic", strProjectpublic);
+      xmlDocument.setParameter("projectName",
+          ReportSalesOrderInvoicedData.selectProject(this, strcProjectId));
+      xmlDocument.setParameter("paramBPartnerDescription",
+          ReportSalesOrderInvoicedData.bPartnerDescription(this, strcBpartnerId));
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
+            "M_Warehouse_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
+                "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderInvoicedJasper"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData,
+            "ReportSalesOrderInvoicedJasper", strmWarehouseId);
+        xmlDocument.setData("reportM_WAREHOUSEID", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
-				    "M_Product_Category_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
-				        "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderInvoicedJasper"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData,
-				    "ReportSalesOrderInvoicedJasper", strmCategoryId);
-				xmlDocument.setData("reportM_PRODUCT_CATEGORYID", "liststructure",
-				    comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
+            "M_Product_Category_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
+                "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderInvoicedJasper"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData,
+            "ReportSalesOrderInvoicedJasper", strmCategoryId);
+        xmlDocument.setData("reportM_PRODUCT_CATEGORYID", "liststructure",
+            comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "LIST", "C_Projectkind_ID",
-				    "Projectkind", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
-				        "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderInvoicedJasper"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData,
-				    "ReportSalesOrderInvoicedJasper", strProjectkind);
-				xmlDocument.setData("reportC_PROJECTKIND", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "LIST", "C_Projectkind_ID",
+            "Projectkind", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
+                "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderInvoicedJasper"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData,
+            "ReportSalesOrderInvoicedJasper", strProjectkind);
+        xmlDocument.setData("reportC_PROJECTKIND", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Region_ID",
-				    "", "C_Region of Country", Utility.getContext(this, vars, "#AccessibleOrgTree",
-				        "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderInvoicedJasper"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData,
-				    "ReportSalesOrderInvoicedJasper", strcRegionId);
-				xmlDocument.setData("reportC_REGIONID", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Region_ID",
+            "", "C_Region of Country", Utility.getContext(this, vars, "#AccessibleOrgTree",
+                "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderInvoicedJasper"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData,
+            "ReportSalesOrderInvoicedJasper", strcRegionId);
+        xmlDocument.setData("reportC_REGIONID", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "LIST",
-				    "C_Project_Public_ID", "PublicPrivate", "", Utility.getContext(this, vars,
-				        "#AccessibleOrgTree", "ReportSalesOrderInvoicedJasper"), Utility.getContext(this,
-				        vars, "#User_Client", "ReportSalesOrderInvoicedJasper"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData,
-				    "ReportSalesOrderInvoicedJasper", strProjectpublic);
-				xmlDocument.setData("reportC_PROJECTPUBLIC", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "LIST",
+            "C_Project_Public_ID", "PublicPrivate", "", Utility.getContext(this, vars,
+                "#AccessibleOrgTree", "ReportSalesOrderInvoicedJasper"), Utility.getContext(this,
+                vars, "#User_Client", "ReportSalesOrderInvoicedJasper"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData,
+            "ReportSalesOrderInvoicedJasper", strProjectpublic);
+        xmlDocument.setData("reportC_PROJECTPUBLIC", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } 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, "#AccessibleOrgTree",
-				        "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderInvoicedJasper"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData,
-				    "ReportSalesOrderInvoicedJasper", strCurrencyId);
-				xmlDocument.setData("reportC_Currency_ID", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} 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, "#AccessibleOrgTree",
+                "ReportSalesOrderInvoicedJasper"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderInvoicedJasper"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData,
+            "ReportSalesOrderInvoicedJasper", strCurrencyId);
+        xmlDocument.setData("reportC_Currency_ID", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-		} else { // command != DEFAULT
-			ReportSalesOrderInvoicedData[] data = ReportSalesOrderInvoicedData.select(this,
-			    strCurrencyId,
-			    Utility.getContext(this, vars, "#User_Client", "ReportSalesOrderInvoiced"),
-			    Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportSalesOrderInvoiced"),
-			    strdateFrom, DateTimeData.nDaysAfter(this, strdateTo, "1"), strcBpartnerId,
-			    strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
-			    strProjectpublic, strProduct);
-			if (data == null || data.length == 0) {
-				xmlDocument = xmlEngine.readXmlTemplate(
-				    "org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedPop", discard)
-				    .createXmlDocument();
-				xmlDocument.setData("structure1", ReportSalesOrderInvoicedData.set());
-			} else {
-				xmlDocument = xmlEngine.readXmlTemplate(
-				    "org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedPop").createXmlDocument();
-				xmlDocument.setData("structure1", data);
-			}
-			if (!strmWarehouseId.equals(""))
-				strTitle += " " + Utility.messageBD(this, "ForWarehouse", vars.getLanguage()) + " "
-				    + ReportSalesOrderInvoicedData.selectWarehouse(this, strmWarehouseId);
-			if (!strcRegionId.equals(""))
-				strTitle += ", " + Utility.messageBD(this, "InRegion", vars.getLanguage()) + " "
-				    + ReportSalesOrderInvoicedData.selectRegionId(this, strcRegionId);
-			if (!strmCategoryId.equals(""))
-				strTitle += ", " + Utility.messageBD(this, "ForProductCategory", vars.getLanguage()) + " "
-				    + ReportSalesOrderInvoicedData.selectCategoryId(this, strmCategoryId);
-			if (!strProjectkind.equals(""))
-				strTitle += ", "
-				    + Utility.messageBD(this, "ProjectType", vars.getLanguage())
-				    + " "
-				    + ReportSalesOrderInvoicedData.selectProjectkind(this, vars.getLanguage(),
-				        strProjectkind);
-			if (!strProjectpublic.equals(""))
-				strTitle += ", "
-				    + Utility.messageBD(this, "WithInitiativeType", vars.getLanguage())
-				    + " "
-				    + ReportSalesOrderInvoicedData.selectProjectpublic(this, vars.getLanguage(),
-				        strProjectpublic);
-			if (!strdateFrom.equals(""))
-				strTitle += ", " + Utility.messageBD(this, "From", vars.getLanguage()) + " " + strdateFrom;
-			if (!strdateTo.equals(""))
-				strTitle += " " + Utility.messageBD(this, "To", vars.getLanguage()) + " " + strdateTo;
-			if (!strProduct.equals(""))
-				strTitle += ", " + Utility.messageBD(this, "ForProduct", vars.getLanguage()) + " "
-				    + ReportSalesOrderInvoicedData.selectProduct(this, strProduct);
-			xmlDocument.setParameter("title", strTitle);
-		}
-		xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
-		xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
+    } else { // command != DEFAULT
+      ReportSalesOrderInvoicedData[] data = ReportSalesOrderInvoicedData.select(this,
+          strCurrencyId,
+          Utility.getContext(this, vars, "#User_Client", "ReportSalesOrderInvoiced"),
+          Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportSalesOrderInvoiced"),
+          strdateFrom, DateTimeData.nDaysAfter(this, strdateTo, "1"), strcBpartnerId,
+          strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
+          strProjectpublic, strProduct);
+      if (data == null || data.length == 0) {
+        xmlDocument = xmlEngine.readXmlTemplate(
+            "org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedPop", discard)
+            .createXmlDocument();
+        xmlDocument.setData("structure1", ReportSalesOrderInvoicedData.set());
+      } else {
+        xmlDocument = xmlEngine.readXmlTemplate(
+            "org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedPop").createXmlDocument();
+        xmlDocument.setData("structure1", data);
+      }
+      if (!strmWarehouseId.equals(""))
+        strTitle += " " + Utility.messageBD(this, "ForWarehouse", vars.getLanguage()) + " "
+            + ReportSalesOrderInvoicedData.selectWarehouse(this, strmWarehouseId);
+      if (!strcRegionId.equals(""))
+        strTitle += ", " + Utility.messageBD(this, "InRegion", vars.getLanguage()) + " "
+            + ReportSalesOrderInvoicedData.selectRegionId(this, strcRegionId);
+      if (!strmCategoryId.equals(""))
+        strTitle += ", " + Utility.messageBD(this, "ForProductCategory", vars.getLanguage()) + " "
+            + ReportSalesOrderInvoicedData.selectCategoryId(this, strmCategoryId);
+      if (!strProjectkind.equals(""))
+        strTitle += ", "
+            + Utility.messageBD(this, "ProjectType", vars.getLanguage())
+            + " "
+            + ReportSalesOrderInvoicedData.selectProjectkind(this, vars.getLanguage(),
+                strProjectkind);
+      if (!strProjectpublic.equals(""))
+        strTitle += ", "
+            + Utility.messageBD(this, "WithInitiativeType", vars.getLanguage())
+            + " "
+            + ReportSalesOrderInvoicedData.selectProjectpublic(this, vars.getLanguage(),
+                strProjectpublic);
+      if (!strdateFrom.equals(""))
+        strTitle += ", " + Utility.messageBD(this, "From", vars.getLanguage()) + " " + strdateFrom;
+      if (!strdateTo.equals(""))
+        strTitle += " " + Utility.messageBD(this, "To", vars.getLanguage()) + " " + strdateTo;
+      if (!strProduct.equals(""))
+        strTitle += ", " + Utility.messageBD(this, "ForProduct", vars.getLanguage()) + " "
+            + ReportSalesOrderInvoicedData.selectProduct(this, strProduct);
+      xmlDocument.setParameter("title", strTitle);
+    }
+    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
+    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
 
-		response.setContentType("text/html; charset=UTF-8");
-		PrintWriter out = response.getWriter();
-		out.println(xmlDocument.print());
-		out.close();
-	}
+    response.setContentType("text/html; charset=UTF-8");
+    PrintWriter out = response.getWriter();
+    out.println(xmlDocument.print());
+    out.close();
+  }
 
-	// Jasper calling starts here
-	private void printPageDataSheetJasper(HttpServletRequest request, HttpServletResponse response,
-	    VariablesSecureApp vars, String strdateFrom, String strdateTo, String strcBpartnerId,
-	    String strmWarehouseId, String strcProjectId, String strmCategoryId, String strProjectkind,
-	    String strcRegionId, String strProjectpublic, String strProduct, String strCurrencyId)
-	    throws IOException, ServletException {
+  // Jasper calling starts here
+  private void printPageDataSheetJasper(HttpServletRequest request, HttpServletResponse response,
+      VariablesSecureApp vars, String strdateFrom, String strdateTo, String strcBpartnerId,
+      String strmWarehouseId, String strcProjectId, String strmCategoryId, String strProjectkind,
+      String strcRegionId, String strProjectpublic, String strProduct, String strCurrencyId)
+      throws IOException, ServletException {
 
-		// Checks if there is a conversion rate for each of the transactions of
-		// the report
-		ReportSalesOrderInvoicedData[] data = null;
-		String strConvRateErrorMsg = "";
-		OBError myMessage = null;
-		myMessage = new OBError();
-		try {
-			data = ReportSalesOrderInvoicedData.select(this, strCurrencyId,
-			    Utility.getContext(this, vars, "#User_Client", "ReportSalesOrderInvoiced"),
-			    Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportSalesOrderInvoiced"),
-			    strdateFrom, DateTimeData.nDaysAfter(this, strdateTo, "1"), strcBpartnerId,
-			    strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
-			    strProjectpublic, 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(request, response, "ERROR",
-			    Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()),
-			    strConvRateErrorMsg);
-		} else { // Launch the report as usual, calling the JRXML file
-			String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.jrxml";
-			String strOutput = "html";
+    // Checks if there is a conversion rate for each of the transactions of
+    // the report
+    ReportSalesOrderInvoicedData[] data = null;
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
+    try {
+      data = ReportSalesOrderInvoicedData.select(this, strCurrencyId,
+          Utility.getContext(this, vars, "#User_Client", "ReportSalesOrderInvoiced"),
+          Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportSalesOrderInvoiced"),
+          strdateFrom, DateTimeData.nDaysAfter(this, strdateTo, "1"), strcBpartnerId,
+          strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
+          strProjectpublic, 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(request, response, "ERROR",
+          Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()),
+          strConvRateErrorMsg);
+    } else { // Launch the report as usual, calling the JRXML file
+      String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportSalesOrderInvoicedJasper.jrxml";
+      String strOutput = "html";
 
-			String strSubTitle = "";
-			strSubTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " " + strdateFrom + " "
-			    + Utility.messageBD(this, "To", vars.getLanguage()) + " " + strdateTo;
+      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_SUBTITLE", strSubTitle);
-			renderJR(vars, response, strReportName, strOutput, parameters, data, null);
-		}
-	}
+      HashMap<String, Object> parameters = new HashMap<String, Object>();
+      parameters.put("REPORT_SUBTITLE", strSubTitle);
+      renderJR(vars, response, strReportName, strOutput, parameters, data, null);
+    }
+  }
 
-	public String getServletInfo() {
-		return "Servlet ReportSalesOrderInvoicedJasper. This Servlet was made by Jon Alegría";
-	} // end of getServletInfo() method
+  public String getServletInfo() {
+    return "Servlet ReportSalesOrderInvoicedJasper. This Servlet was made by Jon Alegría";
+  } // end of getServletInfo() method
 }
--- a/src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.java	Fri Jan 13 12:25:24 2017 -0500
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.java	Tue Jan 17 09:56:58 2017 -0500
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2001-2017 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -39,296 +39,296 @@
 import org.openbravo.xmlEngine.XmlDocument;
 
 public class ReportSalesOrderProvidedJR extends HttpSecureAppServlet {
-	private static final long serialVersionUID = 1L;
+  private static final long serialVersionUID = 1L;
 
-	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
-	    ServletException {
-		VariablesSecureApp vars = new VariablesSecureApp(request);
+  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", "");
-			String strcBpartnerId = vars.getStringParameter("inpcBPartnerId", "");
-			String strmWarehouseId = vars.getStringParameter("inpmWarehouseId", "");
-			String strcProjectId = vars.getStringParameter("inpcProjectId", "");
-			String strmCategoryId = vars.getStringParameter("inpProductCategory", "");
-			String strProjectkind = vars.getStringParameter("inpProjectkind", "");
-			String strcRegionId = vars.getStringParameter("inpcRegionId", "");
-			String strProjectpublic = vars.getStringParameter("inpProjectpublic", "");
-			String strProduct = vars.getStringParameter("inpProductId", "");
-			String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
-			    "ReportSalesOrderProvidedJR|currency", strUserCurrencyId);
-			printPageDataSheet(response, vars, strdateFrom, strdateTo, strcBpartnerId, strmWarehouseId,
-			    strcProjectId, strmCategoryId, strProjectkind, strcRegionId, strProjectpublic,
-			    strProduct, strCurrencyId);
-		} else if (vars.commandIn("FIND")) {
-			String strdateFrom = vars.getStringParameter("inpDateFrom");
-			String strdateTo = vars.getStringParameter("inpDateTo");
-			String strcBpartnerId = vars.getStringParameter("inpcBPartnerId");
-			String strmWarehouseId = vars.getStringParameter("inpmWarehouseId");
-			String strcProjectId = vars.getStringParameter("inpcProjectId");
-			String strmCategoryId = vars.getStringParameter("inpProductCategory");
-			String strProjectkind = vars.getStringParameter("inpProjectkind");
-			String strcRegionId = vars.getStringParameter("inpcRegionId");
-			String strProjectpublic = vars.getStringParameter("inpProjectpublic");
-			String strProduct = vars.getStringParameter("inpmProductId");
-			String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
-			    "ReportSalesOrderProvidedJR|currency", strUserCurrencyId);
-			printPageDataSheetJasper(request, response, vars, strdateFrom, strdateTo, strcBpartnerId,
-			    strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
-			    strProjectpublic, strProduct, strCurrencyId);
-		} else
-			pageErrorPopUp(response);
-	}
+    // 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", "");
+      String strcBpartnerId = vars.getStringParameter("inpcBPartnerId", "");
+      String strmWarehouseId = vars.getStringParameter("inpmWarehouseId", "");
+      String strcProjectId = vars.getStringParameter("inpcProjectId", "");
+      String strmCategoryId = vars.getStringParameter("inpProductCategory", "");
+      String strProjectkind = vars.getStringParameter("inpProjectkind", "");
+      String strcRegionId = vars.getStringParameter("inpcRegionId", "");
+      String strProjectpublic = vars.getStringParameter("inpProjectpublic", "");
+      String strProduct = vars.getStringParameter("inpProductId", "");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
+          "ReportSalesOrderProvidedJR|currency", strUserCurrencyId);
+      printPageDataSheet(response, vars, strdateFrom, strdateTo, strcBpartnerId, strmWarehouseId,
+          strcProjectId, strmCategoryId, strProjectkind, strcRegionId, strProjectpublic,
+          strProduct, strCurrencyId);
+    } else if (vars.commandIn("FIND")) {
+      String strdateFrom = vars.getStringParameter("inpDateFrom");
+      String strdateTo = vars.getStringParameter("inpDateTo");
+      String strcBpartnerId = vars.getStringParameter("inpcBPartnerId");
+      String strmWarehouseId = vars.getStringParameter("inpmWarehouseId");
+      String strcProjectId = vars.getStringParameter("inpcProjectId");
+      String strmCategoryId = vars.getStringParameter("inpProductCategory");
+      String strProjectkind = vars.getStringParameter("inpProjectkind");
+      String strcRegionId = vars.getStringParameter("inpcRegionId");
+      String strProjectpublic = vars.getStringParameter("inpProjectpublic");
+      String strProduct = vars.getStringParameter("inpmProductId");
+      String strCurrencyId = vars.getGlobalVariable("inpCurrencyId",
+          "ReportSalesOrderProvidedJR|currency", strUserCurrencyId);
+      printPageDataSheetJasper(request, response, vars, strdateFrom, strdateTo, strcBpartnerId,
+          strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
+          strProjectpublic, strProduct, strCurrencyId);
+    } else
+      pageErrorPopUp(response);
+  }
 
-	private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
-	    String strdateFrom, String strdateTo, String strcBpartnerId, String strmWarehouseId,
-	    String strcProjectId, String strmCategoryId, String strProjectkind, String strcRegionId,
-	    String strProjectpublic, String strProduct, String strCurrencyId) throws IOException,
-	    ServletException {
-		if (log4j.isDebugEnabled())
-			log4j.debug("Output: dataSheet");
-		String discard[] = { "sectionPartner" };
-		String strTitle = "";
-		XmlDocument xmlDocument = null;
-		if (vars.commandIn("DEFAULT")) {
-			xmlDocument = xmlEngine.readXmlTemplate(
-			    "org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR").createXmlDocument();
+  private void printPageDataSheet(HttpServletResponse response, VariablesSecureApp vars,
+      String strdateFrom, String strdateTo, String strcBpartnerId, String strmWarehouseId,
+      String strcProjectId, String strmCategoryId, String strProjectkind, String strcRegionId,
+      String strProjectpublic, String strProduct, String strCurrencyId) throws IOException,
+      ServletException {
+    if (log4j.isDebugEnabled())
+      log4j.debug("Output: dataSheet");
+    String discard[] = { "sectionPartner" };
+    String strTitle = "";
+    XmlDocument xmlDocument = null;
+    if (vars.commandIn("DEFAULT")) {
+      xmlDocument = xmlEngine.readXmlTemplate(
+          "org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR").createXmlDocument();
 
-			ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportSalesOrderProvidedJR", false,
-			    "", "", "", false, "ad_reports", strReplaceWith, false, true);
-			toolbar.prepareSimpleToolBarTemplate();
-			xmlDocument.setParameter("toolbar", toolbar.toString());
+      ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportSalesOrderProvidedJR", 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.ReportSalesOrderProvidedJR");
-				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(),
-				    "ReportSalesOrderProvidedJR.html", classInfo.id, classInfo.type, strReplaceWith,
-				    tabs.breadcrumb());
-				xmlDocument.setParameter("navigationBar", nav.toString());
-				LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(),
-				    "ReportSalesOrderProvidedJR.html", strReplaceWith);
-				xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
-			{
-				OBError myMessage = vars.getMessage("ReportSalesOrderProvidedJR");
-				vars.removeMessage("ReportSalesOrderProvidedJR");
-				if (myMessage != null) {
-					xmlDocument.setParameter("messageType", myMessage.getType());
-					xmlDocument.setParameter("messageTitle", myMessage.getTitle());
-					xmlDocument.setParameter("messageMessage", myMessage.getMessage());
-				}
-			}
+      try {
+        WindowTabs tabs = new WindowTabs(this, vars,
+            "org.openbravo.erpCommon.ad_reports.ReportSalesOrderProvidedJR");
+        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(),
+            "ReportSalesOrderProvidedJR.html", classInfo.id, classInfo.type, strReplaceWith,
+            tabs.breadcrumb());
+        xmlDocument.setParameter("navigationBar", nav.toString());
+        LeftTabsBar lBar = new LeftTabsBar(this, vars.getLanguage(),
+            "ReportSalesOrderProvidedJR.html", strReplaceWith);
+        xmlDocument.setParameter("leftTabs", lBar.manualTemplate());
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
+      {
+        OBError myMessage = vars.getMessage("ReportSalesOrderProvidedJR");
+        vars.removeMessage("ReportSalesOrderProvidedJR");
+        if (myMessage != null) {
+          xmlDocument.setParameter("messageType", myMessage.getType());
+          xmlDocument.setParameter("messageTitle", myMessage.getTitle());
+          xmlDocument.setParameter("messageMessage", myMessage.getMessage());
+        }
+      }
 
-			xmlDocument.setParameter("calendar", vars.getLanguage().substring(0, 2));
-			xmlDocument.setParameter("dateFrom", strdateFrom);
-			xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-			xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-			xmlDocument.setParameter("dateTo", strdateTo);
-			xmlDocument.setParameter("dateTodisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-			xmlDocument.setParameter("dateTosaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
-			xmlDocument.setParameter("paramBPartnerId", strcBpartnerId);
-			xmlDocument.setParameter("mWarehouseId", strmWarehouseId);
-			xmlDocument.setParameter("cProjectId", strcProjectId);
-			xmlDocument.setParameter("mProductCategoryId", strmCategoryId);
-			xmlDocument.setParameter("cProjectKind", strProjectkind);
-			xmlDocument.setParameter("cRegionId", strcRegionId);
-			xmlDocument.setParameter("cProjectPublic", strProjectpublic);
-			xmlDocument.setParameter("projectName",
-			    ReportSalesOrderProvidedData.selectProject(this, strcProjectId));
-			xmlDocument.setParameter("paramBPartnerDescription",
-			    ReportSalesOrderProvidedData.bPartnerDescription(this, strcBpartnerId));
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
-				    "M_Warehouse_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
-				        "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderProvidedJR"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
-				    strmWarehouseId);
-				xmlDocument.setData("reportM_WAREHOUSEID", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      xmlDocument.setParameter("calendar", vars.getLanguage().substring(0, 2));
+      xmlDocument.setParameter("dateFrom", strdateFrom);
+      xmlDocument.setParameter("dateFromdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+      xmlDocument.setParameter("dateFromsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+      xmlDocument.setParameter("dateTo", strdateTo);
+      xmlDocument.setParameter("dateTodisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+      xmlDocument.setParameter("dateTosaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+      xmlDocument.setParameter("paramBPartnerId", strcBpartnerId);
+      xmlDocument.setParameter("mWarehouseId", strmWarehouseId);
+      xmlDocument.setParameter("cProjectId", strcProjectId);
+      xmlDocument.setParameter("mProductCategoryId", strmCategoryId);
+      xmlDocument.setParameter("cProjectKind", strProjectkind);
+      xmlDocument.setParameter("cRegionId", strcRegionId);
+      xmlDocument.setParameter("cProjectPublic", strProjectpublic);
+      xmlDocument.setParameter("projectName",
+          ReportSalesOrderProvidedData.selectProject(this, strcProjectId));
+      xmlDocument.setParameter("paramBPartnerDescription",
+          ReportSalesOrderProvidedData.bPartnerDescription(this, strcBpartnerId));
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
+            "M_Warehouse_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
+                "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderProvidedJR"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
+            strmWarehouseId);
+        xmlDocument.setData("reportM_WAREHOUSEID", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
-				    "M_Product_Category_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
-				        "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderProvidedJR"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
-				    strmCategoryId);
-				xmlDocument.setData("reportM_PRODUCT_CATEGORYID", "liststructure",
-				    comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR",
+            "M_Product_Category_ID", "", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
+                "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderProvidedJR"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
+            strmCategoryId);
+        xmlDocument.setData("reportM_PRODUCT_CATEGORYID", "liststructure",
+            comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "LIST", "C_Projectkind_ID",
-				    "Projectkind", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
-				        "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderProvidedJR"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
-				    strProjectkind);
-				xmlDocument.setData("reportC_PROJECTKIND", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "LIST", "C_Projectkind_ID",
+            "Projectkind", "", Utility.getContext(this, vars, "#AccessibleOrgTree",
+                "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderProvidedJR"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
+            strProjectkind);
+        xmlDocument.setData("reportC_PROJECTKIND", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Region_ID",
-				    "", "C_Region of Country", Utility.getContext(this, vars, "#AccessibleOrgTree",
-				        "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderProvidedJR"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
-				    strcRegionId);
-				xmlDocument.setData("reportC_REGIONID", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "C_Region_ID",
+            "", "C_Region of Country", Utility.getContext(this, vars, "#AccessibleOrgTree",
+                "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderProvidedJR"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
+            strcRegionId);
+        xmlDocument.setData("reportC_REGIONID", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-			try {
-				ComboTableData comboTableData = new ComboTableData(vars, this, "LIST",
-				    "C_Project_Public_ID", "PublicPrivate", "", Utility.getContext(this, vars,
-				        "#AccessibleOrgTree", "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars,
-				        "#User_Client", "ReportSalesOrderProvidedJR"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
-				    strProjectpublic);
-				xmlDocument.setData("reportC_PROJECTPUBLIC", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} catch (Exception ex) {
-				throw new ServletException(ex);
-			}
+      try {
+        ComboTableData comboTableData = new ComboTableData(vars, this, "LIST",
+            "C_Project_Public_ID", "PublicPrivate", "", Utility.getContext(this, vars,
+                "#AccessibleOrgTree", "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars,
+                "#User_Client", "ReportSalesOrderProvidedJR"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
+            strProjectpublic);
+        xmlDocument.setData("reportC_PROJECTPUBLIC", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } 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, "#AccessibleOrgTree",
-				        "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
-				        "ReportSalesOrderProvidedJR"), 0);
-				Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
-				    strCurrencyId);
-				xmlDocument.setData("reportC_Currency_ID", "liststructure", comboTableData.select(false));
-				comboTableData = null;
-			} 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, "#AccessibleOrgTree",
+                "ReportSalesOrderProvidedJR"), Utility.getContext(this, vars, "#User_Client",
+                "ReportSalesOrderProvidedJR"), 0);
+        Utility.fillSQLParameters(this, vars, null, comboTableData, "ReportSalesOrderProvidedJR",
+            strCurrencyId);
+        xmlDocument.setData("reportC_Currency_ID", "liststructure", comboTableData.select(false));
+        comboTableData = null;
+      } catch (Exception ex) {
+        throw new ServletException(ex);
+      }
 
-		} else { // command != DEFAULT
-			ReportSalesOrderProvidedData[] data = ReportSalesOrderProvidedData.select(this,
-			    strCurrencyId,
-			    Utility.getContext(this, vars, "#User_Client", "ReportSalesOrderProvided"),
-			    Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportSalesOrderProvided"),
-			    strdateFrom, DateTimeData.nDaysAfter(this, strdateTo, "1"), strcBpartnerId,
-			    strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
-			    strProjectpublic, strProduct);
-			if (data == null || data.length == 0) {
-				xmlDocument = xmlEngine.readXmlTemplate(
-				    "org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedPop", discard)
-				    .createXmlDocument();
-				xmlDocument.setData("structure1", ReportSalesOrderProvidedData.set());
-			} else {
-				xmlDocument = xmlEngine.readXmlTemplate(
-				    "org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedPop").createXmlDocument();
-				xmlDocument.setData("structure1", data);
-			}
-			if (!strmWarehouseId.equals(""))
-				strTitle += " " + Utility.messageBD(this, "ForWarehouse", vars.getLanguage()) + " "
-				    + ReportSalesOrderProvidedData.selectWarehouse(this, strmWarehouseId);
-			if (!strcRegionId.equals(""))
-				strTitle += ", " + Utility.messageBD(this, "InRegion", vars.getLanguage()) + " "
-				    + ReportSalesOrderProvidedData.selectRegionId(this, strcRegionId);
-			if (!strmCategoryId.equals(""))
-				strTitle += ", " + Utility.messageBD(this, "ForProductCategory", vars.getLanguage()) + " "
-				    + ReportSalesOrderProvidedData.selectCategoryId(this, strmCategoryId);
-			if (!strProjectkind.equals(""))
-				strTitle += ", "
-				    + Utility.messageBD(this, "ProjectType", vars.getLanguage())
-				    + " "
-				    + ReportSalesOrderProvidedData.selectProjectkind(this, vars.getLanguage(),
-				        strProjectkind);
-			if (!strProjectpublic.equals(""))
-				strTitle += ", "
-				    + Utility.messageBD(this, "WithInitiativeType", vars.getLanguage())
-				    + " "
-				    + ReportSalesOrderProvidedData.selectProjectpublic(this, vars.getLanguage(),
-				        strProjectpublic);
-			if (!strdateFrom.equals(""))
-				strTitle += ", " + Utility.messageBD(this, "From", vars.getLanguage()) + " " + strdateFrom;
-			if (!strdateTo.equals(""))
-				strTitle += " " + Utility.messageBD(this, "To", vars.getLanguage()) + " " + strdateTo;
-			if (!strProduct.equals(""))
-				strTitle += ", " + Utility.messageBD(this, "ForProduct", vars.getLanguage()) + " "
-				    + ReportSalesOrderProvidedData.selectProduct(this, strProduct);
-			xmlDocument.setParameter("title", strTitle);
-		}
-		xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
-		xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
+    } else { // command != DEFAULT
+      ReportSalesOrderProvidedData[] data = ReportSalesOrderProvidedData.select(this,
+          strCurrencyId,
+          Utility.getContext(this, vars, "#User_Client", "ReportSalesOrderProvided"),
+          Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportSalesOrderProvided"),
+          strdateFrom, DateTimeData.nDaysAfter(this, strdateTo, "1"), strcBpartnerId,
+          strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
+          strProjectpublic, strProduct);
+      if (data == null || data.length == 0) {
+        xmlDocument = xmlEngine.readXmlTemplate(
+            "org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedPop", discard)
+            .createXmlDocument();
+        xmlDocument.setData("structure1", ReportSalesOrderProvidedData.set());
+      } else {
+        xmlDocument = xmlEngine.readXmlTemplate(
+            "org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedPop").createXmlDocument();
+        xmlDocument.setData("structure1", data);
+      }
+      if (!strmWarehouseId.equals(""))
+        strTitle += " " + Utility.messageBD(this, "ForWarehouse", vars.getLanguage()) + " "
+            + ReportSalesOrderProvidedData.selectWarehouse(this, strmWarehouseId);
+      if (!strcRegionId.equals(""))
+        strTitle += ", " + Utility.messageBD(this, "InRegion", vars.getLanguage()) + " "
+            + ReportSalesOrderProvidedData.selectRegionId(this, strcRegionId);
+      if (!strmCategoryId.equals(""))
+        strTitle += ", " + Utility.messageBD(this, "ForProductCategory", vars.getLanguage()) + " "
+            + ReportSalesOrderProvidedData.selectCategoryId(this, strmCategoryId);
+      if (!strProjectkind.equals(""))
+        strTitle += ", "
+            + Utility.messageBD(this, "ProjectType", vars.getLanguage())
+            + " "
+            + ReportSalesOrderProvidedData.selectProjectkind(this, vars.getLanguage(),
+                strProjectkind);
+      if (!strProjectpublic.equals(""))
+        strTitle += ", "
+            + Utility.messageBD(this, "WithInitiativeType", vars.getLanguage())
+            + " "
+            + ReportSalesOrderProvidedData.selectProjectpublic(this, vars.getLanguage(),
+                strProjectpublic);
+      if (!strdateFrom.equals(""))
+        strTitle += ", " + Utility.messageBD(this, "From", vars.getLanguage()) + " " + strdateFrom;
+      if (!strdateTo.equals(""))
+        strTitle += " " + Utility.messageBD(this, "To", vars.getLanguage()) + " " + strdateTo;
+      if (!strProduct.equals(""))
+        strTitle += ", " + Utility.messageBD(this, "ForProduct", vars.getLanguage()) + " "
+            + ReportSalesOrderProvidedData.selectProduct(this, strProduct);
+      xmlDocument.setParameter("title", strTitle);
+    }
+    xmlDocument.setParameter("language", "defaultLang=\"" + vars.getLanguage() + "\";");
+    xmlDocument.setParameter("directory", "var baseDirectory = \"" + strReplaceWith + "/\";\n");
 
-		response.setContentType("text/html; charset=UTF-8");
-		PrintWriter out = response.getWriter();
-		out.println(xmlDocument.print());
-		out.close();
-	}
+    response.setContentType("text/html; charset=UTF-8");
+    PrintWriter out = response.getWriter();
+    out.println(xmlDocument.print());
+    out.close();
+  }
 
-	// Jasper calling starts here
-	private void printPageDataSheetJasper(HttpServletRequest request, HttpServletResponse response,
-	    VariablesSecureApp vars, String strdateFrom, String strdateTo, String strcBpartnerId,
-	    String strmWarehouseId, String strcProjectId, String strmCategoryId, String strProjectkind,
-	    String strcRegionId, String strProjectpublic, String strProduct, String strCurrencyId)
-	    throws IOException, ServletException {
+  // Jasper calling starts here
+  private void printPageDataSheetJasper(HttpServletRequest request, HttpServletResponse response,
+      VariablesSecureApp vars, String strdateFrom, String strdateTo, String strcBpartnerId,
+      String strmWarehouseId, String strcProjectId, String strmCategoryId, String strProjectkind,
+      String strcRegionId, String strProjectpublic, String strProduct, String strCurrencyId)
+      throws IOException, ServletException {
 
-		// Checks if there is a conversion rate for each of the transactions of
-		// the report
-		ReportSalesOrderProvidedData[] data = null;
-		String strConvRateErrorMsg = "";
-		OBError myMessage = null;
-		myMessage = new OBError();
-		try {
-			data = ReportSalesOrderProvidedData.select(this, strCurrencyId,
-			    Utility.getContext(this, vars, "#User_Client", "ReportSalesOrderProvided"),
-			    Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportSalesOrderProvided"),
-			    strdateFrom, DateTimeData.nDaysAfter(this, strdateTo, "1"), strcBpartnerId,
-			    strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
-			    strProjectpublic, 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(request, response, "ERROR",
-			    Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()),
-			    strConvRateErrorMsg);
-		} else { // Launch the report as usual, calling the JRXML file
-			String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.jrxml";
-			String strOutput = "html";
+    // Checks if there is a conversion rate for each of the transactions of
+    // the report
+    ReportSalesOrderProvidedData[] data = null;
+    String strConvRateErrorMsg = "";
+    OBError myMessage = null;
+    myMessage = new OBError();
+    try {
+      data = ReportSalesOrderProvidedData.select(this, strCurrencyId,
+          Utility.getContext(this, vars, "#User_Client", "ReportSalesOrderProvided"),
+          Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportSalesOrderProvided"),
+          strdateFrom, DateTimeData.nDaysAfter(this, strdateTo, "1"), strcBpartnerId,
+          strmWarehouseId, strcProjectId, strmCategoryId, strProjectkind, strcRegionId,
+          strProjectpublic, 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(request, response, "ERROR",
+          Utility.messageBD(this, "NoConversionRateHeader", vars.getLanguage()),
+          strConvRateErrorMsg);
+    } else { // Launch the report as usual, calling the JRXML file
+      String strReportName = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportSalesOrderProvidedJR.jrxml";
+      String strOutput = "html";
 
-			String strSubTitle = "";
-			strSubTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " " + strdateFrom + " "
-			    + Utility.messageBD(this, "To", vars.getLanguage()) + " " + strdateTo;
+      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_SUBTITLE", strSubTitle);
-			renderJR(vars, response, strReportName, strOutput, parameters, data, null);
-		}
-	}
+      HashMap<String, Object> parameters = new HashMap<String, Object>();
+      parameters.put("REPORT_SUBTITLE", strSubTitle);
+      renderJR(vars, response, strReportName, strOutput, parameters, data, null);
+    }
+  }
 
-	public String getServletInfo() {
-		return "Servlet ReportSalesOrderProvidedJR. This Servlet was made by Jon Alegría";
-	} // end of getServletInfo() method
+  public String getServletInfo() {
+    return "Servlet ReportSalesOrderProvidedJR. This Servlet was made by Jon Alegría";
+  } // end of getServletInfo() method
 }