[pi-code-cleaning] Merge with latest pi
authorNaroa Iriarte <naroa.iriarte@openbravo.com>
Mon, 09 May 2016 09:57:27 +0200
changeset 29489 1c0637886cfe
parent 29488 ae3288e7bc8a (diff)
parent 29449 58bacde3f953 (current diff)
child 29490 cdef8accca50
[pi-code-cleaning] Merge with latest pi
src-test/src/org/openbravo/test/datasource/TestInitializeAccess.java
src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Mon May 09 09:57:27 2016 +0200
@@ -361,7 +361,6 @@
     return ((FIN_ReconciliationLine_v) obc.uniqueResult()).getTransactionDate();
   }
 
-  @SuppressWarnings("unused")
   private void printPage(HttpServletResponse response, VariablesSecureApp vars, String strOrgId,
       String strWindowId, String strTabId, String strPaymentTypeFilter,
       String strFinancialAccountId, String reconciliationId, String strShowCleared,
@@ -536,7 +535,6 @@
         final String COLOR_STRONG = "#66CC00";
         final String COLOR_WEAK = "#99CC66";
         final String COLOR_WHITE = "white";
-        boolean alreadyMatched = false;
 
         FIN_BankStatementLine line = OBDal.getInstance().get(FIN_BankStatementLine.class,
             FIN_BankStatementLines[i].getId());
@@ -548,7 +546,6 @@
           if (executeMatching) {
             // try to match if exception is thrown continue
             try {
-              long initMatchLine = System.currentTimeMillis();
               matched = matchingTransaction.match(line, excluded);
               // initMatch = initMatch + (System.currentTimeMillis() - initMatchLine);
               OBDal.getInstance().getConnection().commit();
@@ -584,8 +581,6 @@
           }
           matchingType = matched.getMatchLevel();
 
-        } else {
-          alreadyMatched = true;
         }
 
         FieldProviderFactory.setField(data[i], "rownum", Integer.toString(i + 1));
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDisplayLogics.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDisplayLogics.java	Mon May 09 09:57:27 2016 +0200
@@ -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) 2014-2015 Openbravo SLU
+ * All portions are Copyright (C) 2014-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -30,7 +30,6 @@
 import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Organization;
-import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
 
 @ComponentProvider.Qualifier(APRMConstants.TRANSACTION_WINDOW_ID)
 public class TransactionAddPaymentDisplayLogics extends AddPaymentDisplayLogicsHandler {
@@ -80,21 +79,6 @@
     }
   }
 
-  private FIN_FinaccTransaction getTransaction(Map<String, String> requestMap) throws JSONException {
-    // Current Payment
-    JSONObject context = new JSONObject(requestMap.get("context"));
-    String strFinFinaccTransactionIdd = "";
-    if (context.has("inpfinFinaccTransactionId") && !context.isNull("inpfinFinaccTransactionId")) {
-      strFinFinaccTransactionIdd = context.getString("inpfinFinaccTransactionId");
-    }
-    if (context.has("Fin_Finacc_Transaction_ID") && !context.isNull("Fin_Finacc_Transaction_ID")) {
-      strFinFinaccTransactionIdd = context.getString("Fin_Finacc_Transaction_ID");
-    }
-    FIN_FinaccTransaction transaction = OBDal.getInstance().get(FIN_FinaccTransaction.class,
-        strFinFinaccTransactionIdd);
-    return transaction;
-  }
-
   BigDecimal getDefaultGeneratedCredit(Map<String, String> requestMap) throws JSONException {
     return BigDecimal.ZERO;
   }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Mon May 09 09:57:27 2016 +0200
@@ -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) 2010-2015 Openbravo SLU
+ * All portions are Copyright (C) 2010-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -502,10 +502,8 @@
       return targetBusinessPartnerId;
     } catch (Exception e) {
       log4j.error(e.getStackTrace());
-    } finally {
       return targetBusinessPartnerId;
     }
