[client-event-handlers] Merge with pi
authorCarlos Aristu <carlos.aristu@openbravo.com>
Thu, 16 Jun 2016 13:56:48 +0200
changeset 29798 f9fb0877519c
parent 29797 f4ae96b9cee9 (current diff)
parent 29655 e67484476dfd (diff)
child 29799 f799c25992d2
[client-event-handlers] Merge with pi
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
--- a/.hgsigs	Thu Jun 16 12:54:00 2016 +0200
+++ b/.hgsigs	Thu Jun 16 13:56:48 2016 +0200
@@ -194,3 +194,4 @@
 265e8eccf704614fe88220026f2e2bafcebaaf00 0 iEYEABECAAYFAlcgZEQACgkQCX/oGf+2qkPuZgCcDPuB9d77M+51AglMvvmtpCDtnvoAnjqst7QgD6IP3Sv21+4vlqEjLVqU
 98bdf9167a3d4ea9cb9b6f5e214a539220a3f3cb 0 iEYEABECAAYFAldD+MEACgkQCX/oGf+2qkPLHwCgngPaeyLsiGk2FhShX4/IzVARWN8AnRSCXIoWp6ruOcbEfIUFQiM9lY7f
 008d208ba1f60804fd852570f0cd7e985a4220da 0 iEYEABECAAYFAldQUXwACgkQCX/oGf+2qkOtLQCdEZMKf7VfsSt6iVUl59GzwNdr7C4AoK4B3pbbW23fqYd1qplclO3aGm1B
+91b0a6cc5947ea0958b3d677a3e76174fa0a045e 0 iEYEABECAAYFAldajXIACgkQCX/oGf+2qkMRiQCgread+PDPwOVh7Qu/IlmeCLDSPVQAn3cepToICm61fiNkrV+PmFen4bwd
--- a/.hgtags	Thu Jun 16 12:54:00 2016 +0200
+++ b/.hgtags	Thu Jun 16 13:56:48 2016 +0200
@@ -205,3 +205,4 @@
 d386f41fa755d23e0e23f881aece691009051ebd 3.0PR16Q1.1
 ec73935a2c83b6164a18cb70996226cb15672038 3.0PR16Q1.2
 208b773131650c3806cefa65b4d5df9bf1992821 3.0PR16Q1.3
+cfff3c184b53528cd71acfe21b15800db17b3436 3.0PR16Q2
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ModifyPaymentPlanActionHandler.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ModifyPaymentPlanActionHandler.java	Thu Jun 16 13:56:48 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):  ______________________________________.
  ************************************************************************
@@ -270,15 +270,29 @@
       while (ite.hasNext()) {
         FIN_PaymentDetail pd = ite.next();
         BigDecimal amount = canceledPSDs.get(pd);
-        FIN_PaymentScheduleDetail psd = dao.getNewPaymentScheduleDetail(ps, null, amount,
-            BigDecimal.ZERO, pd);
-        psd.setCanceled(true);
+        if (!existsPaymentScheduleDetail(pd)) {
+          FIN_PaymentScheduleDetail psd = dao.getNewPaymentScheduleDetail(ps, null, amount,
+              BigDecimal.ZERO, pd);
+          psd.setCanceled(true);
+        }
       }
       return;
     }
   }
 
   /**
+   * Returns if exists any payment schedule detail for the payment detail
+   * 
+   */
+  private boolean existsPaymentScheduleDetail(FIN_PaymentDetail pd) {
+    OBCriteria<FIN_PaymentScheduleDetail> obcPSD = OBDal.getInstance().createCriteria(
+        FIN_PaymentScheduleDetail.class);
+    obcPSD.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS, pd));
+    obcPSD.setMaxResults(1);
+    return obcPSD.uniqueResult() != null;
+  }
+
+  /**
    * Returns the set of payment schedule detail elements for payments that have been canceled
    * 
    */
--- a/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.client.application/src/org/openbravo/client/application/window/FormInitializationComponent.java	Thu Jun 16 13:56:48 2016 +0200
@@ -47,8 +47,6 @@
 import org.openbravo.base.model.domaintype.PrimitiveDomainType;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.structure.BaseOBObject;
-import org.openbravo.base.structure.ClientEnabled;
-import org.openbravo.base.structure.OrganizationEnabled;
 import org.openbravo.client.application.ApplicationConstants;
 import org.openbravo.client.application.DynamicExpressionParser;
 import org.openbravo.client.application.Note;