-
   }
 
   private BankFileFormat getBankFileFormat() {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/DynamicExpressionParser.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/DynamicExpressionParser.java	Mon May 09 09:57:27 2016 +0200
@@ -357,11 +357,11 @@
     List<Field> fields;
     List<AuxiliaryInput> auxIns;
     if (parameterDisplayLogic) {
-      for (Parameter parameter : parameters) {
-        if (token.equalsIgnoreCase(parameter.getDBColumnName())) {
-          parametersInExpression.add(parameter);
+      for (Parameter param : parameters) {
+        if (token.equalsIgnoreCase(param.getDBColumnName())) {
+          parametersInExpression.add(param);
           UIDefinition uiDef = UIDefinitionController.getInstance().getUIDefinition(
-              parameter.getReference());
+              param.getReference());
           if (uiDef.getDomainType() instanceof DateDomainType) {
             return new DisplayLogicElement(
                 "OB.Utilities.Date.JSToOB(OB.Utilities.getValue(currentValues,'" + token
@@ -383,17 +383,17 @@
         fields = tab.getADFieldList();
         auxIns = tab.getADAuxiliaryInputList();
       }
-      for (Field field : fields) {
-        if (field.getColumn() == null) {
+      for (Field tabField : fields) {
+        if (tabField.getColumn() == null) {
           continue;
         }
-        if (token.equalsIgnoreCase(field.getColumn().getDBColumnName()) && !tabLevelDisplayLogic) {
-          fieldsInExpression.add(field);
+        if (token.equalsIgnoreCase(tabField.getColumn().getDBColumnName()) && !tabLevelDisplayLogic) {
+          fieldsInExpression.add(tabField);
           final String fieldName = KernelUtils.getInstance()
-              .getPropertyFromColumn(field.getColumn()).getName();
+              .getPropertyFromColumn(tabField.getColumn()).getName();
 
           UIDefinition uiDef = UIDefinitionController.getInstance().getUIDefinition(
-              field.getColumn().getId());
+              tabField.getColumn().getId());
           if (uiDef.getDomainType() instanceof DateDomainType) {
             return new DisplayLogicElement(
                 "OB.Utilities.Date.JSToOB(OB.Utilities.getValue(currentValues,'" + fieldName
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ElementValueEventHandler.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/ElementValueEventHandler.java	Mon May 09 09:57:27 2016 +0200
@@ -54,7 +54,6 @@
     return entities;
   }
 
-  @SuppressWarnings("unused")
   public void onSave(@Observes EntityNewEvent event) {
     if (!isValidEvent(event)) {
       return;
@@ -96,7 +95,6 @@
     doIt(account);
   }
 
-  @SuppressWarnings("unused")
   private void doIt(ElementValue account) {
     boolean isNumber = true;
     try {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/LocationSettingsHandler.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/event/LocationSettingsHandler.java	Mon May 09 09:57:27 2016 +0200
@@ -73,7 +73,6 @@
     }
   }
 
-  @SuppressWarnings("unused")
   private void checkCorrectValues(String numericmask, String datetimeformat, String dateformat) {
     if (numericmask != null) {
       if (checkNumericMask(numericmask)) {
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java	Mon May 09 09:57:27 2016 +0200
@@ -74,7 +74,6 @@
   private Tab tab;
   private List<String> statusBarFields;
 
-  private List<String> windowEntities = null;
   private List<OBViewFieldDefinition> fields;
   private List<String> propertiesInButtonFieldDisplayLogic = new ArrayList<String>();
   private List<String> hiddenPropertiesInDisplayLogic = new ArrayList<String>();
@@ -2254,16 +2253,6 @@
     }
   }
 
-  private List<String> getWindowEntities() {
-    if (windowEntities == null) {
-      windowEntities = new ArrayList<String>();
-      for (Tab localTab : tab.getWindow().getADTabList()) {
-        windowEntities.add(localTab.getTable().getName());
-      }
-    }
-    return windowEntities;
-  }
-
   public List<Field> getIgnoredFields() {
     getFields(); // initializes stuff
     return ignoredFields;
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseKernelServlet.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/BaseKernelServlet.java	Mon May 09 09:57:27 2016 +0200
@@ -34,7 +34,6 @@
  * 
  * @author mtaal
  */
-@SuppressWarnings("deprecation")
 public abstract class BaseKernelServlet extends HttpSecureAppServlet {
   protected static final String RESPONSE_HEADER_ETAG = "ETag";
   protected static final String RESPONSE_HEADER_LASTMODIFIED = "Last-Modified";
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/CSSMinimizer.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/CSSMinimizer.java	Mon May 09 09:57:27 2016 +0200
@@ -316,7 +316,7 @@
   public Property(String property) throws Exception {
     try {
       // Parse the property.
-      ArrayList<String> parts = new ArrayList<String>();
+      ArrayList<String> partList = new ArrayList<String>();
       boolean bCanSplit = true;
       int j = 0;
       String substr;
@@ -331,19 +331,19 @@
         } else if (property.charAt(i) == ':') {
           substr = property.substring(j, i);
           if (!(substr.trim().equals("") || (substr == null)))
-            parts.add(substr);
+            partList.add(substr);
           j = i + 1;
         }
       }
       substr = property.substring(j, property.length());
       if (!(substr.trim().equals("") || (substr == null)))
-        parts.add(substr);
-      if (parts.size() < 2) {
+        partList.add(substr);
+      if (partList.size() < 2) {
         throw new Exception("\t\tWarning: Incomplete property: " + property);
       }
-      this.property = parts.get(0).trim().toLowerCase();
+      this.property = partList.get(0).trim().toLowerCase();
 
-      this.parts = parseValues(simplifyColours(parts.get(1).trim().replaceAll(", ", ",")));
+      this.parts = parseValues(simplifyColours(partList.get(1).trim().replaceAll(", ", ",")));
 
     } catch (PatternSyntaxException e) {
       // Invalid regular expression used.
@@ -377,7 +377,6 @@
     // prefixes last -- eg, *display should come after display.
     String thisProp = this.property;
     String thatProp = other.property;
-    String[] parts;
 
     if (thisProp.charAt(0) == '-') {
       thisProp = thisProp.substring(1);
@@ -626,12 +625,15 @@
   }
 }
 
+@SuppressWarnings("serial")
 class UnterminatedCommentException extends Exception {
 }
 
+@SuppressWarnings("serial")
 class UnbalancedBracesException extends Exception {
 }
 
+@SuppressWarnings("serial")
 class IncompletePropertyException extends Exception {
   String message = null;
 
@@ -644,6 +646,7 @@
   }
 }
 
+@SuppressWarnings("serial")
 class EmptySelectorBodyException extends Exception {
   String message = null;
 
@@ -656,6 +659,7 @@
   }
 }
 
+@SuppressWarnings("serial")
 class UnterminatedSelectorException extends Exception {
   String message = null;
 
@@ -668,6 +672,7 @@
   }
 }
 
+@SuppressWarnings("serial")
 class IncompleteSelectorException extends Exception {
   String message = null;
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelServlet.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelServlet.java	Mon May 09 09:57:27 2016 +0200
@@ -66,7 +66,7 @@
   private static String servletPathPart = "org.openbravo.client.kernel";
 
   // are used to compute the relative path
-  private static ConfigParameters globalParameters;
+  private static ConfigParameters kernelServletglobalParameters;
 
   private static ServletContext servletContext;
 
@@ -74,7 +74,7 @@
    * @return the parameters as they are defined in the servlet context.
    */
   public static ConfigParameters getGlobalParameters() {
-    return globalParameters;
+    return kernelServletglobalParameters;
   }
 
   public static String getServletPathPart() {
@@ -146,7 +146,7 @@
 
   public void init(ServletConfig config) {
     super.init(config);
-    globalParameters = ConfigParameters.retrieveFrom(config.getServletContext());
+    kernelServletglobalParameters = ConfigParameters.retrieveFrom(config.getServletContext());
     servletContext = config.getServletContext();
   }
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/RequestContext.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/RequestContext.java	Mon May 09 09:57:27 2016 +0200
@@ -49,7 +49,6 @@
  * 
  * @author mtaal
  */
-@SuppressWarnings("deprecation")
 public class RequestContext {
   private static ServletContext servletContext = null;
 
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/freemarker/FreemarkerTemplateProcessor.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/freemarker/FreemarkerTemplateProcessor.java	Mon May 09 09:57:27 2016 +0200
@@ -93,7 +93,6 @@
    * @see
    * org.openbravo.client.kernel.TemplateProcessor#validate(org.openbravo.client.kernel.Template)
    */
-  @SuppressWarnings("unused")
   public void validate(Template template) throws ValidationException {
     try {
       final String source = createTemplateSource(template);
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DefaultDataSourceService.java	Mon May 09 09:57:27 2016 +0200
@@ -357,12 +357,7 @@
     if (entity == null) {
       dsProperties = super.getDataSourceProperties(parameters);
     } else {
-      if (false) {
-        dsProperties = getInitialProperties(entity,
-            parameters.containsKey(DataSourceConstants.MINIMAL_PROPERTY_OUTPUT));
-      } else {
-        dsProperties = getInitialProperties(entity, false);
-      }
+      dsProperties = getInitialProperties(entity, false);
     }
 
     // now see if there are additional properties, these are often property paths
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java	Fri May 06 10:09:56 2016 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/JsonToDataConverter.java	Mon May 09 09:57:27 2016 +0200
@@ -127,7 +127,6 @@
 
   private final static SimpleDateFormat xmlDateFormat = JsonUtils.createDateFormat();
   private final static SimpleDateFormat xmlDateTimeFormat = JsonUtils.createDateTimeFormat();
-  private final static SimpleDateFormat xmlTimeFormat = JsonUtils.createTimeFormat();
   private final static SimpleDateFormat jsTimeFormat = JsonUtils.createJSTimeFormat();
 
   private final List<JsonConversionError> errors = new ArrayList<JsonConversionError>();
--- a/src-db/database/model/excludeFilter.xml	Fri May 06 10:09:56 2016 +0200
+++ b/src-db/database/model/excludeFilter.xml	Mon May 09 09:57:27 2016 +0200
@@ -34,7 +34,6 @@
     <excludedFunction name="TRUNC"/>
     <excludedFunction name="INSTR"/>
     <excludedFunction name="LAST_DAY"/>
-    <excludedFunction name="IS_TRIGGER_ENABLED"/>
     <excludedFunction name="DROP_VIEW"/>
     <excludedFunction name="MONTHS_BETWEEN"/>
     <excludedFunction name="AD_SCRIPT_DROP_RECREATE_INDEXES"/>
@@ -54,7 +53,6 @@
     <excludedFunction name="NOW"/>
     <excludedFunction name="UPDATE_DATEFORMAT"/>
     <excludedFunction name="GET_UUID"/>
-    <excludedFunction name="HEX_TO_INT"/>
     <excludedFunction name="UUID_GENERATE_V4"/>
     <excludedFunction name="AD_ORG_CHK_DOCUMENTS"/>
     <excludedFunction name="AD_ORG_CHK_DOC_PAYMENTS"/>
--- a/src-db/database/model/functions/AD_SHORTNAME.xml	Fri May 06 10:09:56 2016 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-  <database name="FUNCTION AD_SHORTNAME">
-    <function name="AD_SHORTNAME" type="NVARCHAR">
-      <parameter name="p_name" type="NVARCHAR" mode="in">
-        <default/>
-      </parameter>
-      <body><![CDATA[/*************************************************************************
-* The contents of this file are subject to the Openbravo  Public  License
-* Version  1.1  (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 SLU
-* All portions are Copyright (C) 2001-2006 Openbravo SLU
-* All Rights Reserved.
-* Contributor(s):  ______________________________________.
-************************************************************************/
-/*************************************************************************
-* Title: AD_ShortName
-************************************************************************/
-  v_RetValue NVARCHAR2(2000) ;
-  v_pos NUMBER:=1;
-BEGIN
-  v_RetValue:=SUBSTR(p_Name, 1, 1) ;
-  WHILE(INSTR(REPLACE(p_Name, '.', ' '), ' ', v_pos+1) > 0)
-  LOOP
-    v_pos:=INSTR(REPLACE(p_Name, '.', ' '), ' ', v_pos+1) ;
-    v_RetValue:=v_RetValue || SUBSTR(p_Name, v_pos+1, 1) ;
-  END LOOP;
-  RETURN v_RetValue;
-EXCEPTION
-WHEN OTHERS THEN
-  RETURN TO_CHAR(v_pos) ;
-END AD_SHORTNAME
-]]></body>
-    </function>
-  </database>
--- a/src-db/database/model/postscript-DB2.sql	Fri May 06 10:09:56 2016 +0200
+++ b/src-db/database/model/postscript-DB2.sql	Mon May 09 09:57:27 2016 +0200
@@ -23,31 +23,6 @@
 END NOW;
 /-- END NOW
 
-CREATE OR REPLACE FUNCTION hex_to_int (hexn VARCHAR)
-  RETURN number
-AS
-/*************************************************************************
-* The contents of this file are subject to the Openbravo  Public  License
-* Version  1.1  (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 SLU
-* All portions are Copyright (C) 2001-2008 Openbravo SLU
-* All Rights Reserved.
-* Contributor(s):  ______________________________________.
-************************************************************************/
-BEGIN
-    return to_number(hexn,'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-END hex_to_int;
-/-- END hex_to_int
-
-
 CREATE OR REPLACE FUNCTION ad_script_execute (param_Message VARCHAR2)
   RETURN VARCHAR2
 AS
--- a/src-db/database/model/postscript-Oracle.sql	Fri May 06 10:09:56 2016 +0200
+++ b/src-db/database/model/postscript-Oracle.sql	Mon May 09 09:57:27 2016 +0200
@@ -22,30 +22,6 @@
 END NOW;
 /-- END NOW
 
-CREATE OR REPLACE FUNCTION hex_to_int (hexn VARCHAR)
-  RETURN number
-AS
-/*************************************************************************
-* The contents of this file are subject to the Openbravo  Public  License
-* Version  1.1  (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 SLU
-* All portions are Copyright (C) 2001-2008 Openbravo SLU
-* All Rights Reserved.
-* Contributor(s):  ______________________________________.
-************************************************************************/
-BEGIN
-    return to_number(hexn,'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
-END hex_to_int;
-/-- END hex_to_int
-
 CREATE OR REPLACE FUNCTION ad_script_execute (param_Message VARCHAR2)
   RETURN VARCHAR2
 AS
--- a/src-db/database/model/prescript-PostgreSql.sql	Fri May 06 10:09:56 2016 +0200
+++ b/src-db/database/model/prescript-PostgreSql.sql	Mon May 09 09:57:27 2016 +0200
@@ -176,8 +176,8 @@
     -- this is the old behaviour
     RETURN to_number($1, ''S99999999999999D999999'');
   ELSE
-    v_Mant := substring($1 from 1 for v_Pos - 1); -- Mantissa, implicit cast to data type NUMERIC
-    v_Exp := substring($1 from v_Pos + 1); -- Exponent, implicit cast to data type NUMERIC
+    v_Mant := cast(substring($1 from 1 for v_Pos - 1) as numeric);
+    v_Exp := cast(substring($1 from v_Pos + 1) as numeric);
     v_Res := v_Mant * power(10, v_Exp);
     RETURN v_Res;
   END IF;
@@ -263,11 +263,11 @@
 
 CREATE OR REPLACE FUNCTION to_date
 (
-timestamp, varchar
+ timestamp, varchar
 )
-RETURNS timestamp AS '
+  RETURNS timestamp AS '
 BEGIN
-RETURN to_timestamp($1, $2);
+  RETURN to_timestamp(to_char($1), $2);
 END;
 ' LANGUAGE 'plpgsql' IMMUTABLE
 /-- END
@@ -429,79 +429,6 @@
 ' language 'plpgsql' IMMUTABLE
 /-- END
 
-CREATE OR REPLACE FUNCTION hex_to_int("varchar")
-  RETURNS "numeric" AS
-$BODY$
-DECLARE
-h alias for $1;
-exec varchar;
-curs refcursor;
-res numeric;
-res1 numeric;
-res2 numeric;
-res3 numeric;
-res4 numeric;
-hi varchar;
-h1 varchar;
-h2 varchar;
-h3 varchar;
-h4 varchar;
-exp1 numeric(50);
-exp2 numeric(50);
-exp3 numeric(50);
-BEGIN
-if length(h) < 32 then
-	hi:=repeat('0',32-length(h)) || h;
-else
-	hi:=h;
-end if;
-h1:=substr(hi,25,8);
-h2:=substr(hi,17,8);
-h3:=substr(hi,9,8);
-h4:=substr(hi,1,8);
-exec := 'SELECT x''' || h1 || '''::bigint';
-OPEN curs FOR EXECUTE exec;
-FETCH curs INTO res1;
-CLOSE curs;
-exec := 'SELECT x''' || h2 || '''::bigint';
-OPEN curs FOR EXECUTE exec;
-FETCH curs INTO res2;
-CLOSE curs;
-exec := 'SELECT x''' || h3 || '''::bigint';
-OPEN curs FOR EXECUTE exec;
-FETCH curs INTO res3;
-CLOSE curs;
-exec := 'SELECT x''' || h4 || '''::bigint';
-OPEN curs FOR EXECUTE exec;
-FETCH curs INTO res4;
-CLOSE curs;
-exp1=pow(16::numeric,8::numeric);
-exp2=pow(16::numeric,16::numeric);
-exp3=pow(16::numeric,24::numeric);
-res:=res1;
-res:=res+res2*exp1;
-res:=res+res3*exp2;
-res:=res+res4*exp3;
-return to_number(res);
-END;$BODY$
-  LANGUAGE 'plpgsql' IMMUTABLE STRICT;
-/-- END
-
-CREATE OR REPLACE FUNCTION hex_to_int(numeric) RETURNS numeric AS '
-DECLARE
-h alias for $1;
-exec varchar;
-curs refcursor;
-res int;
-BEGIN
-return h;
-END;'
-LANGUAGE 'plpgsql'
-IMMUTABLE
-STRICT;
-/-- END
-
-
 CREATE OR REPLACE FUNCTION add_months
 (
 date,
@@ -1051,23 +978,6 @@
   RIGHTARG = numeric)
 /-- END
 
--- Auxiliar function for compatibility between 8.2 and 8.3 Postgres version.
-CREATE OR REPLACE FUNCTION is_Trigger_Enabled(tg_name "text")
-  RETURNS boolean AS
-$BODY$ 
-DECLARE
-  v_isEnabled boolean := false;
-BEGIN
-  SELECT tgenabled INTO v_isEnabled FROM pg_trigger WHERE UPPER(tgname) = UPPER(tg_name);
-  RETURN v_isEnabled;
-EXCEPTION
-WHEN OTHERS THEN
-  SELECT (UPPER(tgenabled)<>'D') INTO v_isEnabled FROM pg_trigger WHERE tgname = tg_name;
-  RETURN v_isEnabled;
-END;   $BODY$
-  LANGUAGE 'plpgsql' STABLE;
-/-- END
-
 -- Creating auxiliar functions for view dropping
 CREATE or REPLACE function drop_view (view_name IN varchar) returns varchar as '
 DECLARE
--- a/src-db/src/com/openbravo/db/OpenbravoExcludeFilter.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-db/src/com/openbravo/db/OpenbravoExcludeFilter.java	Mon May 09 09:57:27 2016 +0200
@@ -35,13 +35,13 @@
     return new String[] { "EXIST_LANGUAGE", "INSERT_PG_LANGUAGE", "CREATE_LANGUAGE", "DATEFORMAT",
         "TO_NUMBER", "TO_DATE", "TO_TIMESTAMP", "TO_CHAR", "ROUND", "RPAD", "SUBSTR",
         "TO_INTERVAL", "ADD_MONTHS", "ADD_DAYS", "TYPE_OID", "SUBSTRACT_DAYS", "TRUNC", "INSTR",
-        "LAST_DAY", "IS_TRIGGER_ENABLED", "DROP_VIEW", "MONTHS_BETWEEN",
+        "LAST_DAY", "DROP_VIEW", "MONTHS_BETWEEN",
         "AD_SCRIPT_DISABLE_TRIGGERS", "AD_SCRIPT_DISABLE_CONSTRAINTS", "AD_SCRIPT_ENABLE_TRIGGERS",
         "AD_SCRIPT_ENABLE_CONSTRAINTS", "AD_SCRIPT_DROP_RECREATE_INDEXES",
         "AD_SCRIPT_DROP_RECREATE_INDEX", "AD_SCRIPT_EXECUTE", "DBA_GETATTNUMPOS",
         "DBA_GETSTANDARD_SEARCH_TEXT", "DUMP", "NEGATION", "EQUAL", "GREATEREQUAL", "LOWEREQUAL",
         "LOWEREQUALNUMERIC", "LOWEREQUALTIMESTAMP", "DBA_RECOMPILE", "DBA_AFTERIMPORT", "NOW",
-        "UPDATE_DATEFORMAT", "GET_UUID", "HEX_TO_INT", "UUID_GENERATE_V4", "AD_ORG_CHK_DOCUMENTS",
+        "UPDATE_DATEFORMAT", "GET_UUID", "UUID_GENERATE_V4", "AD_ORG_CHK_DOCUMENTS",
         "AD_ORG_CHK_DOC_PAYMENTS", "C_CREATE_TEMPORARY_TABLES", "AD_DB_MODIFIED", "AD_GET_DOC_LE_BU",
         "AD_GET_RDBMS", "AD_CREATE_AUDIT_TRIGGERS"};
   }
--- a/src-test/src/org/openbravo/test/accounting/PostDocumentTest.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-test/src/org/openbravo/test/accounting/PostDocumentTest.java	Mon May 09 09:57:27 2016 +0200
@@ -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) 2015 Openbravo SLU 
+ * All portions are Copyright (C) 2015-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -66,8 +66,6 @@
   private static final String ORGANIZATION_SPAIN_ID = "357947E87C284935AD1D783CF6F099A1";
   // Organization USA
   private static final String ORGANIZATION_USA_ID = "5EFF95EB540740A3B10510D9814EFAD5";
-  // Role QA Testing Admin
-  private final String ROLE_ID = "4028E6C72959682B01295A071429011E";
   // Table INVOICE
   private static final String TABLE_INVOICE = "318";
   // Table GL_JOURNAL
@@ -91,8 +89,6 @@
   private static final String GLJOURNAL_TEST7 = "F284DBAF46F244EB8CCA145A0CC47ACD";
   // G/L Journal Test with documentNo: 1003
   private static final String GLJOURNAL_TEST8 = "12857A9C03AD49D795F05A889CBEC0F2";
-  // G/L Journal Test with documentNo: 1004
-  private static final String GLJOURNAL_TEST9 = "8F27C4F6393A4457AA07E8D7754CEDF9";
   // ACCOUNTS USED FOR TEST RESULTS
   private static String TAX_RECEIVABLES = "FABD8D6CF3F04EE7A0389C2BAA1D620E";
   private static String SERVICE_COST = "F7B96292FB5842FBB51143BA659008B0";
@@ -109,8 +105,10 @@
   private static String PRETTY_CASH = "627A1291274F4BCF838588BB2F2102AD";
   private static String BANK_ACCOUNT = "58D66F384F7549D995523BF116F29BA0";
 
-  private String testNumber;
-  private String testDescription;
+  @SuppressWarnings("unused")
+  private String testNumber; // It is used to show the test number when the test is run.
+  @SuppressWarnings("unused")
+  private String testDescription; // It is used to show the test description when the test is run.
   private String keyId;
   private String tableId;
   private String orgId;
@@ -177,11 +175,6 @@
         { USA_DOLLAR_LEGDER, PRETTY_CASH, "03-06-2015", "100", "100.00", "0.00", "100.00", "0.00" },
         { MAIN_EURO_LEGDER, FONDO_SOCIAL, "03-06-2015", "100", "0.00", "100.00", "0.00", "200.00" },
         { MAIN_EURO_LEGDER, CAPITAL_SOCIAL, "03-06-2015", "100", "100.00", "0.00", "200.00", "0.00" } };
-    String[][] resultTest9 = {
-        { USA_DOLLAR_LEGDER, BANK_ACCOUNT, "03-06-2015", "100", "0.00", "100.00", "0.00", "100.00" },
-        { USA_DOLLAR_LEGDER, PRETTY_CASH, "03-06-2015", "100", "100.00", "0.00", "100.00", "0.00" },
-        { MAIN_EURO_LEGDER, FONDO_SOCIAL, "03-06-2015", "100", "0.00", "100.00", "0.00", "200.00" },
-        { MAIN_EURO_LEGDER, CAPITAL_SOCIAL, "03-06-2015", "100", "100.00", "0.00", "200.00", "0.00" } };
 
     return Arrays.asList(new Object[][] {
         { "1", "Sales invoice I/29", INVOICE_TEST1, TABLE_INVOICE, ORGANIZATION_SPAIN_ID,
--- a/src-test/src/org/openbravo/test/dal/IssuesTest.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-test/src/org/openbravo/test/dal/IssuesTest.java	Mon May 09 09:57:27 2016 +0200
@@ -709,9 +709,6 @@
     query.setString(0, "en_US");
     query.setString(1, "800025");
 
-    @SuppressWarnings("unchecked")
-    java.util.List<Object[]> l = query.list();
-
   }
 
   /**
--- a/src-test/src/org/openbravo/test/db/model/functions/Ad_isorgincludedTest.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-test/src/org/openbravo/test/db/model/functions/Ad_isorgincludedTest.java	Mon May 09 09:57:27 2016 +0200
@@ -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) 2015 Openbravo SLU
+ * All portions are Copyright (C) 2015-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -53,11 +53,6 @@
   private static final String ORG_A1 = "357947E87C284935AD1D783CF6F099A1";
 
   /**
-   * USA Organization
-   */
-  private static final String ORG_A2 = "5EFF95EB540740A3B10510D9814EFAD5";
-
-  /**
    * F&B International Group Client
    */
   private static final String CLIENT_B = "23C59575B9CF467C9620760EB255B389";
--- a/src-test/src/org/openbravo/test/security/AllowedOrganizationsTest.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-test/src/org/openbravo/test/security/AllowedOrganizationsTest.java	Mon May 09 09:57:27 2016 +0200
@@ -25,6 +25,7 @@
 
 import java.util.Set;
 
+import org.junit.Ignore;
 import org.junit.Test;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.dal.core.OBContext;
@@ -50,27 +51,24 @@
    * Tests valid organizations trees for different organizations.
    */
   @Test
+  @Ignore("Fix test with new org tree map")
   public void testOrganizationTree() {
     setTestAdminContext();
-    // FIXME: Fix test with new org tree map
 
-    // final OrganizationStructureProvider osp = new OrganizationStructureProvider();
-    // osp.setClientId(TEST_CLIENT_ID);
-    //
-    // checkResult("1000001", osp, new String[] { "1000001" });
-    // checkResult("1000002", osp, new String[] { "1000003", "1000004", "1000000", "0", "1000002"
-    // });
-    // checkResult("1000003", osp, new String[] { "1000003", "1000000", "0", "1000002" });
-    // checkResult("1000004", osp, new String[] { "1000004", "1000000", "0", "1000002" });
-    // checkResult("1000005", osp, new String[] { "1000009", "1000006", "0", "1000000", "1000008",
-    // "1000005", "1000007" });
-    // checkResult("1000006", osp, new String[] { "1000009", "1000006", "0", "1000000", "1000008",
-    // "1000005" });
-    // checkResult("1000007", osp, new String[] { "1000000", "0", "1000005", "1000007" });
-    // checkResult("1000008", osp, new String[] { "1000000", "1000006", "0", "1000008", "1000005"
-    // });
-    // checkResult("1000009", osp, new String[] { "1000009", "1000006", "0", "1000000", "1000005"
-    // });
+    final OrganizationStructureProvider osp = new OrganizationStructureProvider();
+    osp.setClientId(TEST_CLIENT_ID);
+
+    checkResult("1000001", osp, new String[] { "1000001" });
+    checkResult("1000002", osp, new String[] { "1000003", "1000004", "1000000", "0", "1000002" });
+    checkResult("1000003", osp, new String[] { "1000003", "1000000", "0", "1000002" });
+    checkResult("1000004", osp, new String[] { "1000004", "1000000", "0", "1000002" });
+    checkResult("1000005", osp, new String[] { "1000009", "1000006", "0", "1000000", "1000008",
+        "1000005", "1000007" });
+    checkResult("1000006", osp, new String[] { "1000009", "1000006", "0", "1000000", "1000008",
+        "1000005" });
+    checkResult("1000007", osp, new String[] { "1000000", "0", "1000005", "1000007" });
+    checkResult("1000008", osp, new String[] { "1000000", "1000006", "0", "1000008", "1000005" });
+    checkResult("1000009", osp, new String[] { "1000009", "1000006", "0", "1000000", "1000005" });
   }
 
   private void checkResult(String id, OrganizationStructureProvider osp, String[] values) {
--- a/src-test/src/org/openbravo/test/services/ServicesTest.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-test/src/org/openbravo/test/services/ServicesTest.java	Mon May 09 09:57:27 2016 +0200
@@ -92,10 +92,7 @@
       PARAMS);
 
   /** this field will take the values defined by parameterValuesRule field. */
-  private @ParameterCdiTest
-  ServiceTestData parameter;
-
-  private static int counterTest = 0;
+  private @ParameterCdiTest ServiceTestData parameter;
 
   /**
    * Verifies price computation for services. Add a relation line, update it and delete it. Review
@@ -191,7 +188,6 @@
           .getOrderlineServiceRelationCOrderlineRelatedIDList().size()),
           closeTo(BigDecimal.ZERO, BigDecimal.ZERO));
 
-      counterTest++;
     } catch (Exception e) {
       log.error("Error when executing: " + parameter.getTestDescription(), e);
       assertFalse(true);
--- a/src-test/src/org/openbravo/test/services/ServicesTest2.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-test/src/org/openbravo/test/services/ServicesTest2.java	Mon May 09 09:57:27 2016 +0200
@@ -85,10 +85,7 @@
       PARAMS);
 
   /** this field will take the values defined by parameterValuesRule field. */
-  private @ParameterCdiTest
-  ServiceTestData parameter;
-
-  private static int counterTest = 0;
+  private @ParameterCdiTest ServiceTestData parameter;
 
   /**
    * Tests cases to check modifications on quantities of a sales order lines with related service
@@ -164,7 +161,6 @@
         }
       }
 
-      counterTest++;
     } catch (Exception e) {
       log.error("Error when executing: " + parameter.getTestDescription(), e);
       assertFalse(true);
--- a/src-test/src/org/openbravo/test/services/ServicesTest3.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-test/src/org/openbravo/test/services/ServicesTest3.java	Mon May 09 09:57:27 2016 +0200
@@ -90,10 +90,7 @@
       PARAMS);
 
   /** this field will take the values defined by parameterValuesRule field. */
-  private @ParameterCdiTest
-  ServiceTestData parameter;
-
-  private static int counterTest = 0;
+  private @ParameterCdiTest ServiceTestData parameter;
 
   /**
    * Tests cases to check ServicePriceUtils.getServiceAmount method. All possible errors are
@@ -160,7 +157,6 @@
       }
 
       assertTrue("Not properly handled error obtained", error);
-      counterTest++;
     } catch (Exception e) {
       log.error("Error when executing: " + parameter.getTestDescription(), e);
       assertFalse(true);
--- a/src-test/src/org/openbravo/test/xml/ClientExportImportTest.java	Fri May 06 10:09:56 2016 +0200
+++ b/src-test/src/org/openbravo/test/xml/ClientExportImportTest.java	Mon May 09 09:57:27 2016 +0200
@@ -108,6 +108,7 @@
    * 
    * Also tests mantis 9000: https://issues.openbravo.com/view.php?id=9000
    */
+  @SuppressWarnings("deprecation")
   @Ignore("This test has been temporarily disabled until the following issue related to the export client functionality is fixed: https://issues.openbravo.com/view.php?id=14848")
   @Test
   public void testExportImportClient1000000() {
@@ -115,12 +116,11 @@
     // This test has been temporarily disabled until the following issue related to the export
     // client functionality is fixed:
     // https://issues.openbravo.com/view.php?id=14848
-
-    // final String newClientId = exportImport(TEST_CLIENT_ID);
-    // testMantis8509(newClientId);
-    // testAccountingFactMantis9000(newClientId);
-    // testTreeNodesMantis9000(newClientId);
-    // SystemService.getInstance().removeAllClientData(newClientId);
+    final String newClientId = exportImport(TEST_CLIENT_ID);
+    testMantis8509(newClientId);
+    testAccountingFactMantis9000(newClientId);
+    testTreeNodesMantis9000(newClientId);
+    SystemService.getInstance().removeAllClientData(newClientId);
   }
 
   private void testTreeNodesMantis9000(String newClientID) {
--- a/src-wad/src/org/openbravo/wad/Tabs_data.xsql	Fri May 06 10:09:56 2016 +0200
+++ b/src-wad/src/org/openbravo/wad/Tabs_data.xsql	Mon May 09 09:57:27 2016 +0200
@@ -12,7 +12,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-2015 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -295,7 +295,7 @@
         WHERE AD_TABLE.ad_table_id = AD_COLUMN.ad_table_id 
         AND iskey='Y' 
         AND AD_TABLE.ad_table_id = a2.ad_table_id) AS KEY, '' AS href, '' AS Td_Height, 
-        COALESCE(a1.ad_tab_id,'-1') AS Parent_Key, a2.isInfoTab, a2.isTranslationTab, AD_ShortName(a2.Name) as NameTab, 
+        COALESCE(a1.ad_tab_id,'-1') AS Parent_Key, a2.isInfoTab, a2.isTranslationTab, 
         a2.EDITREFERENCE, a2.AD_MODULE_ID as tabmodule
         FROM AD_TAB a1, AD_TAB a2
         WHERE a1.ad_tab_id = ?
--- a/src/org/openbravo/base/model/ModelProvider.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/base/model/ModelProvider.java	Mon May 09 09:57:27 2016 +0200
@@ -89,7 +89,6 @@
   private List<Module> modules;
   private Session initsession;
 
-  private static final String DATASOURCEBASEDTABLE = "Datasource";
   private static final String TABLEBASEDTABLE = "Table";
 
   /**
--- a/src/org/openbravo/base/secureApp/OrgTreeNode.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/base/secureApp/OrgTreeNode.java	Mon May 09 09:57:27 2016 +0200
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2008-2010 Openbravo S.L.U.
+ * Copyright (C) 2008-2016 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -30,7 +30,6 @@
   private String value;
   private String isReady;
   private OrganizationType orgType;
-  private String serializedOrgTypeId;
 
   /**
    * Creates a node from data related to it
@@ -65,7 +64,6 @@
   // only be deserialized if they are connected to the db because some
   // of the references maybe a cglib proxy
   private void writeObject(ObjectOutputStream out) throws IOException {
-    serializedOrgTypeId = orgType.getId();
     orgType = null;
     out.defaultWriteObject();
   }
--- a/src/org/openbravo/base/secureApp/VariablesSecureApp.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/base/secureApp/VariablesSecureApp.java	Mon May 09 09:57:27 2016 +0200
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2012 Openbravo S.L.U.
+ * Copyright (C) 2001-2016 Openbravo S.L.U.
  * Licensed under the Apache Software License version 2.0
  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to  in writing,  software  distributed
@@ -22,6 +22,7 @@
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.scheduling.OBScheduler;
+import org.quartz.SchedulerException;
 
 /**
  * This class is used to provide the coder with friendly methods to retrieve certain environment,
@@ -41,7 +42,6 @@
   private String warehouse;
   private String command;
   private String userClient;
-  private String userOrganization;
   private String dbSessionID;
   private String javaDateFormat;
   private String javaDataTimeFormat;
@@ -70,7 +70,6 @@
     this.client = strClient;
     this.organization = strOrganization;
     this.userClient = "";
-    this.userOrganization = "";
     this.warehouse = "";
     this.dbSessionID = "";
     this.command = "DEFAULT";
@@ -129,7 +128,6 @@
     this.client = strClient;
     this.organization = strOrganization;
     this.userClient = "";
-    this.userOrganization = "";
     this.warehouse = "";
     this.dbSessionID = "";
     this.command = "DEFAULT";
@@ -175,7 +173,6 @@
     this.client = getSessionValue("#AD_Client_ID");
     this.organization = getSessionValue("#AD_Org_ID");
     this.userClient = getSessionValue("#User_Client");
-    this.userOrganization = getSessionValue("#User_Org");
     this.warehouse = getSessionValue("#M_Warehouse_ID");
     this.dbSessionID = getSessionValue("#AD_Session_ID");
     this.command = getStringParameter("Command", "DEFAULT");
@@ -221,6 +218,7 @@
    * corresponds to the theme's folder name in the web/skins. Default theme's value is 'Default'.
    * 
    * @return String with the unique name of the theme.
+   * @throws SchedulerException
    */
   public String getTheme() {
     if (!theme.equals("")) {
@@ -248,12 +246,14 @@
             OBContext.restorePreviousMode();
           }
         }
+      } catch (SchedulerException e) {
+        log4j.error("Error while checking if the scheduler is started.", e);
       } finally {
         if (strTheme.isEmpty()) {
           strTheme = "ltr/org.openbravo.userinterface.skin.250to300Comp/250to300Comp";
         }
-        return strTheme;
       }
+      return strTheme;
     }
   }
 
--- a/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Mon May 09 09:57:27 2016 +0200
@@ -1628,21 +1628,6 @@
     return (BigDecimal) query.uniqueResult();
   }
 
-  private BigDecimal getQtyReserved(Reservation reservation, StorageDetail sd) {
-    final StringBuilder hqlString = new StringBuilder();
-    hqlString
-        .append("select coalesce(sum(rs.quantity - coalesce(rs.released,0)),0) from MaterialMgmtReservationStock rs ");
-    hqlString.append("join rs.reservation as r ");
-    hqlString.append(" where r.rESStatus not in ('CL', 'DR') ");
-    hqlString.append(" and rs.storageDetail = :storageDetail ");
-    hqlString.append(" and r <> :reservation ");
-    final Session session = OBDal.getInstance().getSession();
-    Query query = session.createQuery(hqlString.toString());
-    query.setParameter("storageDetail", sd);
-    query.setParameter("reservation", reservation);
-    return (BigDecimal) query.uniqueResult();
-  }
-
   private BigDecimal getQtyReserved(Reservation reservation, Product product,
       AttributeSetInstance attribute, Locator storageBin) {
     final StringBuilder hqlString = new StringBuilder();
--- a/src/org/openbravo/costing/CostingAlgorithm.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/costing/CostingAlgorithm.java	Mon May 09 09:57:27 2016 +0200
@@ -297,7 +297,6 @@
 
     if (ppDate.before(olDate) && stdCostDate.before(olDate)) {
       // purchase order
-      @SuppressWarnings("null")
       BigDecimal cost = transaction.getMovementQuantity().abs().multiply(orderLine.getUnitPrice());
       if (costCurrency.getId().equals(orderLine.getCurrency().getId())) {
         return cost;
--- a/src/org/openbravo/dal/xml/EntityResolver.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/dal/xml/EntityResolver.java	Mon May 09 09:57:27 2016 +0200
@@ -94,7 +94,6 @@
   private Organization organization;
   private String[] orgNaturalTree;
   private ResolvingMode resolvingMode = ResolvingMode.ALLOW_NOT_EXIST;
-  private boolean lookForTranslatedIDs;
 
   private OrganizationStructureProvider organizationStructureProvider;
 
@@ -442,7 +441,7 @@
       boolean filterByClient) {
     PreparedStatement ps = null;
     try {
-      String st = "Select specific_id, generic_id, ad_client_id, ad_org_id from ad_ref_data_loaded where ad_client_id in ('"
+      String st = "Select specific_id, ad_client_id, ad_org_id from ad_ref_data_loaded where ad_client_id in ('"
           + client.getId()
           + "', '0') and generic_id='"
           + id
@@ -455,11 +454,11 @@
       while (rs.next()) {
         RefDataLoaded rfl = new RefDataLoaded();
         rfl.setSpecificId(rs.getString(1));
-        rfl.setGenericId(rs.getString(2));
-        rfl.setClientId(rs.getString(3));
-        rfl.setOrgId(rs.getString(4));
+        rfl.setClientId(rs.getString(2));
+        rfl.setOrgId(rs.getString(3));
         refDataLoadeds.add(rfl);
       }
+
       return refDataLoadeds;
     } catch (Exception e) {
       throw new OBException("Error while accessing the ad_ref_data_loaded table", e);
@@ -474,18 +473,9 @@
 
   private class RefDataLoaded {
     private String specificId;
-    private String genericId;
     private String clientId;
     private String orgId;
 
-    public String getGenericId() {
-      return genericId;
-    }
-
-    public void setGenericId(String genericId) {
-      this.genericId = genericId;
-    }
-
     public String getSpecificId() {
       return specificId;
     }
@@ -746,9 +736,4 @@
     return entityName + id;
   }
 
-  @Deprecated
-  public void setLookForTranslatedIDs(boolean lookForTranslatedIDs) {
-    this.lookForTranslatedIDs = lookForTranslatedIDs;
-  }
-
 }
\ No newline at end of file
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java	Mon May 09 09:57:27 2016 +0200
@@ -310,8 +310,6 @@
     final String strAmountFrom = vars.getNumericParameter("inpamountFrom");
     final String strAmountTo = vars.getNumericParameter("inpamountTo");
     String strIsReceipt = vars.getStringParameter("inpisreceipt");
-    final String isSOTrx = Utility.getContext(this, vars, "isSOTrx", strWindowId);
-    final String strBankAccount = vars.getStringParameter("inpcBankaccountId");
     final String strOrg = vars.getStringParameter("inpadOrgId");
     final String strCharge = vars.getStringParameter("inpCharge");
     final String strPlannedDate = vars.getStringParameter("inpplanneddate", strStatementDate);
@@ -1528,9 +1526,7 @@
             else
               C_Tax_ID = CreateFromInvoiceData.getTax(this, data[i].cOrderlineId);
 
-            final int stdPrecision;
             final int curPrecision;
-            stdPrecision = Integer.valueOf(data[i].stdprecision).intValue();
             if (strType.equals("SHIPMENT")) {
               curPrecision = Integer.valueOf(dataAux[0].priceprecision).intValue();
             } else {
@@ -1602,7 +1598,6 @@
             BigDecimal taxAmt = ((lineNetAmt.multiply(taxRate)).divide(new BigDecimal("100"), 12,
                 BigDecimal.ROUND_HALF_EVEN)).setScale(curPrecision, BigDecimal.ROUND_HALF_UP);
             try {
-              final String strOrg2 = vars.getGlobalVariable("inpadOrgId", "CreateFrom|adOrgId", "");
               // Calculate Acc and Def Plan from Product
               String isDeferred = "N";
               HashMap<String, String> accDefPlanData = AccDefUtility
@@ -1610,7 +1605,6 @@
               String planType = accDefPlanData.get("planType");
               String periodNumber = accDefPlanData.get("periodNumber");
               String startingPeriodId = accDefPlanData.get("startingPeriodId");
-              boolean isSOTRX = "Y".equals(isSOTrx);
               if (!"".equals(planType) && !"".equals(periodNumber) && !"".equals(startingPeriodId)) {
                 isDeferred = "Y";
               } else {
--- a/src/org/openbravo/erpCommon/ad_callouts/CalloutHelper.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/CalloutHelper.java	Mon May 09 09:57:27 2016 +0200
@@ -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-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -30,6 +30,7 @@
 import org.openbravo.data.FieldProvider;
 import org.openbravo.utils.FormatUtilities;
 
+@SuppressWarnings("serial")
 public abstract class CalloutHelper extends HttpSecureAppServlet {
 
   public void init(ServletConfig config) {
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Payment_MultiCurrency.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Payment_MultiCurrency.java	Mon May 09 09:57:27 2016 +0200
@@ -41,7 +41,8 @@
 public class SE_Payment_MultiCurrency extends SimpleCallout {
 
   private static final long serialVersionUID = 1L;
-  static Logger log4j = Logger.getLogger(SE_Payment_MultiCurrency.class);
+  private static final Logger sePaymentMultiCurrencyLog4j = Logger
+      .getLogger(SE_Payment_MultiCurrency.class);
 
   @Override
   protected void execute(CalloutInfo info) throws ServletException {
@@ -110,8 +111,9 @@
         }
       }
     } else {
-      log4j.error("SE_Payment_MultiCurrency. The following field executed the callout"
-          + lastFieldChanged);
+      sePaymentMultiCurrencyLog4j
+          .error("SE_Payment_MultiCurrency. The following field executed the callout"
+              + lastFieldChanged);
     }
 
   }
@@ -160,7 +162,7 @@
         }
       }
     } catch (Exception e) {
-      log4j.error(e);
+      sePaymentMultiCurrencyLog4j.error(e);
       return null;
     } finally {
       OBContext.restorePreviousMode();
@@ -184,7 +186,7 @@
       SimpleDateFormat outputFormat = new SimpleDateFormat(dateFormat);
       return (outputFormat.parse(strDate));
     } catch (ParseException e) {
-      log4j.error(e.getMessage(), e);
+      sePaymentMultiCurrencyLog4j.error(e.getMessage(), e);
       return null;
     }
   }
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_Sales_Pricelist.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_Sales_Pricelist.java	Mon May 09 09:57:27 2016 +0200
@@ -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) 2012 Openbravo SLU
+ * All portions are Copyright (C) 2012-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -20,6 +20,7 @@
 
 import javax.servlet.ServletException;
 
+@SuppressWarnings("serial")
 public class SE_Sales_Pricelist extends SimpleCallout {
 
   @Override
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_JournalLineAmt.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_JournalLineAmt.java	Mon May 09 09:57:27 2016 +0200
@@ -86,10 +86,9 @@
         "org/openbravo/erpCommon/ad_callouts/CallOut").createXmlDocument();
     String strAcctSchema = SLJournalLineAmtData.selectGeneralLedger(this, strGLJournal);
     SLJournalLineAmtData[] data = SLJournalLineAmtData.select(this, strAcctSchema);
-    String strPrecision = "2", strTargetCurrencyId = "";
+    String strPrecision = "2";
     if (data != null && data.length > 0) {
       strPrecision = data[0].stdprecision.equals("") ? "2" : data[0].stdprecision;
-      strTargetCurrencyId = data[0].cCurrencyId.equals("") ? "0" : data[0].cCurrencyId;
     }
     GLJournal gLJournal = OBDal.getInstance().get(GLJournal.class, strGLJournal);
     BigDecimal CurrencyRateValue = gLJournal.getRate();
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Order_UpdateLinesDate.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Order_UpdateLinesDate.java	Mon May 09 09:57:27 2016 +0200
@@ -18,13 +18,9 @@
  */
 package org.openbravo.erpCommon.ad_callouts;
 
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
 import javax.servlet.ServletException;
 
 import org.hibernate.criterion.Restrictions;
-import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -44,11 +40,6 @@
     try {
       OBContext.setAdminMode();
       String lastChanged = info.getStringParameter("inpLastFieldChanged", null);
-      String lastChangedValue = info.getStringParameter(lastChanged, null);
-      String format = OBPropertiesProvider.getInstance().getOpenbravoProperties()
-          .getProperty("dateFormat.java");
-      SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
-      Date d = simpleDateFormat.parse(lastChangedValue);
       String id = info.getStringParameter("C_Order_ID", null);
 
       /*
--- a/src/org/openbravo/erpCommon/ad_callouts/SL_Payment_Amounts.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SL_Payment_Amounts.java	Mon May 09 09:57:27 2016 +0200
@@ -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-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -39,8 +39,6 @@
 public class SL_Payment_Amounts extends HttpSecureAppServlet {
   private static final long serialVersionUID = 1L;
 
-  private static final BigDecimal ZERO = new BigDecimal(0.0);
-
   public void init(ServletConfig config) {
     super.init(config);
     boolHist = false;
@@ -85,25 +83,15 @@
     BigDecimal payamt, discountamt, writeoffamt, overunderamt, convert, invtotamt;
 
     payamt = new BigDecimal(strPayamt);
-    if (payamt == null)
-      payamt = ZERO;
     discountamt = new BigDecimal(strDiscountamt);
-    if (discountamt == null)
-      discountamt = ZERO;
     writeoffamt = new BigDecimal(strWriteoffamt);
-    if (writeoffamt == null)
-      writeoffamt = ZERO;
     overunderamt = new BigDecimal(strOverunderamt);
-    if (overunderamt == null)
-      overunderamt = ZERO;
 
     StringBuffer resultado = new StringBuffer();
     resultado.append("var calloutName='SL_Payment_Amounts';\n\n");
     resultado.append("var respuesta = new Array(");
     if (strChanged.equals("inpisoverunderpayment")) {
       overunderamt = new BigDecimal(strOverunderamt);
-      if (overunderamt == null)
-        overunderamt = ZERO;
       resultado.append("new Array(\"inpoverunderamt\", " + overunderamt.toString() + ")");
     }
 
@@ -174,8 +162,6 @@
       if (log4j.isDebugEnabled())
         log4j.debug("PAYMENT: " + data[0].grand + "CURRENCYID: " + data[0].currencyid);
       invtotamt = new BigDecimal(data[0].grand);
-      if (invtotamt == null)
-        invtotamt = ZERO;
       if (strcCurrencyId.equals(data[0].currencyid)) {
       } else {
         String strconvert = SLPaymentAmountsData.selectConversion(this, data[0].currencyid,
@@ -188,8 +174,6 @@
     } else if (strChanged.equals("inpdiscountamt")) {
       SLPaymentAmountsData[] data = SLPaymentAmountsData.select(this, strcInvoiceId);
       invtotamt = new BigDecimal(data[0].grand);
-      if (invtotamt == null)
-        invtotamt = ZERO;
       if (strcCurrencyId.equals(data[0].currencyid)) {
       } else {
         String strconvert = SLPaymentAmountsData.selectConversion(this, data[0].currencyid,
@@ -202,8 +186,6 @@
     } else if (strChanged.equals("inpwriteoffamt")) {
       SLPaymentAmountsData[] data = SLPaymentAmountsData.select(this, strcInvoiceId);
       invtotamt = new BigDecimal(data[0].grand);
-      if (invtotamt == null)
-        invtotamt = ZERO;
       if (strcCurrencyId.equals(data[0].currencyid)) {
       } else {
         String strconvert = SLPaymentAmountsData.selectConversion(this, data[0].currencyid,
@@ -216,8 +198,6 @@
     } else if (strChanged.equals("inpoverunderamt")) {
       SLPaymentAmountsData[] data = SLPaymentAmountsData.select(this, strcInvoiceId);
       invtotamt = new BigDecimal(data[0].grand);
-      if (invtotamt == null)
-        invtotamt = ZERO;
       invtotamt = invtotamt.subtract(overunderamt).subtract(writeoffamt).subtract(discountamt);
       resultado.append("new Array(\"inppayamt\", " + invtotamt.toString() + ")");
     }
--- a/src/org/openbravo/erpCommon/ad_forms/Account.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/Account.java	Mon May 09 09:57:27 2016 +0200
@@ -203,7 +203,7 @@
   public boolean save(Connection conn1, ConnectionProvider conn) throws ServletException {
     log4jAccount.debug("Account.save - Client_ID=" + AD_Client_ID + ", Org_ID=" + AD_Org_ID
         + "AcctSchema_ID=" + C_AcctSchema_ID + ", Account_ID=" + Account_ID);
-    String C_ValidCombination_ID = "";
+    String cValidCombinationId = "";
     boolean saved = false;
     RespuestaCS respuestaCS;
     try {
@@ -219,14 +219,14 @@
           C_AcctSchema_ID, Account_ID, "", "Y", alias, updatedBy, M_Product_ID, C_BPartner_ID,
           AD_OrgTrx_ID, C_LocFrom_ID, C_LocTo_ID, C_SalesRegion_ID, C_Project_ID, C_Campaign_ID,
           C_Activity_ID, User1_ID, User2_ID);
-      C_ValidCombination_ID = respuestaCS.CValidCombinationId;
+      cValidCombinationId = respuestaCS.CValidCombinationId;
       m_changed = "Y";
       saved = true;
     } catch (ServletException e) {
       log4jAccount.warn("Account.save: " + e);
       m_changed = "N";
     }
-    load(conn1, conn, C_ValidCombination_ID);
+    load(conn1, conn, cValidCombinationId);
     return saved;
   }
 
--- a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java	Mon May 09 09:57:27 2016 +0200
@@ -1513,13 +1513,13 @@
         //
         String strQty = Qty.toString();
         String strDateTrx = DateTrx;
-        String AD_Client_ID = data[i].adClientId;
-        String AD_Org_ID = data[i].adOrgId;
+        String adClientId = data[i].adClientId;
+        String adOrgId = data[i].adOrgId;
         String C_InvoiceLine_ID = data[i].cInvoicelineId;
         String M_InOutLine_ID = data[i].mInoutlineId;
-        String M_Product_ID = data[i].mProductId;
+        String mProductId = data[i].mProductId;
         //
-        if (createMatchInv(AD_Client_ID, AD_Org_ID, M_InOutLine_ID, C_InvoiceLine_ID, M_Product_ID,
+        if (createMatchInv(adClientId, adOrgId, M_InOutLine_ID, C_InvoiceLine_ID, mProductId,
             strDateTrx, strQty, vars, conn, con) == 1)
           counter++;
       }
@@ -2615,10 +2615,6 @@
         APRM_FinaccTransactionV a = OBDal.getInstance()
             .get(APRM_FinaccTransactionV.class, recordId);
         if (a.getForeignCurrency() != null) { // && !a.getForeignCurrency().getId().equals(CurTo_ID)
-          String strDateFormat;
-          strDateFormat = OBPropertiesProvider.getInstance().getOpenbravoProperties()
-              .getProperty("dateFormat.java");
-          final SimpleDateFormat dateFormat = new SimpleDateFormat(strDateFormat);
           Amt = a.getForeignAmount().toString();
           data = AcctServerData.currencyConvert(conn, Amt, a.getForeignCurrency().getId(),
               CurTo_ID, ConvDate, RateType, client, org);
--- a/src/org/openbravo/erpCommon/ad_forms/DocBank.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocBank.java	Mon May 09 09:57:27 2016 +0200
@@ -233,7 +233,7 @@
     log4jDocBank.debug("createFact - object created");
     // Header -- there may be different currency amounts
     BigDecimal TrxAmt = null;
-    BigDecimal ChargeAmt = null;
+    BigDecimal docBankChargeAmt = null;
     BigDecimal ConvertChargeAmt = null;
     String strDateAcct = "FirstIteration";
     // BigDecimal InterestAmt = null;
@@ -251,7 +251,7 @@
       // setC_Period_ID(line.m_DateAcct);
       // BankAsset DR CR (Statement)
       TrxAmt = new BigDecimal(line.m_TrxAmt);
-      ChargeAmt = new BigDecimal(line.chargeAmt);
+      docBankChargeAmt = new BigDecimal(line.chargeAmt);
       ConvertChargeAmt = new BigDecimal(line.convertChargeAmt);
       log4jDocBank.debug("createFact - p_lines.length = " + p_lines.length + " - i=" + i);
       log4jDocBank.debug("createFact - Record_ID = " + Record_ID);
@@ -289,7 +289,7 @@
       fact.createLine(
           lineAux,
           new Account(conn, DocLineBankData.selectChargeAccount(conn, C_BankAccount_ID,
-              as.m_C_AcctSchema_ID)), line.m_C_Currency_ID, ChargeAmt.toString(), "",
+              as.m_C_AcctSchema_ID)), line.m_C_Currency_ID, docBankChargeAmt.toString(), "",
           Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
       // Interest DR CR (Interest)
       /*
--- a/src/org/openbravo/erpCommon/ad_forms/DocDPManagement.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocDPManagement.java	Mon May 09 09:57:27 2016 +0200
@@ -32,23 +32,23 @@
 
 public class DocDPManagement extends AcctServer {
   private static final long serialVersionUID = 1L;
-  static Logger log4j = Logger.getLogger(DocDPManagement.class);
+  private static Logger docDPManagementLog4j = Logger.getLogger(DocDPManagement.class);
 
   private String SeqNo = "0";
 
   /**
-   * @return the log4j
+   * @return the docDPManagementLog4j
    */
   public static Logger getLog4j() {
-    return log4j;
+    return docDPManagementLog4j;
   }
 
   /**
-   * @param log4j
-   *          the log4j to set
+   * @param docDPManagementLog4j
+   *          the docDPManagementLog4j to set
    */
-  public static void setLog4j(Logger log4j) {
-    DocDPManagement.log4j = log4j;
+  public static void setLog4j(Logger docDPManagementLog4j) {
+    DocDPManagement.docDPManagementLog4j = docDPManagementLog4j;
   }
 
   /**
@@ -100,7 +100,7 @@
     loadDocumentType(); // lines require doc type
     // Contained Objects
     p_lines = loadLines(conn);
-    log4j.debug("Record_ID = " + Record_ID + " - Lines=" + p_lines.length);
+    docDPManagementLog4j.debug("Record_ID = " + Record_ID + " - Lines=" + p_lines.length);
     return false;
   } // loadDocumentDetails
 
@@ -115,9 +115,10 @@
 
     try {
       data = DocLineDPManagementData.select(conn, Record_ID);
-      log4j.debug("LoadLines: data.length " + data.length + " record_ID " + Record_ID);
+      docDPManagementLog4j.debug("LoadLines: data.length " + data.length + " record_ID "
+          + Record_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      docDPManagementLog4j.warn(e);
     }
 
     //
@@ -173,14 +174,15 @@
             .newInstance();
         return newTemplate.createFact(this, as, conn, con, vars);
       } catch (Exception e) {
-        log4j.error("Error while creating new instance for DocDPManagementTemplate - " + e);
+        docDPManagementLog4j
+            .error("Error while creating new instance for DocDPManagementTemplate - " + e);
       }
     }
-    log4j.debug("createFact - Inicio");
+    docDPManagementLog4j.debug("createFact - Inicio");
     // create Fact Header
     Fact fact = null;
     String Fact_Acct_Group_ID = SequenceIdData.getUUID();
-    log4j.debug("createFact - object created");
+    docDPManagementLog4j.debug("createFact - object created");
     // Lines
     fact = new Fact(this, as, Fact.POST_Actual);
     for (int i = 0; p_lines != null && i < p_lines.length; i++) {
@@ -218,10 +220,10 @@
    * @param oldSeqNo
    */
   public String nextSeqNo(String oldSeqNo) {
-    log4j.debug("DocDPManagement - oldSeqNo = " + oldSeqNo);
+    docDPManagementLog4j.debug("DocDPManagement - oldSeqNo = " + oldSeqNo);
     BigDecimal seqNo = new BigDecimal(oldSeqNo);
     SeqNo = (seqNo.add(new BigDecimal("10"))).toString();
-    log4j.debug("DocDPManagement - nextSeqNo = " + SeqNo);
+    docDPManagementLog4j.debug("DocDPManagement - nextSeqNo = " + SeqNo);
     return SeqNo;
   }
 
@@ -247,7 +249,7 @@
     try {
       data = DocDPManagementData.paymentInformation(conn, strRecordId);
     } catch (ServletException e) {
-      log4j.error(e.getMessage(), e);
+      docDPManagementLog4j.error(e.getMessage(), e);
       setStatus(STATUS_Error);
       return false;
     }
@@ -303,9 +305,9 @@
       if (validCombination_ID.equals(""))
         return null;
       acc = Account.getAccount(conn, validCombination_ID);
-      log4j.debug("DocDPManagement - getAccount - " + acc.Account_ID);
+      docDPManagementLog4j.debug("DocDPManagement - getAccount - " + acc.Account_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      docDPManagementLog4j.warn(e);
     }
     return acc;
   } // getAccount
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java	Mon May 09 09:57:27 2016 +0200
@@ -72,7 +72,8 @@
   BigDecimal generatedCredit = ZERO;
   boolean exceptionPosting = false;
 
-  private static final Logger log4j = Logger.getLogger(DocFINFinAccTransaction.class);
+  private static final Logger docFINFinAccTransactionLog4j = Logger
+      .getLogger(DocFINFinAccTransaction.class);
 
   String SeqNo = "0";
 
@@ -348,7 +349,7 @@
         }
 
       } catch (Exception e) {
-        log4j.error("Error while retreiving user1 and user2 - ", e);
+        docFINFinAccTransactionLog4j.error("Error while retreiving user1 and user2 - ", e);
       }
 
     } finally {
@@ -447,8 +448,8 @@
               .forName(strClassname).newInstance();
           return newTemplate.createFact(this, as, conn, con, vars);
         } catch (Exception e) {
-          log4j.error("Error while creating new instance for DocFINFinAccTransactionTemplate - "
-              + e);
+          docFINFinAccTransactionLog4j
+              .error("Error while creating new instance for DocFINFinAccTransactionTemplate - " + e);
         }
       }
       FIN_FinaccTransaction transaction = OBDal.getInstance().get(FIN_FinaccTransaction.class,
@@ -828,7 +829,7 @@
     }
     sb.append("]");
     //
-    log4j.debug(" Balance=" + retValue + sb.toString());
+    docFINFinAccTransactionLog4j.debug(" Balance=" + retValue + sb.toString());
     return retValue;
   } // getBalance
 
@@ -1296,7 +1297,7 @@
             as.getC_AcctSchema_ID());
       }
     } catch (ServletException e) {
-      log4j.warn(e);
+      docFINFinAccTransactionLog4j.warn(e);
       e.printStackTrace();
     }
     // Get Acct
@@ -1307,14 +1308,15 @@
       return null;
     // No account
     if (Account_ID.equals("")) {
-      log4j.warn("AcctServer - getAccount - NO account Type=" + AcctType + ", Record=" + Record_ID);
+      docFINFinAccTransactionLog4j.warn("AcctServer - getAccount - NO account Type=" + AcctType
+          + ", Record=" + Record_ID);
       return null;
     }
     Account acct = null;
     try {
       acct = Account.getAccount(conn, Account_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      docFINFinAccTransactionLog4j.warn(e);
       e.printStackTrace();
     }
     return acct;
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java	Mon May 09 09:57:27 2016 +0200
@@ -60,7 +60,7 @@
 import org.openbravo.model.financialmgmt.payment.FinAccPaymentMethod;
 
 public class DocFINPayment extends AcctServer {
-  static Logger log4j = Logger.getLogger(DocFINPayment.class);
+  private static final Logger docFINPaymentLog4j = Logger.getLogger(DocFINPayment.class);
 
   String SeqNo = "0";
   String generatedAmount = "";
@@ -355,7 +355,8 @@
               .newInstance();
           return newTemplate.createFact(this, as, conn, con, vars);
         } catch (Exception e) {
-          log4j.error("Error while creating new instance for DocFINPaymentTemplate - ", e);
+          docFINPaymentLog4j.error(
+              "Error while creating new instance for DocFINPaymentTemplate - ", e);
         }
       }
 
@@ -573,7 +574,7 @@
     }
     sb.append("]");
     //
-    log4j.debug(" Balance=" + retValue + sb.toString());
+    docFINPaymentLog4j.debug(" Balance=" + retValue + sb.toString());
     return retValue;
   } // getBalance
 
@@ -744,22 +745,22 @@
       MultiCurrency = true;
     String Amt = getConvertedAmt(Amount, C_Currency_ID_From, C_Currency_ID_To, conversionDate, "",
         AD_Client_ID, AD_Org_ID, conn);
-    if (log4j.isDebugEnabled())
-      log4j.debug("Amt:" + Amt);
+    if (docFINPaymentLog4j.isDebugEnabled())
+      docFINPaymentLog4j.debug("Amt:" + Amt);
 
     String AmtTo = getConvertedAmt(Amount, C_Currency_ID_From, C_Currency_ID_To, mDateAcct, "",
         AD_Client_ID, AD_Org_ID, conn);
-    if (log4j.isDebugEnabled())
-      log4j.debug("AmtTo:" + AmtTo);
+    if (docFINPaymentLog4j.isDebugEnabled())
+      docFINPaymentLog4j.debug("AmtTo:" + AmtTo);
 
     BigDecimal AmtDiff = (new BigDecimal(AmtTo)).subtract(new BigDecimal(Amt));
-    if (log4j.isDebugEnabled())
-      log4j.debug("AmtDiff:" + AmtDiff);
+    if (docFINPaymentLog4j.isDebugEnabled())
+      docFINPaymentLog4j.debug("AmtDiff:" + AmtDiff);
 
-    if (log4j.isDebugEnabled()) {
-      log4j.debug("curr from:" + C_Currency_ID_From + " Curr to:" + C_Currency_ID_To + " convDate:"
-          + conversionDate + " DateAcct:" + mDateAcct);
-      log4j.debug("Amt:" + Amt + " AmtTo:" + AmtTo + " Diff:" + AmtDiff.toString());
+    if (docFINPaymentLog4j.isDebugEnabled()) {
+      docFINPaymentLog4j.debug("curr from:" + C_Currency_ID_From + " Curr to:" + C_Currency_ID_To
+          + " convDate:" + conversionDate + " DateAcct:" + mDateAcct);
+      docFINPaymentLog4j.debug("Amt:" + Amt + " AmtTo:" + AmtTo + " Diff:" + AmtDiff.toString());
     }
 
     if ((isReceipt && AmtDiff.compareTo(new BigDecimal("0.00")) == 1)
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java	Mon May 09 09:57:27 2016 +0200
@@ -71,7 +71,8 @@
   public static final String TRXTYPE_BPWithdrawal = "BPW";
   public static final String TRXTYPE_BankFee = "BF";
 
-  private static final Logger log4j = Logger.getLogger(DocFINReconciliation.class);
+  private static final Logger docFINReconciliationLog4j = Logger
+      .getLogger(DocFINReconciliation.class);
 
   String SeqNo = "0";
 
@@ -390,7 +391,7 @@
             FieldProviderFactory.setField(data[i], "cCostcenterId", trxInfo[0].cCostcenterId);
           }
         } catch (Exception e) {
-          log4j.error("Error while retreiving user1 and user2 - ", e);
+          docFINReconciliationLog4j.error("Error while retreiving user1 and user2 - ", e);
         }
       }
     } finally {
@@ -446,7 +447,7 @@
           FieldProviderFactory.setField(data[0], "cCostcenterId", trxInfo[0].cCostcenterId);
         }
       } catch (Exception e) {
-        log4j.error("Error while retreiving user1 and user2 - ", e);
+        docFINReconciliationLog4j.error("Error while retreiving user1 and user2 - ", e);
       }
     } finally {
       OBContext.restorePreviousMode();
@@ -492,7 +493,7 @@
           FieldProviderFactory.setField(data[0], "user2Id", trxInfo[0].user2Id);
         }
       } catch (Exception e) {
-        log4j.error("Error while retreiving user1 and user2 - ", e);
+        docFINReconciliationLog4j.error("Error while retreiving user1 and user2 - ", e);
       }
     } finally {
       OBContext.restorePreviousMode();
@@ -578,7 +579,8 @@
               strClassname).newInstance();
           return newTemplate.createFact(this, as, conn, con, vars);
         } catch (Exception e) {
-          log4j.error("Error while creating new instance for DocFINReconciliationTemplate - " + e);
+          docFINReconciliationLog4j
+              .error("Error while creating new instance for DocFINReconciliationTemplate - " + e);
         }
       }
       String Fact_Acct_Group_ID = SequenceIdData.getUUID();
@@ -1041,7 +1043,7 @@
     }
     sb.append("]");
     //
-    log4j.debug(" Balance=" + retValue + sb.toString());
+    docFINReconciliationLog4j.debug(" Balance=" + retValue + sb.toString());
     return retValue;
   } // getBalance
 
@@ -1649,7 +1651,7 @@
       data = AcctServerData.periodOpen(connectionProvider, client, documentType, org, date);
       return data[0].period;
     } catch (ServletException e) {
-      log4j.warn(e);
+      docFINReconciliationLog4j.warn(e);
       e.printStackTrace();
     }
     return null;
@@ -1674,13 +1676,13 @@
         return acct;
       // No account
       if (Account_ID.equals("")) {
-        log4j.warn("AcctServer - getAccount - NO account Type=" + AcctType + ", Record="
-            + Record_ID);
+        docFINReconciliationLog4j.warn("AcctServer - getAccount - NO account Type=" + AcctType
+            + ", Record=" + Record_ID);
         return acct;
       }
       acct = Account.getAccount(conn, Account_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      docFINReconciliationLog4j.warn(e);
       e.printStackTrace();
     } finally {
       if (acct == null) {
--- a/src/org/openbravo/erpCommon/ad_forms/DocGLJournal.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocGLJournal.java	Mon May 09 09:57:27 2016 +0200
@@ -304,23 +304,6 @@
     return true;
   }
 
-  private String isperiodOpen(ConnectionProvider conn, String periodId) {
-    if ("".equals(periodId)) {
-      return "";
-    }
-    try {
-      DocGLJournalData[] data = DocGLJournalData.periodOpen(conn, periodId);
-      if (data != null && data.length > 0) {
-        return periodId;
-      } else {
-        return "";
-      }
-    } catch (ServletException e) {
-      e.printStackTrace();
-      return "";
-    }
-  }
-
   public String getServletInfo() {
     return "Servlet for the accounting";
   } // end of getServletInfo() method
--- a/src/org/openbravo/erpCommon/ad_forms/DocPayment.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocPayment.java	Mon May 09 09:57:27 2016 +0200
@@ -32,7 +32,7 @@
 
 public class DocPayment extends AcctServer {
   private static final long serialVersionUID = 1L;
-  static Logger log4j = Logger.getLogger(DocPayment.class);
+  private static Logger docPaymentLog4j = Logger.getLogger(DocPayment.class);
 
   private String SeqNo = "0";
   private String SettlementType = "";
@@ -64,8 +64,8 @@
     SettlementType = data[0].getField("settlementtype");
     // Contained Objects
     p_lines = loadLines(conn);
-    if (log4j.isDebugEnabled())
-      log4j.debug("DocPayment - loadDocumentDetails - Lines=" + p_lines.length);
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("DocPayment - loadDocumentDetails - Lines=" + p_lines.length);
     return false;
   } // loadDocumentDetails
 
@@ -105,16 +105,16 @@
           docLine.dpStatus = DocLinePaymentData.getDPStatus(connectionProvider, Record_ID,
               data[i].getField("cDebtPaymentId"));
         } catch (ServletException e) {
-          log4j.error(e);
+          docPaymentLog4j.error(e);
           docLine.dpStatus = "";
         }
-        if (log4j.isDebugEnabled())
-          log4j.debug("DocPayment - loadLines - docLine.IsDirectPosting - "
+        if (docPaymentLog4j.isDebugEnabled())
+          docPaymentLog4j.debug("DocPayment - loadLines - docLine.IsDirectPosting - "
               + docLine.IsDirectPosting);
         list.add(docLine);
       }
     } catch (ServletException e) {
-      log4j.warn(e);
+      docPaymentLog4j.warn(e);
     }
     // Return Array
     DocLine[] dl = new DocLine[list.size()];
@@ -167,11 +167,11 @@
             .newInstance();
         return newTemplate.createFact(this, as, conn, con, vars);
       } catch (Exception e) {
-        log4j.error("Error while creating new instance for DocPaymentTemplate - " + e);
+        docPaymentLog4j.error("Error while creating new instance for DocPaymentTemplate - " + e);
       }
     }
-    if (log4j.isDebugEnabled())
-      log4j.debug("DocPayment - createFact - p_lines.length - " + p_lines.length);
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("DocPayment - createFact - p_lines.length - " + p_lines.length);
     Fact fact = new Fact(this, as, Fact.POST_Actual);
     String Fact_Acct_Group_ID = SequenceIdData.getUUID();
 
@@ -180,8 +180,9 @@
     for (int i = 0; p_lines != null && i < p_lines.length; i++) {
       DocLine_Payment line = (DocLine_Payment) p_lines[i];
 
-      if (log4j.isDebugEnabled())
-        log4j.debug("DocPayment - createFact - line.conversionDate - " + line.conversionDate);
+      if (docPaymentLog4j.isDebugEnabled())
+        docPaymentLog4j.debug("DocPayment - createFact - line.conversionDate - "
+            + line.conversionDate);
       // For manual payment with direct posting = 'N' (no posting occurred at payment creation so no
       // conversion, for currency gain-loss, is needed)
       String convertedAmt = "";
@@ -222,12 +223,12 @@
                   : finalConvertedAmt), (line.isReceipt.equals("Y") ? finalConvertedAmt : ""),
               Fact_Acct_Group_ID, nextSeqNo(SeqNo), DocumentType, conn);
         } else { // 2.2* Generated DP
-          if (log4j.isDebugEnabled())
-            log4j.debug("Genenarted DP");
+          if (docPaymentLog4j.isDebugEnabled())
+            docPaymentLog4j.debug("Genenarted DP");
           if (!line.isPaid.equals("Y")
               || !(line.C_Settlement_Cancel_ID == null || line.C_Settlement_Cancel_ID.equals(""))) {
-            if (log4j.isDebugEnabled())
-              log4j.debug("Not paid");
+            if (docPaymentLog4j.isDebugEnabled())
+              docPaymentLog4j.debug("Not paid");
             fact.createLine(
                 line,
                 getAccountBPartner(line.m_C_BPartner_ID, as, line.isReceipt.equals("Y"),
@@ -238,19 +239,21 @@
           }
         }
 
-        if (log4j.isDebugEnabled())
-          log4j.debug("DocPayment - createFact - No manual  - isReceipt: " + line.isReceipt);
+        if (docPaymentLog4j.isDebugEnabled())
+          docPaymentLog4j.debug("DocPayment - createFact - No manual  - isReceipt: "
+              + line.isReceipt);
       } else {// 3* MANUAL debt-payments (generated in a Manual stt)
-        if (log4j.isDebugEnabled())
-          log4j.debug("Manual DP - DirectPosting: " + line.IsDirectPosting + " - SettType:"
-              + SettlementType);
+        if (docPaymentLog4j.isDebugEnabled())
+          docPaymentLog4j.debug("Manual DP - DirectPosting: " + line.IsDirectPosting
+              + " - SettType:" + SettlementType);
         if (line.IsDirectPosting.equals("Y")) { // Direct posting:
           // transitory Account
           BigDecimal amount = ZERO;
           DocPaymentData[] data = DocPaymentData.selectDirectManual(conn, as.m_C_AcctSchema_ID,
               line.Line_ID);
-          if (log4j.isDebugEnabled())
-            log4j.debug("data[0].amount:" + data[0].amount + " - convertedAmt:" + convertedAmt);
+          if (docPaymentLog4j.isDebugEnabled())
+            docPaymentLog4j.debug("data[0].amount:" + data[0].amount + " - convertedAmt:"
+                + convertedAmt);
 
           if (convertedAmt != null && !convertedAmt.equals(""))
             amount = new BigDecimal(convertedAmt);
@@ -258,9 +261,9 @@
           if (changeGenerate)
             amount = amount.negate();
           BigDecimal transitoryAmount = new BigDecimal(convertedAmt);
-          if (log4j.isDebugEnabled())
-            log4j.debug("Manual DP - amount:" + amount + " - transitoryAmount:" + transitoryAmount
-                + " - Receipt:" + line.isReceipt);
+          if (docPaymentLog4j.isDebugEnabled())
+            docPaymentLog4j.debug("Manual DP - amount:" + amount + " - transitoryAmount:"
+                + transitoryAmount + " - Receipt:" + line.isReceipt);
           // Line is cloned to add withholding and/or tax info
           DocLine_Payment lineAux = DocLine_Payment.clone(line);
           lineAux.setM_C_WithHolding_ID(data[0].cWithholdingId);
@@ -303,9 +306,9 @@
                 "", AD_Client_ID, AD_Org_ID, conn);
             amountcredit = getConvertedAmt(amountcredit, as.m_C_Currency_ID, C_Currency_ID,
                 DateAcct, "", AD_Client_ID, AD_Org_ID, conn);
-            if (log4j.isDebugEnabled())
-              log4j.debug("DocPayment - createFact - Conceptos - AmountDebit: " + amountdebit
-                  + " - AmountCredit: " + amountcredit);
+            if (docPaymentLog4j.isDebugEnabled())
+              docPaymentLog4j.debug("DocPayment - createFact - Conceptos - AmountDebit: "
+                  + amountdebit + " - AmountCredit: " + amountcredit);
             // Line is cloned to add withholding and/or tax info
             DocLine_Payment lineAux = DocLine_Payment.clone(line);
             lineAux.setM_C_WithHolding_ID(data[j].cWithholdingId);
@@ -353,12 +356,12 @@
             try {
               acct = Account.getAccount(conn, Account_ID);
             } catch (ServletException e) {
-              log4j.warn(e);
+              docPaymentLog4j.warn(e);
               e.printStackTrace();
             }
           } else {
-            log4j.warn("AcctServer - getAccount - NO account Type=" + AcctServer.ACCTTYPE_WriteOff
-                + ", Record=" + Record_ID);
+            docPaymentLog4j.warn("AcctServer - getAccount - NO account Type="
+                + AcctServer.ACCTTYPE_WriteOff + ", Record=" + Record_ID);
           }
           fact.createLine(line, acct, C_Currency_ID, (line.isReceipt.equals("Y") ? line.WriteOffAmt
               : ""), (line.isReceipt.equals("Y") ? "" : line.WriteOffAmt), Fact_Acct_Group_ID,
@@ -426,24 +429,24 @@
       }
     } // END of the C_Debt_Payment loop
     SeqNo = "0";
-    if (log4j.isDebugEnabled())
-      log4j.debug("DocPayment - createFact - finish");
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("DocPayment - createFact - finish");
     return fact;
   }
 
   /**
-   * @return the log4j
+   * @return the docPaymentLog4j
    */
   public static Logger getLog4j() {
-    return log4j;
+    return docPaymentLog4j;
   }
 
   /**
-   * @param log4j
-   *          the log4j to set
+   * @param docPaymentLog4j
+   *          the docPaymentLog4j to set
    */
-  public static void setLog4j(Logger log4j) {
-    DocPayment.log4j = log4j;
+  public static void setLog4j(Logger docPaymentLog4j) {
+    DocPayment.docPaymentLog4j = docPaymentLog4j;
   }
 
   /**
@@ -494,8 +497,8 @@
       String conversionDate, String C_Currency_ID_From, String C_Currency_ID, DocLine line,
       AcctSchema as, Fact fact, String Fact_Acct_Group_ID, ConnectionProvider conn)
       throws ServletException {
-    if (log4j.isDebugEnabled())
-      log4j.debug("Amount:" + Amount + " curr from:" + C_Currency_ID_From + " Curr to:"
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("Amount:" + Amount + " curr from:" + C_Currency_ID_From + " Curr to:"
           + C_Currency_ID + " convDate:" + conversionDate + " DateAcct:" + DateAcct);
     if (Amount == null || Amount.equals(""))
       Amount = "0";
@@ -505,22 +508,22 @@
       MultiCurrency = true;
     String Amt = getConvertedAmt(Amount, C_Currency_ID_From, C_Currency_ID, conversionDate, "",
         AD_Client_ID, AD_Org_ID, conn);
-    if (log4j.isDebugEnabled())
-      log4j.debug("Amt:" + Amt);
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("Amt:" + Amt);
 
     String AmtTo = getConvertedAmt(Amount, C_Currency_ID_From, C_Currency_ID, DateAcct, "",
         AD_Client_ID, AD_Org_ID, conn);
-    if (log4j.isDebugEnabled())
-      log4j.debug("AmtTo:" + AmtTo);
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("AmtTo:" + AmtTo);
 
     BigDecimal AmtDiff = (new BigDecimal(AmtTo)).subtract(new BigDecimal(Amt));
-    if (log4j.isDebugEnabled())
-      log4j.debug("AmtDiff:" + AmtDiff);
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("AmtDiff:" + AmtDiff);
 
-    if (log4j.isDebugEnabled()) {
-      log4j.debug("curr from:" + C_Currency_ID_From + " Curr to:" + C_Currency_ID + " convDate:"
-          + conversionDate + " DateAcct:" + DateAcct);
-      log4j.debug("Amt:" + Amt + " AmtTo:" + AmtTo + " Diff:" + AmtDiff.toString());
+    if (docPaymentLog4j.isDebugEnabled()) {
+      docPaymentLog4j.debug("curr from:" + C_Currency_ID_From + " Curr to:" + C_Currency_ID
+          + " convDate:" + conversionDate + " DateAcct:" + DateAcct);
+      docPaymentLog4j.debug("Amt:" + Amt + " AmtTo:" + AmtTo + " Diff:" + AmtDiff.toString());
     }
 
     if ((isReceipt && AmtDiff.compareTo(new BigDecimal("0.00")) == 1)
@@ -550,8 +553,8 @@
       String dpStatus, ConnectionProvider conn) {
     DocPaymentData[] data = null;
     try {
-      if (log4j.isDebugEnabled())
-        log4j.debug("DocPayment - getAccountBPartner - DocumentType = " + DocumentType);
+      if (docPaymentLog4j.isDebugEnabled())
+        docPaymentLog4j.debug("DocPayment - getAccountBPartner - DocumentType = " + DocumentType);
       if (isReceipt) {
         data = DocPaymentData.selectBPartnerCustomerAcct(conn, cBPartnerId,
             as.getC_AcctSchema_ID(), dpStatus);
@@ -560,7 +563,7 @@
             dpStatus);
       }
     } catch (ServletException e) {
-      log4j.warn(e);
+      docPaymentLog4j.warn(e);
     }
     // Get Acct
     String Account_ID = "";
@@ -570,7 +573,7 @@
       return null;
     // No account
     if (Account_ID.equals("")) {
-      log4j.warn("DocPayment - getAccountBPartner - NO account BPartner=" + cBPartnerId
+      docPaymentLog4j.warn("DocPayment - getAccountBPartner - NO account BPartner=" + cBPartnerId
           + ", Record=" + Record_ID + ", status " + dpStatus);
       return null;
     }
@@ -579,7 +582,7 @@
     try {
       acct = Account.getAccount(conn, Account_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      docPaymentLog4j.warn(e);
     }
     return acct;
   } // getAccount
@@ -600,7 +603,7 @@
       data = DocPaymentData.selectBankStatementLineAcct(conn, strcBankstatementlineId,
           as.getC_AcctSchema_ID());
     } catch (ServletException e) {
-      log4j.warn(e);
+      docPaymentLog4j.warn(e);
     }
     // Get Acct
     String Account_ID = "";
@@ -610,8 +613,9 @@
       return null;
     // No account
     if (Account_ID.equals("")) {
-      log4j.warn("DocPayment - getAccountBankStatementLine - NO account BankStatementLine="
-          + strcBankstatementlineId + ", Record=" + Record_ID);
+      docPaymentLog4j
+          .warn("DocPayment - getAccountBankStatementLine - NO account BankStatementLine="
+              + strcBankstatementlineId + ", Record=" + Record_ID);
       return null;
     }
     // Return Account
@@ -619,7 +623,7 @@
     try {
       acct = Account.getAccount(conn, Account_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      docPaymentLog4j.warn(e);
     }
     return acct;
   } // getAccount
@@ -639,7 +643,7 @@
     try {
       data = DocPaymentData.selectCashLineAcct(conn, strcCashlineId, as.getC_AcctSchema_ID());
     } catch (ServletException e) {
-      log4j.warn(e);
+      docPaymentLog4j.warn(e);
     }
     // Get Acct
     String Account_ID = "";
@@ -649,8 +653,8 @@
       return null;
     // No account
     if (Account_ID.equals("")) {
-      log4j.warn("DocPayment - getAccountCashLine - NO account CashLine=" + strcCashlineId
-          + ", Record=" + Record_ID);
+      docPaymentLog4j.warn("DocPayment - getAccountCashLine - NO account CashLine="
+          + strcCashlineId + ", Record=" + Record_ID);
       return null;
     }
     // Return Account
@@ -658,18 +662,18 @@
     try {
       acct = Account.getAccount(conn, Account_ID);
     } catch (ServletException e) {
-      log4j.warn(e);
+      docPaymentLog4j.warn(e);
     }
     return acct;
   } // getAccount
 
   public String nextSeqNo(String oldSeqNo) {
-    if (log4j.isDebugEnabled())
-      log4j.debug("DocPayment - oldSeqNo = " + oldSeqNo);
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("DocPayment - oldSeqNo = " + oldSeqNo);
     BigDecimal seqNo = new BigDecimal(oldSeqNo);
     SeqNo = (seqNo.add(new BigDecimal("10"))).toString();
-    if (log4j.isDebugEnabled())
-      log4j.debug("DocPayment - nextSeqNo = " + SeqNo);
+    if (docPaymentLog4j.isDebugEnabled())
+      docPaymentLog4j.debug("DocPayment - nextSeqNo = " + SeqNo);
     return SeqNo;
   }
 
@@ -683,7 +687,7 @@
     try {
       data = DocPaymentData.paymentsInformation(conn, strRecordId);
     } catch (ServletException e) {
-      log4j.error(e.getMessage(), e);
+      docPaymentLog4j.error(e.getMessage(), e);
       setStatus(STATUS_Error);
       return false;
     }
--- a/src/org/openbravo/erpCommon/ad_forms/Fact.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/Fact.java	Mon May 09 09:57:27 2016 +0200
@@ -696,7 +696,6 @@
     } else { // Adjust biggest (Balance Sheet) line amount
       BigDecimal BSamount = ZERO;
       FactLine BSline = null;
-      BigDecimal PLamount = ZERO;
       FactLine PLline = null;
       int signum = diff.signum();
       // Find line
@@ -710,7 +709,6 @@
           BSline = l;
         } else if (!l.isBalanceSheet() && ((amt.compareTo(BSamount) > 0 && signum != 1))
             || ((amt.compareTo(BSamount) < 0 && signum == 1))) {
-          PLamount = amt;
           PLline = l;
         }
       }
--- a/src/org/openbravo/erpCommon/ad_forms/FactLine.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/FactLine.java	Mon May 09 09:57:27 2016 +0200
@@ -1117,29 +1117,6 @@
     }
   }
 
-  /**
-   * Convert a BigDecimal to a BigDecimal with a specified number of decimal places
-   * 
-   * @param in
-   *          BigDecimal to set the precision
-   * @param precision
-   *          (Max) Number of decimal places to output Note: precision generally refers to the total
-   *          number of digits in a number, but within Openbravo it refers to the number of
-   *          significant digits after the decimal point.
-   * @return BigDecimal with specified number of significant decimal places
-   */
-  private BigDecimal toNumberWithPrecision(BigDecimal in, long precision) {
-    if (in == null) {
-      return null;
-    }
-    try {
-      return in.setScale((int) precision, RoundingMode.HALF_UP);
-    } catch (ArithmeticException e) {
-      log4jFactLine.error(e.getMessage(), e);
-      return null;
-    }
-  }
-
   public String getCurrency() {
     return m_C_Currency_ID;
   }
--- a/src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java	Mon May 09 09:57:27 2016 +0200
@@ -38,7 +38,7 @@
 
 public class InitialClientSetup extends HttpSecureAppServlet {
 
-  private static final Logger log4j = Logger.getLogger(InitialClientSetup.class);
+  private static final Logger initialClientSetupLog4j = Logger.getLogger(InitialClientSetup.class);
   private static final long serialVersionUID = 1L;
 
   public void doPost(HttpServletRequest request, HttpServletResponse response)
@@ -51,7 +51,7 @@
       String strModules = vars.getInStringParameter("inpNodes", IsIDFilter.instance);
       StringBuffer strLog = new StringBuffer();
       OBError obeResultado = process(request, response, vars, strModules, strLog);
-      log4j.debug("InitialClientSetup - after processFile");
+      initialClientSetupLog4j.debug("InitialClientSetup - after processFile");
       printPageResult(response, vars, obeResultado, strLog);
     } else
       pageError(response);
@@ -165,7 +165,7 @@
   private OBError process(HttpServletRequest request, HttpServletResponse response,
       VariablesSecureApp vars, String strModules, StringBuffer strLog) throws IOException {
 
-    log4j.debug("process() - Initial Client Setup Process Start - strModules - " + strModules);
+    initialClientSetupLog4j.debug("process() - Initial Client Setup Process Start - strModules - " + strModules);
 
     String strClientName = vars.getStringParameter("inpClient");
     String strClientUser = vars.getStringParameter("inpClientUser");
@@ -173,7 +173,7 @@
     String strCurrency = vars.getStringParameter("inpCurrency");
     org.apache.commons.fileupload.FileItem fileCoAFilePath = vars.getMultiFile("inpFile");
     boolean bCreateAccounting = isTrue(vars.getStringParameter("inpCreateAccounting"));
-    log4j.debug("process() - Client name: " + strClientName + ". Client user name: "
+    initialClientSetupLog4j.debug("process() - Client name: " + strClientName + ". Client user name: "
         + strClientUser);
     org.openbravo.erpCommon.businessUtility.InitialClientSetup ics = new org.openbravo.erpCommon.businessUtility.InitialClientSetup();
     OBError obeResult = ics.createClient(vars, strCurrency, strClientName, strClientUser,
--- a/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/ModuleManagement.java	Mon May 09 09:57:27 2016 +0200
@@ -2026,13 +2026,15 @@
     boolean found = false;
     String agreement = "";
     while (!found && inst != null && i < inst.length) {
-      if (found = inst[i].getModuleID().equals(record))
+      found = inst[i].getModuleID().equals(record);
+      if (found)
         agreement = inst[i].getLicenseAgreement();
       i++;
     }
     i = 0;
     while (!found && upd != null && i < upd.length) {
-      if (found = upd[i].getModuleID().equals(record))
+      found = upd[i].getModuleID().equals(record);
+      if (found)
         agreement = upd[i].getLicenseAgreement();
       i++;
     }
--- a/src/org/openbravo/erpCommon/ad_forms/ProductInfo.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/ProductInfo.java	Mon May 09 09:57:27 2016 +0200
@@ -11,7 +11,7 @@
  * Portions created by Jorg Janke are Copyright (C) 1999-2001 Jorg Janke, parts
  * created by ComPiere are Copyright (C) ComPiere, Inc.;   All Rights Reserved.
  * Contributor(s): Openbravo SLU
- * Contributions are Copyright (C) 2001-2012 Openbravo S.L.U.
+ * Contributions are Copyright (C) 2001-2016 Openbravo S.L.U.
  ******************************************************************************
  */
 package org.openbravo.erpCommon.ad_forms;
@@ -278,10 +278,6 @@
       return null;
     }
     BigDecimal cost = new BigDecimal(getProductItemCost(date, as, "", conn, con));
-    if (cost == null) {
-      log4jProductInfo.debug("getProductCosts - No Costs");
-      return null;
-    }
     log4jProductInfo.debug("getProductCosts - qty = " + m_qty);
     if (strQty == null || strQty.equals("")) {
       BigDecimal qty = new BigDecimal(m_qty);
--- a/src/org/openbravo/erpCommon/ad_process/CopyFromGLJournal.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/CopyFromGLJournal.java	Mon May 09 09:57:27 2016 +0200
@@ -21,7 +21,6 @@
 import java.io.IOException;
 import java.io.PrintWriter;
 import java.sql.Connection;
-import java.text.SimpleDateFormat;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletException;
@@ -85,8 +84,6 @@
 
   private OBError processButton(VariablesSecureApp vars, String strKey, String strGLJournalBatch,
       String windowId) {
-    String strDateFormat = vars.getJavaDateFormat();
-    SimpleDateFormat dateFormat = new SimpleDateFormat(strDateFormat);
 
     if (log4j.isDebugEnabled())
       log4j.debug("Save: GLJournal");
--- a/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ExpenseAPInvoice.java	Mon May 09 09:57:27 2016 +0200
@@ -49,7 +49,7 @@
 public class ExpenseAPInvoice extends HttpSecureAppServlet {
   private static final long serialVersionUID = 1L;
   private static final BigDecimal ZERO = BigDecimal.ZERO;
-  static Logger log4j = Logger.getLogger(ExpenseAPInvoice.class);
+  private static final Logger expenseAPInvoiceLog4j = Logger.getLogger(ExpenseAPInvoice.class);
 
   public void init(ServletConfig config) {
     super.init(config);
@@ -87,8 +87,8 @@
 
   private OBError processExpense(VariablesSecureApp vars, String strcBpartnerId,
       String strDatereportFrom, String strDatereportTo, String strDateInvoiced) {
-    if (log4j.isDebugEnabled())
-      log4j.debug("Save: Expense AP Invoice");
+    if (expenseAPInvoiceLog4j.isDebugEnabled())
+      expenseAPInvoiceLog4j.debug("Save: Expense AP Invoice");
     int line = 0;
 
     String strcInvoiceId = "";
@@ -303,8 +303,8 @@
             data[i].adOrgId, data[i].mProductId, data[i].cUomId, strPricestd, strPricelist,
             strPricelimit, data[i].description, strcTaxID);
 
-        if (log4j.isDebugEnabled())
-          log4j.debug("dataInvoiceline: " + dataInvoiceline.length);
+        if (expenseAPInvoiceLog4j.isDebugEnabled())
+          expenseAPInvoiceLog4j.debug("dataInvoiceline: " + dataInvoiceline.length);
         if (dataInvoiceline == null || dataInvoiceline.length == 0) {
           // If it is a new line, calculates c_invoiceline_id and qty
           strcInvoiceLineId = SequenceIdData.getUUID();
@@ -315,8 +315,8 @@
             strLine = "10";
           line += Integer.valueOf(strLine);
 
-          if (log4j.isDebugEnabled())
-            log4j.debug("*****************+client: "
+          if (expenseAPInvoiceLog4j.isDebugEnabled())
+            expenseAPInvoiceLog4j.debug("*****************+client: "
                 + (data[i].invoiceprice.equals("") ? dataPrice[0].pricestd : data[i].invoiceprice));
           // Calculate Acc and Def Plan from Product
           String isDeferred = "N";
@@ -326,7 +326,6 @@
           String periodNumber = accDefPlanData.get("periodNumber");
           String startingPeriodId = accDefPlanData.get("startingPeriodId");
           // As it is a Expense invoice:
-          boolean isSOTRX = false;
           if (!"".equals(planType) && !"".equals(periodNumber) && !"".equals(startingPeriodId)) {
             isDeferred = "Y";
           } else {
@@ -435,7 +434,7 @@
       } catch (Exception ignored) {
       }
       f.printStackTrace();
-      log4j.warn("Rollback in transaction");
+      expenseAPInvoiceLog4j.warn("Rollback in transaction");
       myMessage.setType("Error");
       myMessage.setTitle(Utility.messageBD(this, "Error", vars.getLanguage()));
       myMessage.setMessage(Utility.messageBD(this, "PriceListVersionNotFound", vars.getLanguage())
@@ -452,7 +451,7 @@
       } catch (Exception ignored) {
       }
       e.printStackTrace();
-      log4j.warn("Rollback in transaction");
+      expenseAPInvoiceLog4j.warn("Rollback in transaction");
       myMessage.setType("Error");
       myMessage.setTitle(Utility.messageBD(this, "Error", vars.getLanguage()));
       if (e.getMessage().equals("PricelistNotdefined")) {
@@ -485,8 +484,8 @@
   private void printPage(HttpServletResponse response, VariablesSecureApp vars,
       String strcBpartnerId, String strDatereportFrom, String strDatereportTo,
       String strDateInvoiced) throws IOException, ServletException {
-    if (log4j.isDebugEnabled())
-      log4j.debug("Output: process ExpenseAPInvoice");
+    if (expenseAPInvoiceLog4j.isDebugEnabled())
+      expenseAPInvoiceLog4j.debug("Output: process ExpenseAPInvoice");
 
     ActionButtonDefaultData[] data = null;
     String strHelp = "", strDescription = "", strProcessId = "187";
--- a/src/org/openbravo/erpCommon/ad_process/ProcedureProcess.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ProcedureProcess.java	Mon May 09 09:57:27 2016 +0200
@@ -106,7 +106,6 @@
 
         if (params != null) {
           for (int i = 0; i < params.length; i++) {
-            String type = types[i];
             String value = params[i];
 
             int iParameter = i + 1;
--- a/src/org/openbravo/erpCommon/ad_process/Register.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/Register.java	Mon May 09 09:57:27 2016 +0200
@@ -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) 2008-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -21,6 +21,7 @@
 
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 
+@SuppressWarnings("serial")
 public class Register extends HttpSecureAppServlet {
 
   /*
--- a/src/org/openbravo/erpCommon/ad_process/TestHeartbeat.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/TestHeartbeat.java	Mon May 09 09:57:27 2016 +0200
@@ -108,7 +108,6 @@
               .init(connectionProvider);
           Map<String, Object> params = bundle.getParams();
           params.put("action", "DECLINE");
-          final String beatExecutionId = new ProcessRunner(bundle).execute(connectionProvider);
         }
 
         // Deactivating the process at SystemInfo
--- a/src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportCashflowForecast.java	Mon May 09 09:57:27 2016 +0200
@@ -84,16 +84,9 @@
       String strBankAccount, String strDateMax, String strBreakDate, boolean showDefault)
       throws IOException, ServletException {
 
-    ToolBar toolbar = new ToolBar(this, vars.getLanguage(), "ReportCashflowForecast", false, "",
-        "", "", false, "ad_reports", strReplaceWith, false, true);
-
     // ReportCashflowForecastData[] dataSummary =
     // ReportCashflowForecastData.select(this,Utility.getContext(this, vars, "#User_Client",
     // "ReportBank"), Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportBank"));
-    ReportCashflowForecastData[] dataSummary = ReportCashflowForecastData.select(this,
-        vars.getLanguage(), strDateMax, "",
-        Utility.getContext(this, vars, "#User_Client", "ReportBank"),
-        Utility.getContext(this, vars, "#AccessibleOrgTree", "ReportBank"));
 
     if (!showDefault) {
       ReportCashflowForecastData[] dataDetail = null;
--- a/src/org/openbravo/erpCommon/ad_reports/ReportNotPosted.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportNotPosted.java	Mon May 09 09:57:27 2016 +0200
@@ -63,7 +63,6 @@
       log4j.debug("Output: dataSheet");
     response.setContentType("text/html; charset=UTF-8");
     PrintWriter out = response.getWriter();
-    String discard[] = { "sectionDocType" };
     XmlDocument xmlDocument = null;
     ReportNotPostedData[] data = null;
     // if (strDateFrom.equals("") && strDateTo.equals("")) {
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalance.java	Mon May 09 09:57:27 2016 +0200
@@ -803,7 +803,6 @@
         BigDecimal parcialDR = new BigDecimal((String) vecParcial.elementAt(0));
         BigDecimal parcialCR = new BigDecimal((String) vecParcial.elementAt(1));
         BigDecimal parcialInicial = new BigDecimal((String) vecParcial.elementAt(2));
-        BigDecimal parcialFinal = new BigDecimal((String) vecParcial.elementAt(3));
         data[i].amtacctdr = (new BigDecimal(data[i].amtacctdr).add(parcialDR)).toPlainString();
         data[i].amtacctcr = (new BigDecimal(data[i].amtacctcr).add(parcialCR)).toPlainString();
         data[i].saldoInicial = (new BigDecimal(data[i].saldoInicial).add(parcialInicial))
--- a/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalanceDetail.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportTrialBalanceDetail.java	Mon May 09 09:57:27 2016 +0200
@@ -29,8 +29,6 @@
 import org.openbravo.base.filter.IsIDFilter;
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
-import org.openbravo.base.structure.BaseOBObject;
-import org.openbravo.dal.service.OBDal;
 import org.openbravo.erpCommon.businessUtility.Tree;
 import org.openbravo.erpCommon.businessUtility.WindowTabs;
 import org.openbravo.erpCommon.utility.DateTimeData;
--- a/src/org/openbravo/erpCommon/businessUtility/AuditTrailPopup_data.xsql	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/AuditTrailPopup_data.xsql	Mon May 09 09:57:27 2016 +0200
@@ -127,7 +127,7 @@
         WHERE AD_TABLE.ad_table_id = AD_COLUMN.ad_table_id 
         AND iskey='Y' 
         AND AD_TABLE.ad_table_id = a2.ad_table_id) AS KEY, '' AS href, '' AS Td_Height, 
-        COALESCE(a1.ad_tab_id,'-1') AS Parent_Key, a2.isInfoTab, a2.isTranslationTab, AD_ShortName(a2.Name) as NameTab, 
+        COALESCE(a1.ad_tab_id,'-1') AS Parent_Key, a2.isInfoTab, a2.isTranslationTab,
         a2.EDITREFERENCE, a2.AD_MODULE_ID as tabmodule
         FROM AD_TAB a1, AD_TAB a2
         WHERE a1.ad_tab_id = ?
--- a/src/org/openbravo/erpCommon/businessUtility/EMailAuthenticator.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/EMailAuthenticator.java	Mon May 09 09:57:27 2016 +0200
@@ -49,12 +49,4 @@
       return "EMailAuthenticator[" + m_pass.getUserName() + "/" + m_pass.getPassword() + "]";
   }
 
-  private String getUserName() {
-    return m_pass.getUserName();
-  }
-
-  private String getPassword() {
-    return m_pass.getPassword();
-  }
-
 }
--- a/src/org/openbravo/erpCommon/info/BusinessPartner.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/info/BusinessPartner.java	Mon May 09 09:57:27 2016 +0200
@@ -125,7 +125,7 @@
       // - exactly one row (and row content is needed)
       // - zero or more than one row (row content not needed)
       // so limit <= 2 records to get both info from result without needing to fetch all rows
-      String rownum = "0", oraLimit1 = null, pgLimit = null;
+      String oraLimit1 = null, pgLimit = null;
       if (this.myPool.getRDBMS().equalsIgnoreCase("ORACLE")) {
         oraLimit1 = "2";
       } else {
--- a/src/org/openbravo/erpCommon/info/LocatorMultiple.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/info/LocatorMultiple.java	Mon May 09 09:57:27 2016 +0200
@@ -339,83 +339,6 @@
     out.close();
   }
 
-  /**
-   * Prints the response for the getRowsIds action. It returns the rowkey for the identifier column
-   * for the list of selected rows [minOffset..maxOffset]
-   * 
-   */
-  private void printGridDataSelectedRows(HttpServletResponse response, VariablesSecureApp vars,
-      String strKey, String strName, String strProductCategory, String strOrg, String strOrderCols,
-      String strOrderDirs, boolean isSoTrx) throws IOException, ServletException {
-    int minOffset = new Integer(vars.getStringParameter("minOffset")).intValue();
-    int maxOffset = new Integer(vars.getStringParameter("maxOffset")).intValue();
-    log4j.debug("Output: print page ids, minOffset: " + minOffset + ", maxOffset: " + maxOffset);
-    String type = "Hidden";
-    String title = "";
-    String description = "";
-    FieldProvider[] data = null;
-    FieldProvider[] res = null;
-    try {
-      // build sql orderBy clause
-      String strOrderBy = SelectorUtility.buildOrderByClause(strOrderCols, strOrderDirs);
-      String strPage = vars.getSessionValue("LocatorMultiple|currentPage", "0");
-      int page = Integer.valueOf(strPage);
-
-      int oldMinOffset = minOffset;
-      int oldMaxOffset = maxOffset;
-      minOffset = (page * TableSQLData.maxRowsPerGridPage) + minOffset;
-      maxOffset = (page * TableSQLData.maxRowsPerGridPage) + maxOffset;
-      log4j.debug("relativeMinOffset: " + oldMinOffset + " absoluteMinOffset: " + minOffset);
-      log4j.debug("relativeMaxOffset: " + oldMaxOffset + " absoluteMaxOffset: " + maxOffset);
-      // Filtering result
-      if (this.myPool.getRDBMS().equalsIgnoreCase("ORACLE")) {
-        String oraLimit1 = String.valueOf(maxOffset);
-        String oraLimit2 = (minOffset + 1) + " AND " + oraLimit1;
-        data = LocatorMultipleData.select(this, "ROWNUM", strKey, strName, strProductCategory,
-            (isSoTrx) ? "Y" : null,
-            Utility.getContext(this, vars, "#User_Client", "LocatorMultiple"),
-            Utility.getSelectorOrgs(this, vars, strOrg), strOrderBy, "", oraLimit1, oraLimit2);
-      } else {
-        // minOffset and maxOffset are zero based so pageSize is difference +1
-        int pageSize = maxOffset - minOffset + 1;
-        String pgLimit = pageSize + " OFFSET " + minOffset;
-        data = LocatorMultipleData.select(this, "1", strKey, strName, strProductCategory,
-            (isSoTrx) ? "Y" : null,
-            Utility.getContext(this, vars, "#User_Client", "LocatorMultiple"),
-            Utility.getSelectorOrgs(this, vars, strOrg), strOrderBy, pgLimit, "", "");
-
-      }
-
-      // result field has to be named id -> rename by copy the list
-      res = new FieldProvider[data.length];
-      for (int i = 0; i < data.length; i++) {
-        SQLReturnObject sqlReturnObject = new SQLReturnObject();
-        String resValue = "<![CDATA[" + data[i].getField("rowkey") + "]]>";
-        sqlReturnObject.setData("id", resValue);
-        res[i] = sqlReturnObject;
-      }
-    } catch (Exception e) {
-      log4j.error("Error obtaining id-list for getIdsInRange", e);
-      type = "Error";
-      title = "Error";
-      if (!e.getMessage().startsWith("<![CDATA["))
-        description = "<![CDATA[" + e.getMessage() + "]]>";
-    }
-
-    XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
-        "org/openbravo/erpCommon/utility/DataGridID").createXmlDocument();
-    xmlDocument.setParameter("type", type);
-    xmlDocument.setParameter("title", title);
-    xmlDocument.setParameter("description", description);
-    xmlDocument.setData("structure1", res);
-    response.setContentType("text/xml; charset=UTF-8");
-    response.setHeader("Cache-Control", "no-cache");
-    PrintWriter out = response.getWriter();
-    log4j.debug(xmlDocument.print());
-    out.println(xmlDocument.print());
-    out.close();
-  }
-
   public String getServletInfo() {
     return "Servlet that presents the multiple locators seeker";
   } // end of getServletInfo() method
--- a/src/org/openbravo/erpCommon/info/Product.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/info/Product.java	Mon May 09 09:57:27 2016 +0200
@@ -185,7 +185,6 @@
       String strName = vars.getGlobalVariable("inpName", "Product.name", "");
       String strOrg = vars.getGlobalVariable("inpAD_Org_ID", "Product.adorgid", "");
       String strWarehouse = vars.getGlobalVariable("inpWarehouse", "Product.warehouse", "");
-      String strPriceList = vars.getGlobalVariable("inpPriceList", "Product.priceList", "");
       String strPriceListVersion = vars.getGlobalVariable("inpPriceListVersion",
           "Product.priceListVersion", "");
 
--- a/src/org/openbravo/erpCommon/info/Project.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/info/Project.java	Mon May 09 09:57:27 2016 +0200
@@ -94,11 +94,9 @@
       if (vars.getStringParameter("newFilter").equals("1")) {
         removePageSessionVariables(vars);
       }
-      String strWindowId = vars.getGlobalVariable("inpWindowId", "Project.windowId", "");
       String strKey = vars.getGlobalVariable("inpKey", "Project.key", "");
       String strName = vars.getGlobalVariable("inpName", "Project.name", "");
       String strBpartners = vars.getGlobalVariable("inpBpartnerId", "Project.bpartner", "");
-      String strIsSOTrx = Utility.getContext(this, vars, "isSOTrx", strWindowId);
       String strOrg = vars.getGlobalVariable("inpAD_Org_ID", "Project.adorgid", "");
 
       String strNewFilter = vars.getStringParameter("newFilter");
--- a/src/org/openbravo/erpCommon/modules/ModuleReferenceDataClientTree.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/modules/ModuleReferenceDataClientTree.java	Mon May 09 09:57:27 2016 +0200
@@ -102,19 +102,19 @@
   public String getHTMLDescription(String node) {
     try {
 
-      ModuleReferenceDataClientTreeData[] data = ModuleReferenceDataClientTreeData
+      ModuleReferenceDataClientTreeData[] moduleReferenceDataClientTreeData = ModuleReferenceDataClientTreeData
           .selectDescription(conn, lang, node);
       String discard[] = { "" };
-      if (data != null && data.length > 0 && data[0].linkname != null
-          && !data[0].linkname.equals(""))
-        data[0].statusName = "";
-      if (data != null && data.length > 0
-          && (data[0].updateAvailable == null || data[0].updateAvailable.equals("")))
+      if (moduleReferenceDataClientTreeData != null && moduleReferenceDataClientTreeData.length > 0 && moduleReferenceDataClientTreeData[0].linkname != null
+          && !moduleReferenceDataClientTreeData[0].linkname.equals(""))
+        moduleReferenceDataClientTreeData[0].statusName = "";
+      if (moduleReferenceDataClientTreeData != null && moduleReferenceDataClientTreeData.length > 0
+          && (moduleReferenceDataClientTreeData[0].updateAvailable == null || moduleReferenceDataClientTreeData[0].updateAvailable.equals("")))
         discard[0] = "update";
 
       XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
           "org/openbravo/erpCommon/modules/ModuleTreeDescription", discard).createXmlDocument();
-      xmlDocument.setData("structureDesc", data);
+      xmlDocument.setData("structureDesc", moduleReferenceDataClientTreeData);
       return xmlDocument.print();
 
     } catch (Exception e) {
--- a/src/org/openbravo/erpCommon/modules/ModuleReferenceDataOrgTree.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/modules/ModuleReferenceDataOrgTree.java	Mon May 09 09:57:27 2016 +0200
@@ -286,22 +286,22 @@
   public String getHTMLDescription(String node) {
     try {
 
-      ModuleReferenceDataOrgTreeData[] data = ModuleReferenceDataOrgTreeData.selectDescription(
+      ModuleReferenceDataOrgTreeData[] moduleReferenceDataOrgTreeData = ModuleReferenceDataOrgTreeData.selectDescription(
           conn, lang, node);
       // addLinks(data, true);
       String discard[] = { "" };
-      if (data != null && data.length > 0 && data[0].linkname != null
-          && !data[0].linkname.equals(""))
-        data[0].statusName = "";
-      if (data != null
-          && data.length > 0
-          && (data[0].updateAvailable == null || data[0].updateAvailable.equals("") || data[0].updateAvailable
+      if (moduleReferenceDataOrgTreeData != null && moduleReferenceDataOrgTreeData.length > 0 && moduleReferenceDataOrgTreeData[0].linkname != null
+          && !moduleReferenceDataOrgTreeData[0].linkname.equals(""))
+        moduleReferenceDataOrgTreeData[0].statusName = "";
+      if (moduleReferenceDataOrgTreeData != null
+          && moduleReferenceDataOrgTreeData.length > 0
+          && (moduleReferenceDataOrgTreeData[0].updateAvailable == null || moduleReferenceDataOrgTreeData[0].updateAvailable.equals("") || moduleReferenceDataOrgTreeData[0].updateAvailable
               .equals("N")))
         discard[0] = "update";
 
       XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
           "org/openbravo/erpCommon/modules/ModuleTreeDescription", discard).createXmlDocument();
-      xmlDocument.setData("structureDesc", data);
+      xmlDocument.setData("structureDesc", moduleReferenceDataOrgTreeData);
       return xmlDocument.print();
 
     } catch (Exception e) {
--- a/src/org/openbravo/erpCommon/modules/ModuleTree.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/modules/ModuleTree.java	Mon May 09 09:57:27 2016 +0200
@@ -249,13 +249,13 @@
    */
   private boolean hasChildUpdate(String node) {
     try {
-      ModuleTreeData data[] = ModuleTreeData.selectSubTree(conn, "", node);
-      if (data == null || data.length == 0)
+      ModuleTreeData moduleTreeData[] = ModuleTreeData.selectSubTree(conn, "", node);
+      if (moduleTreeData == null || moduleTreeData.length == 0)
         return false;
-      for (int i = 0; i < data.length; i++) {
-        if (data[i].updateAvailable != null && !data[i].updateAvailable.equals(""))
+      for (int i = 0; i < moduleTreeData.length; i++) {
+        if (moduleTreeData[i].updateAvailable != null && !moduleTreeData[i].updateAvailable.equals(""))
           return true;
-        if (hasChildUpdate(data[i].nodeId))
+        if (hasChildUpdate(moduleTreeData[i].nodeId))
           return true;
       }
       return false;
--- a/src/org/openbravo/erpCommon/modules/VersionUtility.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/modules/VersionUtility.java	Mon May 09 09:57:27 2016 +0200
@@ -54,20 +54,16 @@
     String name;
     String availableMinVer;
     String availableMaxVer;
-    String type;
     HashMap<String, Ver> versions;
   }
 
   private static class Ver {
-    String verId;
     String version;
     HashMap<String, Dep> dependencies;
     HashMap<String, Dep> includes;
   }
 
   private static class Dep {
-    String depId;
-    String version;
     String minVer;
     String maxVer;
     String modId;
@@ -325,7 +321,6 @@
         Mod mod = new Mod();
         mod.modId = data[i].adModuleId;
         mod.name = data[i].name;
-        mod.type = data[i].type;
         mod.versions = fillVersions(data[i], mod, "Y".equals(data[i].installed));
         modules.put(data[i].adModuleId, mod);
       }
@@ -384,7 +379,6 @@
     HashMap<String, Dep> hashDep = new HashMap<String, Dep>();
     for (int i = 0; i < data.length; i++) {
       Dep dep = new Dep();
-      dep.depId = data[i].adModuleDependencyId;
       dep.minVer = data[i].startversion;
       dep.maxVer = data[i].endversion;
       dep.modId = data[i].adDependentModuleId;
@@ -566,7 +560,6 @@
     for (int i = 0; i < modules.length; i++) {
       Mod mod = mods.get(modules[i].getModuleID());
       Ver ver = new Ver();
-      ver.verId = modules[i].getModuleVersionID();
       ver.version = modules[i].getVersionNo();
       if (mod.availableMinVer == null || versionCompare(ver.version, mod.availableMinVer) == -1) {
         mod.availableMinVer = ver.version;
--- a/src/org/openbravo/erpCommon/security/SessionLogin.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/security/SessionLogin.java	Mon May 09 09:57:27 2016 +0200
@@ -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-2014 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -203,10 +203,6 @@
     return ((this.org == null) ? "" : this.org);
   }
 
-  private void setIsActive(String newValue) {
-    this.isactive = (newValue == null) ? "Y" : newValue;
-  }
-
   private boolean getIsActive() {
     return (this.isactive.equals("Y"));
   }
@@ -243,10 +239,6 @@
     return ((this.remoteHost == null) ? "" : this.remoteHost);
   }
 
-  private void setProcessed(String newValue) {
-    this.processed = (newValue == null) ? "" : newValue;
-  }
-
   private boolean getProcessed() {
     return ((this.processed == null) ? false : this.processed.equals("Y"));
   }
--- a/src/org/openbravo/erpCommon/utility/Alert.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/Alert.java	Mon May 09 09:57:27 2016 +0200
@@ -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) 2008-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -29,8 +29,6 @@
   private String referencekeyId = "0";
 
   private static Logger log4j = Logger.getLogger(Alert.class);
-  private static final char DATA_DRIVEN = 'D';
-  private static final char EXTERNAL = 'E';
 
   public Alert() {
     this(0);
--- a/src/org/openbravo/erpCommon/utility/AntExecutor.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/AntExecutor.java	Mon May 09 09:57:27 2016 +0200
@@ -107,7 +107,6 @@
   @Deprecated
   public String setLogFile(String directory, String logFileName) throws Exception {
     // DefaultLogger logger = new DefaultLogger();
-    final FileOutputStream logFile = new FileOutputStream(directory + "/" + logFileName);
     // PrintStream ps = new PrintStream(logFile);
     // logger.setOutputPrintStream(ps);
     // logger.setErrorPrintStream(ps);
--- a/src/org/openbravo/erpCommon/utility/ComboTableData.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/ComboTableData.java	Mon May 09 09:57:27 2016 +0200
@@ -427,21 +427,6 @@
   }
 
   /**
-   * Adds a new parameter to the select section of the query.
-   * 
-   * @param _parameter
-   *          String with the parameter.
-   * @param _fieldName
-   *          String with the name of the field.
-   */
-  private void addSelectParameter(String _parameter, String _fieldName) {
-    if (this.paramSelect == null)
-      this.paramSelect = new Vector<QueryParameterStructure>();
-    QueryParameterStructure aux = new QueryParameterStructure(_parameter, _fieldName, "SELECT");
-    paramSelect.addElement(aux);
-  }
-
-  /**
    * Gets all the defined parameters for the select section.
    * 
    * @return Vector with the parameters.
@@ -628,15 +613,6 @@
   }
 
   /**
-   * Getter for the table alias index.
-   * 
-   * @return Integer with the index.
-   */
-  private int getIndex() {
-    return this.index;
-  }
-
-  /**
    * Main method to build the query.
    * 
    * @throws Exception
--- a/src/org/openbravo/erpCommon/utility/ExecuteQuery.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/ExecuteQuery.java	Mon May 09 09:57:27 2016 +0200
@@ -290,7 +290,6 @@
 
       boolean first = true;
       int numColumns = 0;
-      int rowNum = 0;
       Vector<String> names = new Vector<String>(0);
       while (result.next()) {
         if (first) {
@@ -306,7 +305,6 @@
           sqlReturnObject.setData(names.elementAt(i), UtilSql.getValue(result, names.elementAt(i)));
         }
         vector.addElement(sqlReturnObject);
-        rowNum++;
       }
       result.close();
     } catch (SQLException e) {
--- a/src/org/openbravo/erpCommon/utility/OBPrintStream.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/OBPrintStream.java	Mon May 09 09:57:27 2016 +0200
@@ -36,11 +36,10 @@
 class OBPrintStream extends PrintStream {
   private StringBuffer log;
   private boolean finished;
-  private PrintWriter out;
+  private PrintWriter obPrintStreamOut;
   private PrintStream psout;
   public static final int TEXT_HTML = 1;
   public static final int TEXT_PLAIN = 2;
-  private File logFile;
   private PrintWriter logWriter;
 
   /**
@@ -65,11 +64,10 @@
   }
 
   public void setPrintWritter(PrintWriter p) {
-    out = p;
+    obPrintStreamOut = p;
   }
 
   public void setLogFile(File f) {
-    logFile = f;
     try {
       logWriter = new PrintWriter(f);
 
@@ -97,9 +95,9 @@
     if (psout != null) {
       psout.println(encodeHtml(s));
       psout.flush();
-    } else if (out != null) {
-      out.println(encodeHtml(s));
-      out.flush();
+    } else if (obPrintStreamOut != null) {
+      obPrintStreamOut.println(encodeHtml(s));
+      obPrintStreamOut.flush();
     }
     if (logWriter != null) {
       logWriter.print(s);
--- a/src/org/openbravo/erpCommon/utility/TableSQLData.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/TableSQLData.java	Mon May 09 09:57:27 2016 +0200
@@ -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-2012 Openbravo SLU 
+ * All portions are Copyright (C) 2001-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -38,6 +38,7 @@
  * 
  *         Handler to manage all the process for the tab's query building.
  */
+@SuppressWarnings("serial")
 public class TableSQLData implements Serializable {
   private static Logger log4j = Logger.getLogger(TableSQLData.class);
   private final String internalPrefix = "@@";
@@ -1673,13 +1674,9 @@
         _alias = _alias.substring(0, _alias.length() - 2);
       }
       int position = -1;
-      UIReference reference = null;
       Properties myProps = getColumnPosition(_alias);
       if (myProps != null) {
         position = Integer.valueOf(myProps.getProperty("Position")).intValue();
-
-        reference = Reference.getUIReference(myProps.getProperty("AD_Reference_ID"),
-            myProps.getProperty("AD_Reference_Value_ID"));
       }
       if (position != -1) {
         addOrderByPosition(Integer.toString(position));
--- a/src/org/openbravo/erpCommon/utility/UsedByLink.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/UsedByLink.java	Mon May 09 09:57:27 2016 +0200
@@ -555,7 +555,7 @@
     if (log4j.isDebugEnabled())
       log4j.debug("WHERE CLAUSE: " + strWhere);
     final StringBuffer where = new StringBuffer();
-    String token = "", fin = "";
+    String token = "";
     int i = 0;
     i = strWhere.indexOf("@");
     while (i != -1) {
@@ -566,7 +566,6 @@
       if (log4j.isDebugEnabled())
         log4j.debug("WHERE COMPARATION: " + strWhere);
       if (strWhere.startsWith("SQL")) {
-        fin += ")";
         strWhere.substring(4);
         where.append("(");
       } else {
--- a/src/org/openbravo/erpCommon/utility/Utility.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/Utility.java	Mon May 09 09:57:27 2016 +0200
@@ -995,17 +995,13 @@
       return true;
 
     boolean retValue = true;
-    String whatMissing = "";
 
     if (AD_Client_ID.equals("0") && AD_Org_ID.equals("0") && User_Level.indexOf("S") == -1) {
       retValue = false;
-      whatMissing += "S";
     } else if (!AD_Client_ID.equals("0") && AD_Org_ID.equals("0") && User_Level.indexOf("C") == -1) {
       retValue = false;
-      whatMissing += "C";
     } else if (!AD_Client_ID.equals("0") && !AD_Org_ID.equals("0") && User_Level.indexOf("O") == -1) {
       retValue = false;
-      whatMissing += "O";
     }
 
     if (!WindowAccessData.hasWriteAccess(conn, window, vars.getRole()))
@@ -1885,7 +1881,6 @@
    *          a String
    * @return true if the string can be parsed
    */
-  @SuppressWarnings("unused")
   public static boolean isBigDecimal(String str) {
     try {
       new BigDecimal(str.trim());
--- a/src/org/openbravo/erpCommon/utility/WindowTree.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/WindowTree.java	Mon May 09 09:57:27 2016 +0200
@@ -165,7 +165,7 @@
     String TreeName = "";
     String TreeDescription = "";
 
-    StringBuffer menu = new StringBuffer();
+    StringBuffer nodesMenu = new StringBuffer();
     if (key == null || key.isEmpty()) {
       Tab tab = OBDal.getInstance().get(Tab.class, strTabId);
       Table table = tab.getTable();
@@ -197,17 +197,17 @@
 
     if (log4j.isDebugEnabled())
       log4j.debug("WindowTree.loadNodes() - TreeType: " + TreeType + " || TreeID: " + TreeID);
-    menu.append("\n<ul class=\"dhtmlgoodies_tree\">\n");
-    menu.append(WindowTreeUtility.addNodeElement(TreeName, TreeDescription, CHILD_SHEETS, true, "",
-        strDireccion, "clickItem(0, '" + Replace.replace(TreeName, "'", "\\'") + "', 'N');",
-        "dblClickItem(0);", true, "0", ""));
+    nodesMenu.append("\n<ul class=\"dhtmlgoodies_tree\">\n");
+    nodesMenu.append(WindowTreeUtility.addNodeElement(TreeName, TreeDescription, CHILD_SHEETS,
+        true, "", strDireccion, "clickItem(0, '" + Replace.replace(TreeName, "'", "\\'")
+            + "', 'N');", "dblClickItem(0);", true, "0", ""));
     WindowTreeData[] wtd = WindowTreeUtility.getTree(this, vars, TreeType, TreeID, editable, "",
         "", strTabId);
     Map<String, List<WindowTreeData>> wtdTree = buildTree(wtd);
-    menu.append(generateTree(wtd, wtdTree, strDireccion, "0", true, strTabId));
-    menu.append("\n</ul>\n");
+    nodesMenu.append(generateTree(wtd, wtdTree, strDireccion, "0", true, strTabId));
+    nodesMenu.append("\n</ul>\n");
     nodeIdList = null;
-    return menu.toString();
+    return nodesMenu.toString();
   }
 
   /**
--- a/src/org/openbravo/erpCommon/utility/reporting/ReportManager.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/ReportManager.java	Mon May 09 09:57:27 2016 +0200
@@ -53,7 +53,6 @@
   private String _strBaseWeb; // BASE WEB!!!!!!
   private String _prefix;
   private String _strAttachmentPath;
-  private boolean multiReports = false;
 
   public ReportManager(ConnectionProvider connectionProvider, String ftpDirectory,
       String replaceWithFull, String baseDesignPath, String defaultDesignPath, String prefix,
@@ -64,7 +63,6 @@
     _strDefaultDesignPath = defaultDesignPath;
     _strAttachmentPath = ftpDirectory;
     _prefix = prefix;
-    multiReports = multiReport;
 
     // Strip of ending slash character
     if (_strBaseDesignPath.endsWith("/"))
@@ -214,10 +212,10 @@
     designParameters.put("USER_ORG",
         Utility.getContext(_connectionProvider, variables, "#User_Org", ""));
 
-    final String language = variables.getLanguage();
-    designParameters.put("LANGUAGE", language);
+    final String lang = variables.getLanguage();
+    designParameters.put("LANGUAGE", lang);
 
-    final Locale locale = new Locale(language.substring(0, 2), language.substring(3, 5));
+    final Locale locale = new Locale(lang.substring(0, 2), lang.substring(3, 5));
     designParameters.put("LOCALE", locale);
 
     final DecimalFormatSymbols dfs = new DecimalFormatSymbols();
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintController.java	Mon May 09 09:57:27 2016 +0200
@@ -8,7 +8,7 @@
  * 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 SLU All
- * portions are Copyright (C) 2008-2015 Openbravo SLU All Rights Reserved.
+ * portions are Copyright (C) 2008-2016 Openbravo SLU All Rights Reserved.
  * Contributor(s): ______________________________________.
  */
 package org.openbravo.erpCommon.utility.reporting.printing;
@@ -278,7 +278,6 @@
 
               final String senderAddress = EmailData.getSenderAddress(this, vars.getClient(),
                   report.getOrgId());
-              boolean moreThanOnesalesRep = checks.get("moreThanOnesalesRep").booleanValue();
 
               if (request.getServletPath().toLowerCase().indexOf(PRINT_PATH) == -1
                   && request.getServletPath().toLowerCase().indexOf(PRINT_OPTIONS_PATH) == -1) {
@@ -412,7 +411,7 @@
                 + fullDocumentIdentifier);
             final String templateId = vars.getRequestGlobalVariable("templates", "templates");
             final String documentId = pocData[0].documentId;
-            for (final PocData documentData : pocData) {
+            for (int i = 0; i < pocData.length; i++) {
               final Report report = new Report(this, documentType, documentId, vars.getLanguage(),
                   templateId, multiReports, OutputTypeEnum.DEFAULT);
               o.put("templateId", templateId);
@@ -1334,28 +1333,20 @@
     // check the templates
     if (differentDocTypes.size() > 1) { // the templates selector shouldn't
       // appear
-      if (discard == null) { // Its the only think to hide
-        discard = new String[] { "discardSelect" };
-      } else {
-        final String[] discardAux = new String[discard.length + 1];
-        for (int i = 0; i < discard.length; i++) {
-          discardAux[i] = discard[i];
-        }
-        discardAux[discard.length] = "discardSelect";
-        return discardAux;
+      final String[] discardAux = new String[discard.length + 1];
+      for (int i = 0; i < discard.length; i++) {
+        discardAux[i] = discard[i];
       }
+      discardAux[discard.length] = "discardSelect";
+      return discardAux;
     }
     if (vector == null && vars.getMultiFile("inpFile") == null) {
-      if (discard == null) {
-        discard = new String[] { "view" };
-      } else {
-        final String[] discardAux = new String[discard.length + 1];
-        for (int i = 0; i < discard.length; i++) {
-          discardAux[i] = discard[i];
-        }
-        discardAux[discard.length] = "view";
-        return discardAux;
+      final String[] discardAux = new String[discard.length + 1];
+      for (int i = 0; i < discard.length; i++) {
+        discardAux[i] = discard[i];
       }
+      discardAux[discard.length] = "view";
+      return discardAux;
     }
     return discard;
   }
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintInvoices.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintInvoices.java	Mon May 09 09:57:27 2016 +0200
@@ -37,7 +37,6 @@
     boolHist = false;
   }
 
-  @SuppressWarnings("unchecked")
   public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintOrders.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintOrders.java	Mon May 09 09:57:27 2016 +0200
@@ -37,7 +37,6 @@
     boolHist = false;
   }
 
-  @SuppressWarnings("unchecked")
   public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintQuotations.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintQuotations.java	Mon May 09 09:57:27 2016 +0200
@@ -37,7 +37,6 @@
     boolHist = false;
   }
 
-  @SuppressWarnings("unchecked")
   public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
--- a/src/org/openbravo/erpCommon/utility/reporting/printing/PrintShipments.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpCommon/utility/reporting/printing/PrintShipments.java	Mon May 09 09:57:27 2016 +0200
@@ -37,7 +37,6 @@
     boolHist = false;
   }
 
-  @SuppressWarnings("unchecked")
   public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException,
       ServletException {
     VariablesSecureApp vars = new VariablesSecureApp(request);
--- a/src/org/openbravo/erpReports/RptM_Inout.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/erpReports/RptM_Inout.java	Mon May 09 09:57:27 2016 +0200
@@ -58,7 +58,6 @@
         .createXmlDocument();
 
     RptMInoutData[] data = RptMInoutData.select(this, strmInoutId);
-    String strCopies = minimumOne(RptMInoutData.selectCopies(this, strmInoutId));
     RptMInoutData[] dataPrincipal = RptMInoutData.selectNumCopies(this,
         Integer.toString(data.length));
     RptMInoutHeaderData[][] dataHeader = new RptMInoutHeaderData[data.length][];
--- a/src/org/openbravo/event/CharacteristicValueEventHandler.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/event/CharacteristicValueEventHandler.java	Mon May 09 09:57:27 2016 +0200
@@ -54,14 +54,11 @@
     return entities;
   }
 
-  @SuppressWarnings("unused")
-  public void onTransactionBegin(@Observes
-  TransactionBeginEvent event) {
+  public void onTransactionBegin(@Observes TransactionBeginEvent event) {
     chvalueUpdated.set(null);
   }
 
-  public void onUpdate(@Observes
-  EntityUpdateEvent event) {
+  public void onUpdate(@Observes EntityUpdateEvent event) {
     if (!isValidEvent(event)) {
       return;
     }
@@ -100,8 +97,7 @@
     }
   }
 
-  public void onTransactionCompleted(@Observes
-  TransactionCompletedEvent event) {
+  public void onTransactionCompleted(@Observes TransactionCompletedEvent event) {
     String strChValueId = chvalueUpdated.get();
     chvalueUpdated.set(null);
     if (StringUtils.isBlank(strChValueId) || event.getTransaction().wasRolledBack()) {
--- a/src/org/openbravo/event/ProductCharacteristicValueEventHandler.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/event/ProductCharacteristicValueEventHandler.java	Mon May 09 09:57:27 2016 +0200
@@ -53,7 +53,6 @@
     return entities;
   }
 
-  @SuppressWarnings("unused")
   public void onTransactionBegin(@Observes TransactionBeginEvent event) {
     prodchvalueUpdated.set(null);
   }
--- a/src/org/openbravo/financial/ResetAccounting.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/financial/ResetAccounting.java	Mon May 09 09:57:27 2016 +0200
@@ -251,7 +251,6 @@
       updateBalanced.setString("tableId", tableId);
       updateBalanced.setParameterList("transactions", transactions);
       updateBalanced.setString("clientId", client);
-      int balancedUpdated = updateBalanced.executeUpdate();
       Table table = OBDal.getInstance().get(Table.class, tableId);
       if (!table.isView()) {
         tableName = table.getDBTableName();
--- a/src/org/openbravo/service/system/DatabaseValidator.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/service/system/DatabaseValidator.java	Mon May 09 09:57:27 2016 +0200
@@ -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) 2009-2014 Openbravo SLU 
+ * All portions are Copyright (C) 2009-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -490,7 +490,6 @@
 
         dbColumnsByName.remove(column.getDBColumnName().toUpperCase());
 
-        checkDefaultValue(column, dbColumn, result);
       }
     }
 
@@ -505,35 +504,6 @@
     }
   }
 
-  private void checkDefaultValue(Column adColumn, org.apache.ddlutils.model.Column dbColumn,
-      SystemValidationResult result) {
-    if (true) {
-      // disable this test until the following issues are all solved:
-      // https://issues.openbravo.com/view.php?id=9054
-      // https://issues.openbravo.com/view.php?id=9053
-      // https://issues.openbravo.com/view.php?id=9052
-      // https://issues.openbravo.com/view.php?id=9051
-      // https://issues.openbravo.com/view.php?id=9050
-      // these cover the differences in default values
-      return;
-    }
-    if (adColumn.getDefaultValue() == null || adColumn.getDefaultValue().startsWith("@")) {
-      return;
-    } else if (false && dbColumn.getDefaultValue() == null) {
-      // this check is disabled for now
-      result.addWarning(SystemValidationType.UNEQUAL_DEFAULTVALUE, "Column "
-          + adColumn.getTable().getName() + "." + adColumn.getName() + " has default value "
-          + adColumn.getDefaultValue()
-          + " in the Application Dictionary but no default value in the database");
-    } else if (dbColumn.getDefaultValue() != null
-        && !dbColumn.getDefaultValue().equals(adColumn.getDefaultValue())) {
-      result.addWarning(SystemValidationType.UNEQUAL_DEFAULTVALUE, "Column "
-          + adColumn.getTable().getName() + "." + adColumn.getName()
-          + ": the Application Dictionary and the database have differing default values,"
-          + " AD: " + adColumn.getDefaultValue() + " DB: " + dbColumn.getDefaultValue());
-    }
-  }
-
   private void checkDataType(Column adColumn, org.apache.ddlutils.model.Column dbColumn,
       SystemValidationResult result, org.apache.ddlutils.model.Table dbTable) {
 
--- a/src/org/openbravo/service/system/ModuleValidator.java	Fri May 06 10:09:56 2016 +0200
+++ b/src/org/openbravo/service/system/ModuleValidator.java	Mon May 09 09:57:27 2016 +0200
@@ -24,10 +24,7 @@
 import java.util.List;
 
 import org.hibernate.criterion.Restrictions;
-import org.openbravo.base.model.Entity;
-import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.model.NamingUtil;
-import org.openbravo.base.model.Property;
 import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.dal.service.OBCriteria;
@@ -173,55 +170,6 @@
     }
   }
 
-  // checks https://issues.openbravo.com/view.php?id=7905
-  // Add to validation: module artifacts shouldn't use id's in the range of 100.000-799.999 as these
-  // are used for old customizations
-  private void checkHasIllegalId(Module module, SystemValidationResult result) {
-    for (Entity entity : ModelProvider.getInstance().getModel()) {
-      Property moduleProperty = null;
-      for (Property property : entity.getProperties()) {
-        if (property.getTargetEntity() != null && property.getTargetEntity() == module.getEntity()) {
-          moduleProperty = property;
-          break;
-        }
-      }
-      // check the artifacts pointing to a module
-      if (moduleProperty != null) {
-        final OBCriteria<BaseOBObject> obCriteria = OBDal.getInstance().createCriteria(
-            entity.getName());
-        obCriteria.setFilterOnActive(false);
-        obCriteria.setFilterOnReadableClients(false);
-        obCriteria.setFilterOnReadableOrganization(false);
-        obCriteria.add(Restrictions.eq(moduleProperty.getName(), module));
-        for (BaseOBObject baseOBObject : obCriteria.list()) {
-          checkIllegalId(baseOBObject, result, module);
-        }
-      }
-    }
-  }
-
-  private void checkIllegalId(BaseOBObject baseOBObject, SystemValidationResult result,
-      Module module) {
-    final String id = (String) baseOBObject.getId();
-    if (id.compareTo("100000") > 0 && id.compareTo("799999") < 0 && id.length() == 6) {
-      result.addError(SystemValidationType.CUSTOMIZATION_ID, "Module " + module.getName()
-          + " has an artifact (" + baseOBObject
-          + ") with an id in the customization range 100000 to 799999. This is not allowed.");
-    }
-
-    // also check the children
-    for (Property property : baseOBObject.getEntity().getProperties()) {
-      if (property.isOneToMany() && property.isChild()) {
-        @SuppressWarnings("unchecked")
-        final List<BaseOBObject> children = (List<BaseOBObject>) baseOBObject.get(property
-            .getName());
-        for (BaseOBObject child : children) {
-          checkIllegalId(child, result, module);
-        }
-      }
-    }
-  }
-
   private <T extends BaseOBObject> boolean hasArtifact(Class<T> clz, Module module) {
     final OBCriteria<T> obc = OBDal.getInstance().createCriteria(clz);
     obc.add(Restrictions.eq("module", module));