@@ -63,6 +61,7 @@
 import org.openbravo.client.kernel.reference.UIDefinitionController;
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.security.SecurityChecker;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
@@ -533,27 +532,10 @@
       }
 
       if ((mode.equals("EDIT") || mode.equals("CHANGE")) && row != null) {
-        if ((row instanceof ClientEnabled && ((ClientEnabled) row).getClient() != null)) {
-          final String rowClientId = ((ClientEnabled) row).getClient().getId();
-          final String currentClientId = OBContext.getOBContext().getCurrentClient().getId();
-          if (!rowClientId.equals(currentClientId)) {
-            finalObject.put("_readOnly", true);
-          }
+        if (!SecurityChecker.getInstance().isWritable(row)) {
+          finalObject.put("_readOnly", true);
         }
-        if (row instanceof OrganizationEnabled
-            && ((OrganizationEnabled) row).getOrganization() != null) {
-          boolean writable = false;
-          final String objectOrgId = ((OrganizationEnabled) row).getOrganization().getId();
-          for (String orgId : OBContext.getOBContext().getWritableOrganizations()) {
-            if (orgId.equals(objectOrgId)) {
-              writable = true;
-              break;
-            }
-          }
-          if (!writable) {
-            finalObject.put("_readOnly", true);
-          }
-        }
+
         finalObject.put("noteCount", noteCount);
       }
       if (attachments.size() > 0) {
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-tree-view-grid.js	Thu Jun 16 13:56:48 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) 2013-2014 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -91,11 +91,11 @@
       me.parentTabRecordId = me.getParentTabRecordId();
       dsRequest.params.parentRecordId = me.parentTabRecordId;
       dsRequest.params.tabId = me.view.tabId;
+      dsRequest.params._extraProperties = me.view.dataSource && me.view.dataSource.requestProperties.params._extraProperties;
       if (dsRequest.dropIndex || dsRequest.dropIndex === 0) {
         //Only send the index if the tree is ordered
         dsRequest = me.addOrderedTreeParameters(dsRequest);
       }
-      dsRequest.params._selectedProperties = me.getSelectedPropertiesString();
       // Includes the context, it could be used in the hqlwhereclause
       isc.addProperties(dsRequest.params, me.view.getContextInfo(true, false));
       dsRequest.willHandleError = true;
--- a/modules/org.openbravo.client.kernel/jsbeautify/jsbeautify	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jsbeautify	Thu Jun 16 13:56:48 2016 +0200
@@ -24,7 +24,11 @@
 ./modules/org.openbravo.client.kernel/jsbeautify/jsbeautifier.py --indent-size=2 --jslint-happy "$changedfile" | perl -pe 'chop if eof' > "$changedfile.beautified"
 if ! diff "$changedfile" "$changedfile.beautified" >/dev/null ; then
   if [ "$replaceparam" != "replace" ] ; then
+    echo ""
+    echo "******************************************************************************************************************************************************"
     echo "Beautify Error --> Please, beautify $changedfile";
+    echo "******************************************************************************************************************************************************"
+    echo ""
     rm -rf "$changedfile.beautified"
     export ERROR="1"
   else
--- a/modules/org.openbravo.client.kernel/jsbeautify/jsbeautify-module	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jsbeautify-module	Thu Jun 16 13:56:48 2016 +0200
@@ -24,7 +24,11 @@
 ../org.openbravo.client.kernel/jsbeautify/jsbeautifier.py --indent-size=2 --jslint-happy "$changedfile" | perl -pe 'chop if eof' > "$changedfile.beautified"
 if ! diff "$changedfile" "$changedfile.beautified" >/dev/null ; then
   if [ "$replaceparam" != "replace" ] ; then
+    echo ""
+    echo "******************************************************************************************************************************************************"
     echo "Beautify Error --> Please, beautify $changedfile";
+    echo "******************************************************************************************************************************************************"
+    echo ""
     rm -rf "$changedfile.beautified"
     export ERROR="1"
   else
--- a/modules/org.openbravo.client.kernel/jsbeautify/jscheck-btfy	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jscheck-btfy	Thu Jun 16 13:56:48 2016 +0200
@@ -18,12 +18,16 @@
 
 set -e
 replaceparam=$1
+
+ echo ""
+ echo "-----------------------------------------------"
 if [ "$replaceparam" != "replace" ] ; then
  echo "Performing jsbeautify check on all js resources"
 else
  echo "Performing jsbeautify replacement on all js resources"
 fi
-
+ echo "-----------------------------------------------"
+ echo ""
 files=$(./modules/org.openbravo.client.kernel/jscheck/jsfiles ./modules)
 
 for changedfile in echo $files; do
--- a/modules/org.openbravo.client.kernel/jsbeautify/jscheck-btfy-module	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.client.kernel/jsbeautify/jscheck-btfy-module	Thu Jun 16 13:56:48 2016 +0200
@@ -18,12 +18,16 @@
 
 set -e
 replaceparam=$1
+
+ echo ""
+ echo "***********************************************"
 if [ "$replaceparam" != "replace" ] ; then
  echo "Performing jsbeautify check on all js resources"
 else
  echo "Performing jsbeautify replacement on all js resources"
 fi
-
+ echo "***********************************************"
+ echo ""
 files=$(../org.openbravo.client.kernel/jscheck/jsfiles ./)
 
 for changedfile in echo $files;
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java	Thu Jun 16 13:56:48 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) 2011 Openbravo SLU 
+ * All portions are Copyright (C) 2011-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -82,7 +82,7 @@
     Date date = null;
     try {
       // We retrieve the time from the database, using the predefined sql date-time format
-      String now = DateTimeData.now(new DalConnectionProvider(), sqlDateTimeFormat);
+      String now = DateTimeData.now(new DalConnectionProvider(false), sqlDateTimeFormat);
       SimpleDateFormat formatter = new SimpleDateFormat(javaDateTimeFormat);
       date = formatter.parse(now);
     } catch (Exception ex) {
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java	Thu Jun 16 13:56:48 2016 +0200
@@ -51,7 +51,6 @@
 import org.openbravo.erpCommon.businessUtility.Preferences;
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.domain.ReferencedTree;
-import org.openbravo.model.ad.domain.ReferencedTreeField;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.ad.ui.Tab;
 import org.openbravo.model.ad.utility.TableTree;
@@ -196,19 +195,9 @@
     String tabId = parameters.get("tabId");
     String treeReferenceId = parameters.get("treeReferenceId");
     Tab tab = null;
-    JSONArray selectedProperties = null;
     if (tabId != null) {
       tab = OBDal.getInstance().get(Tab.class, tabId);
-      String selectedPropertiesStr = parameters.get("_selectedProperties");
-      selectedProperties = new JSONArray(selectedPropertiesStr);
-    } else if (treeReferenceId != null) {
-      ReferencedTree treeReference = OBDal.getInstance().get(ReferencedTree.class, treeReferenceId);
-      treeReference.getADReferencedTreeFieldList();
-      selectedProperties = new JSONArray();
-      for (ReferencedTreeField treeField : treeReference.getADReferencedTreeFieldList()) {
-        selectedProperties.put(treeField.getProperty());
-      }
-    } else {
+    } else if (treeReferenceId == null) {
       logger
           .error("A request to the TreeDatasourceService must include the tabId or the treeReferenceId parameter");
       return new JSONArray();
@@ -219,6 +208,7 @@
     Entity entity = ModelProvider.getInstance().getEntityByTableId(tree.getTable().getId());
     final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(
         DataToJsonConverter.class);
+    toJsonConverter.setAdditionalProperties(JsonUtils.getAdditionalProperties(parameters));
 
     // Joins the ADTreeNode with the referenced table
     StringBuilder joinClause = new StringBuilder();
@@ -350,6 +340,7 @@
     OBQuery<BaseOBObject> obq = OBDal.getInstance()
         .createQuery("ADTreeNode", joinClause.toString());
     obq.setFilterOnActive(false);
+    obq.setFilterOnReadableOrganization(entity.getMappingClass() != Organization.class);
     final List<Object> parameters = new ArrayList<Object>();
     parameters.add(nodeId);
     obq.setParameters(parameters);
@@ -563,19 +554,11 @@
     String tableId = null;
     String referencedTableId = parameters.get("referencedTableId");
     String treeReferenceId = parameters.get("treeReferenceId");
-    JSONArray selectedProperties = null;
     if (referencedTableId != null) {
       tableId = referencedTableId;
-      String selectedPropertiesStr = parameters.get("_selectedProperties");
-      selectedProperties = new JSONArray(selectedPropertiesStr);
     } else if (treeReferenceId != null) {
       ReferencedTree treeReference = OBDal.getInstance().get(ReferencedTree.class, treeReferenceId);
-      treeReference.getADReferencedTreeFieldList();
       tableId = treeReference.getTable().getId();
-      selectedProperties = new JSONArray();
-      for (ReferencedTreeField treeField : treeReference.getADReferencedTreeFieldList()) {
-        selectedProperties.put(treeField.getProperty());
-      }
     } else {
       logger
           .error("A request to the TreeDatasourceService must include the tabId or the treeReferenceId parameter");
@@ -650,6 +633,7 @@
 
     final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(
         DataToJsonConverter.class);
+    toJsonConverter.setAdditionalProperties(JsonUtils.getAdditionalProperties(parameters));
 
     JSONObject json = null;
     try {
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Thu Jun 16 13:56:48 2016 +0200
@@ -50,6 +50,8 @@
 import org.openbravo.dal.service.OBQuery;
 import org.openbravo.database.SessionInfo;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.ad.system.Client;
+import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.service.db.DbUtility;
 import org.openbravo.service.json.JsonToDataConverter.JsonConversionError;
 import org.openbravo.userinterface.selector.Selector;
@@ -642,12 +644,12 @@
 
   private void addWritableAttribute(List<JSONObject> jsonObjects) throws JSONException {
     for (JSONObject jsonObject : jsonObjects) {
-      if (!jsonObject.has("client") || !jsonObject.has("organization")) {
-        continue;
-      }
-      final Object rowClient = jsonObject.get("client");
-      final Object rowOrganization = jsonObject.get("organization");
-      if (!(rowClient instanceof String) || !(rowOrganization instanceof String)) {
+      final Object rowClient = getFKValue(jsonObject, "client", Client.ENTITY_NAME);
+      final Object rowOrganization = getFKValue(jsonObject, "organization",
+          Organization.ENTITY_NAME);
+
+      if (rowClient == null || !(rowClient instanceof String) || rowOrganization == null
+          || !(rowOrganization instanceof String)) {
         continue;
       }
       final String currentClientId = OBContext.getOBContext().getCurrentClient().getId();
@@ -668,6 +670,23 @@
     }
   }
 
+  /**
+   * Returns the value for a FK property, in case the entity of the row is the referencedEntity for
+   * that FK, it returns the row id.
+   */
+  private Object getFKValue(JSONObject row, String propertyName,
+      String referencedEntityName) throws JSONException {
+    Object value = null;
+    if (row.has(propertyName)) {
+      value = row.get(propertyName);
+    } else if (row.has(JsonConstants.ENTITYNAME)
+        && referencedEntityName.equals(row.get(JsonConstants.ENTITYNAME))
+        && row.has(BaseOBObject.ID)) {
+      value = row.get(BaseOBObject.ID);
+    }
+    return value;
+  }
+
   /*
    * (non-Javadoc)
    * 
--- a/src-core/src/org/openbravo/data/Sqlc.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-core/src/org/openbravo/data/Sqlc.java	Thu Jun 16 13:56:48 2016 +0200
@@ -1,6 +1,6 @@
 /*
  ************************************************************************************
- * Copyright (C) 2001-2015 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
@@ -736,10 +736,9 @@
       // Get the ResultSetMetaData. This will be used for
       // the column headings
       if (sql.executeType.equals("executeQuery")) {
-        result = preparedStatement.executeQuery();
-        if (log4j.isDebugEnabled())
-          log4j.debug("query done");
-        rsmd = result.getMetaData();
+        // No need to really run the query. Both pg & ora allow to get ResultSetMetaData from a
+        // PreparedStatement already
+        rsmd = preparedStatement.getMetaData();
         // Get the number of columns in the result set
         numCols = rsmd.getColumnCount();
         if (log4j.isDebugEnabled())
--- a/src-db/database/model/functions/M_INOUT_POST.xml	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-db/database/model/functions/M_INOUT_POST.xml	Thu Jun 16 13:56:48 2016 +0200
@@ -95,6 +95,8 @@
     v_QtyAux NUMBER;
     v_Count NUMBER:=0;
     v_Line VARCHAR2(10) ;
+    v_OrderDocumentNo C_ORDER.DocumentNo%TYPE;
+    v_OrderLineNo C_ORDERLINE.Line%TYPE;
     v_OrderID_old VARCHAR2(32);
     Cur_MILines RECORD;
     FINISH_PROCESS BOOLEAN:=false;
@@ -353,18 +355,26 @@
         IF (v_Count=0) THEN
           RAISE_APPLICATION_ERROR(-20000, '@NotCorrectOrgDoctypeShipment@') ;
         END IF;
-        SELECT COUNT(*), MAX(M.line)
-        INTO v_Count, v_line
-        FROM M_InOutLine M,
-          M_Product P
-        WHERE M.M_PRODUCT_ID=P.M_PRODUCT_ID
-          AND P.M_ATTRIBUTESET_ID IS NOT NULL
+        SELECT COUNT(*), MAX(M.line), MAX(O.documentno), Max(OL.line)
+        INTO v_Count, v_line, v_OrderDocumentNo, v_OrderLineNo
+        FROM M_InOutLine M
+        JOIN M_Product P
+        ON M.m_product_id = P.m_product_id
+        LEFT JOIN C_OrderLine OL
+        ON M.c_orderline_id = OL.c_orderline_id
+        LEFT JOIN C_Order O
+        ON OL.c_order_id = O.c_order_id
+        WHERE P.M_ATTRIBUTESET_ID IS NOT NULL
           AND (P.ATTRSETVALUETYPE IS NULL OR P.ATTRSETVALUETYPE <> 'F')
           AND (SELECT ISONEATTRSETVALREQUIRED FROM M_ATTRIBUTESET WHERE M_ATTRIBUTESET_ID = P.M_ATTRIBUTESET_ID) = 'Y'
           AND COALESCE(M.M_ATTRIBUTESETINSTANCE_ID, '0') = '0'
           AND M.M_INOUT_ID=v_Record_ID;
-        IF v_Count<>0 THEN
-          RAISE_APPLICATION_ERROR(-20000, '@Inline@'||' '||v_line||' '||'@productWithoutAttributeSet@') ;
+        IF (v_Count <> 0) THEN
+          IF (v_orderDocumentNo IS NULL) THEN
+            RAISE_APPLICATION_ERROR(-20000, '@Inline@'||' '||v_line||' '||'@productWithoutAttributeSet@');
+          ELSE
+            RAISE_APPLICATION_ERROR(-20000, '@Inline@'||' '||v_line||' '||'@productWithoutAttributeSet@'||'. '||'@INS_POREFERENCE@'||' '||v_OrderDocumentNo||' '||'@line@'||' '||v_OrderLineNo);
+          END IF;
         END IF;
         SELECT COUNT(*), MAX(M.line)
         INTO v_Count, v_Line
--- a/src-db/database/sourcedata/AD_MENU.xml	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-db/database/sourcedata/AD_MENU.xml	Thu Jun 16 13:56:48 2016 +0200
@@ -4952,6 +4952,20 @@
 <!--6787A809DB364371B797ECED5E9262BF-->  <OPENLINKINBROWSER><![CDATA[N]]></OPENLINKINBROWSER>
 <!--6787A809DB364371B797ECED5E9262BF--></AD_MENU>
 
+<!--68516F327BFE4CDEB2DA255122089917--><AD_MENU>
+<!--68516F327BFE4CDEB2DA255122089917-->  <AD_MENU_ID><![CDATA[68516F327BFE4CDEB2DA255122089917]]></AD_MENU_ID>
+<!--68516F327BFE4CDEB2DA255122089917-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--68516F327BFE4CDEB2DA255122089917-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--68516F327BFE4CDEB2DA255122089917-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--68516F327BFE4CDEB2DA255122089917-->  <NAME><![CDATA[Reset Accounting]]></NAME>
+<!--68516F327BFE4CDEB2DA255122089917-->  <DESCRIPTION><![CDATA[Reset Accounting Entries]]></DESCRIPTION>
+<!--68516F327BFE4CDEB2DA255122089917-->  <ISSUMMARY><![CDATA[N]]></ISSUMMARY>
+<!--68516F327BFE4CDEB2DA255122089917-->  <ACTION><![CDATA[OBUIAPP_Process]]></ACTION>
+<!--68516F327BFE4CDEB2DA255122089917-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--68516F327BFE4CDEB2DA255122089917-->  <OPENLINKINBROWSER><![CDATA[N]]></OPENLINKINBROWSER>
+<!--68516F327BFE4CDEB2DA255122089917-->  <EM_OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></EM_OBUIAPP_PROCESS_ID>
+<!--68516F327BFE4CDEB2DA255122089917--></AD_MENU>
+
 <!--6EEC8E0853CB432B886B8751A73F5E28--><AD_MENU>
 <!--6EEC8E0853CB432B886B8751A73F5E28-->  <AD_MENU_ID><![CDATA[6EEC8E0853CB432B886B8751A73F5E28]]></AD_MENU_ID>
 <!--6EEC8E0853CB432B886B8751A73F5E28-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -5272,7 +5286,7 @@
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <AD_MENU_ID><![CDATA[CC8E287A0B0743D69C53D8F678F9AD41]]></AD_MENU_ID>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--CC8E287A0B0743D69C53D8F678F9AD41-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CC8E287A0B0743D69C53D8F678F9AD41-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <NAME><![CDATA[Reset Accounting]]></NAME>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <DESCRIPTION><![CDATA[Reset Accounting Entries]]></DESCRIPTION>
 <!--CC8E287A0B0743D69C53D8F678F9AD41-->  <ISSUMMARY><![CDATA[N]]></ISSUMMARY>
--- a/src-db/database/sourcedata/AD_PROCESS.xml	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-db/database/sourcedata/AD_PROCESS.xml	Thu Jun 16 13:56:48 2016 +0200
@@ -7162,7 +7162,7 @@
 <!--E264309FF8244A94936502BF51829109-->  <AD_PROCESS_ID><![CDATA[E264309FF8244A94936502BF51829109]]></AD_PROCESS_ID>
 <!--E264309FF8244A94936502BF51829109-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--E264309FF8244A94936502BF51829109-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--E264309FF8244A94936502BF51829109-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E264309FF8244A94936502BF51829109-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
 <!--E264309FF8244A94936502BF51829109-->  <VALUE><![CDATA[Reset Accounting]]></VALUE>
 <!--E264309FF8244A94936502BF51829109-->  <NAME><![CDATA[Reset Accounting]]></NAME>
 <!--E264309FF8244A94936502BF51829109-->  <DESCRIPTION><![CDATA[Reset Accounting Entries]]></DESCRIPTION>
--- a/src-db/database/sourcedata/AD_REFERENCE.xml	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-db/database/sourcedata/AD_REFERENCE.xml	Thu Jun 16 13:56:48 2016 +0200
@@ -4926,6 +4926,18 @@
 <!--4452E6997DD14363AB4387B06939871A-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--4452E6997DD14363AB4387B06939871A--></AD_REFERENCE>
 
+<!--45134B97CEF74E27AD2A5D8E8DC8D388--><AD_REFERENCE>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <AD_REFERENCE_ID><![CDATA[45134B97CEF74E27AD2A5D8E8DC8D388]]></AD_REFERENCE_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <NAME><![CDATA[Client Selector]]></NAME>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <PARENTREFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></PARENTREFERENCE_ID>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--45134B97CEF74E27AD2A5D8E8DC8D388--></AD_REFERENCE>
+
 <!--467CA50808444F9890E23536FDE10405--><AD_REFERENCE>
 <!--467CA50808444F9890E23536FDE10405-->  <AD_REFERENCE_ID><![CDATA[467CA50808444F9890E23536FDE10405]]></AD_REFERENCE_ID>
 <!--467CA50808444F9890E23536FDE10405-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -5392,6 +5404,18 @@
 <!--66F2DCC800A34F94923444C29478E70A-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--66F2DCC800A34F94923444C29478E70A--></AD_REFERENCE>
 
+<!--682B6F47F6B147008D0454FEACB9F4C7--><AD_REFERENCE>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <AD_REFERENCE_ID><![CDATA[682B6F47F6B147008D0454FEACB9F4C7]]></AD_REFERENCE_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <NAME><![CDATA[Table Multi Selector]]></NAME>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <PARENTREFERENCE_ID><![CDATA[87E6CFF8F71548AFA33F181C317970B5]]></PARENTREFERENCE_ID>
+<!--682B6F47F6B147008D0454FEACB9F4C7-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--682B6F47F6B147008D0454FEACB9F4C7--></AD_REFERENCE>
+
 <!--689DF2175C944B70AF0DF7D57C3411A6--><AD_REFERENCE>
 <!--689DF2175C944B70AF0DF7D57C3411A6-->  <AD_REFERENCE_ID><![CDATA[689DF2175C944B70AF0DF7D57C3411A6]]></AD_REFERENCE_ID>
 <!--689DF2175C944B70AF0DF7D57C3411A6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -6201,6 +6225,18 @@
 <!--C123B7BF5B2C438D84D2E509734776B5-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--C123B7BF5B2C438D84D2E509734776B5--></AD_REFERENCE>
 
+<!--C205D56B07D74778A6D6A1AED8467690--><AD_REFERENCE>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <AD_REFERENCE_ID><![CDATA[C205D56B07D74778A6D6A1AED8467690]]></AD_REFERENCE_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <NAME><![CDATA[Legal or Business Organizations Selector]]></NAME>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <PARENTREFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></PARENTREFERENCE_ID>
+<!--C205D56B07D74778A6D6A1AED8467690-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--C205D56B07D74778A6D6A1AED8467690--></AD_REFERENCE>
+
 <!--C3531F85C14B4515AB7259F0D338050D--><AD_REFERENCE>
 <!--C3531F85C14B4515AB7259F0D338050D-->  <AD_REFERENCE_ID><![CDATA[C3531F85C14B4515AB7259F0D338050D]]></AD_REFERENCE_ID>
 <!--C3531F85C14B4515AB7259F0D338050D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TREENODE.xml	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-db/database/sourcedata/AD_TREENODE.xml	Thu Jun 16 13:56:48 2016 +0200
@@ -121,6 +121,17 @@
 <!--336590D9E14D4C269480543BA8A31321-->  <SEQNO><![CDATA[140]]></SEQNO>
 <!--336590D9E14D4C269480543BA8A31321--></AD_TREENODE>
 
+<!--3754425FEBD3407FAAE48E832F330E5A--><AD_TREENODE>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <AD_TREENODE_ID><![CDATA[3754425FEBD3407FAAE48E832F330E5A]]></AD_TREENODE_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <NODE_ID><![CDATA[68516F327BFE4CDEB2DA255122089917]]></NODE_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <PARENT_ID><![CDATA[800254]]></PARENT_ID>
+<!--3754425FEBD3407FAAE48E832F330E5A-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--3754425FEBD3407FAAE48E832F330E5A--></AD_TREENODE>
+
 <!--3887BEFE9C8C43B892367AA37B0FC04A--><AD_TREENODE>
 <!--3887BEFE9C8C43B892367AA37B0FC04A-->  <AD_TREENODE_ID><![CDATA[3887BEFE9C8C43B892367AA37B0FC04A]]></AD_TREENODE_ID>
 <!--3887BEFE9C8C43B892367AA37B0FC04A-->  <AD_TREE_ID><![CDATA[10]]></AD_TREE_ID>
@@ -4153,7 +4164,7 @@
 <!--8E286E545FC6433F8BADCF02254A8C14-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8E286E545FC6433F8BADCF02254A8C14-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8E286E545FC6433F8BADCF02254A8C14-->  <PARENT_ID><![CDATA[800254]]></PARENT_ID>
-<!--8E286E545FC6433F8BADCF02254A8C14-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--8E286E545FC6433F8BADCF02254A8C14-->  <SEQNO><![CDATA[110]]></SEQNO>
 <!--8E286E545FC6433F8BADCF02254A8C14--></AD_TREENODE>
 
 <!--955B7E22F1B94135A25F867F8DC7A35D--><AD_TREENODE>
--- a/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Thu Jun 16 13:56:48 2016 +0200
@@ -72,6 +72,31 @@
 <!--0AC32C93E78E47FBA10B62CB1AE72303-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
 <!--0AC32C93E78E47FBA10B62CB1AE72303--></OBUIAPP_PARAMETER>
 
+<!--14CEFF8FDC6A4A148BB89C921E5570FA--><OBUIAPP_PARAMETER>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <OBUIAPP_PARAMETER_ID><![CDATA[14CEFF8FDC6A4A148BB89C921E5570FA]]></OBUIAPP_PARAMETER_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <NAME><![CDATA[Ending Date]]></NAME>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <DESCRIPTION><![CDATA[A parameter stating the ending time range related for a specified request, query, etc.]]></DESCRIPTION>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <HELP><![CDATA[The Date To indicates the end date of a range (inclusive)]]></HELP>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <COLUMNNAME><![CDATA[dateto]]></COLUMNNAME>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <AD_ELEMENT_ID><![CDATA[1582]]></AD_ELEMENT_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--14CEFF8FDC6A4A148BB89C921E5570FA--></OBUIAPP_PARAMETER>
+
 <!--19B6A6E74EC8497E956F2EBE96096226--><OBUIAPP_PARAMETER>
 <!--19B6A6E74EC8497E956F2EBE96096226-->  <OBUIAPP_PARAMETER_ID><![CDATA[19B6A6E74EC8497E956F2EBE96096226]]></OBUIAPP_PARAMETER_ID>
 <!--19B6A6E74EC8497E956F2EBE96096226-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -97,6 +122,33 @@
 <!--19B6A6E74EC8497E956F2EBE96096226-->  <EM_OBKMO_WIDGET_CLASS_ID><![CDATA[7EE694CFF8B94B4C9B9CE69C9D292CC4]]></EM_OBKMO_WIDGET_CLASS_ID>
 <!--19B6A6E74EC8497E956F2EBE96096226--></OBUIAPP_PARAMETER>
 
+<!--1AEB6EE93F7842D38F9F2F0835A56483--><OBUIAPP_PARAMETER>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <OBUIAPP_PARAMETER_ID><![CDATA[1AEB6EE93F7842D38F9F2F0835A56483]]></OBUIAPP_PARAMETER_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <NAME><![CDATA[Client]]></NAME>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_REFERENCE_VALUE_ID><![CDATA[45134B97CEF74E27AD2A5D8E8DC8D388]]></AD_REFERENCE_VALUE_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <COLUMNNAME><![CDATA[AD_Client_ID]]></COLUMNNAME>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <DEFAULTVALUE><![CDATA[OB.getContext().getCurrentClient().id]]></DEFAULTVALUE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <AD_ELEMENT_ID><![CDATA[102]]></AD_ELEMENT_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--1AEB6EE93F7842D38F9F2F0835A56483-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--1AEB6EE93F7842D38F9F2F0835A56483--></OBUIAPP_PARAMETER>
+
 <!--1F29EB4AE5C44C789C9895722D8A6AD5--><OBUIAPP_PARAMETER>
 <!--1F29EB4AE5C44C789C9895722D8A6AD5-->  <OBUIAPP_PARAMETER_ID><![CDATA[1F29EB4AE5C44C789C9895722D8A6AD5]]></OBUIAPP_PARAMETER_ID>
 <!--1F29EB4AE5C44C789C9895722D8A6AD5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -148,6 +200,31 @@
 <!--282411DB886F438C90D43C0BFBABFE68-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
 <!--282411DB886F438C90D43C0BFBABFE68--></OBUIAPP_PARAMETER>
 
+<!--39F2F7282EC14B58A10E4FC33F13744F--><OBUIAPP_PARAMETER>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <OBUIAPP_PARAMETER_ID><![CDATA[39F2F7282EC14B58A10E4FC33F13744F]]></OBUIAPP_PARAMETER_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <NAME><![CDATA[Starting Date]]></NAME>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <DESCRIPTION><![CDATA[A parameter stating the starting time range related to a specified request.]]></DESCRIPTION>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <HELP><![CDATA[The Date From indicates the starting date of a range.]]></HELP>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <COLUMNNAME><![CDATA[datefrom]]></COLUMNNAME>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <AD_ELEMENT_ID><![CDATA[1581]]></AD_ELEMENT_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--39F2F7282EC14B58A10E4FC33F13744F-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--39F2F7282EC14B58A10E4FC33F13744F--></OBUIAPP_PARAMETER>
+
 <!--3DA90EDE17724374A90089F096D59949--><OBUIAPP_PARAMETER>
 <!--3DA90EDE17724374A90089F096D59949-->  <OBUIAPP_PARAMETER_ID><![CDATA[3DA90EDE17724374A90089F096D59949]]></OBUIAPP_PARAMETER_ID>
 <!--3DA90EDE17724374A90089F096D59949-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -199,6 +276,32 @@
 <!--439E00644F0647B397201C0C099D60E4-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
 <!--439E00644F0647B397201C0C099D60E4--></OBUIAPP_PARAMETER>
 
+<!--47F7B399D2BA434E861B14D07583173F--><OBUIAPP_PARAMETER>
+<!--47F7B399D2BA434E861B14D07583173F-->  <OBUIAPP_PARAMETER_ID><![CDATA[47F7B399D2BA434E861B14D07583173F]]></OBUIAPP_PARAMETER_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <NAME><![CDATA[Table]]></NAME>
+<!--47F7B399D2BA434E861B14D07583173F-->  <DESCRIPTION><![CDATA[A dictionary table used for this tab that points to the database table.]]></DESCRIPTION>
+<!--47F7B399D2BA434E861B14D07583173F-->  <HELP><![CDATA[The Table indicates the table in which a field or fields reside.]]></HELP>
+<!--47F7B399D2BA434E861B14D07583173F-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_REFERENCE_ID><![CDATA[87E6CFF8F71548AFA33F181C317970B5]]></AD_REFERENCE_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_REFERENCE_VALUE_ID><![CDATA[682B6F47F6B147008D0454FEACB9F4C7]]></AD_REFERENCE_VALUE_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <COLUMNNAME><![CDATA[AD_Table_ID]]></COLUMNNAME>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--47F7B399D2BA434E861B14D07583173F-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--47F7B399D2BA434E861B14D07583173F-->  <AD_ELEMENT_ID><![CDATA[126]]></AD_ELEMENT_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--47F7B399D2BA434E861B14D07583173F-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--47F7B399D2BA434E861B14D07583173F-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--47F7B399D2BA434E861B14D07583173F-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--47F7B399D2BA434E861B14D07583173F-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--47F7B399D2BA434E861B14D07583173F-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--47F7B399D2BA434E861B14D07583173F-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--47F7B399D2BA434E861B14D07583173F--></OBUIAPP_PARAMETER>
+
 <!--490120F2EB114AB08A8377DC50DCAB55--><OBUIAPP_PARAMETER>
 <!--490120F2EB114AB08A8377DC50DCAB55-->  <OBUIAPP_PARAMETER_ID><![CDATA[490120F2EB114AB08A8377DC50DCAB55]]></OBUIAPP_PARAMETER_ID>
 <!--490120F2EB114AB08A8377DC50DCAB55-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -449,6 +552,33 @@
 <!--608B149396C04375B78B0B28681AA53E-->  <EM_OBKMO_WIDGET_CLASS_ID><![CDATA[7EE694CFF8B94B4C9B9CE69C9D292CC4]]></EM_OBKMO_WIDGET_CLASS_ID>
 <!--608B149396C04375B78B0B28681AA53E--></OBUIAPP_PARAMETER>
 
+<!--630B129C43ED4FDAA4A8F9C518FC413D--><OBUIAPP_PARAMETER>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <OBUIAPP_PARAMETER_ID><![CDATA[630B129C43ED4FDAA4A8F9C518FC413D]]></OBUIAPP_PARAMETER_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <NAME><![CDATA[Organization]]></NAME>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_REFERENCE_VALUE_ID><![CDATA[C205D56B07D74778A6D6A1AED8467690]]></AD_REFERENCE_VALUE_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <COLUMNNAME><![CDATA[AD_Org_ID]]></COLUMNNAME>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <FIELDLENGTH><![CDATA[32]]></FIELDLENGTH>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <DEFAULTVALUE><![CDATA['0']]></DEFAULTVALUE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <AD_ELEMENT_ID><![CDATA[113]]></AD_ELEMENT_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--630B129C43ED4FDAA4A8F9C518FC413D-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--630B129C43ED4FDAA4A8F9C518FC413D--></OBUIAPP_PARAMETER>
+
 <!--642AFC2EE03646DBA83C8744F81BA691--><OBUIAPP_PARAMETER>
 <!--642AFC2EE03646DBA83C8744F81BA691-->  <OBUIAPP_PARAMETER_ID><![CDATA[642AFC2EE03646DBA83C8744F81BA691]]></OBUIAPP_PARAMETER_ID>
 <!--642AFC2EE03646DBA83C8744F81BA691-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1074,6 +1204,31 @@
 <!--E22E8E3B737D4A47A691A073951BBF16-->  <C_ATTACHMENT_METHOD_ID><![CDATA[D7B1319FC2B340799283BBF8E838DF9F]]></C_ATTACHMENT_METHOD_ID>
 <!--E22E8E3B737D4A47A691A073951BBF16--></OBUIAPP_PARAMETER>
 
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3--><OBUIAPP_PARAMETER>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <OBUIAPP_PARAMETER_ID><![CDATA[E4AAC9D59BEF4DF4A138D83602D3BEB3]]></OBUIAPP_PARAMETER_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <NAME><![CDATA[Delete existing Accounting Entries]]></NAME>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <DESCRIPTION><![CDATA[The selected accounting entries will be deleted!  DANGEROUS !!!]]></DESCRIPTION>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <HELP><![CDATA[The selected accounting entries will be deleted!  DANGEROUS !!!]]></HELP>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_REFERENCE_ID><![CDATA[20]]></AD_REFERENCE_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <COLUMNNAME><![CDATA[DeletePosting]]></COLUMNNAME>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <AD_ELEMENT_ID><![CDATA[1692]]></AD_ELEMENT_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3-->  <ATT_SHOWINDESCRIPTION><![CDATA[N]]></ATT_SHOWINDESCRIPTION>
+<!--E4AAC9D59BEF4DF4A138D83602D3BEB3--></OBUIAPP_PARAMETER>
+
 <!--EBAC5A44ECF3491A9B4281C8902A3B02--><OBUIAPP_PARAMETER>
 <!--EBAC5A44ECF3491A9B4281C8902A3B02-->  <OBUIAPP_PARAMETER_ID><![CDATA[EBAC5A44ECF3491A9B4281C8902A3B02]]></OBUIAPP_PARAMETER_ID>
 <!--EBAC5A44ECF3491A9B4281C8902A3B02-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Thu Jun 16 13:56:48 2016 +0200
@@ -548,6 +548,26 @@
 <!--C600DAD457664EFDA6B1AA76931552BA-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
 <!--C600DAD457664EFDA6B1AA76931552BA--></OBUIAPP_PROCESS>
 
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC--><OBUIAPP_PROCESS>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <OBUIAPP_PROCESS_ID><![CDATA[C6ED4B93E0D54C08A57072AEEC40E6EC]]></OBUIAPP_PROCESS_ID>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <VALUE><![CDATA[Reset Accounting]]></VALUE>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <NAME><![CDATA[Reset Accounting]]></NAME>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <DESCRIPTION><![CDATA[Reset Accounting Entries]]></DESCRIPTION>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <HELP><![CDATA[The reset accounting process allows to totally or partially remove the ledger entries of an organization. The ledger entries can be massively re-created again by using the "Accounting Server Process" or the "G/L Posting by DB Tables" process. The manual changes done for the accounting entries description will obviously be lost after running this process]]></HELP>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ACCESSLEVEL><![CDATA[3]]></ACCESSLEVEL>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <CLASSNAME><![CDATA[org.openbravo.common.actionhandler.ResetAccountingHandler]]></CLASSNAME>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <UIPATTERN><![CDATA[OBUIAPP_PickAndExecute]]></UIPATTERN>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISMULTIRECORD><![CDATA[N]]></ISMULTIRECORD>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISGRIDLEGACY><![CDATA[N]]></ISGRIDLEGACY>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
+<!--C6ED4B93E0D54C08A57072AEEC40E6EC--></OBUIAPP_PROCESS>
+
 <!--D395B727675C45C98320F8A40E0768E7--><OBUIAPP_PROCESS>
 <!--D395B727675C45C98320F8A40E0768E7-->  <OBUIAPP_PROCESS_ID><![CDATA[D395B727675C45C98320F8A40E0768E7]]></OBUIAPP_PROCESS_ID>
 <!--D395B727675C45C98320F8A40E0768E7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Thu Jun 16 13:56:48 2016 +0200
@@ -68,6 +68,38 @@
 <!--121CCCD7F670457A9FF815163F11A61F-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--121CCCD7F670457A9FF815163F11A61F--></OBUISEL_SELECTOR>
 
+<!--159A0EA5DE8844E9B0E7198E5525C854--><OBUISEL_SELECTOR>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <OBUISEL_SELECTOR_ID><![CDATA[159A0EA5DE8844E9B0E7198E5525C854]]></OBUISEL_SELECTOR_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <NAME><![CDATA[Client Selector]]></NAME>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_REFERENCE_ID><![CDATA[45134B97CEF74E27AD2A5D8E8DC8D388]]></AD_REFERENCE_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <AD_TABLE_ID><![CDATA[112]]></AD_TABLE_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <WHERECLAUSE><![CDATA[e.id=@client@ or e.id='0']]></WHERECLAUSE>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <POPUPTEXTMATCHSTYLE><![CDATA[substring]]></POPUPTEXTMATCHSTYLE>
+<!--159A0EA5DE8844E9B0E7198E5525C854-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--159A0EA5DE8844E9B0E7198E5525C854--></OBUISEL_SELECTOR>
+
+<!--1DB80A7D4BC244F0BE5615702D3BF91C--><OBUISEL_SELECTOR>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <OBUISEL_SELECTOR_ID><![CDATA[1DB80A7D4BC244F0BE5615702D3BF91C]]></OBUISEL_SELECTOR_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <NAME><![CDATA[Legal or Business Organizations Selector]]></NAME>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_REFERENCE_ID><![CDATA[C205D56B07D74778A6D6A1AED8467690]]></AD_REFERENCE_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <AD_TABLE_ID><![CDATA[155]]></AD_TABLE_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <WHERECLAUSE><![CDATA[(e.id='0' OR exists (select 1 from OrganizationType ot where ot.id = e.organizationType.id and (ot.legalEntity=true or ot.businessUnit=true))) AND e.ready=true]]></WHERECLAUSE>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <POPUPTEXTMATCHSTYLE><![CDATA[substring]]></POPUPTEXTMATCHSTYLE>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--1DB80A7D4BC244F0BE5615702D3BF91C--></OBUISEL_SELECTOR>
+
 <!--1E14C66616444E0DA8D5C5321EC9F61B--><OBUISEL_SELECTOR>
 <!--1E14C66616444E0DA8D5C5321EC9F61B-->  <OBUISEL_SELECTOR_ID><![CDATA[1E14C66616444E0DA8D5C5321EC9F61B]]></OBUISEL_SELECTOR_ID>
 <!--1E14C66616444E0DA8D5C5321EC9F61B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -620,6 +652,22 @@
 <!--A48B1462EE7F4C109F06564E0B4677A8-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--A48B1462EE7F4C109F06564E0B4677A8--></OBUISEL_SELECTOR>
 
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12--><OBUISEL_SELECTOR>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <OBUISEL_SELECTOR_ID><![CDATA[ACF43EE5C10F4A83ABCDF1C9F55CDB12]]></OBUISEL_SELECTOR_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <NAME><![CDATA[Table Multi Selector]]></NAME>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_REFERENCE_ID><![CDATA[682B6F47F6B147008D0454FEACB9F4C7]]></AD_REFERENCE_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <AD_TABLE_ID><![CDATA[800039]]></AD_TABLE_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <WHERECLAUSE><![CDATA[e.language=@#AD_LANGUAGE@]]></WHERECLAUSE>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[startsWith]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <POPUPTEXTMATCHSTYLE><![CDATA[substring]]></POPUPTEXTMATCHSTYLE>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--ACF43EE5C10F4A83ABCDF1C9F55CDB12--></OBUISEL_SELECTOR>
+
 <!--B06B003BD6E34FDDAF5DFD5A9ECD14E2--><OBUISEL_SELECTOR>
 <!--B06B003BD6E34FDDAF5DFD5A9ECD14E2-->  <OBUISEL_SELECTOR_ID><![CDATA[B06B003BD6E34FDDAF5DFD5A9ECD14E2]]></OBUISEL_SELECTOR_ID>
 <!--B06B003BD6E34FDDAF5DFD5A9ECD14E2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-test/src/org/openbravo/test/costing/TestCosting.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/src-test/src/org/openbravo/test/costing/TestCosting.java	Thu Jun 16 13:56:48 2016 +0200
@@ -10160,6 +10160,7 @@
             productPriceClone.setListPrice(salesPrice);
           }
           productPriceClone.setProduct(productClone);
+          OBDal.getInstance().save(productPriceClone);
           productClone.getPricingProductPriceList().add(productPriceClone);
           i++;
         }
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/ResetAccountingAccess.class has changed
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/ResetAccountingAccessData.class has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/ResetAccountingAccess.java	Thu Jun 16 13:56:48 2016 +0200
@@ -0,0 +1,47 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.modulescript;
+
+import org.openbravo.modulescript.ModuleScript;
+import org.openbravo.database.ConnectionProvider;
+
+/*
+ * Related to issue: https://issues.openbravo.com/view.php?id=33063
+ */
+public class ResetAccountingAccess extends ModuleScript {
+  @Override
+  public void execute() {
+    try {
+      ConnectionProvider cp = getConnectionProvider();
+      ResetAccountingAccessData.insert(cp);
+    } catch(Exception e) {
+      handleError(e);
+    }
+  }
+
+  @Override
+  protected ModuleScriptExecutionLimits getModuleScriptExecutionLimits() {
+    return new ModuleScriptExecutionLimits("0", null, new OpenbravoVersion(3,0,28839));
+  }
+
+  @Override
+  protected boolean executeOnInstall() {
+    return false;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/ResetAccountingAccess_data.xsql	Thu Jun 16 13:56:48 2016 +0200
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ *************************************************************************
+ * 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) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<SqlClass name="ResetAccountingAccessData" package="org.openbravo.modulescript">
+  <SqlClassComment></SqlClassComment>
+  <SqlMethod name="select" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT '' as exist FROM DUAL
+      ]]>
+    </Sql>
+  </SqlMethod>
+  <SqlMethod name="insert" type="preparedStatement" return="rowcount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        INSERT INTO OBUIAPP_Process_Access
+        (
+          OBUIAPP_Process_Access_ID, OBUIAPP_Process_ID, AD_Role_ID, AD_Client_ID,
+          AD_Org_ID, IsActive, Created, CreatedBy, Updated, UpdatedBy
+        )
+        SELECT
+          get_uuid(), 'C6ED4B93E0D54C08A57072AEEC40E6EC', ad_role_id, ad_client_id,
+          ad_org_id, isactive, to_date(now()), '0', to_date(now()), '0'
+        FROM AD_Process_Access apa
+        WHERE ad_process_id = 'E264309FF8244A94936502BF51829109'
+        AND NOT EXISTS (
+          SELECT 1
+          FROM OBUIAPP_Process_Access opa
+          WHERE opa.ad_role_id = apa.ad_role_id
+          AND opa.obuiapp_process_id = 'C6ED4B93E0D54C08A57072AEEC40E6EC'
+        )
+      ]]>
+    </Sql>
+  </SqlMethod>
+</SqlClass>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/common/actionhandler/ResetAccountingHandler.java	Thu Jun 16 13:56:48 2016 +0200
@@ -0,0 +1,98 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License  is  distributed  on  an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific  language  governing  rights  and  limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2016 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ *************************************************************************
+ */
+package org.openbravo.common.actionhandler;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.commons.lang.StringUtils;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.client.application.process.BaseProcessActionHandler;
+import org.openbravo.erpCommon.utility.OBDateUtils;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.financial.ResetAccounting;
+import org.openbravo.service.db.DbUtility;
+import org.openbravo.service.json.JsonUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class ResetAccountingHandler extends BaseProcessActionHandler {
+
+  private static final Logger log = LoggerFactory.getLogger(ResetAccountingHandler.class);
+
+  @Override
+  protected JSONObject doExecute(Map<String, Object> parameters, String content) {
+
+    JSONObject result = null;
+    try {
+      result = new JSONObject();
+      JSONObject request = new JSONObject(content);
+      JSONObject params = request.getJSONObject("_params");
+
+      String adClientId = params.getString("AD_Client_ID");
+      String adOrgId = params.getString("AD_Org_ID");
+      String deletePosting = params.getString("DeletePosting");
+      String datefrom = StringUtils.equals(params.getString("datefrom"), "null") ? "" : OBDateUtils
+          .formatDate(JsonUtils.createDateFormat().parse(params.getString("datefrom")));
+      String dateto = StringUtils.equals(params.getString("dateto"), "null") ? "" : OBDateUtils
+          .formatDate(JsonUtils.createDateFormat().parse(params.getString("dateto")));
+      JSONArray tableIds = params.getJSONArray("AD_Table_ID");
+      List<String> tableIdsList = new ArrayList<String>();
+      for (int i = 0; i < tableIds.length(); i++) {
+        String tableId = tableIds.getString(i);
+        tableIdsList.add(tableId);
+      }
+
+      HashMap<String, Integer> results = new HashMap<String, Integer>();
+      if (StringUtils.equals(deletePosting, "true")) {
+        results = ResetAccounting.delete(adClientId, adOrgId, tableIdsList, datefrom, dateto);
+      } else {
+        results = ResetAccounting.restore(adClientId, adOrgId, tableIdsList, datefrom, dateto);
+      }
+
+      int counter = results.get("updated");
+      int counterDeleted = results.get("deleted");
+      JSONObject successMessage = new JSONObject();
+      successMessage.put("severity", "success");
+      StringBuilder message = new StringBuilder();
+      message.append(OBMessageUtils.parseTranslation("@UnpostedDocuments@ = " + counter
+          + ", @DeletedEntries@ = " + counterDeleted));
+      successMessage.put("text", message);
+      result.put("message", successMessage);
+
+    } catch (Exception e) {
+      log.error("Error in Reset Accounting Action Handler", e);
+      try {
+        result = new JSONObject();
+        Throwable ex = DbUtility.getUnderlyingSQLException(e);
+        String message = OBMessageUtils.translateError(ex.getMessage()).getMessage();
+        JSONObject errorMessage = new JSONObject();
+        errorMessage.put("severity", "error");
+        errorMessage.put("text", message);
+        result.put("message", errorMessage);
+      } catch (Exception e2) {
+        log.error(e.getMessage(), e2);
+      }
+    }
+    return result;
+  }
+}
\ No newline at end of file
--- a/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/src/org/openbravo/common/datasource/StockReservationPickAndEditDataSource.java	Thu Jun 16 13:56:48 2016 +0200
@@ -150,20 +150,7 @@
 
   private List<Map<String, Object>> getOrderLineSetValueFilterData(Map<String, String> parameters) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-    Map<String, String> filterCriteria = new HashMap<String, String>();
-    try {
-      // Builds the criteria based on the fetch parameters
-      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
-      for (int i = 0; i < criterias.length(); i++) {
-        final JSONObject criteria = criterias.getJSONObject(i);
-        if (criteria.has("fieldName")) {
-          filterCriteria.put(criteria.getString("fieldName"),
-              criteria.has("value") ? criteria.getString("value") : criteria.toString());
-        }
-      }
-    } catch (JSONException e) {
-      log4j.error("Error while building the criteria", e);
-    }
+    Map<String, String> filterCriteria = buildCriteria(parameters);
     OBContext.setAdminMode();
     try {
       for (OrderLine o : getOrderLineFromGrid(filterCriteria.get("orderLine$_identifier"),
@@ -206,18 +193,7 @@
 
   private List<Map<String, Object>> getWarehouseFilterData(Map<String, String> parameters) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-    Map<String, String> filterCriteria = new HashMap<String, String>();
-    try {
-      // Builds the criteria based on the fetch parameters
-      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
-      for (int i = 0; i < criterias.length(); i++) {
-        final JSONObject criteria = criterias.getJSONObject(i);
-        filterCriteria.put(criteria.getString("fieldName"),
-            criteria.has("value") ? criteria.getString("value") : criteria.toString());
-      }
-    } catch (JSONException e) {
-      log4j.error("Error while building the criteria", e);
-    }
+    Map<String, String> filterCriteria = buildCriteria(parameters);
     OBContext.setAdminMode();
     try {
       for (Warehouse o : getWarehouseFromGrid(filterCriteria.get("warehouse$_identifier"),
@@ -342,18 +318,7 @@
 
   private List<Map<String, Object>> getStorageFilterData(Map<String, String> parameters) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-    Map<String, String> filterCriteria = new HashMap<String, String>();
-    try {
-      // Builds the criteria based on the fetch parameters
-      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
-      for (int i = 0; i < criterias.length(); i++) {
-        final JSONObject criteria = criterias.getJSONObject(i);
-        filterCriteria.put(criteria.getString("fieldName"),
-            criteria.has("value") ? criteria.getString("value") : criteria.toString());
-      }
-    } catch (JSONException e) {
-      log4j.error("Error while building the criteria", e);
-    }
+    Map<String, String> filterCriteria = buildCriteria(parameters);
     OBContext.setAdminMode();
     try {
       for (Locator o : getStorageBinFromGrid(filterCriteria.get("storageBin$_identifier"),
@@ -462,20 +427,7 @@
 
   private List<Map<String, Object>> getAttributeSetValueFilterData(Map<String, String> parameters) {
     List<Map<String, Object>> result = new ArrayList<Map<String, Object>>();
-    Map<String, String> filterCriteria = new HashMap<String, String>();
-    try {
-      // Builds the criteria based on the fetch parameters
-      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
-      for (int i = 0; i < criterias.length(); i++) {
-        final JSONObject criteria = criterias.getJSONObject(i);
-        if (criteria.has("fieldName")) {
-          filterCriteria.put(criteria.getString("fieldName"),
-              criteria.has("value") ? criteria.getString("value") : criteria.toString());
-        }
-      }
-    } catch (JSONException e) {
-      log4j.error("Error while building the criteria", e);
-    }
+    Map<String, String> filterCriteria = buildCriteria(parameters);
     OBContext.setAdminMode();
     try {
       for (AttributeSetInstance o : getAttributeSetValueFromGrid(
@@ -531,14 +483,33 @@
         if (criteria.has("criteria") && criteria.has("operator")) {
           JSONArray mySon = new JSONArray(criteria.getString("criteria"));
           for (int j = 0; j < mySon.length(); j++) {
-            if (filterCriteria.containsKey(mySon.getJSONObject(j).getString("fieldName"))) {
-              JSONArray values = new JSONArray(filterCriteria.get(mySon.getJSONObject(j).getString(
-                  "fieldName")));
-              filterCriteria.put(mySon.getJSONObject(j).getString("fieldName"),
-                  values.put(mySon.getJSONObject(j)).toString());
-            } else {
-              filterCriteria.put(mySon.getJSONObject(j).getString("fieldName"), new JSONArray()
-                  .put(mySon.getJSONObject(j)).toString());
+            final JSONObject criteria2 = mySon.getJSONObject(j);
+            if (criteria2.has("criteria") && criteria2.has("operator")) {
+              JSONArray mySonSon = new JSONArray(criteria2.getString("criteria"));
+              for (int k = 0; k < mySonSon.length(); k++) {
+                final JSONObject criteria3 = mySonSon.getJSONObject(k);
+                if (criteria3.has("fieldName")) {
+                  if (filterCriteria.containsKey(criteria3.getString("fieldName"))) {
+                    JSONArray values = new JSONArray(filterCriteria.get(criteria3
+                        .getString("fieldName")));
+                    filterCriteria.put(criteria3.getString("fieldName"), values.put(criteria3)
+                        .toString());
+                  } else {
+                    filterCriteria.put(criteria3.getString("fieldName"),
+                        new JSONArray().put(criteria3).toString());
+                  }
+                }
+              }
+            } else if (criteria2.has("fieldName")) {
+              if (filterCriteria.containsKey(criteria2.getString("fieldName"))) {
+                JSONArray values = new JSONArray(filterCriteria.get(criteria2
+                    .getString("fieldName")));
+                filterCriteria.put(criteria2.getString("fieldName"), values.put(criteria2)
+                    .toString());
+              } else {
+                filterCriteria.put(criteria2.getString("fieldName"), new JSONArray().put(criteria2)
+                    .toString());
+              }
             }
           }
           // lessOrEqual
@@ -1657,6 +1628,44 @@
     return (BigDecimal) query.uniqueResult();
   }
 
+  private Map<String, String> buildCriteria(Map<String, String> parameters) {
+    Map<String, String> filterCriteria = new HashMap<String, String>();
+
+    try {
+      // Builds the criteria based on the fetch parameters
+      JSONArray criterias = (JSONArray) JsonUtils.buildCriteria(parameters).get("criteria");
+      for (int i = 0; i < criterias.length(); i++) {
+        final JSONObject criteria1 = criterias.getJSONObject(i);
+        if (criteria1.has("criteria") && criteria1.has("operator")) {
+          JSONArray mySon = new JSONArray(criteria1.getString("criteria"));
+          for (int j = 0; j < mySon.length(); j++) {
+            final JSONObject criteria2 = mySon.getJSONObject(j);
+            if (criteria2.has("criteria") && criteria2.has("operator")) {
+              JSONArray mySonSon = new JSONArray(criteria2.getString("criteria"));
+              for (int k = 0; k < mySonSon.length(); k++) {
+                final JSONObject criteria3 = mySonSon.getJSONObject(k);
+                if (criteria3.has("fieldName")) {
+                  filterCriteria.put(criteria3.getString("fieldName"),
+                      criteria3.has("value") ? criteria3.getString("value") : criteria3.toString());
+                }
+              }
+            } else if (criteria2.has("fieldName")) {
+              filterCriteria.put(criteria2.getString("fieldName"),
+                  criteria2.has("value") ? criteria2.getString("value") : criteria2.toString());
+            }
+          }
+        } else if (criteria1.has("fieldName")) {
+          filterCriteria.put(criteria1.getString("fieldName"),
+              criteria1.has("value") ? criteria1.getString("value") : criteria1.toString());
+        }
+      }
+    } catch (JSONException e) {
+      log4j.error("Error while building the criteria", e);
+    }
+
+    return filterCriteria;
+  }
+
   @Override
   protected int getCount(Map<String, String> parameters) {
     // TODO Auto-generated method stub
--- a/src/org/openbravo/dal/security/SecurityChecker.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/src/org/openbravo/dal/security/SecurityChecker.java	Thu Jun 16 13:56:48 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-2015 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2016 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -33,6 +33,8 @@
 import org.openbravo.dal.core.DalUtil;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.core.SessionHandler;
+import org.openbravo.model.ad.system.Client;
+import org.openbravo.model.common.enterprise.Organization;
 
 /**
  * This class combines all security checks which are performed on entity level:
@@ -83,51 +85,9 @@
    * @return true if writable, false otherwise
    * @see Entity
    */
-  // NOTE: this method needs to be kept insync with the checkWritable method
   public boolean isWritable(Object obj) {
-
-    // check that the client id and organization id are resp. in the list of
-    // user_client and user_org
-    // TODO: throw specific and translated exception, for more info:
-    // Utility.translateError(this, vars, vars.getLanguage(),
-    // Utility.messageBD(this, "NoWriteAccess", vars.getLanguage()))
-
-    final OBContext obContext = OBContext.getOBContext();
-
-    String clientId = "";
-    if (obj instanceof ClientEnabled && ((ClientEnabled) obj).getClient() != null) {
-      clientId = (String) DalUtil.getId(((ClientEnabled) obj).getClient());
-    }
-    String orgId = "";
-    if (obj instanceof OrganizationEnabled && ((OrganizationEnabled) obj).getOrganization() != null) {
-      orgId = (String) DalUtil.getId(((OrganizationEnabled) obj).getOrganization());
-    }
-
-    final Entity entity = ((BaseOBObject) obj).getEntity();
-    if (!obContext.isInAdministratorMode() && clientId.length() > 0) {
-      if (obj instanceof ClientEnabled) {
-        if (!obContext.getCurrentClient().getId().equals(clientId)) {
-          return false;
-        }
-      }
-
-      // todo can be improved by only checking if the client or
-      // organization
-      // actually changed...
-      if (!obContext.getEntityAccessChecker().isWritable(entity)) {
-        return false;
-      }
-
-      if (obj instanceof OrganizationEnabled && orgId.length() > 0) {
-        if (!obContext.getWritableOrganizations().contains(orgId)) {
-          return false;
-        }
-      }
-    }
-
-    // accesslevel check must also be done for administrators
     try {
-      entity.checkAccessLevel(clientId, orgId);
+      checkWriteAccess(obj, false);
     } catch (final OBSecurityException e) {
       return false;
     }
@@ -142,8 +102,11 @@
    *          the object to check
    * @throws OBSecurityException
    */
-  // NOTE: this method needs to be kept insync with the isWritable method
   public void checkWriteAccess(Object obj) {
+    checkWriteAccess(obj, true);
+  }
+
+  private void checkWriteAccess(Object obj, boolean logError) {
 
     // check that the client id and organization id are resp. in the list of
     // user_client and user_org
@@ -155,10 +118,15 @@
     String clientId = "";
     if (obj instanceof ClientEnabled && ((ClientEnabled) obj).getClient() != null) {
       clientId = (String) DalUtil.getId(((ClientEnabled) obj).getClient());
+    } else if (obj instanceof Client) {
+      clientId = (String) DalUtil.getId(obj);
     }
+
     String orgId = "";
     if (obj instanceof OrganizationEnabled && ((OrganizationEnabled) obj).getOrganization() != null) {
       orgId = (String) DalUtil.getId(((OrganizationEnabled) obj).getOrganization());
+    } else if (obj instanceof Organization) {
+      orgId = (String) DalUtil.getId(obj);
     }
 
     final Entity entity = ((BaseOBObject) obj).getEntity();
@@ -169,21 +137,16 @@
           // TODO: maybe move rollback to exception throwing
           SessionHandler.getInstance().setDoRollback(true);
           throw new OBSecurityException("Client (" + clientId + ") of object (" + obj
-              + ") is not present in ClientList " + obContext.getCurrentClient().getId());
+              + ") is not present in ClientList " + obContext.getCurrentClient().getId(), logError);
         }
       }
 
-      // todo can be improved by only checking if the client or
-      // organization
-      // actually changed...
-      obContext.getEntityAccessChecker().checkWritable(entity);
+      if (!obContext.getEntityAccessChecker().isWritable(entity)) {
+        throw new OBSecurityException("Entity " + entity + " is not writable by this user",
+            logError);
+      }
 
-      if (obj instanceof OrganizationEnabled && orgId != null && orgId.length() > 0) {
-        // todo as only the id is required this can be made much more
-        // efficient
-        // by
-        // not loading the hibernate proxy
-
+      if (orgId != null && orgId.length() > 0) {
         // Due to issue 23419: Impossible to add an organization to one role, it has been necessary
         // to add the below check. The system is going to check if it can avoid the permission
         // during the record insertion. The application is allowed to avoid the permission when the
@@ -197,7 +160,8 @@
           // TODO: maybe move rollback to exception throwing
           SessionHandler.getInstance().setDoRollback(true);
           throw new OBSecurityException("Organization " + orgId + " of object (" + obj
-              + ") is not present in OrganizationList " + obContext.getWritableOrganizations());
+              + ") is not present in OrganizationList " + obContext.getWritableOrganizations(),
+              logError);
         }
       }
     }
--- a/src/org/openbravo/erpCommon/ad_process/ResetAccountingProcess.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/src/org/openbravo/erpCommon/ad_process/ResetAccountingProcess.java	Thu Jun 16 13:56:48 2016 +0200
@@ -11,15 +11,18 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2013 Openbravo SLU
+ * All portions are Copyright (C) 2013-2016 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
  */
 package org.openbravo.erpCommon.ad_process;
 
+import java.util.Arrays;
 import java.util.HashMap;
+import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.Utility;
@@ -28,6 +31,12 @@
 import org.openbravo.service.db.DalBaseProcess;
 import org.quartz.JobExecutionException;
 
+/**
+ * 
+ * @deprecated use {@link org.openbravo.common.actionhandler.ResetAccountingHandler}
+ * 
+ */
+@Deprecated
 public class ResetAccountingProcess extends DalBaseProcess {
 
   public void doExecute(ProcessBundle bundle) throws Exception {
@@ -44,11 +53,8 @@
         results = ResetAccounting
             .delete(adClientId, adOrgId, adTableId, recordId, datefrom, dateto);
       } else {
-        if (!"".equals(adTableId)) {
-          results = ResetAccounting.restore(adClientId, adOrgId, adTableId, datefrom, dateto);
-        } else {
-          results = ResetAccounting.restore(adClientId, adOrgId, datefrom, dateto);
-        }
+        List<String> tableIds = StringUtils.isEmpty(adTableId) ? null : Arrays.asList(adTableId);
+        results = ResetAccounting.restore(adClientId, adOrgId, tableIds, datefrom, dateto);
       }
       int counter = results.get("updated");
       int counterDeleted = results.get("deleted");
--- a/src/org/openbravo/financial/ResetAccounting.java	Thu Jun 16 12:54:00 2016 +0200
+++ b/src/org/openbravo/financial/ResetAccounting.java	Thu Jun 16 13:56:48 2016 +0200
@@ -27,6 +27,8 @@
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.log4j.Logger;
 import org.hibernate.Query;
 import org.hibernate.ScrollMode;
@@ -42,6 +44,7 @@
 import org.openbravo.model.ad.datamodel.Table;
 import org.openbravo.model.ad.system.Client;
 import org.openbravo.model.common.enterprise.Organization;
+import org.openbravo.model.common.enterprise.OrganizationType;
 import org.openbravo.model.financialmgmt.accounting.AccountingFact;
 import org.openbravo.model.financialmgmt.calendar.Period;
 
@@ -49,6 +52,24 @@
   final static int FETCH_SIZE = 1000;
   private static final Logger log4j = Logger.getLogger(ResetAccounting.class);
 
+  public static HashMap<String, Integer> delete(String adClientId, String adOrgId,
+      List<String> tableIds, String strdatefrom, String strdateto) throws OBException {
+    if (tableIds.isEmpty()) {
+      return delete(adClientId, adOrgId, "", null, strdatefrom, strdateto);
+    } else {
+      HashMap<String, Integer> results = new HashMap<String, Integer>();
+      results.put("deleted", 0);
+      results.put("updated", 0);
+      for (String tableId : tableIds) {
+        HashMap<String, Integer> partial = delete(adClientId, adOrgId, tableId, null, strdatefrom,
+            strdateto);
+        results.put("deleted", results.get("deleted") + partial.get("deleted"));
+        results.put("updated", results.get("updated") + partial.get("updated"));
+      }
+      return results;
+    }
+  }
+
   @SuppressWarnings("unchecked")
   public static HashMap<String, Integer> delete(String adClientId, String adOrgId,
       String adTableId, String recordId, String strdatefrom, String strdateto) throws OBException {
@@ -70,7 +91,8 @@
     String client = adClientId;
     List<String> tables = getTables(adTableId);
     try {
-      Set<String> orgIds = new OrganizationStructureProvider().getChildTree(adOrgId, true);
+      Set<String> orgIds = StringUtils.equals(adOrgId, "0") ? getLegalOrBusinessOrgsChilds(client)
+          : new OrganizationStructureProvider().getChildTree(adOrgId, true);
       for (String table : tables) {
         List<String> docbasetypes = getDocbasetypes(client, table, localRecordId);
         String myQuery = "select distinct e.recordID from FinancialMgmtAccountingFact e where e.organization.id in (:orgIds) and e.client.id = :clientId and e.table.id = :tableId";
@@ -85,7 +107,6 @@
           // organizationPeriodControl: hashmap with organizations and their organization allow
           // period control associated
           Map<String, String> organizationPeriodControl = new HashMap<String, String>();
-          String calendarId = getCalendarId(adOrgId);
 
           String myQuery1 = "select ad_org_id, ad_org_getperiodcontrolallow(ad_org_id) from ad_org where ad_org_id in (:orgIds)";
           Query query1 = OBDal.getInstance().getSession().createSQLQuery(myQuery1);
@@ -101,8 +122,9 @@
               if (orgperiodcontrol != null) {
                 organizationPeriodControl.put(organization, orgperiodcontrol);
                 if (!organizationPeriod.keySet().contains(orgperiodcontrol)) {
-                  periods = getPeriodsDates(getOpenPeriods(client, dbt, orgIds, calendarId, table,
-                      localRecordId, strdatefrom, strdateto, orgperiodcontrol));
+                  periods = getPeriodsDates(getOpenPeriods(client, dbt, orgIds,
+                      getCalendarId(organization), table, localRecordId, strdatefrom, strdateto,
+                      orgperiodcontrol));
                   organizationPeriod.put(orgperiodcontrol, periods);
                 }
               }
@@ -166,8 +188,8 @@
               // all
               // dates are within an open period
               HashMap<String, Integer> partial = treatExceptions(exceptionsSql, localRecordId,
-                  table, orgIds, client, p[0], p[1], calendarId, strdatefrom, strdateto, dbt,
-                  orgAllow, organization);
+                  table, orgIds, client, p[0], p[1], getCalendarId(organization), strdatefrom,
+                  strdateto, dbt, orgAllow, organization);
               deleted = deleted + partial.get("deleted");
               updated = updated + partial.get("updated");
               docUpdated = docUpdated + partial.get("updated");
@@ -294,15 +316,21 @@
 
   public static HashMap<String, Integer> restore(String clientId, String adOrgId, String datefrom,
       String dateto) throws OBException {
+    List<String> tableIds = null;
+    return restore(clientId, adOrgId, tableIds, datefrom, dateto);
+  }
+
+  public static HashMap<String, Integer> restore(String clientId, String adOrgId,
+      List<String> tableIds, String datefrom, String dateto) throws OBException {
     HashMap<String, Integer> results = new HashMap<String, Integer>();
     results.put("deleted", 0);
     results.put("updated", 0);
-    List<String> tableIds = getActiveTables(clientId, adOrgId);
-    for (String tableId : tableIds) {
+    List<String> tableIdList = CollectionUtils.isEmpty(tableIds) ? getActiveTables(clientId,
+        adOrgId) : tableIds;
+    for (String tableId : tableIdList) {
       HashMap<String, Integer> partial = restore(clientId, adOrgId, tableId, datefrom, dateto);
       results.put("deleted", results.get("deleted") + partial.get("deleted"));
       results.put("updated", results.get("updated") + partial.get("updated"));
-
     }
     return results;
   }
@@ -598,4 +626,31 @@
     count = ((Long) query.list().get(0)).intValue();
     return (count == 1);
   }
+
+  @SuppressWarnings("unchecked")
+  private static Set<String> getLegalOrBusinessOrgsChilds(String clientId) {
+    StringBuffer hql = new StringBuffer();
+    hql = new StringBuffer();
+    hql.append(" select o1." + Organization.PROPERTY_ID);
+    hql.append(" from " + Organization.ENTITY_NAME + " as o1");
+    hql.append(" , " + Organization.ENTITY_NAME + " as o2");
+    hql.append(" join o2." + Organization.PROPERTY_ORGANIZATIONTYPE + " as ot");
+    hql.append(" where o1." + Organization.PROPERTY_CLIENT + ".id = :clientId");
+    hql.append(" and o2." + Organization.PROPERTY_CLIENT + ".id = :clientId");
+    hql.append(" and ad_isorgincluded(o1." + Organization.PROPERTY_ID + ", o2."
+        + Organization.PROPERTY_ID + ", o1." + Organization.PROPERTY_CLIENT + ".id) <> -1");
+    hql.append(" and (ot." + OrganizationType.PROPERTY_LEGALENTITY + " = true");
+    hql.append(" or ot." + OrganizationType.PROPERTY_BUSINESSUNIT + " = true)");
+    hql.append(" and o1." + Organization.PROPERTY_ACTIVE + " = true");
+    hql.append(" and o1." + Organization.PROPERTY_READY + " = true");
+    hql.append(" and o2." + Organization.PROPERTY_ACTIVE + " = true");
+    hql.append(" and o2." + Organization.PROPERTY_READY + " = true");
+    hql.append(" order by o2." + Organization.PROPERTY_NAME);
+    hql.append(" , ad_isorgincluded(o1." + Organization.PROPERTY_ID + ", o2."
+        + Organization.PROPERTY_ID + ", o1." + Organization.PROPERTY_CLIENT + ".id)");
+    hql.append(" , o1." + Organization.PROPERTY_NAME);
+    Query query = OBDal.getInstance().getSession().createQuery(hql.toString());
+    query.setParameter("clientId", clientId);
+    return new HashSet<String>(query.list());
+  }
 }