Related with bug 25811: Merge with pi
authorAugusto Mauch <augusto.mauch@openbravo.com>
Wed, 19 Nov 2014 19:11:32 +0100
changeset 25293 3221fd5a8661
parent 25292 c5de0b748930 (current diff)
parent 25264 bae727490668 (diff)
child 25294 130e3a63dcc2
Related with bug 25811: Merge with pi
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js
modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java
--- a/build.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/build.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -994,93 +994,23 @@
     <ant dir="src-util/diagnostic" antfile="build-create.xml" target="build" />
     <ant dir="src-util/diagnostic" target="check.all" />
   </target>
-
-  <target name="setup.check.os">
-    <condition property="osname" value="linux">
-      <equals arg1="${os.name}" arg2="Linux" />
-    </condition>
-    <condition property="osname" value="freebsd6">
-      <equals arg1="${os.name}" arg2="FreeBSD" />
-    </condition>
-    <condition property="osname" value="windows">
-      <contains string="${os.name}" substring="Windows" />
-    </condition>
-    <condition property="osname" value="osx">
-      <contains string="${os.name}" substring="OS X" />
-    </condition>
-    <condition property="osname" value="solaris">
-      <or>
-        <contains string="${os.name}" substring="Solaris" />
-        <contains string="${os.name}" substring="SunOS" />
-      </or>
-    </condition>
-    <condition property="osname" value="openbsd">
-      <equals arg1="${os.name}" arg2="OpenBSD" />
-    </condition>
-    <condition property="osname" value="aix">
-      <equals arg1="${os.name}" arg2="AIX" />
-    </condition>
-    <condition property="osname" value="hpux">
-      <equals arg1="${os.name}" arg2="HPUX" />
-    </condition>
+  
+  <target name="setup.compile">
+          <echo message="Compiling application configuration classes..." />
+	   <mkdir dir="build/classes" />
+          <javac srcdir="src/org/openbravo/configuration" destdir="build/classes" includeantruntime="false">
+             <classpath refid="project.class.path"/>  
+          </javac>
   </target>
 
-  <target name="setup.check.arch">
-    <condition property="osarch" value="">
-      <or>
-        <equals arg1="${os.arch}" arg2="x86" />
-        <equals arg1="${os.arch}" arg2="i386" />
-        <contains string="${os.name}" substring="Windows" />
-        <contains string="${os.name}" substring="OS X" />
-      </or>
-    </condition>
-    <condition property="osarch" value="-x64">
-      <or>
-        <equals arg1="${os.arch}" arg2="amd64" />
-        <equals arg1="${os.arch}" arg2="x86_64" />
-        <not>
-          <contains string="${os.name}" substring="Windows" />
-        </not>
-        <not>
-          <contains string="${os.name}" substring="OS X" />
-        </not>
-      </or>
-    </condition>
-    <condition property="osarch" value="-ia64">
-      <equals arg1="${os.arch}" arg2="ia64" />
-    </condition>
-    <condition property="osarch" value="-sparc">
-      <equals arg1="${os.arch}" arg2="sparc" />
-    </condition>
-    <condition property="osarch" value="-ppc">
-      <equals arg1="${os.arch}" arg2="ppc" />
-    </condition>
-  </target>
-
-  <target name="setup.exists.test">
-    <condition property="bin.ext" value="exe">
-      <os family="windows" />
-    </condition>
-
-    <condition property="bin.ext" value="app.tar.gz">
-      <os family="mac" />
-    </condition>
-
-    <condition property="bin.ext" value="bin">
-      <not>
-        <isset property="${bin.ext}" />
-      </not>
-    </condition>
-
-    <available file="config/setup-properties-${osname}${osarch}.${bin.ext}" property="setup.exists" value="true" />
-  </target>
-
-  <target name="setup" depends="setup.check.os, setup.check.arch, setup.exists.test" unless="setup.exists">
-    <get src="https://code.openbravo.com/tools/rm/erp-setup-tool/raw-file/tip/setup/output/setup-properties-${osname}${osarch}.${bin.ext}" dest="config/setup-properties-${osname}${osarch}.${bin.ext}" verbose="true" />
-
-    <chmod file="config/setup-properties-${osname}${osarch}.${bin.ext}" perm="+x" />
-  </target>
-
+  <target name="setup" depends="setup.compile">    
+      <echo message="Launching configuration application..."/>
+      <taskdef name="configurationApp" classname="org.openbravo.configuration.ConfigurationApp">
+        <classpath refid="project.class.path" />
+      </taskdef>
+      <configurationApp/>
+    </target>
+  
   <target name="package.core" depends="init, set.version.number">
 	<property name="tmpdir" value="${java.io.tmpdir}/ob.core${core.rev}" />
    
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java	Wed Nov 19 19:11:32 2014 +0100
@@ -153,7 +153,23 @@
             return;
           }
         }
+        // check BP currency
+        if ("CO".equals(strdocaction)) {
+            // check BP currency
+            if (invoice.getBusinessPartner().getCurrency() == null) {
+            	String errorMSG =  
+            			Utility.messageBD(this, "InitBPCurrencyLnk", vars.getLanguage(), false);
+               msg = new OBError();
+               msg.setType("Error");
+               msg.setTitle(Utility.messageBD(this, "Error", vars.getLanguage()));
+               msg.setMessage(String.format(errorMSG, invoice.getBusinessPartner().getId(), invoice.getBusinessPartner().getName()));
 
+               vars.setMessage(strTabId, msg);
+               printPageClosePopUp(response, vars, Utility.getTabURL(strTabId, "R", true));
+               return;
+            }
+        }
+        
         OBContext.setAdminMode(true);
         Process process = null;
         try {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/hqlinjections/AddPaymentOrderInvoicesTransformer.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/hqlinjections/AddPaymentOrderInvoicesTransformer.java	Wed Nov 19 19:11:32 2014 +0100
@@ -109,7 +109,7 @@
     return transformedHql;
   }
 
-  private StringBuffer getSelectClause(String transactionType, boolean hasSelectedIds) {
+  protected StringBuffer getSelectClause(String transactionType, boolean hasSelectedIds) {
     StringBuffer selectClause = new StringBuffer();
     // Create Select Clause
     selectClause.append(getAggregatorFunction("psd.id") + " as paymentScheduleDetail, ");
@@ -161,7 +161,7 @@
     return selectClause;
   }
 
-  private StringBuffer getWhereClause(String transactionType,
+  protected StringBuffer getWhereClause(String transactionType,
       Map<String, String> requestParameters, List<String> selectedPSDs) {
     String strBusinessPartnerId = requestParameters.get("received_from");
     String strFinPaymentId = requestParameters.get("fin_payment_id");
@@ -244,7 +244,7 @@
 
   }
 
-  private StringBuffer getGroupByClause(String transactionType) {
+  protected StringBuffer getGroupByClause(String transactionType) {
     StringBuffer groupByClause = new StringBuffer();
     // Create GroupBy Clause
     if ("I".equals(transactionType)) {
@@ -279,7 +279,7 @@
    * @param transactionType
    * @return
    */
-  private StringBuffer getOrderByClause(String transactionType, List<String> selectedPSDs,
+  protected StringBuffer getOrderByClause(String transactionType, List<String> selectedPSDs,
       Map<String, String> requestParameters) {
     StringBuffer orderByClause = new StringBuffer();
     if (selectedPSDs.size() == 0) {
@@ -321,7 +321,7 @@
     return orderByClause;
   }
 
-  private String removeGridFilters(String _hqlQuery) {
+  protected String removeGridFilters(String _hqlQuery) {
     String hqlQuery = _hqlQuery;
     // Get the substring of grid filter inside where clause, if transaction type is "Orders" or
     // "Invoices", put in the having clause
@@ -343,7 +343,7 @@
    * @param queryNamedParameters
    * @return
    */
-  private String calculateHavingClause(String _hqlQuery, String transactionType,
+  protected String calculateHavingClause(String _hqlQuery, String transactionType,
       JSONObject criteria, Map<String, Object> queryNamedParameters) {
     String hqlQuery = _hqlQuery;
     StringBuffer havingClause = new StringBuffer();
@@ -470,7 +470,8 @@
    * @param orderByClause
    * @return
    */
-  private String appendOrderByClause(String _hqlQuery, StringBuffer orderByClause, boolean justCount) {
+  protected String appendOrderByClause(String _hqlQuery, StringBuffer orderByClause,
+      boolean justCount) {
     String hqlQuery = _hqlQuery;
     if (!justCount) {
       if (hqlQuery.contains(" ORDER BY ")) {
@@ -483,7 +484,7 @@
     return hqlQuery;
   }
 
-  private void transformCriteria(JSONObject buildCriteria, List<String> selectedPSDs)
+  protected void transformCriteria(JSONObject buildCriteria, List<String> selectedPSDs)
       throws JSONException {
     JSONArray criteriaArray = buildCriteria.getJSONArray("criteria");
     JSONArray newCriteriaArray = new JSONArray();
@@ -509,14 +510,14 @@
    * @param expression
    * @return
    */
-  private String getAggregatorFunction(String expression) {
+  protected String getAggregatorFunction(String expression) {
     return " hqlagg(" + expression + ")";
   }
 
   /**
    * @see HQLDataSourceService#replaceParametersWithAlias(Table, String)
    */
-  private String replaceParametersWithAlias(Table table, String whereClause) {
+  protected String replaceParametersWithAlias(Table table, String whereClause) {
     if (whereClause.trim().isEmpty()) {
       return whereClause;
     }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Wed Nov 19 19:11:32 2014 +0100
@@ -415,6 +415,18 @@
                         .getInvoicePaymentSchedule().getInvoice() : null;
                     paidAmount = BigDecimal.ZERO;
                     String fromCurrency = payment.getCurrency().getId();
+                    if (businessPartner.getCurrency() == null) {
+                    	String errorMSG = 
+                    			Utility.messageBD(conProvider, "InitBPCurrencyLnk", language, false);
+                    	
+                    	 msg.setType("Error");
+                         msg.setTitle(Utility.messageBD(conProvider, "Error", language));
+                         msg.setMessage(String.format(errorMSG, businessPartner.getId(), businessPartner.getName()));
+                         bundle.setResult(msg);
+                         OBDal.getInstance().rollbackAndClose();
+                         return;
+                    	
+                    }
                     String toCurrency = businessPartner.getCurrency().getId();
                     if (!fromCurrency.equals(toCurrency)) {
                       BigDecimal exchangeRate = BigDecimal.ZERO;
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/formitem/ob-formitem-fk-filter.js	Wed Nov 19 19:11:32 2014 +0100
@@ -298,7 +298,8 @@
 
     if (this.form.grid.sourceWidget.lazyFiltering) {
       // Fetch the criteria from the current values of the filter editor
-      gridCriteria = this.form.grid.getValues();
+      // Invoke the convertCriteria function to filter by the record selected in the parent tab if needed
+      gridCriteria = this.grid.sourceWidget.convertCriteria(this.form.grid.getValues());
     } else {
       gridCriteria = this.form.grid.sourceWidget.getCriteria();
     }
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js	Wed Nov 19 19:11:32 2014 +0100
@@ -1066,7 +1066,8 @@
           delete field.textField._textChanged;
         }
       } else if (isDateTime) {
-        jsDateTime = isc.Date.parseStandardDate(columnValue.value);
+        // FIC returns date-time in UTC
+        jsDateTime = isc.Date.parseSchemaDate(columnValue.value);
         this.setItemValue(field.name, jsDateTime);
         if (field.textField) {
           delete field.textField._textChanged;
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-grid.js	Wed Nov 19 19:11:32 2014 +0100
@@ -697,7 +697,9 @@
           if (!this._iconEnabled) {
             return;
           }
-          if (grid.filterHasChanged) {
+          if (grid.filterHasChanged || grid.filterClauseJustRemoved) {
+            // the filter clause can only be removed once
+            delete grid.filterClauseJustRemoved;
             // Do not change the sorting after receiving the data from the datasource
             grid._filteringAndSortingManually = true;
             grid.filterEditor.performFilter(true, true);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/main/ob-standard-view.js	Wed Nov 19 19:11:32 2014 +0100
@@ -2498,6 +2498,10 @@
             if (propertyObj.type && convertToClassicFormat) {
               type = isc.SimpleType.getType(propertyObj.type);
               if (type.createClassicString) {
+                if (type.editorType === 'OBDateTimeItem') {
+                  // converting time to UTC before it is sent to FIC
+                  value = OB.Utilities.Date.addTimezoneOffset(value);
+                }
                 contextInfo[properties[i].inpColumn] = type.createClassicString(value);
               } else {
                 contextInfo[properties[i].inpColumn] = this.convertContextValue(value, propertyObj.type);
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js	Wed Nov 19 19:11:32 2014 +0100
@@ -572,6 +572,10 @@
   },
 
   clearFilter: function () {
+    if (this.lazyFiltering && this.filterClause) {
+      // store that the filter has been removed to enable showing potential new records
+      this.filterClauseJustRemoved = true;
+    }
     this.filterClause = null;
     this._cleaningFilter = true;
     this.contentView.messageBar.hide();
@@ -876,6 +880,11 @@
     } else {
       this.Super('getMinFieldWidth', arguments);
     }
+  },
+
+  refreshGrid: function () {
+    // fetch the data with the current criteria and context info
+    this.filterData(this.getCriteria(), null, this.getContextInfo());
   }
 
 });
\ No newline at end of file
--- a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js	Wed Nov 19 19:11:32 2014 +0100
@@ -213,7 +213,8 @@
   loadingLayout.addMember(isc.Label.create({
     contents: label,
     styleName: OB.Styles.LoadingPrompt.loadingTextStyleName,
-    width: 1,
+    width: 100,
+    align: 'right',
     overflow: 'visible'
   }));
   loadingLayout.addMember(isc.Img.create(OB.Styles.LoadingPrompt.loadingImage));
--- a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/DateTimeUIDefinition.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/reference/DateTimeUIDefinition.java	Wed Nov 19 19:11:32 2014 +0100
@@ -11,14 +11,17 @@
  * 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-2012 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2014 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
 package org.openbravo.client.kernel.reference;
 
+import java.text.FieldPosition;
+import java.text.ParseException;
 import java.text.SimpleDateFormat;
+import java.util.Calendar;
 import java.util.Date;
 
 import org.openbravo.base.exception.OBException;
@@ -33,6 +36,7 @@
 public class DateTimeUIDefinition extends DateUIDefinition {
   private String lastUsedPattern = null;
   private SimpleDateFormat dateFormat = null;
+  private static final SimpleDateFormat ficDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 
   @Override
   public String getParentType() {
@@ -49,6 +53,42 @@
   }
 
   @Override
+  public String convertToClassicString(Object value) {
+    if (value == null || value == "") {
+      return "";
+    }
+
+    if (value instanceof String) {
+      return (String) value;
+    }
+
+    StringBuffer convertedValue = convertLocalTimeToUTC(value.toString());
+    return convertedValue.toString();
+  }
+
+  private StringBuffer convertLocalTimeToUTC(String value) {
+    StringBuffer localTimeColumnValue = null;
+    try {
+      Date UTCDate = ficDateFormat.parse(value);
+      Calendar now = Calendar.getInstance();
+
+      Calendar calendar = Calendar.getInstance();
+      calendar.setTime(UTCDate);
+      calendar.set(Calendar.DATE, now.get(Calendar.DATE));
+      calendar.set(Calendar.MONTH, now.get(Calendar.MONTH));
+      calendar.set(Calendar.YEAR, now.get(Calendar.YEAR));
+
+      int gmtMillisecondOffset = (now.get(Calendar.ZONE_OFFSET) + now.get(Calendar.DST_OFFSET));
+      calendar.add(Calendar.MILLISECOND, -gmtMillisecondOffset);
+      localTimeColumnValue = getClassicFormat().format(calendar.getTime(), new StringBuffer(),
+          new FieldPosition(0));
+    } catch (ParseException e) {
+      throw new OBException("Exception when parsing date ", e);
+    }
+    return localTimeColumnValue;
+  }
+
+  @Override
   protected SimpleDateFormat getClassicFormat() {
     String pattern = RequestContext.get().getSessionAttribute("#AD_JavaDateTimeFormat").toString();
     if (dateFormat == null || !pattern.equals(lastUsedPattern)) {
@@ -68,7 +108,13 @@
       if (value.contains("T")) {
         return value;
       }
+      Calendar now = Calendar.getInstance();
       final Date date = getClassicFormat().parse(value);
+      Calendar calendar = Calendar.getInstance();
+      calendar.setTime(date);
+      // Applies the zone offset and the dst offset to convert the time from local to UTC
+      int gmtMillisecondOffset = (now.get(Calendar.ZONE_OFFSET) + now.get(Calendar.DST_OFFSET));
+      calendar.add(Calendar.MILLISECOND, -gmtMillisecondOffset);
       return ((PrimitiveDomainType) getDomainType()).convertToString(date);
     } catch (Exception e) {
       throw new OBException(e);
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/DataSourceServiceProvider.java	Wed Nov 19 19:11:32 2014 +0100
@@ -26,6 +26,7 @@
 
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.base.exception.OBException;
+import org.openbravo.base.model.Entity;
 import org.openbravo.base.model.ModelProvider;
 import org.openbravo.base.util.OBClassLoader;
 import org.openbravo.base.weld.WeldUtils;
@@ -54,63 +55,124 @@
    * Checks the internal cache for a datasource with the requested name and returns it if found. If
    * not found a new one is created, which is cached and then returned.
    * 
-   * @param name
+   * @param dataSourceIdentifier
    *          the name by which to search and identify the data source.
    * @return a {@link DataSourceService} object
    */
-  @SuppressWarnings("unchecked")
-  public DataSourceService getDataSource(String name) {
-    DataSourceService ds = dataSources.get(name);
-    if (ds == null) {
+  public DataSourceService getDataSource(String dataSourceIdentifier) {
+    DataSourceService dataSourceService = dataSources.get(dataSourceIdentifier);
+    if (dataSourceService == null) {
       OBContext.setAdminMode();
       try {
-        DataSource dataSource = OBDal.getInstance().get(DataSource.class, name);
-        if (dataSource == null) {
-
-          final OBCriteria<DataSource> obCriteria = OBDal.getInstance().createCriteria(
-              DataSource.class);
-          obCriteria.add(Restrictions.eq(DataSource.PROPERTY_NAME, name));
-          if (!obCriteria.list().isEmpty()) {
-            dataSource = obCriteria.list().get(0);
-          }
-        }
-        if (dataSource == null) {
-          final OBCriteria<Table> qTable = OBDal.getInstance().createCriteria(Table.class);
-          qTable.add(Restrictions.eq(Table.PROPERTY_NAME, name));
-          if (!qTable.list().isEmpty()) {
-            Table table = (Table) qTable.list().get(0);
-            if (ApplicationConstants.DATASOURCEBASEDTABLE.equals(table.getDataOriginType())) {
-              dataSource = table.getObserdsDatasource();
-              ds.setEntity(ModelProvider.getInstance().getEntityByTableId(table.getId()));
-            } else if (ApplicationConstants.HQLBASEDTABLE.equals(table.getDataOriginType())) {
-              dataSource = OBDal.getInstance().get(DataSource.class,
-                  ApplicationConstants.HQL_TABLE_DATASOURCE_ID);
-            }
-          }
-          if (dataSource == null) {
-            ds = weldUtils.getInstance(DefaultDataSourceService.class);
-            ds.setName(name);
-            ds.setEntity(ModelProvider.getInstance().getEntity(name));
-            dataSources.put(name, ds);
-          }
-
-        } else {
-          if (dataSource.getJavaClassName() != null) {
-            final Class<DataSourceService> clz = (Class<DataSourceService>) OBClassLoader
-                .getInstance().loadClass(dataSource.getJavaClassName());
-            ds = weldUtils.getInstance(clz);
-          } else {
-            ds = new DefaultDataSourceService();
-          }
-          ds.setDataSource(dataSource);
-          dataSources.put(name, ds);
-        }
+        DataSource dataSource = getRealDataSource(dataSourceIdentifier);
+        dataSourceService = getDataSourceServiceFromDataSource(dataSource, dataSourceIdentifier);
+        dataSources.put(dataSourceIdentifier, dataSourceService);
       } catch (Exception e) {
         throw new OBException(e);
       } finally {
         OBContext.restorePreviousMode();
       }
     }
+    return dataSourceService;
+  }
+
+  /**
+   * Obtains a dataSource given a dataSource identifier.
+   * 
+   * This class should have been named getDataSource instead of getRealDataSource, but the name was
+   * already taken by a public method that returns a DataSourceService
+   * 
+   * @param dataSourceIdentifier
+   *          a string that identifies the dataSource. it can be either the ID of the DataSource,
+   *          the name of the DataSource or the name of the Table whose datasource is to be
+   *          retrieved
+   * @return the datasource associated with the provided identifier or null if there aren't any
+   */
+  private DataSource getRealDataSource(String dataSourceIdentifier) {
+    // Checks if the dataSourceIdentifier the ID of the DataSource
+    DataSource dataSource = getDataSourceFromDataSourceId(dataSourceIdentifier);
+    if (dataSource == null) {
+      // If it is not the ID of the DataSource, checks if it is its name
+      dataSource = getDataSourceFromDataSourceName(dataSourceIdentifier);
+      if (dataSource == null) {
+        // If the dataSourceIdentifier is not the DataSource ID nor its name, checks if it is the
+        // name of a Table
+        dataSource = getDataSourceFromTableName(dataSourceIdentifier);
+      }
+    }
+    return dataSource;
+  }
+
+  private DataSource getDataSourceFromDataSourceId(String dataSourceId) {
+    return OBDal.getInstance().get(DataSource.class, dataSourceId);
+  }
+
+  private DataSource getDataSourceFromDataSourceName(String dataSourceName) {
+    DataSource dataSource = null;
+    final OBCriteria<DataSource> obCriteria = OBDal.getInstance().createCriteria(DataSource.class);
+    obCriteria.add(Restrictions.eq(DataSource.PROPERTY_NAME, dataSourceName));
+    if (!obCriteria.list().isEmpty()) {
+      dataSource = obCriteria.list().get(0);
+    }
+    return dataSource;
+  }
+
+  private DataSource getDataSourceFromTableName(String tableName) {
+    DataSource dataSource = null;
+    final OBCriteria<Table> qTable = OBDal.getInstance().createCriteria(Table.class);
+    qTable.add(Restrictions.eq(Table.PROPERTY_NAME, tableName));
+    if (!qTable.list().isEmpty()) {
+      Table table = (Table) qTable.list().get(0);
+      if (ApplicationConstants.DATASOURCEBASEDTABLE.equals(table.getDataOriginType())) {
+        // If the table is based on a manual datasource, return that particular datasource
+        dataSource = table.getObserdsDatasource();
+      } else if (ApplicationConstants.HQLBASEDTABLE.equals(table.getDataOriginType())) {
+        // If the table is based on a HQL table, use the 'HQL Tables Datasource'
+        dataSource = OBDal.getInstance().get(DataSource.class,
+            ApplicationConstants.HQL_TABLE_DATASOURCE_ID);
+      }
+    }
+    return dataSource;
+  }
+
+  /**
+   * Returns a DataSourceService given a DataSource
+   * 
+   * @param dataSource
+   *          the dataSource whose DataSourceService is to be retrieved
+   * @param dataSourceIdentifier
+   *          the name that was used to retrieve the dataSource
+   * @return the DataSourceService associated with the provided DataSource, or the
+   *         DefaultDataSourceService otherwise
+   * @throws ClassNotFoundException
+   */
+  private DataSourceService getDataSourceServiceFromDataSource(DataSource dataSource,
+      String dataSourceIdentifier) throws ClassNotFoundException {
+    DataSourceService ds = null;
+    if (dataSource == null) {
+      // if no dataSource is provided, return the DefaultDataSourceService
+      ds = weldUtils.getInstance(DefaultDataSourceService.class);
+      ds.setName(dataSourceIdentifier);
+    } else {
+      // try to retrieve the DataSourceService through the dataSource java class name, otherwise
+      // return the DefaultDataSourceService
+      if (dataSource.getJavaClassName() != null) {
+        @SuppressWarnings("unchecked")
+        final Class<DataSourceService> clz = (Class<DataSourceService>) OBClassLoader.getInstance()
+            .loadClass(dataSource.getJavaClassName());
+        ds = weldUtils.getInstance(clz);
+      } else {
+        ds = new DefaultDataSourceService();
+      }
+      ds.setDataSource(dataSource);
+    }
+    // don't fail if the entity does not exist, just don't assign it to the DataSourceService
+    boolean checkIfNotExists = false;
+    Entity entity = ModelProvider.getInstance().getEntity(dataSourceIdentifier, checkIfNotExists);
+    if (entity != null) {
+      ds.setEntity(entity);
+    }
     return ds;
   }
+
 }
--- a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/TreeDatasourceService.java	Wed Nov 19 19:11:32 2014 +0100
@@ -42,6 +42,7 @@
 import org.openbravo.base.model.Property;
 import org.openbravo.base.structure.BaseOBObject;
 import org.openbravo.client.kernel.ComponentProvider;
+import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
@@ -745,7 +746,15 @@
     }
     String hqlCopy = new String(hqlTreeWhereClause);
     for (String key : replacements.keySet()) {
-      hqlCopy = hqlCopy.replaceAll(key, replacements.get(key));
+      // Value is equals 'null' when can not find in parameters.
+      if (replacements.get(key).equals("'null'")) {
+        // Obtain variable without the "@"
+        String keyWithoutAt = key.substring(1, key.length() - 1);
+        hqlCopy = hqlCopy.replaceAll(key,
+            "'" + (String) RequestContext.get().getSessionAttribute(keyWithoutAt) + "'");
+      } else {
+        hqlCopy = hqlCopy.replaceAll(key, replacements.get(key));
+      }
     }
     return hqlCopy;
   }
--- a/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/modules/org.openbravo.service.json/src/org/openbravo/service/json/DefaultJsonDataService.java	Wed Nov 19 19:11:32 2014 +0100
@@ -261,9 +261,14 @@
     final DataEntityQueryService queryService = createSetQueryService(parameters, false);
     queryService.setEntityName(entityName);
 
+    String selectedProperties = parameters.get(JsonConstants.SELECTEDPROPERTIES_PARAMETER);
+
     final DataToJsonConverter toJsonConverter = OBProvider.getInstance().get(
         DataToJsonConverter.class);
     toJsonConverter.setAdditionalProperties(JsonUtils.getAdditionalProperties(parameters));
+    // Convert to Json only the properties specified in the request. If no properties are specified,
+    // all of them will be converted to Json
+    toJsonConverter.setSelectedProperties(selectedProperties);
 
     final ScrollableResults scrollableResults = queryService.scroll();
     try {
--- a/src-core/src/org/openbravo/utils/FormatUtilities.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-core/src/org/openbravo/utils/FormatUtilities.java	Wed Nov 19 19:11:32 2014 +0100
@@ -46,6 +46,10 @@
   }
 
   public static String replaceJS(String strIni, boolean isUnderQuotes) {
+    if (strIni == null) {
+      // nothing to return if the provided string is null
+      return null;
+    }
     return Replace
         .replace(
             Replace.replace(Replace.replace(
--- a/src-db/database/model/tables/C_PERIOD.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-db/database/model/tables/C_PERIOD.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -90,6 +90,9 @@
       <foreign-key foreignTable="C_YEAR" name="C_YEAR_PERIOD">
         <reference local="C_YEAR_ID" foreign="C_YEAR_ID"/>
       </foreign-key>
+      <index name="C_PERIOD_ORG" unique="false">
+        <index-column name="AD_ORG_ID"/>
+      </index>
       <index name="C_PERIOD_YEAR" unique="false">
         <index-column name="C_YEAR_ID"/>
       </index>
--- a/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-db/database/sourcedata/AD_AUXILIARINPUT.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -1521,6 +1521,17 @@
 <!--3752F4D586254CA0BAA6CE2AA8E6137F-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--3752F4D586254CA0BAA6CE2AA8E6137F--></AD_AUXILIARINPUT>
 
+<!--377353A77F7A4876BE4F36592679CD4C--><AD_AUXILIARINPUT>
+<!--377353A77F7A4876BE4F36592679CD4C-->  <AD_AUXILIARINPUT_ID><![CDATA[377353A77F7A4876BE4F36592679CD4C]]></AD_AUXILIARINPUT_ID>
+<!--377353A77F7A4876BE4F36592679CD4C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--377353A77F7A4876BE4F36592679CD4C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--377353A77F7A4876BE4F36592679CD4C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--377353A77F7A4876BE4F36592679CD4C-->  <AD_TAB_ID><![CDATA[187]]></AD_TAB_ID>
+<!--377353A77F7A4876BE4F36592679CD4C-->  <NAME><![CDATA[ATTRIBUTESETINSTANCIABLE]]></NAME>
+<!--377353A77F7A4876BE4F36592679CD4C-->  <CODE><![CDATA[@SQL=SELECT (CASE count(*) WHEN 0 THEN 'N' ELSE 'Y' END) from M_ATTRIBUTESET mats join M_PRODUCT mp on mats.M_AttributeSet_ID=mp.M_AttributeSet_ID WHERE mp.M_PRODUCT_ID=@M_Product_ID@ and (mats.IsLot='Y' or mats.IsSerNo='Y' or mats.IsGuaranteeDate='Y')]]></CODE>
+<!--377353A77F7A4876BE4F36592679CD4C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--377353A77F7A4876BE4F36592679CD4C--></AD_AUXILIARINPUT>
+
 <!--38FA2581642644948132767B5CE448A4--><AD_AUXILIARINPUT>
 <!--38FA2581642644948132767B5CE448A4-->  <AD_AUXILIARINPUT_ID><![CDATA[38FA2581642644948132767B5CE448A4]]></AD_AUXILIARINPUT_ID>
 <!--38FA2581642644948132767B5CE448A4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1717,6 +1728,17 @@
 <!--44C89F429E0E42F7961A634D61F34E0A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--44C89F429E0E42F7961A634D61F34E0A--></AD_AUXILIARINPUT>
 
+<!--44F99FD664A64A9683694FE63672BD55--><AD_AUXILIARINPUT>
+<!--44F99FD664A64A9683694FE63672BD55-->  <AD_AUXILIARINPUT_ID><![CDATA[44F99FD664A64A9683694FE63672BD55]]></AD_AUXILIARINPUT_ID>
+<!--44F99FD664A64A9683694FE63672BD55-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--44F99FD664A64A9683694FE63672BD55-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--44F99FD664A64A9683694FE63672BD55-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--44F99FD664A64A9683694FE63672BD55-->  <AD_TAB_ID><![CDATA[293]]></AD_TAB_ID>
+<!--44F99FD664A64A9683694FE63672BD55-->  <NAME><![CDATA[ATTRIBUTESETINSTANCIABLE]]></NAME>
+<!--44F99FD664A64A9683694FE63672BD55-->  <CODE><![CDATA[@SQL=SELECT (CASE count(*) WHEN 0 THEN 'N' ELSE 'Y' END) from M_ATTRIBUTESET mats join M_PRODUCT mp on mats.M_AttributeSet_ID=mp.M_AttributeSet_ID WHERE mp.M_PRODUCT_ID=@M_Product_ID@ and (mats.IsLot='Y' or mats.IsSerNo='Y' or mats.IsGuaranteeDate='Y')]]></CODE>
+<!--44F99FD664A64A9683694FE63672BD55-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--44F99FD664A64A9683694FE63672BD55--></AD_AUXILIARINPUT>
+
 <!--467629226B744AD5A9D5CEBD284C29E4--><AD_AUXILIARINPUT>
 <!--467629226B744AD5A9D5CEBD284C29E4-->  <AD_AUXILIARINPUT_ID><![CDATA[467629226B744AD5A9D5CEBD284C29E4]]></AD_AUXILIARINPUT_ID>
 <!--467629226B744AD5A9D5CEBD284C29E4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -70296,7 +70296,7 @@
 <!--4765-->  <AD_REFERENCE_ID><![CDATA[30]]></AD_REFERENCE_ID>
 <!--4765-->  <AD_REFERENCE_VALUE_ID><![CDATA[31]]></AD_REFERENCE_VALUE_ID>
 <!--4765-->  <FIELDLENGTH><![CDATA[60]]></FIELDLENGTH>
-<!--4765-->  <DEFAULTVALUE><![CDATA[@M_Locator_ID@]]></DEFAULTVALUE>
+<!--4765-->  <DEFAULTVALUE><![CDATA[@SQL=SELECT M_LOCATOR_ID AS DEFAULTVALUE FROM M_LOCATOR WHERE AD_ISORGINCLUDED(@AD_Org_ID@, M_LOCATOR.AD_Org_ID, @#AD_Client_ID@) <> -1 AND ISACTIVE='Y' AND M_WAREHOUSE_ID IN (SELECT max(ow.M_WAREHOUSE_ID) as DefaultValue2 from AD_ORG_WAREHOUSE ow WHERE ow.AD_Org_ID=@AD_Org_ID@ AND ow.ISACTIVE = 'Y' AND NOT EXISTS (SELECT 1 FROM AD_ORG_WAREHOUSE ow2 WHERE ow2.AD_Org_ID=@AD_Org_ID@ and ow2.PRIORITY<ow.PRIORITY)) ORDER BY M_LOCATOR.ISDEFAULT DESC]]></DEFAULTVALUE>
 <!--4765-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--4765-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--4765-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
@@ -111876,7 +111876,7 @@
 <!--8767-->  <ISPARENT><![CDATA[N]]></ISPARENT>
 <!--8767-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
 <!--8767-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
-<!--8767-->  <READONLYLOGIC><![CDATA[@Processed@='Y']]></READONLYLOGIC>
+<!--8767-->  <READONLYLOGIC><![CDATA[@Processed@='Y' | @ATTRIBUTESETINSTANCIABLE@='Y']]></READONLYLOGIC>
 <!--8767-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
 <!--8767-->  <SEQNO><![CDATA[0]]></SEQNO>
 <!--8767-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
--- a/src-db/database/sourcedata/AD_FIELD.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -181195,6 +181195,35 @@
 <!--0B6B5FF16D8D419DA4E4751CDCC78158-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--0B6B5FF16D8D419DA4E4751CDCC78158--></AD_FIELD>
 
+<!--0B6D4F88C0C04FFCA730D7115B17A298--><AD_FIELD>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <AD_FIELD_ID><![CDATA[0B6D4F88C0C04FFCA730D7115B17A298]]></AD_FIELD_ID>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <NAME><![CDATA[Year]]></NAME>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <DESCRIPTION><![CDATA[Calendar Year]]></DESCRIPTION>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <HELP><![CDATA[The Year uniquely identifies an accounting year for a calendar.]]></HELP>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <AD_COLUMN_ID><![CDATA[846]]></AD_COLUMN_ID>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <PROPERTY><![CDATA[period.year]]></PROPERTY>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <DISPLAYLENGTH><![CDATA[22]]></DISPLAYLENGTH>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--0B6D4F88C0C04FFCA730D7115B17A298-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--0B6D4F88C0C04FFCA730D7115B17A298--></AD_FIELD>
+
 <!--0B8D3921854242DB8406BE46A4C0AC8F--><AD_FIELD>
 <!--0B8D3921854242DB8406BE46A4C0AC8F-->  <AD_FIELD_ID><![CDATA[0B8D3921854242DB8406BE46A4C0AC8F]]></AD_FIELD_ID>
 <!--0B8D3921854242DB8406BE46A4C0AC8F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -181708,6 +181737,34 @@
 <!--0CBE816A45594928AB5484A9B82FBC9D-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--0CBE816A45594928AB5484A9B82FBC9D--></AD_FIELD>
 
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB--><AD_FIELD>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <AD_FIELD_ID><![CDATA[0CC4EEFC6B84455EA2B01704BF87AAEB]]></AD_FIELD_ID>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <NAME><![CDATA[Status]]></NAME>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <HELP><![CDATA[Status for the debt payment]]></HELP>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <AD_COLUMN_ID><![CDATA[6C095E9D39CD4A31BC29FB37853B9044]]></AD_COLUMN_ID>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <SEQNO><![CDATA[15]]></SEQNO>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--0CC4EEFC6B84455EA2B01704BF87AAEB--></AD_FIELD>
+
 <!--0CD05D49ED214052B2C59F88F8999A34--><AD_FIELD>
 <!--0CD05D49ED214052B2C59F88F8999A34-->  <AD_FIELD_ID><![CDATA[0CD05D49ED214052B2C59F88F8999A34]]></AD_FIELD_ID>
 <!--0CD05D49ED214052B2C59F88F8999A34-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -187437,6 +187494,63 @@
 <!--1C1FBE81744B4AB4974716E8E420F27B-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--1C1FBE81744B4AB4974716E8E420F27B--></AD_FIELD>
 
+<!--1C57893D7EE14B43BA50FA6C1CC652CD--><AD_FIELD>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <AD_FIELD_ID><![CDATA[1C57893D7EE14B43BA50FA6C1CC652CD]]></AD_FIELD_ID>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <NAME><![CDATA[Open/Close All]]></NAME>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <DESCRIPTION><![CDATA[Open/Close all Base Document Types]]></DESCRIPTION>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <HELP><![CDATA[Open/Close all Base Document Types.
+NOTE: You will not be able to close the fiscal year if you close all its periods permanently. Maybe you should close it before changing the last period from closed to permanently closed.]]></HELP>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <AD_COLUMN_ID><![CDATA[5944]]></AD_COLUMN_ID>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <SEQNO><![CDATA[90]]></SEQNO>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--1C57893D7EE14B43BA50FA6C1CC652CD--></AD_FIELD>
+
+<!--1C699675AE784F6CB33D050E9F8C51F7--><AD_FIELD>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <AD_FIELD_ID><![CDATA[1C699675AE784F6CB33D050E9F8C51F7]]></AD_FIELD_ID>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <NAME><![CDATA[Regularization Fact_Acct_Group_ID]]></NAME>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <DESCRIPTION><![CDATA[Refers to the Fact_Acct_Group_ID of the regularization entry]]></DESCRIPTION>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <HELP><![CDATA[Refers to the Fact_Acct_Group_ID of the regularization entry]]></HELP>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <AD_COLUMN_ID><![CDATA[5854D61EEF923B11E040007F01002D1D]]></AD_COLUMN_ID>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <SEQNO><![CDATA[110]]></SEQNO>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--1C699675AE784F6CB33D050E9F8C51F7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--1C699675AE784F6CB33D050E9F8C51F7--></AD_FIELD>
+
 <!--1C70789D0D4F4C36AEB334055B995C6F--><AD_FIELD>
 <!--1C70789D0D4F4C36AEB334055B995C6F-->  <AD_FIELD_ID><![CDATA[1C70789D0D4F4C36AEB334055B995C6F]]></AD_FIELD_ID>
 <!--1C70789D0D4F4C36AEB334055B995C6F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -189367,6 +189481,34 @@
 <!--21E3DA53AEFE4CAFB2CBC2C0E47D0D13-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--21E3DA53AEFE4CAFB2CBC2C0E47D0D13--></AD_FIELD>
 
+<!--21ECF5080AC0406898A5899E82E4A2F3--><AD_FIELD>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <AD_FIELD_ID><![CDATA[21ECF5080AC0406898A5899E82E4A2F3]]></AD_FIELD_ID>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <NAME><![CDATA[Document Category]]></NAME>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <DESCRIPTION><![CDATA[A classification of document types that are shown and processed in the same window.]]></DESCRIPTION>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <HELP><![CDATA[The Document Base Type identifies the base or starting point for a document.  Multiple document types may share a single document base type.]]></HELP>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <AD_COLUMN_ID><![CDATA[5945]]></AD_COLUMN_ID>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--21ECF5080AC0406898A5899E82E4A2F3-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--21ECF5080AC0406898A5899E82E4A2F3--></AD_FIELD>
+
 <!--22039949CA0345DB91BE3B3B5E776F7E--><AD_FIELD>
 <!--22039949CA0345DB91BE3B3B5E776F7E-->  <AD_FIELD_ID><![CDATA[22039949CA0345DB91BE3B3B5E776F7E]]></AD_FIELD_ID>
 <!--22039949CA0345DB91BE3B3B5E776F7E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -192950,6 +193092,36 @@
 <!--2D06E858042E4397966007C26D191CF1-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--2D06E858042E4397966007C26D191CF1--></AD_FIELD>
 
+<!--2D08326CF03F4D348AA069B8E923DB68--><AD_FIELD>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <AD_FIELD_ID><![CDATA[2D08326CF03F4D348AA069B8E923DB68]]></AD_FIELD_ID>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <NAME><![CDATA[Active]]></NAME>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <DESCRIPTION><![CDATA[A flag indicating whether this record is available for use or de-activated.]]></DESCRIPTION>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <HELP><![CDATA[There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records: 
+(1) The system requires the record for auditing purposes.
+(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.]]></HELP>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <AD_COLUMN_ID><![CDATA[1815]]></AD_COLUMN_ID>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--2D08326CF03F4D348AA069B8E923DB68-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--2D08326CF03F4D348AA069B8E923DB68--></AD_FIELD>
+
 <!--2D1767DF008E44C6AC778416B50DA9C1--><AD_FIELD>
 <!--2D1767DF008E44C6AC778416B50DA9C1-->  <AD_FIELD_ID><![CDATA[2D1767DF008E44C6AC778416B50DA9C1]]></AD_FIELD_ID>
 <!--2D1767DF008E44C6AC778416B50DA9C1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -197175,6 +197347,33 @@
 <!--3846B544FCE14364B39D309A04EC3994-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--3846B544FCE14364B39D309A04EC3994--></AD_FIELD>
 
+<!--384D92F0496046BB8C2DCB494AD9ECF4--><AD_FIELD>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <AD_FIELD_ID><![CDATA[384D92F0496046BB8C2DCB494AD9ECF4]]></AD_FIELD_ID>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <NAME><![CDATA[Client]]></NAME>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <AD_COLUMN_ID><![CDATA[1813]]></AD_COLUMN_ID>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <DISPLAYLENGTH><![CDATA[22]]></DISPLAYLENGTH>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--384D92F0496046BB8C2DCB494AD9ECF4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--384D92F0496046BB8C2DCB494AD9ECF4--></AD_FIELD>
+
 <!--385EEC17D494423CA7009AD3D3268B4C--><AD_FIELD>
 <!--385EEC17D494423CA7009AD3D3268B4C-->  <AD_FIELD_ID><![CDATA[385EEC17D494423CA7009AD3D3268B4C]]></AD_FIELD_ID>
 <!--385EEC17D494423CA7009AD3D3268B4C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -199438,6 +199637,33 @@
 <!--4040A5566CC24140928B07806947EAC9-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--4040A5566CC24140928B07806947EAC9--></AD_FIELD>
 
+<!--405DE947F5744F03877A02FF73B28C9C--><AD_FIELD>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <AD_FIELD_ID><![CDATA[405DE947F5744F03877A02FF73B28C9C]]></AD_FIELD_ID>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <NAME><![CDATA[Client]]></NAME>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <DESCRIPTION><![CDATA[Client for this installation.]]></DESCRIPTION>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <HELP><![CDATA[A Client is a company or a legal entity. You cannot share data between Clients.]]></HELP>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <AD_COLUMN_ID><![CDATA[838]]></AD_COLUMN_ID>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <DISPLAYLENGTH><![CDATA[22]]></DISPLAYLENGTH>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--405DE947F5744F03877A02FF73B28C9C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--405DE947F5744F03877A02FF73B28C9C--></AD_FIELD>
+
 <!--4067AD7F0E8F41FBA5E1FD302A6623C5--><AD_FIELD>
 <!--4067AD7F0E8F41FBA5E1FD302A6623C5-->  <AD_FIELD_ID><![CDATA[4067AD7F0E8F41FBA5E1FD302A6623C5]]></AD_FIELD_ID>
 <!--4067AD7F0E8F41FBA5E1FD302A6623C5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -200910,6 +201136,35 @@
 <!--44023AE71D154D9DBE06532EDA193069-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--44023AE71D154D9DBE06532EDA193069--></AD_FIELD>
 
+<!--4402F9658DAD4486BFC67FB62E275856--><AD_FIELD>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <AD_FIELD_ID><![CDATA[4402F9658DAD4486BFC67FB62E275856]]></AD_FIELD_ID>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <NAME><![CDATA[Calendar]]></NAME>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <DESCRIPTION><![CDATA[A table showing the days of the week for each month of the year.]]></DESCRIPTION>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <HELP><![CDATA[The Calendar uniquely identifies an accounting calendar.  Multiple calendars can be used.  For example you may need a standard calendar that runs from Jan 1 to Dec 31 and a fiscal calendar that runs from July 1 to June 30.]]></HELP>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <AD_COLUMN_ID><![CDATA[1042]]></AD_COLUMN_ID>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <PROPERTY><![CDATA[year.calendar]]></PROPERTY>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--4402F9658DAD4486BFC67FB62E275856-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--4402F9658DAD4486BFC67FB62E275856--></AD_FIELD>
+
 <!--44075B86C7C543F8973D5C2C7C276C85--><AD_FIELD>
 <!--44075B86C7C543F8973D5C2C7C276C85-->  <AD_FIELD_ID><![CDATA[44075B86C7C543F8973D5C2C7C276C85]]></AD_FIELD_ID>
 <!--44075B86C7C543F8973D5C2C7C276C85-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -201507,6 +201762,34 @@
 <!--45EE0A7E487041C1A6F47E791B31C82F-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--45EE0A7E487041C1A6F47E791B31C82F--></AD_FIELD>
 
+<!--45FC2891BD3044CEACA7F06E13B8AD9C--><AD_FIELD>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <AD_FIELD_ID><![CDATA[45FC2891BD3044CEACA7F06E13B8AD9C]]></AD_FIELD_ID>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <NAME><![CDATA[Period]]></NAME>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <DESCRIPTION><![CDATA[A specified time period.]]></DESCRIPTION>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <HELP><![CDATA[The Period indicates an exclusive range of dates for a calendar.]]></HELP>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <AD_COLUMN_ID><![CDATA[1820]]></AD_COLUMN_ID>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <DISPLAYLENGTH><![CDATA[22]]></DISPLAYLENGTH>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--45FC2891BD3044CEACA7F06E13B8AD9C--></AD_FIELD>
+
 <!--46076641CD0748C7B7268451CFCB0850--><AD_FIELD>
 <!--46076641CD0748C7B7268451CFCB0850-->  <AD_FIELD_ID><![CDATA[46076641CD0748C7B7268451CFCB0850]]></AD_FIELD_ID>
 <!--46076641CD0748C7B7268451CFCB0850-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -201714,6 +201997,34 @@
 <!--46E31D53387F4BDEB84B2DD16F7DA22A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--46E31D53387F4BDEB84B2DD16F7DA22A--></AD_FIELD>
 
+<!--4718F0995E304F2CB96710CC4B4EC955--><AD_FIELD>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <AD_FIELD_ID><![CDATA[4718F0995E304F2CB96710CC4B4EC955]]></AD_FIELD_ID>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <NAME><![CDATA[Organization]]></NAME>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <AD_COLUMN_ID><![CDATA[1814]]></AD_COLUMN_ID>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <DISPLAYLENGTH><![CDATA[22]]></DISPLAYLENGTH>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--4718F0995E304F2CB96710CC4B4EC955-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--4718F0995E304F2CB96710CC4B4EC955--></AD_FIELD>
+
 <!--47258ECF7D664AE4849BCD833382B90D--><AD_FIELD>
 <!--47258ECF7D664AE4849BCD833382B90D-->  <AD_FIELD_ID><![CDATA[47258ECF7D664AE4849BCD833382B90D]]></AD_FIELD_ID>
 <!--47258ECF7D664AE4849BCD833382B90D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -202342,6 +202653,34 @@
 <!--491A105F5FE148E2B64D2B122A2DC6A4-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--491A105F5FE148E2B64D2B122A2DC6A4--></AD_FIELD>
 
+<!--493F74D5DD8845848A0310C614991E75--><AD_FIELD>
+<!--493F74D5DD8845848A0310C614991E75-->  <AD_FIELD_ID><![CDATA[493F74D5DD8845848A0310C614991E75]]></AD_FIELD_ID>
+<!--493F74D5DD8845848A0310C614991E75-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--493F74D5DD8845848A0310C614991E75-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--493F74D5DD8845848A0310C614991E75-->  <NAME><![CDATA[Ending Date]]></NAME>
+<!--493F74D5DD8845848A0310C614991E75-->  <DESCRIPTION><![CDATA[A parameter stating when a specified request will end.]]></DESCRIPTION>
+<!--493F74D5DD8845848A0310C614991E75-->  <HELP><![CDATA[The End Date indicates the last date in this range.]]></HELP>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--493F74D5DD8845848A0310C614991E75-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--493F74D5DD8845848A0310C614991E75-->  <AD_COLUMN_ID><![CDATA[5943]]></AD_COLUMN_ID>
+<!--493F74D5DD8845848A0310C614991E75-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--493F74D5DD8845848A0310C614991E75-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--493F74D5DD8845848A0310C614991E75-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--493F74D5DD8845848A0310C614991E75-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--493F74D5DD8845848A0310C614991E75-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--493F74D5DD8845848A0310C614991E75-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--493F74D5DD8845848A0310C614991E75-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--493F74D5DD8845848A0310C614991E75-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--493F74D5DD8845848A0310C614991E75-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--493F74D5DD8845848A0310C614991E75--></AD_FIELD>
+
 <!--496692F1E30A400DB2C448F97AA8A9C1--><AD_FIELD>
 <!--496692F1E30A400DB2C448F97AA8A9C1-->  <AD_FIELD_ID><![CDATA[496692F1E30A400DB2C448F97AA8A9C1]]></AD_FIELD_ID>
 <!--496692F1E30A400DB2C448F97AA8A9C1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -202480,6 +202819,35 @@
 <!--49D7345C33DC426A83EE3B10A6B2E7C8-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--49D7345C33DC426A83EE3B10A6B2E7C8--></AD_FIELD>
 
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5--><AD_FIELD>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <AD_FIELD_ID><![CDATA[49DBC6AB5D3A4453B1E715AB8EDD8EF5]]></AD_FIELD_ID>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <NAME><![CDATA[Calendar]]></NAME>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <DESCRIPTION><![CDATA[A table showing the days of the week for each month of the year.]]></DESCRIPTION>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <HELP><![CDATA[The Calendar uniquely identifies an accounting calendar.  Multiple calendars can be used.  For example you may need a standard calendar that runs from Jan 1 to Dec 31 and a fiscal calendar that runs from July 1 to June 30.]]></HELP>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <AD_COLUMN_ID><![CDATA[1042]]></AD_COLUMN_ID>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <PROPERTY><![CDATA[period.year.calendar]]></PROPERTY>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <IGNOREINWAD><![CDATA[Y]]></IGNOREINWAD>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <DISPLAYLENGTH><![CDATA[22]]></DISPLAYLENGTH>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--49DBC6AB5D3A4453B1E715AB8EDD8EF5--></AD_FIELD>
+
 <!--49F526720AB54F1F8B8DE1C500BFA87B--><AD_FIELD>
 <!--49F526720AB54F1F8B8DE1C500BFA87B-->  <AD_FIELD_ID><![CDATA[49F526720AB54F1F8B8DE1C500BFA87B]]></AD_FIELD_ID>
 <!--49F526720AB54F1F8B8DE1C500BFA87B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -203815,6 +204183,34 @@
 <!--4E7181E5E2EC4BD89FB05FDA27FF9B60-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--4E7181E5E2EC4BD89FB05FDA27FF9B60--></AD_FIELD>
 
+<!--4E85BE7BAB5749EAA192B5E77A28217D--><AD_FIELD>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <AD_FIELD_ID><![CDATA[4E85BE7BAB5749EAA192B5E77A28217D]]></AD_FIELD_ID>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <NAME><![CDATA[Divideup Fact_Acct_Group_ID]]></NAME>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <DESCRIPTION><![CDATA[Refers to the Fact_Acct_Group_ID of the divide up entry]]></DESCRIPTION>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <HELP><![CDATA[Refers to the Fact_Acct_Group_ID of the divide up entry]]></HELP>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <AD_COLUMN_ID><![CDATA[5854D61EEF933B11E040007F01002D1D]]></AD_COLUMN_ID>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <SEQNO><![CDATA[120]]></SEQNO>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--4E85BE7BAB5749EAA192B5E77A28217D-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--4E85BE7BAB5749EAA192B5E77A28217D--></AD_FIELD>
+
 <!--4E94D12948864A1D92461F87C9595B0D--><AD_FIELD>
 <!--4E94D12948864A1D92461F87C9595B0D-->  <AD_FIELD_ID><![CDATA[4E94D12948864A1D92461F87C9595B0D]]></AD_FIELD_ID>
 <!--4E94D12948864A1D92461F87C9595B0D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -213758,6 +214154,34 @@
 <!--594880DA2BB74D00B5AD14AB0278CB7D-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--594880DA2BB74D00B5AD14AB0278CB7D--></AD_FIELD>
 
+<!--59608B4464DD4D8BA5352008B5127D6A--><AD_FIELD>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <AD_FIELD_ID><![CDATA[59608B4464DD4D8BA5352008B5127D6A]]></AD_FIELD_ID>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <NAME><![CDATA[Open_Fact_Acct_Group_ID]]></NAME>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <DESCRIPTION><![CDATA[Refers to the Open_Fact_Acct_Group_ID of the open entry]]></DESCRIPTION>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <HELP><![CDATA[Refers to the Open_Fact_Acct_Group_ID of the open entry]]></HELP>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <AD_COLUMN_ID><![CDATA[8200738EF14611DDB9650016D4EE9DB3]]></AD_COLUMN_ID>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <SEQNO><![CDATA[130]]></SEQNO>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--59608B4464DD4D8BA5352008B5127D6A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--59608B4464DD4D8BA5352008B5127D6A--></AD_FIELD>
+
 <!--59887AF48863C5B0E040007F01015E76--><AD_FIELD>
 <!--59887AF48863C5B0E040007F01015E76-->  <AD_FIELD_ID><![CDATA[59887AF48863C5B0E040007F01015E76]]></AD_FIELD_ID>
 <!--59887AF48863C5B0E040007F01015E76-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -226844,6 +227268,34 @@
 <!--742F35383FC34CBE895C4EAB2E581FAF-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--742F35383FC34CBE895C4EAB2E581FAF--></AD_FIELD>
 
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5--><AD_FIELD>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <AD_FIELD_ID><![CDATA[7434FE03C6CC43AB8CFCEF1049EA43D5]]></AD_FIELD_ID>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <NAME><![CDATA[Period Action]]></NAME>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <DESCRIPTION><![CDATA[Action taken for this period]]></DESCRIPTION>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <HELP><![CDATA[The Period Action indicates the action to be taken for this period.  For example 'Close Period' or 'Open Period'.]]></HELP>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <AD_COLUMN_ID><![CDATA[2354]]></AD_COLUMN_ID>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--7434FE03C6CC43AB8CFCEF1049EA43D5--></AD_FIELD>
+
 <!--7446D90108A64F659D08BDA0BE526704--><AD_FIELD>
 <!--7446D90108A64F659D08BDA0BE526704-->  <AD_FIELD_ID><![CDATA[7446D90108A64F659D08BDA0BE526704]]></AD_FIELD_ID>
 <!--7446D90108A64F659D08BDA0BE526704-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -226871,6 +227323,34 @@
 <!--7446D90108A64F659D08BDA0BE526704-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--7446D90108A64F659D08BDA0BE526704--></AD_FIELD>
 
+<!--74626827988342D4AD25D01FD27DEAF8--><AD_FIELD>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <AD_FIELD_ID><![CDATA[74626827988342D4AD25D01FD27DEAF8]]></AD_FIELD_ID>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <NAME><![CDATA[Period Status]]></NAME>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <DESCRIPTION><![CDATA[Current state of this period]]></DESCRIPTION>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <HELP><![CDATA[The Period Status indicates the current status for this period.  For example 'Closed', 'Open', 'Never Opened'.]]></HELP>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <AD_COLUMN_ID><![CDATA[1822]]></AD_COLUMN_ID>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--74626827988342D4AD25D01FD27DEAF8-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--74626827988342D4AD25D01FD27DEAF8--></AD_FIELD>
+
 <!--746EE23586C94DB2A1366876E3935D22--><AD_FIELD>
 <!--746EE23586C94DB2A1366876E3935D22-->  <AD_FIELD_ID><![CDATA[746EE23586C94DB2A1366876E3935D22]]></AD_FIELD_ID>
 <!--746EE23586C94DB2A1366876E3935D22-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -229101,6 +229581,33 @@
 <!--79F6BC10FDBF4915AA2516B6FB400FB2-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--79F6BC10FDBF4915AA2516B6FB400FB2--></AD_FIELD>
 
+<!--7A09F86A950347EA85B725CC2FC09754--><AD_FIELD>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <AD_FIELD_ID><![CDATA[7A09F86A950347EA85B725CC2FC09754]]></AD_FIELD_ID>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <NAME><![CDATA[Open Close]]></NAME>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <DESCRIPTION><![CDATA[Open / Close period control.]]></DESCRIPTION>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <AD_COLUMN_ID><![CDATA[F27047EFFEDF4F499F8D9D93A55B79B5]]></AD_COLUMN_ID>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--7A09F86A950347EA85B725CC2FC09754-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--7A09F86A950347EA85B725CC2FC09754--></AD_FIELD>
+
 <!--7A3A75A0F0D6403BBFD157B6DE057A83--><AD_FIELD>
 <!--7A3A75A0F0D6403BBFD157B6DE057A83-->  <AD_FIELD_ID><![CDATA[7A3A75A0F0D6403BBFD157B6DE057A83]]></AD_FIELD_ID>
 <!--7A3A75A0F0D6403BBFD157B6DE057A83-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -229699,6 +230206,33 @@
 <!--7C3C6AE4742F435D8A5CCF0E5BC71AB6-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--7C3C6AE4742F435D8A5CCF0E5BC71AB6--></AD_FIELD>
 
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55--><AD_FIELD>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <AD_FIELD_ID><![CDATA[7C4EB7E3D6D64865A2D9ECE326AD4B55]]></AD_FIELD_ID>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <NAME><![CDATA[Period Control]]></NAME>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <DESCRIPTION><![CDATA[Period Control]]></DESCRIPTION>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <HELP><![CDATA[The Period Control shows the status of a Period (Never Opened, Opened, Closed) for each of the DocBaseTypes.]]></HELP>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <AD_COLUMN_ID><![CDATA[1812]]></AD_COLUMN_ID>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--7C4EB7E3D6D64865A2D9ECE326AD4B55--></AD_FIELD>
+
 <!--7C541AC0C757FDD7E040007F01016B4D--><AD_FIELD>
 <!--7C541AC0C757FDD7E040007F01016B4D-->  <AD_FIELD_ID><![CDATA[7C541AC0C757FDD7E040007F01016B4D]]></AD_FIELD_ID>
 <!--7C541AC0C757FDD7E040007F01016B4D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -250540,6 +251074,34 @@
 <!--9EE010D24949479E9D92F82554DEF22C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--9EE010D24949479E9D92F82554DEF22C--></AD_FIELD>
 
+<!--9F15AB5E61454B7DBB5201089922FE55--><AD_FIELD>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <AD_FIELD_ID><![CDATA[9F15AB5E61454B7DBB5201089922FE55]]></AD_FIELD_ID>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <NAME><![CDATA[Starting Date]]></NAME>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <DESCRIPTION><![CDATA[A parameter stating when a specified request will begin.]]></DESCRIPTION>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <HELP><![CDATA[A parameter stating when a specified request will begin.]]></HELP>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <AD_COLUMN_ID><![CDATA[484]]></AD_COLUMN_ID>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--9F15AB5E61454B7DBB5201089922FE55-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--9F15AB5E61454B7DBB5201089922FE55--></AD_FIELD>
+
 <!--9F23E336ECF442C180DC146F8B771C05--><AD_FIELD>
 <!--9F23E336ECF442C180DC146F8B771C05-->  <AD_FIELD_ID><![CDATA[9F23E336ECF442C180DC146F8B771C05]]></AD_FIELD_ID>
 <!--9F23E336ECF442C180DC146F8B771C05-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -251221,6 +251783,34 @@
 <!--A175C8B51EFE460BAEB495029AE8AF21-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--A175C8B51EFE460BAEB495029AE8AF21--></AD_FIELD>
 
+<!--A178883F5CE0421CA02C722DCEF154B9--><AD_FIELD>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <AD_FIELD_ID><![CDATA[A178883F5CE0421CA02C722DCEF154B9]]></AD_FIELD_ID>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <NAME><![CDATA[Year]]></NAME>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <DESCRIPTION><![CDATA[Calendar Year]]></DESCRIPTION>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <HELP><![CDATA[The Year uniquely identifies an accounting year for a calendar.]]></HELP>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <AD_COLUMN_ID><![CDATA[846]]></AD_COLUMN_ID>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <DISPLAYLENGTH><![CDATA[22]]></DISPLAYLENGTH>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--A178883F5CE0421CA02C722DCEF154B9-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--A178883F5CE0421CA02C722DCEF154B9--></AD_FIELD>
+
 <!--A18268C7292C4EB7A862476D7E89D80B--><AD_FIELD>
 <!--A18268C7292C4EB7A862476D7E89D80B-->  <AD_FIELD_ID><![CDATA[A18268C7292C4EB7A862476D7E89D80B]]></AD_FIELD_ID>
 <!--A18268C7292C4EB7A862476D7E89D80B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -269727,6 +270317,34 @@
 <!--BFC19E677C2347A6A5BCAA12FA2CA82C-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--BFC19E677C2347A6A5BCAA12FA2CA82C--></AD_FIELD>
 
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8--><AD_FIELD>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <AD_FIELD_ID><![CDATA[BFCD276E190841E3AC18FCE6E7CDEFD8]]></AD_FIELD_ID>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <NAME><![CDATA[Name]]></NAME>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <DESCRIPTION><![CDATA[A non-unique identifier for a record/document often used as a search tool.]]></DESCRIPTION>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <HELP><![CDATA[A more descriptive identifier (that does need to be unique) of a record/document that is used as a default search option along with the search key (that is unique and mostly shorter). It is up to 60 characters in length.]]></HELP>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <AD_COLUMN_ID><![CDATA[482]]></AD_COLUMN_ID>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--BFCD276E190841E3AC18FCE6E7CDEFD8--></AD_FIELD>
+
 <!--BFDDA6636FB04F4AA150791E4E105547--><AD_FIELD>
 <!--BFDDA6636FB04F4AA150791E4E105547-->  <AD_FIELD_ID><![CDATA[BFDDA6636FB04F4AA150791E4E105547]]></AD_FIELD_ID>
 <!--BFDDA6636FB04F4AA150791E4E105547-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -273516,6 +274134,34 @@
 <!--C94728F7441E41C38660A8AE2AAFC716-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--C94728F7441E41C38660A8AE2AAFC716--></AD_FIELD>
 
+<!--C949AF7941034C7DA6303248740FB098--><AD_FIELD>
+<!--C949AF7941034C7DA6303248740FB098-->  <AD_FIELD_ID><![CDATA[C949AF7941034C7DA6303248740FB098]]></AD_FIELD_ID>
+<!--C949AF7941034C7DA6303248740FB098-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C949AF7941034C7DA6303248740FB098-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C949AF7941034C7DA6303248740FB098-->  <NAME><![CDATA[Organization]]></NAME>
+<!--C949AF7941034C7DA6303248740FB098-->  <DESCRIPTION><![CDATA[Organizational entity within client]]></DESCRIPTION>
+<!--C949AF7941034C7DA6303248740FB098-->  <HELP><![CDATA[An organization is a unit of your client or legal entity - examples are store, department. You can share data between organizations.]]></HELP>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C949AF7941034C7DA6303248740FB098-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--C949AF7941034C7DA6303248740FB098-->  <AD_COLUMN_ID><![CDATA[839]]></AD_COLUMN_ID>
+<!--C949AF7941034C7DA6303248740FB098-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--C949AF7941034C7DA6303248740FB098-->  <DISPLAYLENGTH><![CDATA[22]]></DISPLAYLENGTH>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--C949AF7941034C7DA6303248740FB098-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C949AF7941034C7DA6303248740FB098-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C949AF7941034C7DA6303248740FB098-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C949AF7941034C7DA6303248740FB098-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C949AF7941034C7DA6303248740FB098-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C949AF7941034C7DA6303248740FB098-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C949AF7941034C7DA6303248740FB098-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C949AF7941034C7DA6303248740FB098--></AD_FIELD>
+
 <!--C9716CAD12E842D1BE87230518FE3A01--><AD_FIELD>
 <!--C9716CAD12E842D1BE87230518FE3A01-->  <AD_FIELD_ID><![CDATA[C9716CAD12E842D1BE87230518FE3A01]]></AD_FIELD_ID>
 <!--C9716CAD12E842D1BE87230518FE3A01-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -273742,6 +274388,34 @@
 <!--C9DF612F55AC45A58371BB8711D13CCB-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--C9DF612F55AC45A58371BB8711D13CCB--></AD_FIELD>
 
+<!--C9EFE6ACF6D7465D86740EE43F219C3E--><AD_FIELD>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <AD_FIELD_ID><![CDATA[C9EFE6ACF6D7465D86740EE43F219C3E]]></AD_FIELD_ID>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <NAME><![CDATA[Open/Close]]></NAME>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <DESCRIPTION><![CDATA[Open/Close]]></DESCRIPTION>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <HELP><![CDATA[Open/Close]]></HELP>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <AD_COLUMN_ID><![CDATA[2355]]></AD_COLUMN_ID>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--C9EFE6ACF6D7465D86740EE43F219C3E--></AD_FIELD>
+
 <!--C9F0FE067F9A4D20A0D84D6D43865BC2--><AD_FIELD>
 <!--C9F0FE067F9A4D20A0D84D6D43865BC2-->  <AD_FIELD_ID><![CDATA[C9F0FE067F9A4D20A0D84D6D43865BC2]]></AD_FIELD_ID>
 <!--C9F0FE067F9A4D20A0D84D6D43865BC2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -274516,6 +275190,36 @@
 <!--CA9E542CEB127632E040007F01006734-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--CA9E542CEB127632E040007F01006734--></AD_FIELD>
 
+<!--CAA731B47DA0436E81D85BD3640F05E7--><AD_FIELD>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <AD_FIELD_ID><![CDATA[CAA731B47DA0436E81D85BD3640F05E7]]></AD_FIELD_ID>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <NAME><![CDATA[Active]]></NAME>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <DESCRIPTION><![CDATA[A flag indicating whether this record is available for use or de-activated.]]></DESCRIPTION>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <HELP><![CDATA[There are two methods of making records unavailable in the system: One is to delete the record, the other is to de-activate the record. A de-activated record is not available for selection, but available for reporting. There are two reasons for de-activating and not deleting records: 
+(1) The system requires the record for auditing purposes.
+(2) The record is referenced by other records. E.g., you cannot delete a Business Partner, if there are existing invoices for it. By de-activating the Business Partner you prevent it from being used in future transactions.]]></HELP>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <AD_COLUMN_ID><![CDATA[840]]></AD_COLUMN_ID>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <DISPLAYLENGTH><![CDATA[1]]></DISPLAYLENGTH>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--CAA731B47DA0436E81D85BD3640F05E7-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--CAA731B47DA0436E81D85BD3640F05E7--></AD_FIELD>
+
 <!--CAB22ACCB6E86B2FE040007F010059CA--><AD_FIELD>
 <!--CAB22ACCB6E86B2FE040007F010059CA-->  <AD_FIELD_ID><![CDATA[CAB22ACCB6E86B2FE040007F010059CA]]></AD_FIELD_ID>
 <!--CAB22ACCB6E86B2FE040007F010059CA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -282288,6 +282992,34 @@
 <!--D72BAEDF1E3E451D8942DF2FE4B805EF-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--D72BAEDF1E3E451D8942DF2FE4B805EF--></AD_FIELD>
 
+<!--D7432D982A8D4BF58380D60A9BD0F09A--><AD_FIELD>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <AD_FIELD_ID><![CDATA[D7432D982A8D4BF58380D60A9BD0F09A]]></AD_FIELD_ID>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <NAME><![CDATA[Period Type]]></NAME>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <DESCRIPTION><![CDATA[Period Type]]></DESCRIPTION>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <HELP><![CDATA[The Period Type indicates the type (Standard or Adjustment) of period.]]></HELP>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <AD_COLUMN_ID><![CDATA[847]]></AD_COLUMN_ID>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <SEQNO><![CDATA[90]]></SEQNO>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D7432D982A8D4BF58380D60A9BD0F09A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D7432D982A8D4BF58380D60A9BD0F09A--></AD_FIELD>
+
 <!--D74D967D0AFF45679516ACB4214FF361--><AD_FIELD>
 <!--D74D967D0AFF45679516ACB4214FF361-->  <AD_FIELD_ID><![CDATA[D74D967D0AFF45679516ACB4214FF361]]></AD_FIELD_ID>
 <!--D74D967D0AFF45679516ACB4214FF361-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -284973,6 +285705,32 @@
 <!--DD0A1F35341446C2BCC14B330B1DC545-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--DD0A1F35341446C2BCC14B330B1DC545--></AD_FIELD>
 
+<!--DD1EBE37AD75403BAFEA77EC0734D41E--><AD_FIELD>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <AD_FIELD_ID><![CDATA[DD1EBE37AD75403BAFEA77EC0734D41E]]></AD_FIELD_ID>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <NAME><![CDATA[Status]]></NAME>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <DISPLAYLENGTH><![CDATA[4]]></DISPLAYLENGTH>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <CLIENTCLASS><![CDATA[PeriodControlStatus_Field]]></CLIENTCLASS>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--DD1EBE37AD75403BAFEA77EC0734D41E--></AD_FIELD>
+
 <!--DD2A5839D78146559012A9D2AC8FA1F7--><AD_FIELD>
 <!--DD2A5839D78146559012A9D2AC8FA1F7-->  <AD_FIELD_ID><![CDATA[DD2A5839D78146559012A9D2AC8FA1F7]]></AD_FIELD_ID>
 <!--DD2A5839D78146559012A9D2AC8FA1F7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -286089,6 +286847,34 @@
 <!--E01FC44E2874FFBCE040007F01000332-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--E01FC44E2874FFBCE040007F01000332--></AD_FIELD>
 
+<!--E021828CBBA74A29B77D98B771B9A81D--><AD_FIELD>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <AD_FIELD_ID><![CDATA[E021828CBBA74A29B77D98B771B9A81D]]></AD_FIELD_ID>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <NAME><![CDATA[Period No.]]></NAME>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <DESCRIPTION><![CDATA[Unique Period Number]]></DESCRIPTION>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <HELP><![CDATA[The Period No identifies a specific period for this year. Each period is defined by a start and end date.  Date ranges for a calendar and year cannot overlap.]]></HELP>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <AD_COLUMN_ID><![CDATA[845]]></AD_COLUMN_ID>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <DISPLAYLENGTH><![CDATA[10]]></DISPLAYLENGTH>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--E021828CBBA74A29B77D98B771B9A81D-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--E021828CBBA74A29B77D98B771B9A81D--></AD_FIELD>
+
 <!--E056A7C3E5214E68B4DDB00F5A64022F--><AD_FIELD>
 <!--E056A7C3E5214E68B4DDB00F5A64022F-->  <AD_FIELD_ID><![CDATA[E056A7C3E5214E68B4DDB00F5A64022F]]></AD_FIELD_ID>
 <!--E056A7C3E5214E68B4DDB00F5A64022F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -288597,6 +289383,33 @@
 <!--E7A84652321C421BBED957FCB4F3CE92-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--E7A84652321C421BBED957FCB4F3CE92--></AD_FIELD>
 
+<!--E7AD476047D94A3C85052467A5013772--><AD_FIELD>
+<!--E7AD476047D94A3C85052467A5013772-->  <AD_FIELD_ID><![CDATA[E7AD476047D94A3C85052467A5013772]]></AD_FIELD_ID>
+<!--E7AD476047D94A3C85052467A5013772-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E7AD476047D94A3C85052467A5013772-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E7AD476047D94A3C85052467A5013772-->  <NAME><![CDATA[Open Close]]></NAME>
+<!--E7AD476047D94A3C85052467A5013772-->  <DESCRIPTION><![CDATA[Open / Close period control.]]></DESCRIPTION>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--E7AD476047D94A3C85052467A5013772-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--E7AD476047D94A3C85052467A5013772-->  <AD_COLUMN_ID><![CDATA[7270DE4F7AAA41E89E5F133AF78F2163]]></AD_COLUMN_ID>
+<!--E7AD476047D94A3C85052467A5013772-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--E7AD476047D94A3C85052467A5013772-->  <DISPLAYLENGTH><![CDATA[60]]></DISPLAYLENGTH>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--E7AD476047D94A3C85052467A5013772-->  <SEQNO><![CDATA[140]]></SEQNO>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E7AD476047D94A3C85052467A5013772-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--E7AD476047D94A3C85052467A5013772-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E7AD476047D94A3C85052467A5013772-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--E7AD476047D94A3C85052467A5013772-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--E7AD476047D94A3C85052467A5013772-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--E7AD476047D94A3C85052467A5013772-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--E7AD476047D94A3C85052467A5013772--></AD_FIELD>
+
 <!--E7B46A3FA13E4E87A418FFAF6841F629--><AD_FIELD>
 <!--E7B46A3FA13E4E87A418FFAF6841F629-->  <AD_FIELD_ID><![CDATA[E7B46A3FA13E4E87A418FFAF6841F629]]></AD_FIELD_ID>
 <!--E7B46A3FA13E4E87A418FFAF6841F629-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -289104,6 +289917,32 @@
 <!--E9814FE8483F4C2D87F69BC8BE9314C1-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--E9814FE8483F4C2D87F69BC8BE9314C1--></AD_FIELD>
 
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2--><AD_FIELD>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <AD_FIELD_ID><![CDATA[E9A00524A8074CB7BD11B5D9ECF8B6C2]]></AD_FIELD_ID>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <NAME><![CDATA[Status]]></NAME>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <DISPLAYLENGTH><![CDATA[4]]></DISPLAYLENGTH>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <CLIENTCLASS><![CDATA[PeriodStatus_Field]]></CLIENTCLASS>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--E9A00524A8074CB7BD11B5D9ECF8B6C2--></AD_FIELD>
+
 <!--E9AA034E69644D3FAD38A9E6149A11A0--><AD_FIELD>
 <!--E9AA034E69644D3FAD38A9E6149A11A0-->  <AD_FIELD_ID><![CDATA[E9AA034E69644D3FAD38A9E6149A11A0]]></AD_FIELD_ID>
 <!--E9AA034E69644D3FAD38A9E6149A11A0-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -289808,6 +290647,34 @@
 <!--EB8FF491CE734785982BAD81F9523B93-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--EB8FF491CE734785982BAD81F9523B93--></AD_FIELD>
 
+<!--EC3124AE4095410DA49E7AC5FEF2AC48--><AD_FIELD>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <AD_FIELD_ID><![CDATA[EC3124AE4095410DA49E7AC5FEF2AC48]]></AD_FIELD_ID>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <NAME><![CDATA[Closing Fact_Acct_Group_ID]]></NAME>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <DESCRIPTION><![CDATA[Refers to the Fact_Acct_Group_ID of the closing entry]]></DESCRIPTION>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <HELP><![CDATA[Refers to the Fact_Acct_Group_ID of the closing entry]]></HELP>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <AD_COLUMN_ID><![CDATA[5854D61EEF913B11E040007F01002D1D]]></AD_COLUMN_ID>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <SEQNO><![CDATA[100]]></SEQNO>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--EC3124AE4095410DA49E7AC5FEF2AC48--></AD_FIELD>
+
 <!--EC787F77B1254D9A871B60CF6F2A52DA--><AD_FIELD>
 <!--EC787F77B1254D9A871B60CF6F2A52DA-->  <AD_FIELD_ID><![CDATA[EC787F77B1254D9A871B60CF6F2A52DA]]></AD_FIELD_ID>
 <!--EC787F77B1254D9A871B60CF6F2A52DA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -294539,6 +295406,33 @@
 <!--FAA9ED0D2AEA444F83D09DF2FE479785-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--FAA9ED0D2AEA444F83D09DF2FE479785--></AD_FIELD>
 
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE--><AD_FIELD>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <AD_FIELD_ID><![CDATA[FAAB7E56371A4A6984C12D3DABE5DFAE]]></AD_FIELD_ID>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <NAME><![CDATA[Period]]></NAME>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <DESCRIPTION><![CDATA[A specified time period.]]></DESCRIPTION>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <HELP><![CDATA[The Period indicates an exclusive range of dates for a calendar.]]></HELP>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <AD_COLUMN_ID><![CDATA[837]]></AD_COLUMN_ID>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISDISPLAYED><![CDATA[N]]></ISDISPLAYED>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <DISPLAYLENGTH><![CDATA[32]]></DISPLAYLENGTH>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--FAAB7E56371A4A6984C12D3DABE5DFAE--></AD_FIELD>
+
 <!--FAB4A3C5C0F34374B68D789C4710BF99--><AD_FIELD>
 <!--FAB4A3C5C0F34374B68D789C4710BF99-->  <AD_FIELD_ID><![CDATA[FAB4A3C5C0F34374B68D789C4710BF99]]></AD_FIELD_ID>
 <!--FAB4A3C5C0F34374B68D789C4710BF99-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-db/database/sourcedata/AD_MESSAGE.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -17399,6 +17399,18 @@
 <!--24DC08DDDEF64FFE81EF69745410C78C-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--24DC08DDDEF64FFE81EF69745410C78C--></AD_MESSAGE>
 
+<!--270BF082B1234A3FB74792CC4E5A4B26--><AD_MESSAGE>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <AD_MESSAGE_ID><![CDATA[270BF082B1234A3FB74792CC4E5A4B26]]></AD_MESSAGE_ID>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <VALUE><![CDATA[InitBPCurrencyLnk]]></VALUE>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <MSGTEXT><![CDATA[Please initialize <a class="LabelLink" onclick="OB.Utilities.openDirectTab('220', '%s')" href="#"> %s </a> business partner currency before processing the document.]]></MSGTEXT>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--270BF082B1234A3FB74792CC4E5A4B26-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--270BF082B1234A3FB74792CC4E5A4B26--></AD_MESSAGE>
+
 <!--272961BF12DB4930A0F8EDDADE8827CA--><AD_MESSAGE>
 <!--272961BF12DB4930A0F8EDDADE8827CA-->  <AD_MESSAGE_ID><![CDATA[272961BF12DB4930A0F8EDDADE8827CA]]></AD_MESSAGE_ID>
 <!--272961BF12DB4930A0F8EDDADE8827CA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TAB.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-db/database/sourcedata/AD_TAB.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -14947,6 +14947,35 @@
 <!--4F9E1C27F7F040C58C5CA2E6FD5B26CB-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
 <!--4F9E1C27F7F040C58C5CA2E6FD5B26CB--></AD_TAB>
 
+<!--4FB5884A443240EEB5504BBF7813870D--><AD_TAB>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <AD_TAB_ID><![CDATA[4FB5884A443240EEB5504BBF7813870D]]></AD_TAB_ID>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <NAME><![CDATA[Documents]]></NAME>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <AD_TABLE_ID><![CDATA[229]]></AD_TABLE_ID>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <AD_WINDOW_ID><![CDATA[110]]></AD_WINDOW_ID>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <SEQNO><![CDATA[52]]></SEQNO>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <TABLEVEL><![CDATA[2]]></TABLEVEL>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <ISTRANSLATIONTAB><![CDATA[N]]></ISTRANSLATIONTAB>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <HASTREE><![CDATA[N]]></HASTREE>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <ISREADONLYTREE><![CDATA[N]]></ISREADONLYTREE>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <ISSHOWTREENODEICONS><![CDATA[Y]]></ISSHOWTREENODEICONS>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <EM_OBUIAPP_CAN_ADD><![CDATA[N]]></EM_OBUIAPP_CAN_ADD>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <EM_OBUIAPP_CAN_DELETE><![CDATA[N]]></EM_OBUIAPP_CAN_DELETE>
+<!--4FB5884A443240EEB5504BBF7813870D-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
+<!--4FB5884A443240EEB5504BBF7813870D--></AD_TAB>
+
 <!--5247D51755AA43F384EBC35006FC2329--><AD_TAB>
 <!--5247D51755AA43F384EBC35006FC2329-->  <AD_TAB_ID><![CDATA[5247D51755AA43F384EBC35006FC2329]]></AD_TAB_ID>
 <!--5247D51755AA43F384EBC35006FC2329-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -15623,8 +15652,8 @@
 <!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <AD_TAB_ID><![CDATA[6BC4F7D2CBE94AEE939CCB5990B55FEA]]></AD_TAB_ID>
 <!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
 <!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
-<!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
-<!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <NAME><![CDATA[Period Control]]></NAME>
+<!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <ISACTIVE><![CDATA[N]]></ISACTIVE>
+<!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <NAME><![CDATA[Period Control Old]]></NAME>
 <!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <DESCRIPTION><![CDATA[View to display the Period Control for the selected organization]]></DESCRIPTION>
 <!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <HELP><![CDATA[Period control tab is a read-only tab which lists the fiscal calendar period status of an organization.]]></HELP>
 <!--6BC4F7D2CBE94AEE939CCB5990B55FEA-->  <AD_TABLE_ID><![CDATA[CB391C8A13D74B688A34017B5B5D1F5D]]></AD_TABLE_ID>
@@ -16428,6 +16457,38 @@
 <!--8723B0D2464B4AF8B63EDD3E541B883D-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
 <!--8723B0D2464B4AF8B63EDD3E541B883D--></AD_TAB>
 
+<!--885A6DB490044F3F8528373B60E3D9F5--><AD_TAB>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <AD_TAB_ID><![CDATA[885A6DB490044F3F8528373B60E3D9F5]]></AD_TAB_ID>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <NAME><![CDATA[Period Control]]></NAME>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <AD_TABLE_ID><![CDATA[145]]></AD_TABLE_ID>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <AD_WINDOW_ID><![CDATA[110]]></AD_WINDOW_ID>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <SEQNO><![CDATA[51]]></SEQNO>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <TABLEVEL><![CDATA[1]]></TABLEVEL>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <ISTRANSLATIONTAB><![CDATA[N]]></ISTRANSLATIONTAB>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <HASTREE><![CDATA[N]]></HASTREE>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <HQLORDERBYCLAUSE><![CDATA[startingDate]]></HQLORDERBYCLAUSE>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <HQLFILTERCLAUSE><![CDATA[e._computedColumns.status not in ('P','C')]]></HQLFILTERCLAUSE>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <DISPLAYLOGIC><![CDATA[@IsPeriodControlAllowed@='Y']]></DISPLAYLOGIC>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <ISREADONLYTREE><![CDATA[N]]></ISREADONLYTREE>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <ISSHOWTREENODEICONS><![CDATA[Y]]></ISSHOWTREENODEICONS>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <EM_OBUIAPP_CAN_ADD><![CDATA[N]]></EM_OBUIAPP_CAN_ADD>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <EM_OBUIAPP_CAN_DELETE><![CDATA[N]]></EM_OBUIAPP_CAN_DELETE>
+<!--885A6DB490044F3F8528373B60E3D9F5-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
+<!--885A6DB490044F3F8528373B60E3D9F5--></AD_TAB>
+
 <!--89A2764B004B4D95B09C9F4C1CB56BE5--><AD_TAB>
 <!--89A2764B004B4D95B09C9F4C1CB56BE5-->  <AD_TAB_ID><![CDATA[89A2764B004B4D95B09C9F4C1CB56BE5]]></AD_TAB_ID>
 <!--89A2764B004B4D95B09C9F4C1CB56BE5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-db/database/sourcedata/AD_TEXTINTERFACES.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -12508,6 +12508,325 @@
 <!--1005900031-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--1005900031--></AD_TEXTINTERFACES>
 
+<!--000E28DCAC59E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC59E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC59E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC59E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC59E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC59E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC59E636E050007F01015D90-->  <TEXT><![CDATA[M. %]]></TEXT>
+<!--000E28DCAC59E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC59E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC59E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC59E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC5BE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC5BE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC5BE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC5BE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC5BE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC5BE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC5BE636E050007F01015D90-->  <TEXT><![CDATA[Amt. ref]]></TEXT>
+<!--000E28DCAC5BE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC5BE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC5BE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC5BE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC5DE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC5DE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC5DE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC5DE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC5DE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC5DE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC5DE636E050007F01015D90-->  <TEXT><![CDATA[Cost ref]]></TEXT>
+<!--000E28DCAC5DE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC5DE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC5DE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC5DE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC5FE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC5FE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC5FE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC5FE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC5FE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC5FE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC5FE636E050007F01015D90-->  <TEXT><![CDATA[Pro. ref]]></TEXT>
+<!--000E28DCAC5FE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC5FE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC5FE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC5FE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC61E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC61E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC61E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC61E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC61E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC61E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC61E636E050007F01015D90-->  <TEXT><![CDATA[M.r %]]></TEXT>
+<!--000E28DCAC61E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC61E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC61E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC61E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC63E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC63E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC63E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC63E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC63E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC63E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC63E636E050007F01015D90-->  <TEXT><![CDATA[A. %]]></TEXT>
+<!--000E28DCAC63E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC63E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC63E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC63E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC65E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC65E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC65E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC65E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC65E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC65E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC65E636E050007F01015D90-->  <TEXT><![CDATA[M.dif]]></TEXT>
+<!--000E28DCAC65E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC65E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC65E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC65E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC67E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC67E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC67E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC67E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC67E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC67E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC67E636E050007F01015D90-->  <TEXT><![CDATA[Amt. ref2]]></TEXT>
+<!--000E28DCAC67E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC67E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC67E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC67E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC69E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC69E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC69E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC69E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC69E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC69E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC69E636E050007F01015D90-->  <TEXT><![CDATA[Cost ref2]]></TEXT>
+<!--000E28DCAC69E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC69E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC69E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC69E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC6BE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC6BE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC6BE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC6BE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC6BE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC6BE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC6BE636E050007F01015D90-->  <TEXT><![CDATA[Pro. ref2]]></TEXT>
+<!--000E28DCAC6BE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC6BE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC6BE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC6BE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC6DE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC6DE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC6DE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC6DE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC6DE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC6DE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC6DE636E050007F01015D90-->  <TEXT><![CDATA[M.r2 %]]></TEXT>
+<!--000E28DCAC6DE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC6DE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC6DE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC6DE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC6FE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC6FE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC6FE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC6FE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC6FE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC6FE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC6FE636E050007F01015D90-->  <TEXT><![CDATA[A.2 %]]></TEXT>
+<!--000E28DCAC6FE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC6FE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC6FE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC6FE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC71E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC71E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC71E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC71E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC71E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC71E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC71E636E050007F01015D90-->  <TEXT><![CDATA[M.dif2]]></TEXT>
+<!--000E28DCAC71E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC71E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC71E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC71E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC73E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC73E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC73E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC73E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC73E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC73E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC73E636E050007F01015D90-->  <TEXT><![CDATA[W. Ref]]></TEXT>
+<!--000E28DCAC73E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC73E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC73E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC73E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC75E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC75E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC75E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC75E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC75E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC75E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC75E636E050007F01015D90-->  <TEXT><![CDATA[W.Ref2]]></TEXT>
+<!--000E28DCAC75E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC75E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC75E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC75E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC77E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC77E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC77E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC77E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC77E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC77E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC77E636E050007F01015D90-->  <TEXT><![CDATA[Q. ref]]></TEXT>
+<!--000E28DCAC77E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC77E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC77E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC77E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC79E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC79E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC79E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC79E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC79E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC79E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC79E636E050007F01015D90-->  <TEXT><![CDATA[Qty%]]></TEXT>
+<!--000E28DCAC79E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC79E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC79E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC79E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC7BE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC7BE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC7BE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC7BE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC7BE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC7BE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC7BE636E050007F01015D90-->  <TEXT><![CDATA[Q. ref2]]></TEXT>
+<!--000E28DCAC7BE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC7BE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC7BE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC7BE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC7DE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC7DE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC7DE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC7DE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC7DE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC7DE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC7DE636E050007F01015D90-->  <TEXT><![CDATA[Qty2%]]></TEXT>
+<!--000E28DCAC7DE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC7DE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC7DE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC7DE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC7FE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC7FE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC7FE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC7FE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC7FE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC7FE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC7FE636E050007F01015D90-->  <TEXT><![CDATA[Amt. ref3]]></TEXT>
+<!--000E28DCAC7FE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC7FE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC7FE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC7FE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC81E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC81E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC81E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC81E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC81E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC81E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC81E636E050007F01015D90-->  <TEXT><![CDATA[Cost ref3]]></TEXT>
+<!--000E28DCAC81E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC81E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC81E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC81E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC83E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC83E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC83E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC83E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC83E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC83E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC83E636E050007F01015D90-->  <TEXT><![CDATA[Pro. ref3]]></TEXT>
+<!--000E28DCAC83E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC83E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC83E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC83E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC85E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC85E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC85E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC85E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC85E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC85E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC85E636E050007F01015D90-->  <TEXT><![CDATA[M.r3 %]]></TEXT>
+<!--000E28DCAC85E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC85E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC85E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC85E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC87E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC87E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC87E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC87E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC87E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC87E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC87E636E050007F01015D90-->  <TEXT><![CDATA[A.3 %]]></TEXT>
+<!--000E28DCAC87E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC87E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC87E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC87E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC89E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC89E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC89E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC89E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC89E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC89E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC89E636E050007F01015D90-->  <TEXT><![CDATA[M.dif3]]></TEXT>
+<!--000E28DCAC89E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC89E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC89E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC89E636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC8BE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC8BE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC8BE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC8BE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC8BE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC8BE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC8BE636E050007F01015D90-->  <TEXT><![CDATA[W.Ref3]]></TEXT>
+<!--000E28DCAC8BE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC8BE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC8BE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC8BE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC8DE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC8DE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC8DE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC8DE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC8DE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC8DE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC8DE636E050007F01015D90-->  <TEXT><![CDATA[Q. ref3]]></TEXT>
+<!--000E28DCAC8DE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC8DE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC8DE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC8DE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC8FE636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC8FE636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC8FE636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC8FE636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC8FE636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC8FE636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC8FE636E050007F01015D90-->  <TEXT><![CDATA[Qty3%]]></TEXT>
+<!--000E28DCAC8FE636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC8FE636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC8FE636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC8FE636E050007F01015D90--></AD_TEXTINTERFACES>
+
+<!--000E28DCAC91E636E050007F01015D90--><AD_TEXTINTERFACES>
+<!--000E28DCAC91E636E050007F01015D90-->  <AD_TEXTINTERFACES_ID><![CDATA[000E28DCAC91E636E050007F01015D90]]></AD_TEXTINTERFACES_ID>
+<!--000E28DCAC91E636E050007F01015D90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--000E28DCAC91E636E050007F01015D90-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--000E28DCAC91E636E050007F01015D90-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--000E28DCAC91E636E050007F01015D90-->  <TEXT><![CDATA[Generated on]]></TEXT>
+<!--000E28DCAC91E636E050007F01015D90-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml]]></FILENAME>
+<!--000E28DCAC91E636E050007F01015D90-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--000E28DCAC91E636E050007F01015D90-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--000E28DCAC91E636E050007F01015D90--></AD_TEXTINTERFACES>
+
 <!--006359C02D074CCE8F3770E59CEC20C5--><AD_TEXTINTERFACES>
 <!--006359C02D074CCE8F3770E59CEC20C5-->  <AD_TEXTINTERFACES_ID><![CDATA[006359C02D074CCE8F3770E59CEC20C5]]></AD_TEXTINTERFACES_ID>
 <!--006359C02D074CCE8F3770E59CEC20C5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -21910,4 +22229,224 @@
 <!--FE9F357DE872420ABD3286CDCAE919D1-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
 <!--FE9F357DE872420ABD3286CDCAE919D1--></AD_TEXTINTERFACES>
 
+<!--FFF934E2721F103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E2721F103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E2721F103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E2721F103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E2721F103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E2721F103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E2721F103EE040007F01010265-->  <TEXT><![CDATA[M. %]]></TEXT>
+<!--FFF934E2721F103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E2721F103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E2721F103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E2721F103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27221103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27221103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27221103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27221103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27221103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27221103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27221103EE040007F01010265-->  <TEXT><![CDATA[Amt. ref]]></TEXT>
+<!--FFF934E27221103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27221103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27221103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27221103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27223103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27223103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27223103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27223103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27223103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27223103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27223103EE040007F01010265-->  <TEXT><![CDATA[Cost ref]]></TEXT>
+<!--FFF934E27223103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27223103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27223103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27223103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27225103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27225103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27225103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27225103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27225103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27225103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27225103EE040007F01010265-->  <TEXT><![CDATA[Pro. ref]]></TEXT>
+<!--FFF934E27225103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27225103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27225103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27225103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27227103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27227103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27227103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27227103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27227103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27227103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27227103EE040007F01010265-->  <TEXT><![CDATA[M.r %]]></TEXT>
+<!--FFF934E27227103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27227103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27227103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27227103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27229103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27229103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27229103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27229103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27229103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27229103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27229103EE040007F01010265-->  <TEXT><![CDATA[A. %]]></TEXT>
+<!--FFF934E27229103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27229103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27229103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27229103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E2722B103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E2722B103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E2722B103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E2722B103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E2722B103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E2722B103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E2722B103EE040007F01010265-->  <TEXT><![CDATA[M.dif]]></TEXT>
+<!--FFF934E2722B103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E2722B103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E2722B103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E2722B103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E2722D103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E2722D103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E2722D103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E2722D103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E2722D103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E2722D103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E2722D103EE040007F01010265-->  <TEXT><![CDATA[Amt. ref2]]></TEXT>
+<!--FFF934E2722D103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E2722D103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E2722D103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E2722D103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E2722F103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E2722F103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E2722F103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E2722F103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E2722F103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E2722F103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E2722F103EE040007F01010265-->  <TEXT><![CDATA[Cost ref2]]></TEXT>
+<!--FFF934E2722F103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E2722F103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E2722F103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E2722F103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27231103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27231103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27231103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27231103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27231103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27231103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27231103EE040007F01010265-->  <TEXT><![CDATA[Pro. ref2]]></TEXT>
+<!--FFF934E27231103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27231103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27231103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27231103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27233103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27233103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27233103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27233103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27233103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27233103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27233103EE040007F01010265-->  <TEXT><![CDATA[M.r2 %]]></TEXT>
+<!--FFF934E27233103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27233103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27233103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27233103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27235103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27235103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27235103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27235103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27235103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27235103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27235103EE040007F01010265-->  <TEXT><![CDATA[A.2 %]]></TEXT>
+<!--FFF934E27235103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27235103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27235103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27235103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27237103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27237103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27237103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27237103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27237103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27237103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27237103EE040007F01010265-->  <TEXT><![CDATA[M.dif2]]></TEXT>
+<!--FFF934E27237103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27237103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27237103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27237103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27239103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27239103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27239103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27239103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27239103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27239103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27239103EE040007F01010265-->  <TEXT><![CDATA[W. Ref]]></TEXT>
+<!--FFF934E27239103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27239103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27239103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27239103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E2723B103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E2723B103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E2723B103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E2723B103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E2723B103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E2723B103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E2723B103EE040007F01010265-->  <TEXT><![CDATA[W.Ref2]]></TEXT>
+<!--FFF934E2723B103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E2723B103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E2723B103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E2723B103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E2723D103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E2723D103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E2723D103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E2723D103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E2723D103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E2723D103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E2723D103EE040007F01010265-->  <TEXT><![CDATA[Q. ref]]></TEXT>
+<!--FFF934E2723D103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E2723D103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E2723D103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E2723D103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E2723F103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E2723F103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E2723F103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E2723F103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E2723F103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E2723F103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E2723F103EE040007F01010265-->  <TEXT><![CDATA[Qty%]]></TEXT>
+<!--FFF934E2723F103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E2723F103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E2723F103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E2723F103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27241103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27241103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27241103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27241103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27241103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27241103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27241103EE040007F01010265-->  <TEXT><![CDATA[Q. ref2]]></TEXT>
+<!--FFF934E27241103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27241103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27241103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27241103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27243103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27243103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27243103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27243103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27243103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27243103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27243103EE040007F01010265-->  <TEXT><![CDATA[Qty2%]]></TEXT>
+<!--FFF934E27243103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27243103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27243103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27243103EE040007F01010265--></AD_TEXTINTERFACES>
+
+<!--FFF934E27245103EE040007F01010265--><AD_TEXTINTERFACES>
+<!--FFF934E27245103EE040007F01010265-->  <AD_TEXTINTERFACES_ID><![CDATA[FFF934E27245103EE040007F01010265]]></AD_TEXTINTERFACES_ID>
+<!--FFF934E27245103EE040007F01010265-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FFF934E27245103EE040007F01010265-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FFF934E27245103EE040007F01010265-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FFF934E27245103EE040007F01010265-->  <TEXT><![CDATA[Generated on]]></TEXT>
+<!--FFF934E27245103EE040007F01010265-->  <FILENAME><![CDATA[/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml]]></FILENAME>
+<!--FFF934E27245103EE040007F01010265-->  <ISUSED><![CDATA[Y]]></ISUSED>
+<!--FFF934E27245103EE040007F01010265-->  <AD_MODULE_ID><![CDATA[0]]></AD_MODULE_ID>
+<!--FFF934E27245103EE040007F01010265--></AD_TEXTINTERFACES>
+
 </data>
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/InitializeBPCurrency.class has changed
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/InitializeBPCurrencyData.class has changed
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateVariantImage.class has changed
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateVariantImageData.class has changed
--- a/src-util/modulescript/build/javasqlc/src/org/openbravo/modulescript/InitializeBPCurrencyData.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-util/modulescript/build/javasqlc/src/org/openbravo/modulescript/InitializeBPCurrencyData.java	Wed Nov 19 19:11:32 2014 +0100
@@ -122,6 +122,43 @@
     return(updateCount);
   }
 
+  public static int UpdateBpCurrency(ConnectionProvider connectionProvider)    throws ServletException {
+    String strSql = "";
+    strSql = strSql + 
+      "        UPDATE C_Bpartner bp" +
+      " 		SET BP_Currency_ID = (" +
+      " 		                     SELECT DISTINCT i.C_Currency_ID" +
+      " 		                     FROM C_INVOICE i" +
+      " 		                     WHERE i.C_Bpartner_ID = bp.C_Bpartner_ID " +
+      " 		                     AND i.docstatus = 'CO'" +
+      " 		                     AND ((SELECT COUNT(DISTINCT i.C_CURRENCY_ID) FROM C_INVOICE i " +
+      " 		                     WHERE i.docstatus='CO' AND i.C_Bpartner_ID = bp.C_Bpartner_ID) = 1) " +
+      " 		                     )" +
+      " 		WHERE bp.BP_Currency_ID IS NULL";
+
+    int updateCount = 0;
+    PreparedStatement st = null;
+
+    try {
+    st = connectionProvider.getPreparedStatement(strSql);
+
+      updateCount = st.executeUpdate();
+    } catch(SQLException e){
+      log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
+      throw new ServletException("@CODE=" + Integer.toString(e.getErrorCode()) + "@" + e.getMessage());
+    } catch(Exception ex){
+      log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
+      throw new ServletException("@CODE=@" + ex.getMessage());
+    } finally {
+      try {
+        connectionProvider.releasePreparedStatement(st);
+      } catch(Exception ignore){
+        ignore.printStackTrace();
+      }
+    }
+    return(updateCount);
+  }
+
   public static boolean isExecuted(ConnectionProvider connectionProvider)    throws ServletException {
     String strSql = "";
     strSql = strSql + 
@@ -257,4 +294,72 @@
     }
     return(updateCount);
   }
+
+  public static boolean isUpdatedFromInvoice(ConnectionProvider connectionProvider)    throws ServletException {
+    String strSql = "";
+    strSql = strSql + 
+      "        SELECT count(*) as exist" +
+      "        FROM DUAL" +
+      "        WHERE EXISTS (SELECT 1 FROM ad_preference" +
+      "                      WHERE attribute = 'isUpdatedFromInvoice')";
+
+    ResultSet result;
+    boolean boolReturn = false;
+    PreparedStatement st = null;
+
+    try {
+    st = connectionProvider.getPreparedStatement(strSql);
+
+      result = st.executeQuery();
+      if(result.next()) {
+        boolReturn = !UtilSql.getValue(result, "exist").equals("0");
+      }
+      result.close();
+    } catch(SQLException e){
+      log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
+      throw new ServletException("@CODE=" + Integer.toString(e.getErrorCode()) + "@" + e.getMessage());
+    } catch(Exception ex){
+      log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
+      throw new ServletException("@CODE=@" + ex.getMessage());
+    } finally {
+      try {
+        connectionProvider.releasePreparedStatement(st);
+      } catch(Exception ignore){
+        ignore.printStackTrace();
+      }
+    }
+    return(boolReturn);
+  }
+
+  public static int createUpdateFromInvoicePref(ConnectionProvider connectionProvider)    throws ServletException {
+    String strSql = "";
+    strSql = strSql + 
+      "           INSERT INTO ad_preference (" +
+      "           ad_preference_id, ad_client_id, ad_org_id, isactive," +
+      "           createdby, created, updatedby, updated,attribute" +
+      "           ) VALUES (" +
+      "           get_uuid(), '0', '0', 'Y', '0', NOW(), '0', NOW(),'isUpdatedFromInvoice')";
+
+    int updateCount = 0;
+    PreparedStatement st = null;
+
+    try {
+    st = connectionProvider.getPreparedStatement(strSql);
+
+      updateCount = st.executeUpdate();
+    } catch(SQLException e){
+      log4j.error("SQL error in query: " + strSql + "Exception:"+ e);
+      throw new ServletException("@CODE=" + Integer.toString(e.getErrorCode()) + "@" + e.getMessage());
+    } catch(Exception ex){
+      log4j.error("Exception in query: " + strSql + "Exception:"+ ex);
+      throw new ServletException("@CODE=@" + ex.getMessage());
+    } finally {
+      try {
+        connectionProvider.releasePreparedStatement(st);
+      } catch(Exception ignore){
+        ignore.printStackTrace();
+      }
+    }
+    return(updateCount);
+  }
 }
--- a/src-util/modulescript/src/org/openbravo/modulescript/InitializeBPCurrency.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-util/modulescript/src/org/openbravo/modulescript/InitializeBPCurrency.java	Wed Nov 19 19:11:32 2014 +0100
@@ -37,12 +37,22 @@
         InitializeBPCurrencyData.initializeCurrency(cp);
         InitializeBPCurrencyData.createPreference(cp);
         InitializeBPCurrencyData.createUpdatePreference(cp);
+        // update bp currency if it is not updated by initializeCurrency
+        // and there exists completed invoice in same currency 
+        // for any business partner
+        InitializeBPCurrencyData.UpdateBpCurrency(cp);
+        InitializeBPCurrencyData.createUpdateFromInvoicePref(cp);
       } else {
         boolean isUpdated = InitializeBPCurrencyData.isUpdated(cp);
         if(!isUpdated) {
           InitializeBPCurrencyData.initializeCurrency(cp);
           InitializeBPCurrencyData.createUpdatePreference(cp);
         }
+        boolean isUpdatedFromInv = InitializeBPCurrencyData.isUpdatedFromInvoice(cp);
+        if(!isUpdatedFromInv) {
+          InitializeBPCurrencyData.UpdateBpCurrency(cp);
+          InitializeBPCurrencyData.createUpdateFromInvoicePref(cp);
+        }
       }
     } catch (Exception e) {
       handleError(e);
--- a/src-util/modulescript/src/org/openbravo/modulescript/InitializeBPCurrency_data.xsql	Wed Nov 19 19:04:06 2014 +0100
+++ b/src-util/modulescript/src/org/openbravo/modulescript/InitializeBPCurrency_data.xsql	Wed Nov 19 19:11:32 2014 +0100
@@ -44,6 +44,23 @@
       ]]>
     </Sql>
   </SqlMethod>
+  <SqlMethod name="UpdateBpCurrency" type="preparedStatement" return="rowCount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+     <![CDATA[
+        UPDATE C_Bpartner bp
+ 		SET BP_Currency_ID = (
+ 		                     SELECT DISTINCT i.C_Currency_ID
+ 		                     FROM C_INVOICE i
+ 		                     WHERE i.C_Bpartner_ID = bp.C_Bpartner_ID 
+ 		                     AND i.docstatus = 'CO'
+ 		                     AND ((SELECT COUNT(DISTINCT i.C_CURRENCY_ID) FROM C_INVOICE i 
+ 		                     WHERE i.docstatus='CO' AND i.C_Bpartner_ID = bp.C_Bpartner_ID) = 1) 
+ 		                     )
+ 		WHERE bp.BP_Currency_ID IS NULL
+      ]]>
+    </Sql>
+  </SqlMethod>
   <SqlMethod name="isExecuted" type="preparedStatement" return="boolean">
     <SqlMethodComment></SqlMethodComment>
     <Sql>
@@ -90,4 +107,27 @@
          ]]>
         </Sql>
    </SqlMethod>
+   <SqlMethod name="isUpdatedFromInvoice" type="preparedStatement" return="boolean">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        SELECT count(*) as exist
+        FROM DUAL
+        WHERE EXISTS (SELECT 1 FROM ad_preference
+                      WHERE attribute = 'isUpdatedFromInvoice')
+      ]]>
+    </Sql>
+  </SqlMethod>
+   <SqlMethod name="createUpdateFromInvoicePref" type="preparedStatement" return="rowcount">
+      <SqlMethodComment></SqlMethodComment>
+       <Sql>
+       <![CDATA[
+           INSERT INTO ad_preference (
+           ad_preference_id, ad_client_id, ad_org_id, isactive,
+           createdby, created, updatedby, updated,attribute
+           ) VALUES (
+           get_uuid(), '0', '0', 'Y', '0', NOW(), '0', NOW(),'isUpdatedFromInvoice')
+         ]]>
+        </Sql>
+   </SqlMethod>
 </SqlClass>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdateVariantImage.java	Wed Nov 19 19:11:32 2014 +0100
@@ -0,0 +1,53 @@
+/*
+ *************************************************************************
+ * 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) 2014 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.modulescript;
+
+import org.apache.log4j.Logger;
+import org.openbravo.database.ConnectionProvider;
+import org.openbravo.modulescript.ModuleScript;
+
+public class UpdateVariantImage extends ModuleScript {
+
+  private static final Logger log4j = Logger.getLogger(UpdateVariantImage.class);
+
+  @Override
+  public void execute() {
+    try {
+      ConnectionProvider cp = getConnectionProvider();
+      boolean executed = UpdateVariantImageData.isModuleScriptExecuted(cp);
+
+      if (!executed) {
+        UpdateVariantImageData[] data = UpdateVariantImageData.getVariantsImageId(cp);
+        for (UpdateVariantImageData variantsImage : data) {
+          String generatedId = UpdateVariantImageData.getGeneratedId(cp);
+          int count = UpdateVariantImageData.insertNewProductImage(cp, generatedId,
+              variantsImage.adImageId);
+
+          if (count > 0) {
+            UpdateVariantImageData.updateVariantImage(cp, generatedId, variantsImage.mProductId);
+          }
+        }
+        UpdateVariantImageData.createPreference(cp);
+      }
+    } catch (Exception e) {
+      handleError(e);
+    }
+  }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdateVariantImage_data.xsql	Wed Nov 19 19:11:32 2014 +0100
@@ -0,0 +1,94 @@
+<?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) 2014 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<SqlClass name="UpdateVariantImageData" package="org.openbravo.modulescript">
+   <SqlClassComment></SqlClassComment>
+  <SqlMethod name="select" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql><![CDATA[
+      SELECT '' AS AD_IMAGE_ID, '' AS M_PRODUCT_ID FROM DUAL
+      ]]>
+    </Sql>
+  </SqlMethod>
+  <SqlMethod name="getVariantsImageId" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql><![CDATA[
+       SELECT AD_IMAGE_ID, M_PRODUCT_ID 
+       FROM M_PRODUCT 
+       WHERE GENERIC_PRODUCT_ID IS NOT NULL
+      ]]></Sql>
+  </SqlMethod>
+  <SqlMethod name="getGeneratedId" type="preparedStatement" return="string">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql><![CDATA[
+       SELECT GET_UUID() AS AD_IMAGE_ID FROM DUAL
+      ]]></Sql>
+  </SqlMethod>
+  <SqlMethod name="insertNewProductImage" type="preparedStatement" return="rowcount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+      INSERT INTO AD_IMAGE (
+          AD_IMAGE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE,
+          CREATED, CREATEDBY, UPDATED, UPDATEDBY,
+          NAME, BINARYDATA, WIDTH, HEIGHT, MIMETYPE
+        ) 
+          SELECT ?, AD_CLIENT_ID, AD_ORG_ID, 'Y',
+                now(), CREATEDBY, now(), UPDATEDBY,
+                NAME, BINARYDATA, WIDTH, HEIGHT, MIMETYPE
+          FROM AD_IMAGE 
+          WHERE AD_IMAGE_ID = ?
+      ]]>
+    </Sql>
+    <Parameter name="generatedId"/>
+    <Parameter name="imageId"/>
+  </SqlMethod>
+  <SqlMethod name="updateVariantImage" type="preparedStatement" return="rowcount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql><![CDATA[
+      UPDATE M_PRODUCT SET AD_IMAGE_ID = ? WHERE M_PRODUCT_ID = ?
+      ]]>
+    </Sql>
+    <Parameter name="imageId"/>
+    <Parameter name="productId"/>
+  </SqlMethod>
+  <SqlMethod name="isModuleScriptExecuted" type="preparedStatement" return="boolean">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+    SELECT COUNT(*) AS EXIST
+    FROM AD_PREFERENCE
+    WHERE ATTRIBUTE = 'UpdateVariantImage' AND ISACTIVE = 'Y'
+      ]]>
+    </Sql>
+  </SqlMethod>
+   <SqlMethod name="createPreference" type="preparedStatement" return="rowcount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+    INSERT INTO AD_PREFERENCE (
+    AD_PREFERENCE_ID, AD_CLIENT_ID, AD_ORG_ID, ISACTIVE,
+    CREATEDBY, CREATED, UPDATEDBY, UPDATED, ATTRIBUTE
+    ) VALUES (
+    GET_UUID(), '0', '0', 'Y', 
+    '0', NOW(), '0', NOW(), 'UpdateVariantImage')
+      ]]>
+    </Sql>
+  </SqlMethod>
+</SqlClass>
\ No newline at end of file
--- a/src/org/openbravo/base/model/ModelProvider.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/src/org/openbravo/base/model/ModelProvider.java	Wed Nov 19 19:11:32 2014 +0100
@@ -900,10 +900,26 @@
    * @throws CheckException
    */
   public Entity getEntity(String entityName) throws CheckException {
+    boolean checkIfNotExists = true;
+    return getEntity(entityName, checkIfNotExists);
+  }
+
+  /**
+   * Retrieves an Entity using the entityName. If not found then a CheckException is thrown if the
+   * checkIfNotExists parameter is true.
+   * 
+   * @param entityName
+   *          the name used for searching the Entity.
+   * @param checkIfNotExists
+   *          a boolean that is true calls to Check.fail if the entity does not exist
+   * @return the Entity object
+   * @throws CheckException
+   */
+  public Entity getEntity(String entityName, boolean checkIfNotExists) throws CheckException {
     if (model == null)
       getModel();
     final Entity entity = entitiesByName.get(entityName);
-    if (entity == null) {
+    if (entity == null && checkIfNotExists) {
       Check.fail("Mapping name: " + entityName + " not found in runtime model");
     }
     return entity;
--- a/src/org/openbravo/common/actionhandler/ManageReservationActionHandler.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/src/org/openbravo/common/actionhandler/ManageReservationActionHandler.java	Wed Nov 19 19:11:32 2014 +0100
@@ -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 Openbravo SLU 
+ * All portions are Copyright (C) 2013-2014 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -186,8 +186,11 @@
     if (idList.size() > 0) {
       for (String id : idList) {
         ReservationStock resStock = OBDal.getInstance().get(ReservationStock.class, id);
-        reservation.getMaterialMgmtReservationStockList().remove(resStock);
-        OBDal.getInstance().remove(resStock);
+        if(resStock.getReleased() == null
+            || resStock.getReleased().compareTo(BigDecimal.ZERO) == 0) {
+          reservation.getMaterialMgmtReservationStockList().remove(resStock);
+          OBDal.getInstance().remove(resStock);
+        }
       }
       OBDal.getInstance().save(reservation);
       OBDal.getInstance().flush();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/configuration/ConfigurationApp.java	Wed Nov 19 19:11:32 2014 +0100
@@ -0,0 +1,1456 @@
+/*
+ *************************************************************************
+ * 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) 2014 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.configuration;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Scanner;
+import java.util.TreeMap;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.tools.ant.Project;
+
+/**
+ * ConfigurationApp configure Openbravo.properties. Besides creates some files from their respective
+ * templates. If this process ends successfully and all the details are correct, the environment
+ * will be ready for the ant install.source. *execute() method is invoke by ant setup task.
+ * 
+ * @author inigosanchez
+ * 
+ */
+public class ConfigurationApp extends org.apache.tools.ant.Task {
+
+  private static HashMap<Integer, ConfigureOption> optionLast = new HashMap<Integer, ConfigureOption>();
+  private static HashMap<Integer, ConfigureOption> optionOracle = new HashMap<Integer, ConfigureOption>();
+  private static HashMap<Integer, ConfigureOption> optionPostgreSQL = new HashMap<Integer, ConfigureOption>();
+  private static HashMap<Integer, ConfigureOption> optionFirst = new HashMap<Integer, ConfigureOption>();
+  private static HashMap<String, String> replaceProperties = new HashMap<String, String>();
+
+  private final static String BASEDIR = System.getProperty("user.dir");
+  private final static String BASEDIR_CONFIG = BASEDIR + "/config/";
+
+  private final static String OPENBRAVO_PROPERTIES_TEMPLATE = BASEDIR_CONFIG
+      + "Openbravo.properties.template";
+  private final static String OPENBRAVO_PROPERTIES = BASEDIR_CONFIG + "Openbravo.properties";
+  private final static String OPENBRAVO_PROPERTIES_AUX = BASEDIR_CONFIG
+      + "Openbravo.properties.aux";
+  private final static String FORMAT_XML_TEMPLATE = BASEDIR_CONFIG + "Format.xml.template";
+  private final static String FORMAT_XML = BASEDIR_CONFIG + "Format.xml";
+  private final static String LOG4J_LCF_TAMPLATE = BASEDIR_CONFIG + "log4j.lcf.template";
+  private final static String LOG4J_LCF = BASEDIR_CONFIG + "log4j.lcf";
+  private final static String USERCONFIG_XML_TEMPLATE = BASEDIR_CONFIG + "userconfig.xml.template";
+  private final static String USERCONFIG_XML = BASEDIR_CONFIG + "userconfig.xml";
+  private final static String COMMON_COMPONENT_TEMPLATE = ".settings/org.eclipse.wst.common.component.template";
+  private final static String COMMON_COMPONENT = ".settings/org.eclipse.wst.common.component";
+  private final static String CLASSPATH_TEMPLATE = ".classpath.template";
+  private final static String CLASSPATH = ".classpath";
+
+  private final static String OPENBRAVO_LICENSE = BASEDIR + "/legal/Licensing.txt";
+  private static final int LINES_SHOWING_LICENSE = 50;
+
+  public void execute() {
+    Scanner licenseIn = new Scanner(System.in);
+    Scanner inp = new Scanner(System.in);
+    int option, menuOption = 0, optionMod = 0, numOptionsDDBB = 0, mainOption = 0, optionConfigure = 0;
+    String optionString = "", optionS, input, menuOptionS;
+    boolean numberOk, isChange, isChangeO, isChangeL, menuOptionOk;
+    Project p = getProject();
+
+    // Copy templates and rename files
+    fileCopyTemplate(FORMAT_XML_TEMPLATE, FORMAT_XML, p);
+    fileCopyTemplate(LOG4J_LCF_TAMPLATE, LOG4J_LCF, p);
+    fileCopyTemplate(USERCONFIG_XML_TEMPLATE, USERCONFIG_XML, p);
+    fileCopyTemplate(OPENBRAVO_PROPERTIES_TEMPLATE, OPENBRAVO_PROPERTIES, p);
+    fileCopyTemplate(COMMON_COMPONENT_TEMPLATE, COMMON_COMPONENT, p);
+    fileCopyTemplate(CLASSPATH_TEMPLATE, CLASSPATH, p);
+
+    while (mainOption != -1) {
+      switch (mainOption) {
+      case 0:
+        showWelcome(p);
+        try {
+          readLicense(p);
+        } catch (IOException e) {
+          e.printStackTrace();
+        }
+        p.log("Do you accept this license? [y/n]: ");
+        input = licenseIn.nextLine();
+        while (!("Y".equalsIgnoreCase(input) || "N".equalsIgnoreCase(input))) {
+          p.log("Please, introduce a correct option. Do you accept this license? [y/n]: ");
+          input = licenseIn.nextLine();
+        }
+        if ("Y".equalsIgnoreCase(input)) {
+          mainOption++;
+        } else if ("N".equalsIgnoreCase(input)) {
+          p.log("---------------------------------------------------------------------------- \n You have not successfully completed the configuration process.");
+          mainOption = -1;
+        }
+        break;
+      case 1:
+        p.log("---------------------------------------------------------------------------- \n Please choose one option. \n----------------------------------------------------------------------------");
+        p.log("[1]. Step-by-step configuration.");
+        p.log("[2]. Default configuration.");
+        p.log("[3]. Exit without saving.");
+        p.log("Choose an option: ");
+        mainOption++;
+        break;
+      case 2:
+        menuOptionOk = false;
+        do {
+          menuOptionS = inp.nextLine();
+          try {
+            menuOption = Integer.parseInt(menuOptionS);
+            menuOptionOk = true;
+          } catch (NumberFormatException e) {
+            p.log("Please, introduce a correct option: ");
+          }
+        } while (!menuOptionOk);
+        // Create options one-by-one
+        if (menuOption == 1) {
+          if (optionFirst.isEmpty()) {
+            optionFirst = createOP(p);
+          }
+          // Create optionsDDBB
+          // Oracle or Postgresql options
+          String keyValueS = "";
+          Iterator<Integer> optionBBDD = optionFirst.keySet().iterator();
+          do {
+            keyValueS = optionFirst.get(optionBBDD.next()).getChooseString();
+          } while (!(keyValueS.equals("PostgreSQL") || keyValueS.equals("Oracle")));
+          if (keyValueS.equals("Oracle")) {
+            optionOracle = createOPOracle(p);
+            numOptionsDDBB = optionOracle.size();
+          } else if (keyValueS.equals("PostgreSQL")) {
+            optionPostgreSQL = createOPPostgreSQL(p);
+            numOptionsDDBB = optionPostgreSQL.size();
+          }
+          mainOption = 3;
+          // Create all options by default.
+        } else if (menuOption == 2) {
+          if (optionFirst.isEmpty()) {
+            optionFirst = createOP(p);
+          }
+          // Oracle or Postgresql options
+          String keyValue = "";
+          Iterator<Integer> optionBBDD = optionFirst.keySet().iterator();
+          do {
+            keyValue = optionFirst.get(optionBBDD.next()).getChooseString();
+          } while (!(keyValue.equals("PostgreSQL") || keyValue.equals("Oracle")));
+          if (keyValue.equals("Oracle")) {
+            optionOracle = createOPOracle(p);
+            numOptionsDDBB = optionOracle.size();
+          } else if (keyValue.equals("PostgreSQL")) {
+            optionPostgreSQL = createOPPostgreSQL(p);
+            numOptionsDDBB = optionPostgreSQL.size();
+          }
+          if (optionLast.isEmpty()) {
+            optionLast = createOP2(p);
+          }
+          // Go to preview options configurate by default
+          mainOption = 4;
+        } else if (menuOption == 3) {
+          mainOption = 22;
+        } else {
+          p.log("Please, introduce a correct option: ");
+        }
+        break;
+      case 3:
+        String typeDDBB = "";
+        Map<Integer, ConfigureOption> treeMap = new TreeMap<Integer, ConfigureOption>(optionFirst);
+        for (Map.Entry<Integer, ConfigureOption> entry : treeMap.entrySet()) {
+          if (entry.getValue().getType() == ConfigureOption.TYPE_OPT_CHOOSE) {
+            p.log("Please select " + entry.getValue().getAskInfo());
+            entry.getValue().getOptions(p);
+            numberOk = false;
+            do {
+              optionS = inp.nextLine();
+              try {
+                option = Integer.parseInt(optionS);
+                if (option >= 0 && option < entry.getValue().getMax()) {
+                  entry.getValue().setChoose(option);
+                  numberOk = true;
+                } else {
+                  p.log("Please, introduce a correct option: ");
+                }
+              } catch (NumberFormatException e) {
+                if (optionS.equals("")) {
+                  numberOk = true;
+                } else {
+                  p.log("Please, introduce a correct option: ");
+                }
+              }
+            } while (!numberOk);
+          } else if (entry.getValue().getType() == ConfigureOption.TYPE_OPT_STRING) {
+            p.log("\nPlease introduce " + entry.getValue().getAskInfo());
+            entry.getValue().getOptions(p);
+            optionString = inp.nextLine();
+            if (!optionString.equals("")) {
+              entry.getValue().setChooseString(optionString);
+            }
+          }
+          // review
+          optionFirst.put(entry.getKey(), entry.getValue());
+          typeDDBB = entry.getValue().getOptionChoose();
+          p.log("\n-------------------------\nYour choice " + typeDDBB
+              + "\n-------------------------\n\n");
+        }
+        // Select Oracle or PostgreSQL
+        if (typeDDBB.equals("Oracle")) {
+          if (optionOracle.isEmpty()) {
+            optionOracle = createOPOracle(p);
+            numOptionsDDBB = optionOracle.size();
+          }
+          if (!optionPostgreSQL.isEmpty()) {
+            optionPostgreSQL.clear();
+          }
+          mainOption = 7;
+        } else if (typeDDBB.equals("PostgreSQL")) {
+          if (optionPostgreSQL.isEmpty()) {
+            optionPostgreSQL = createOPPostgreSQL(p);
+            numOptionsDDBB = optionPostgreSQL.size();
+          }
+
+          if (!optionOracle.isEmpty()) {
+            optionOracle.clear();
+          }
+          mainOption = 8;
+        }
+        break;
+      // Preview openBravo options
+      case 4:
+        p.log("---------------------------------------------------------------------------- \n Preview Openbravo ERP configuration \n----------------------------------------------------------------------------");
+        // TreeMap for show questions in order for get user parameters.
+        int numberOption = 1;
+        Map<Integer, ConfigureOption> previewOptions1 = new TreeMap<Integer, ConfigureOption>(
+            optionFirst);
+        Map<Integer, ConfigureOption> previewOptions2;
+        Map<Integer, ConfigureOption> previewOptions3 = new TreeMap<Integer, ConfigureOption>(
+            optionLast);
+        if (optionPostgreSQL.isEmpty()) {
+          previewOptions2 = new TreeMap<Integer, ConfigureOption>(optionOracle);
+        } else if (optionOracle.isEmpty()) {
+          previewOptions2 = new TreeMap<Integer, ConfigureOption>(optionPostgreSQL);
+        } else {
+          previewOptions2 = new TreeMap<Integer, ConfigureOption>(optionPostgreSQL);
+        }
+        // Show all options by order asc
+        for (Map.Entry<Integer, ConfigureOption> entry : previewOptions1.entrySet()) {
+          p.log("[" + numberOption + "] " + entry.getValue().getAskInfo() + " "
+              + entry.getValue().getOptionChoose());
+          numberOption = numberOption + 1;
+        }
+        for (Map.Entry<Integer, ConfigureOption> entry : previewOptions2.entrySet()) {
+          p.log("[" + numberOption + "] " + entry.getValue().getAskInfo() + " "
+              + entry.getValue().getOptionChoose());
+          numberOption = numberOption + 1;
+        }
+        for (Map.Entry<Integer, ConfigureOption> entry : previewOptions3.entrySet()) {
+          p.log("[" + numberOption + "] " + entry.getValue().getAskInfo() + " "
+              + entry.getValue().getOptionChoose());
+          numberOption = numberOption + 1;
+        }
+        mainOption = 5;
+        break;
+      // It can be changed an option...
+      case 5:
+        p.log("---------------------------------------------------------------------------- \n Do you change any option? \n----------------------------------------------------------------------------");
+        p.log("Choose [0] for continue with configuration or a number option for modify: ");
+        menuOptionOk = false;
+        do {
+          menuOptionS = inp.nextLine();
+          try {
+            optionMod = Integer.parseInt(menuOptionS);
+            if (optionMod >= 0
+                && optionMod <= optionFirst.size() + optionLast.size() + numOptionsDDBB) {
+              menuOptionOk = true;
+            } else {
+              p.log("Choose a real option: ");
+            }
+          } catch (NumberFormatException e) {
+            p.log("Choose a real option: ");
+          }
+        } while (!menuOptionOk);
+        // Accept all configuration
+        if (optionMod == 0) {
+          mainOption = 10;
+          // Options 0 to numberLastOptions + NUM_OPTIONS_LAST, change a particular option
+        } else if (optionMod > 0 && optionMod <= optionFirst.size()) {
+          mainOption = 6;
+        } else if (optionMod > optionFirst.size()
+            && optionMod <= optionFirst.size() + numOptionsDDBB) {
+          mainOption = 11;
+        } else if (optionMod > optionFirst.size() + numOptionsDDBB
+            && optionMod <= optionFirst.size() + optionLast.size() + numOptionsDDBB) {
+          mainOption = 12;
+        }
+        break;
+      // Change a option in optionFirst[]...
+      case 6:
+        int keyOpt = 0;
+        isChange = false;
+        Iterator<Integer> optionBBDD1 = optionFirst.keySet().iterator();
+        while ((optionBBDD1.hasNext() && !isChange)) {
+          keyOpt = optionBBDD1.next();
+          if (keyOpt == optionMod - 1) {
+            ConfigureOption optionChange = optionFirst.get(keyOpt);
+            if (optionChange.getType() == ConfigureOption.TYPE_OPT_CHOOSE) {
+              p.log("Please select " + optionChange.getAskInfo());
+              optionChange.getOptions(p);
+              numberOk = false;
+              do {
+                optionS = inp.nextLine();
+                try {
+                  option = Integer.parseInt(optionS);
+                  if (option >= 0 && option < optionChange.getMax()) {
+                    optionChange.setChoose(option);
+                    optionChange.setChooseString(optionChange.getOptionChoose());
+                    numberOk = true;
+                  } else {
+                    p.log("Please, introduce a correct option: ");
+                  }
+                } catch (NumberFormatException e) {
+                  if (optionS.equals("")) {
+                    numberOk = true;
+                  } else {
+                    p.log("Please, introduce a correct option: ");
+                  }
+                }
+              } while (!numberOk);
+            } else if (optionChange.getType() == ConfigureOption.TYPE_OPT_STRING) {
+              p.log("\nPlease introduce " + optionChange.getAskInfo());
+              optionChange.getOptions(p);
+              optionString = inp.nextLine();
+              if (!optionString.equals("")) {
+                optionChange.setChooseString(optionString);
+              }
+            }
+            optionFirst.put(optionMod - 1, optionChange);
+            p.log("\n-------------------------\nYour choice " + optionChange.getOptionChoose()
+                + "\n-------------------------\n\n");
+            isChange = true;
+            // Check a change in type of database
+            File fileO = new File(OPENBRAVO_PROPERTIES);
+            if (optionChange.getOptionChoose().equals("Oracle")) {
+              if (searchOptionsProperties(fileO, "bbdd.rdbms", p).equals("POSTGRE")) {
+                if (optionOracle.isEmpty()) {
+                  optionOracle = createOPOracle(p);
+                  numOptionsDDBB = optionOracle.size();
+                }
+                if (!optionPostgreSQL.isEmpty()) {
+                  optionPostgreSQL.clear();
+                }
+              }
+            } else if (optionChange.getOptionChoose().equals("PostgreSQL")) {
+              if (searchOptionsProperties(fileO, "bbdd.rdbms", p).equals("ORACLE")) {
+                if (optionPostgreSQL.isEmpty()) {
+                  optionPostgreSQL = createOPPostgreSQL(p);
+                  numOptionsDDBB = optionPostgreSQL.size();
+                }
+                if (!optionOracle.isEmpty()) {
+                  optionOracle.clear();
+                }
+              }
+            }
+          }
+        }
+        mainOption = 4;
+        break;
+      // Change ALL options in optionesOracle[]...
+      case 7:
+        Map<Integer, ConfigureOption> treeMapO = new TreeMap<Integer, ConfigureOption>(optionOracle);
+        for (Map.Entry<Integer, ConfigureOption> entryO : treeMapO.entrySet()) {
+          if (entryO.getValue().getType() == ConfigureOption.TYPE_OPT_CHOOSE) {
+            p.log("Please select " + entryO.getValue().getAskInfo());
+            entryO.getValue().getOptions(p);
+            numberOk = false;
+            do {
+              optionS = inp.nextLine();
+              try {
+                option = Integer.parseInt(optionS);
+                if (option >= 0 && option < entryO.getValue().getMax()) {
+                  entryO.getValue().setChoose(option);
+                  entryO.getValue().setChooseString(entryO.getValue().getOptionChoose());
+                  numberOk = true;
+                } else {
+                  p.log("Please, introduce a correct option: ");
+                }
+              } catch (NumberFormatException e) {
+                if (optionS.equals("")) {
+                  numberOk = true;
+                } else {
+                  p.log("Please, introduce a correct option: ");
+                }
+              }
+            } while (!numberOk);
+          } else if (entryO.getValue().getType() == ConfigureOption.TYPE_OPT_STRING) {
+            p.log("\nPlease introduce " + entryO.getValue().getAskInfo());
+            entryO.getValue().getOptions(p);
+            optionString = inp.nextLine();
+            if (!optionString.equals("")) {
+              entryO.getValue().setChooseString(optionString);
+            }
+          }
+          optionPostgreSQL.put(entryO.getKey(), entryO.getValue());
+          p.log("\n-------------------------\nYour choice " + entryO.getValue().getOptionChoose()
+              + "\n-------------------------\n\n");
+        }
+        // All information are introduced. Configure now last options
+        if (optionLast.isEmpty()) {
+          optionLast = createOP2(p);
+        }
+        mainOption = 9;
+        break;
+      // Change ALL optionS in optionesPostgreSQL[]...
+      case 8:
+        Map<Integer, ConfigureOption> treeMapP = new TreeMap<Integer, ConfigureOption>(
+            optionPostgreSQL);
+        for (Map.Entry<Integer, ConfigureOption> entryP : treeMapP.entrySet()) {
+          if (entryP.getValue().getType() == ConfigureOption.TYPE_OPT_CHOOSE) {
+            p.log("Please select " + entryP.getValue().getAskInfo());
+            entryP.getValue().getOptions(p);
+            numberOk = false;
+            do {
+              optionS = inp.nextLine();
+              try {
+                option = Integer.parseInt(optionS);
+                if (option >= 0 && option < entryP.getValue().getMax()) {
+                  entryP.getValue().setChoose(option);
+                  entryP.getValue().setChooseString(entryP.getValue().getOptionChoose());
+                  numberOk = true;
+                } else {
+                  p.log("Please, introduce a correct option: ");
+                }
+              } catch (NumberFormatException e) {
+                if (optionS.equals("")) {
+                  numberOk = true;
+                } else {
+                  p.log("Please, introduce a correct option: ");
+                }
+              }
+            } while (!numberOk);
+          } else if (entryP.getValue().getType() == ConfigureOption.TYPE_OPT_STRING) {
+            p.log("\nPlease introduce " + entryP.getValue().getAskInfo());
+            entryP.getValue().getOptions(p);
+            optionString = inp.nextLine();
+            if (!optionString.equals("")) {
+              entryP.getValue().setChooseString(optionString);
+            }
+          }
+          optionPostgreSQL.put(entryP.getKey(), entryP.getValue());
+          p.log("\n-------------------------\nYour choice " + entryP.getValue().getOptionChoose()
+              + "\n-------------------------\n\n");
+        }
+        // All information are introduced. Configure now last options
+        if (optionLast.isEmpty()) {
+          optionLast = createOP2(p);
+        }
+        mainOption = 9;
+        break;
+      case 9:
+        Map<Integer, ConfigureOption> treeMapL = new TreeMap<Integer, ConfigureOption>(optionLast);
+        for (Map.Entry<Integer, ConfigureOption> entryL : treeMapL.entrySet()) {
+          if (entryL.getValue().getType() == ConfigureOption.TYPE_OPT_CHOOSE) {
+            p.log("Please select " + entryL.getValue().getAskInfo());
+            entryL.getValue().getOptions(p);
+            numberOk = false;
+            do {
+              optionS = inp.nextLine();
+              try {
+                option = Integer.parseInt(optionS);
+                if (option >= 0 && option < entryL.getValue().getMax()) {
+                  entryL.getValue().setChoose(option);
+                  entryL.getValue().setChooseString(entryL.getValue().getOptionChoose());
+                  numberOk = true;
+                } else {
+                  p.log("Please, introduce a correct option: ");
+                }
+              } catch (NumberFormatException e) {
+                if (optionS.equals("")) {
+                  numberOk = true;
+                } else {
+                  p.log("Please, introduce a correct option: ");
+                }
+              }
+            } while (!numberOk);
+          } else if (entryL.getValue().getType() == ConfigureOption.TYPE_OPT_STRING) {
+            p.log("\nPlease introduce " + entryL.getValue().getAskInfo());
+            entryL.getValue().getOptions(p);
+            optionString = inp.nextLine();
+            if (!optionString.equals("")) {
+              entryL.getValue().setChooseString(optionString);
+            }
+          }
+          optionLast.put(entryL.getKey(), entryL.getValue());
+          p.log("\n-------------------------\nYour choice " + entryL.getValue().getOptionChoose()
+              + "\n-------------------------\n\n");
+        }
+        mainOption = 10;
+        break;
+      case 10:
+        p.log("---------------------------------------------------------------------------- \n Are you agree with all options that you configure? \n----------------------------------------------------------------------------");
+        p.log("[1]. Accept.");
+        p.log("[2]. Back to preview configuration.");
+        p.log("[3]. Exit without saving.");
+        p.log("Choose an option: ");
+        menuOptionOk = false;
+        do {
+          menuOptionS = inp.nextLine();
+          try {
+            optionConfigure = Integer.parseInt(menuOptionS);
+            menuOptionOk = true;
+          } catch (NumberFormatException e) {
+            p.log("Choose a real option: ");
+          }
+        } while (!menuOptionOk);
+        switch (optionConfigure) {
+        case 1:
+          mainOption = 20;
+          break;
+        case 2:
+          mainOption = 4;
+          break;
+        case 3:
+          mainOption = 22;
+          break;
+        default:
+          p.log("Choose a real option: ");
+        }
+        break;
+      // Change a option in optionesOracle or optionesPostgreSQL...
+      case 11:
+        if (!optionOracle.isEmpty()) {
+          int keyOracle = 0;
+          isChangeO = false;
+          Iterator<Integer> optionBBDDoracle = optionOracle.keySet().iterator();
+          optionMod = optionMod - optionFirst.size();
+          while ((optionBBDDoracle.hasNext() && !isChangeO)) {
+            keyOracle = optionBBDDoracle.next();
+            if (keyOracle == optionMod - 1) {
+              ConfigureOption optionChange = optionOracle.get(keyOracle);
+              if (optionChange.getType() == ConfigureOption.TYPE_OPT_CHOOSE) {
+                p.log("Please select " + optionChange.getAskInfo());
+                optionChange.getOptions(p);
+                numberOk = false;
+                do {
+                  optionS = inp.nextLine();
+                  try {
+                    option = Integer.parseInt(optionS);
+                    if (option >= 0 && option < optionChange.getMax()) {
+                      optionChange.setChoose(option);
+                      optionChange.setChooseString(optionChange.getOptionChoose());
+                      numberOk = true;
+                    } else {
+                      p.log("Please, introduce a correct option: ");
+                    }
+                  } catch (NumberFormatException e) {
+                    if (optionS.equals("")) {
+                      numberOk = true;
+                    } else {
+                      p.log("Please, introduce a correct option: ");
+                    }
+                  }
+                } while (!numberOk);
+              } else if (optionChange.getType() == ConfigureOption.TYPE_OPT_STRING) {
+                p.log("\nPlease introduce " + optionChange.getAskInfo());
+                optionChange.getOptions(p);
+                optionString = inp.nextLine();
+                if (!optionString.equals("")) {
+                  optionChange.setChooseString(optionString);
+                }
+              }
+              optionOracle.put(optionMod - 1, optionChange);
+              p.log("\n-------------------------\nYour choice " + optionChange.getOptionChoose()
+                  + "\n-------------------------\n\n");
+              isChangeO = true;
+            }
+          }
+        } else if (!optionPostgreSQL.isEmpty()) {
+          int keyPostgre = 0;
+          boolean isChangeP = false;
+          Iterator<Integer> optionBBDDpostgre = optionPostgreSQL.keySet().iterator();
+          optionMod = optionMod - optionFirst.size();
+          while ((optionBBDDpostgre.hasNext() && !isChangeP)) {
+            keyPostgre = optionBBDDpostgre.next();
+            if (keyPostgre == optionMod - 1) {
+              ConfigureOption optionChange = optionPostgreSQL.get(keyPostgre);
+              if (optionChange.getType() == ConfigureOption.TYPE_OPT_CHOOSE) {
+                p.log("Please select " + optionChange.getAskInfo());
+                optionChange.getOptions(p);
+                numberOk = false;
+                do {
+                  optionS = inp.nextLine();
+                  try {
+                    option = Integer.parseInt(optionS);
+                    if (option >= 0 && option < optionChange.getMax()) {
+                      optionChange.setChoose(option);
+                      optionChange.setChooseString(optionChange.getOptionChoose());
+                      numberOk = true;
+                    } else {
+                      p.log("Please, introduce a correct option: ");
+                    }
+                  } catch (NumberFormatException e) {
+                    if (optionS.equals("")) {
+                      numberOk = true;
+                    } else {
+                      p.log("Please, introduce a correct option: ");
+                    }
+                  }
+                } while (!numberOk);
+              } else if (optionChange.getType() == ConfigureOption.TYPE_OPT_STRING) {
+                p.log("\nPlease introduce " + optionChange.getAskInfo());
+                optionChange.getOptions(p);
+                optionString = inp.nextLine();
+                if (!optionString.equals("")) {
+                  optionChange.setChooseString(optionString);
+                }
+              }
+              optionPostgreSQL.put(optionMod - 1, optionChange);
+              p.log("\n-------------------------\nYour choice " + optionChange.getOptionChoose()
+                  + "\n-------------------------\n\n");
+              isChangeP = true;
+            }
+          }
+        }
+        mainOption = 4;
+        break;
+      // Change a option in optionesLast[]...
+      case 12:
+        int keyLast = 0;
+        isChangeL = false;
+        Iterator<Integer> optionBBDDlast = optionLast.keySet().iterator();
+        optionMod = optionMod - optionFirst.size() - optionPostgreSQL.size();
+        while ((optionBBDDlast.hasNext() && !isChangeL)) {
+          keyLast = optionBBDDlast.next();
+          if (keyLast == optionMod - 1) {
+            ConfigureOption optionChange = optionLast.get(keyLast);
+            if (optionChange.getType() == ConfigureOption.TYPE_OPT_CHOOSE) {
+              p.log("Please select " + optionChange.getAskInfo());
+              optionChange.getOptions(p);
+              numberOk = false;
+              do {
+                optionS = inp.nextLine();
+                try {
+                  option = Integer.parseInt(optionS);
+                  if (option >= 0 && option < optionChange.getMax()) {
+                    optionChange.setChoose(option);
+                    optionChange.setChooseString(optionChange.getOptionChoose());
+                    numberOk = true;
+                  } else {
+                    p.log("Please, introduce a correct option: ");
+                  }
+                } catch (NumberFormatException e) {
+                  if (optionS.equals("")) {
+                    numberOk = true;
+                  } else {
+                    p.log("Please, introduce a correct option: ");
+                  }
+                }
+              } while (!numberOk);
+            } else if (optionChange.getType() == ConfigureOption.TYPE_OPT_STRING) {
+              p.log("\nPlease introduce " + optionChange.getAskInfo());
+              optionChange.getOptions(p);
+              optionString = inp.nextLine();
+              if (!optionString.equals("")) {
+                optionChange.setChooseString(optionString);
+              }
+            }
+            optionLast.put(optionMod - 1, optionChange);
+            p.log("\n-------------------------\nYour choice " + optionChange.getOptionChoose()
+                + "\n-------------------------\n\n");
+            isChangeL = true;
+          }
+        }
+        mainOption = 4;
+        break;
+      // All options have been selected... configure Openbravo.properties file.
+      case 20:
+        setValuesProperties();
+        Iterator<String> keySetIterator = replaceProperties.keySet().iterator();
+        while (keySetIterator.hasNext()) {
+          String keyForFile = keySetIterator.next();
+          replaceOptionsProperties(keyForFile + "=", replaceProperties.get(keyForFile), p);
+        }
+        mainOption = 21;
+        break;
+      // configuration done
+      case 21:
+        p.log("---------------------------------------------------------------------------- \n Configuration complete. \n----------------------------------------------------------------------------");
+        mainOption = -1;
+        break;
+      // re-confirm exit
+      case 22:
+        p.log("Do you want to exit this program? [y/n]: ");
+        input = licenseIn.nextLine();
+        while (!("Y".equalsIgnoreCase(input) || "N".equalsIgnoreCase(input))) {
+          p.log("Please, introduce a correct option. Do you want to exit this program? [y/n]: ");
+          input = licenseIn.nextLine();
+        }
+        if ("Y".equalsIgnoreCase(input)) {
+          p.log("---------------------------------------------------------------------------- \n You have not successfully completed the configuration process.");
+          mainOption = -1;
+        } else if ("N".equalsIgnoreCase(input)) {
+          if (optionFirst.isEmpty()) {
+            mainOption = 1;
+          } else {
+            mainOption = 10;
+          }
+        }
+      }
+    }
+    inp.close();
+    licenseIn.close();
+    p.log("---------------------------------------------------------------------------- \n Thanks for use Openbravo ERP Setup. \n----------------------------------------------------------------------------");
+  }
+
+  /**
+   * This function showWelcome() show a welcome to install application.
+   * 
+   * @param p1
+   *          : Project
+   */
+  private static void showWelcome(Project p1) {
+    Scanner inp = new Scanner(System.in);
+    p1.log("---------------------------------------------------------------------------- \n Welcome to the Openbravo ERP Setup Wizard. \n----------------------------------------------------------------------------");
+    p1.log("Please read the following License Agreement. You must accept the terms of this\n agreement before continuing with the installation.");
+    p1.log("Press [Enter] to continue:");
+    inp.nextLine();
+  }
+
+  /**
+   * This function setValuesProperties() use all information asking to user for configurate
+   * Openbravo.properties file.
+   */
+  private static void setValuesProperties() {
+
+    String timeSeparator = "", dateSeparator = "", timeFormat = "", dateFormat = "", database = "";
+    // Get important data for building all the options.
+    Map<Integer, ConfigureOption> treeMapSet = new TreeMap<Integer, ConfigureOption>(optionFirst);
+    for (Map.Entry<Integer, ConfigureOption> entrySet : treeMapSet.entrySet()) {
+      if (entrySet.getValue().getAskInfo().equals("date separator: ")) {
+        dateSeparator = entrySet.getValue().getOptionChoose();
+      } else if (entrySet.getValue().getAskInfo().equals("time separator: ")) {
+        timeSeparator = entrySet.getValue().getOptionChoose();
+      } else if (entrySet.getValue().getAskInfo().equals("date format: ")) {
+        dateFormat = entrySet.getValue().getOptionChoose();
+      } else if (entrySet.getValue().getAskInfo().equals("time format: ")) {
+        timeFormat = entrySet.getValue().getOptionChoose();
+      } else if (entrySet.getValue().getAskInfo().equals("Database:")) {
+        database = entrySet.getValue().getOptionChoose();
+      }
+    }
+    replaceProperties.put("source.path", System.getProperty("user.dir"));
+
+    treeMapSet = new TreeMap<Integer, ConfigureOption>(optionFirst);
+    for (Map.Entry<Integer, ConfigureOption> entry : treeMapSet.entrySet()) {
+      if (entry.getValue().getAskInfo().equals("Attachments directory: ")) {
+        replaceProperties.put("attach.path", entry.getValue().getOptionChoose());
+      } else if (entry.getValue().getAskInfo().equals("Context name: ")) {
+        replaceProperties.put("context.name", entry.getValue().getOptionChoose());
+      } else if (entry.getValue().getAskInfo().equals("Web URL: ")) {
+        replaceProperties.put("web.url", entry.getValue().getOptionChoose());
+      } else if (entry.getValue().getAskInfo().equals("Output script location: ")) {
+        replaceProperties.put("bbdd.outputscript", entry.getValue().getOptionChoose());
+      } else if (entry.getValue().getAskInfo().equals("Context URL :")) {
+        replaceProperties.put("context.url", entry.getValue().getOptionChoose());
+      }
+    }
+    // dateFormat.java
+    if (dateFormat.substring(0, 1).equals("D")) {
+      replaceProperties
+          .put("dateFormat.java", "dd" + dateSeparator + "MM" + dateSeparator + "yyyy");
+    } else if (dateFormat.substring(0, 1).equals("M")) {
+      replaceProperties
+          .put("dateFormat.java", "MM" + dateSeparator + "dd" + dateSeparator + "yyyy");
+    } else if (dateFormat.substring(0, 1).equals("Y")) {
+      replaceProperties
+          .put("dateFormat.java", "yyyy" + dateSeparator + "MM" + dateSeparator + "dd");
+    }
+    // dateTimeFormat.java
+    if (timeFormat.equals("12h")) {
+      if (dateFormat.substring(0, 1).equals("D")) {
+        replaceProperties.put("dateTimeFormat.java", "dd" + dateSeparator + "MM" + dateSeparator
+            + "yyyy hh" + timeSeparator + "mm" + timeSeparator + "ss a");
+      } else if (dateFormat.substring(0, 1).equals("M")) {
+        replaceProperties.put("dateTimeFormat.java", "MM" + dateSeparator + "dd" + dateSeparator
+            + "yyyy hh" + timeSeparator + "mm" + timeSeparator + "ss a");
+      } else if (dateFormat.substring(0, 1).equals("Y")) {
+        replaceProperties.put("dateTimeFormat.java", "yyyy" + dateSeparator + "MM" + dateSeparator
+            + "dd hh" + timeSeparator + "mm" + timeSeparator + "ss a");
+      }
+    } else if (timeFormat.equals("24h")) {
+      if (dateFormat.substring(0, 1).equals("D")) {
+        replaceProperties.put("dateTimeFormat.java", "dd" + dateSeparator + "MM" + dateSeparator
+            + "yyyy HH" + timeSeparator + "mm" + timeSeparator + "ss");
+      } else if (dateFormat.substring(0, 1).equals("M")) {
+        replaceProperties.put("dateTimeFormat.java", "MM" + dateSeparator + "dd" + dateSeparator
+            + "yyyy HH" + timeSeparator + "mm" + timeSeparator + "ss");
+      } else if (dateFormat.substring(0, 1).equals("Y")) {
+        replaceProperties.put("dateTimeFormat.java", "yyyy" + dateSeparator + "MM" + dateSeparator
+            + "dd HH" + timeSeparator + "mm" + timeSeparator + "ss");
+      }
+    }
+    // dateFormat.sql
+    if (dateFormat.substring(0, 1).equals("D")) {
+      replaceProperties.put("dateFormat.sql", "DD" + dateSeparator + "MM" + dateSeparator + "YYYY");
+    } else if (dateFormat.substring(0, 1).equals("M")) {
+      replaceProperties.put("dateFormat.sql", "MM" + dateSeparator + "DD" + dateSeparator + "YYYY");
+    } else if (dateFormat.substring(0, 1).equals("Y")) {
+      replaceProperties.put("dateFormat.sql", "YYYY" + dateSeparator + "MM" + dateSeparator + "DD");
+    }
+    // "dateFormat.js"
+    if (dateFormat.substring(0, 1).equals("D")) {
+      replaceProperties.put("dateFormat.js", "%d" + dateSeparator + "%m" + dateSeparator + "%Y");
+    } else if (dateFormat.substring(0, 1).equals("M")) {
+      replaceProperties.put("dateFormat.js", "%m" + dateSeparator + "%d" + dateSeparator + "%Y");
+    } else if (dateFormat.substring(0, 1).equals("Y")) {
+      replaceProperties.put("dateFormat.js", "%Y" + dateSeparator + "%m" + dateSeparator + "%d");
+    }
+    // dateTimeFormat.sql
+    replaceProperties.put("dateTimeFormat.sql", "DD-MM-YYYY HH24:MI:SS");
+    // bbdd.sessionConfig and BBDD Oracle
+    if (database.equals("Oracle")) {
+      if (dateFormat.substring(0, 1).equals("D")) {
+        replaceProperties.put("bbdd.sessionConfig", "ALTER SESSION SET NLS_DATE_FORMAT='DD"
+            + dateSeparator + "MM" + dateSeparator + "YYYY' NLS_NUMERIC_CHARACTERS='.,'");
+      } else if (dateFormat.substring(0, 1).equals("M")) {
+        replaceProperties.put("bbdd.sessionConfig", "ALTER SESSION SET NLS_DATE_FORMAT='MM"
+            + dateSeparator + "DD" + dateSeparator + "YYYY' NLS_NUMERIC_CHARACTERS='.,'");
+      } else if (dateFormat.substring(0, 1).equals("Y")) {
+        replaceProperties.put("bbdd.sessionConfig", "ALTER SESSION SET NLS_DATE_FORMAT='YYYY"
+            + dateSeparator + "MM" + dateSeparator + "DD' NLS_NUMERIC_CHARACTERS='.,'");
+      }
+      String nameBBDD = "", serverBBDD = "", portBBDD = "";
+      treeMapSet = new TreeMap<Integer, ConfigureOption>(optionOracle);
+      for (Map.Entry<Integer, ConfigureOption> entryO : treeMapSet.entrySet()) {
+        if (entryO.getValue().getAskInfo().equals("SID: ")) {
+          nameBBDD = entryO.getValue().getOptionChoose();
+          replaceProperties.put("bbdd.sid", nameBBDD);
+        } else if (entryO.getValue().getAskInfo().equals("System User: ")) {
+          replaceProperties.put("bbdd.systemUser", entryO.getValue().getOptionChoose());
+        } else if (entryO.getValue().getAskInfo().equals("System Password: ")) {
+          replaceProperties.put("bbdd.systemPassword", entryO.getValue().getOptionChoose());
+        } else if (entryO.getValue().getAskInfo().equals("DB User: ")) {
+          replaceProperties.put("bbdd.user", entryO.getValue().getOptionChoose());
+        } else if (entryO.getValue().getAskInfo().equals("DB User Password: ")) {
+          replaceProperties.put("bbdd.password", entryO.getValue().getOptionChoose());
+        } else if (entryO.getValue().getAskInfo().equals("DB Server Address: ")) {
+          serverBBDD = entryO.getValue().getOptionChoose();
+        } else if (entryO.getValue().getAskInfo().equals("DB Server Port: ")) {
+          portBBDD = entryO.getValue().getOptionChoose();
+        }
+      }
+      replaceProperties.put("bbdd.rdbms", "ORACLE");
+      replaceProperties.put("bbdd.driver", "oracle.jdbc.driver.OracleDriver");
+      replaceProperties.put("bbdd.url", "jdbc:oracle:thin:@" + serverBBDD + ":" + portBBDD + ":"
+          + nameBBDD);
+      // bbdd.sessionConfig and BBDD PostgreSQL
+    } else if (database.equals("PostgreSQL")) {
+      if (dateFormat.substring(0, 1).equals("D")) {
+        replaceProperties.put("bbdd.sessionConfig", "select update_dateFormat('DD" + dateSeparator
+            + "MM" + dateSeparator + "YYYY')");
+      } else if (dateFormat.substring(0, 1).equals("M")) {
+        replaceProperties.put("bbdd.sessionConfig", "select update_dateFormat('MM" + dateSeparator
+            + "DD" + dateSeparator + "YYYY')");
+      } else if (dateFormat.substring(0, 1).equals("Y")) {
+        replaceProperties.put("bbdd.sessionConfig", "select update_dateFormat('YYYY"
+            + dateSeparator + "MM" + dateSeparator + "DD')");
+      }
+      String serverBBDD = "", portBBDD = "";
+      treeMapSet = new TreeMap<Integer, ConfigureOption>(optionPostgreSQL);
+      for (Map.Entry<Integer, ConfigureOption> entryP : treeMapSet.entrySet()) {
+        if (entryP.getValue().getAskInfo().equals("SID: ")) {
+          replaceProperties.put("bbdd.sid", entryP.getValue().getOptionChoose());
+        } else if (entryP.getValue().getAskInfo().equals("System User: ")) {
+          replaceProperties.put("bbdd.systemUser", entryP.getValue().getOptionChoose());
+        } else if (entryP.getValue().getAskInfo().equals("System Password: ")) {
+          replaceProperties.put("bbdd.systemPassword", entryP.getValue().getOptionChoose());
+        } else if (entryP.getValue().getAskInfo().equals("DB User: ")) {
+          replaceProperties.put("bbdd.user", entryP.getValue().getOptionChoose());
+        } else if (entryP.getValue().getAskInfo().equals("DB User Password: ")) {
+          replaceProperties.put("bbdd.password", entryP.getValue().getOptionChoose());
+        } else if (entryP.getValue().getAskInfo().equals("DB Server Address: ")) {
+          serverBBDD = entryP.getValue().getOptionChoose();
+        } else if (entryP.getValue().getAskInfo().equals("DB Server Port: ")) {
+          portBBDD = entryP.getValue().getOptionChoose();
+        }
+      }
+      replaceProperties.put("bbdd.rdbms", "POSTGRE");
+      replaceProperties.put("bbdd.driver", "org.postgresql.Driver");
+      replaceProperties.put("bbdd.url", "jdbc:postgresql://" + serverBBDD + ":" + portBBDD);
+    }
+    treeMapSet = new TreeMap<Integer, ConfigureOption>(optionLast);
+    for (Map.Entry<Integer, ConfigureOption> entryL : treeMapSet.entrySet()) {
+      if (entryL.getValue().getAskInfo().equals("Tomcat Manager URL: ")) {
+        replaceProperties.put("tomcat.manager.url", entryL.getValue().getOptionChoose());
+      } else if (entryL.getValue().getAskInfo().equals("Tomcat manager username: ")) {
+        replaceProperties.put("tomcat.manager.username", entryL.getValue().getOptionChoose());
+      } else if (entryL.getValue().getAskInfo().equals("Tomcat manager password: ")) {
+        replaceProperties.put("tomcat.manager.password", entryL.getValue().getOptionChoose());
+      } else if (entryL.getValue().getAskInfo().equals("Authentication class: ")) {
+        replaceProperties.put("authentication.class", entryL.getValue().getOptionChoose());
+      }
+    }
+  }
+
+  /**
+   * This function replace in Openbravo.properties the value of option searchOption with value
+   * changeOption. Concatenated searchOption+changeOption. For example: "bbdd.user=" + "admin".
+   * 
+   * @param searchOption
+   *          : prefix to search
+   * @param changeOption
+   *          : value to write in Openbravo.properties
+   */
+  private static void replaceOptionsProperties(String searchOption, String changeOption, Project p) {
+    try {
+      boolean isFound = false;
+      File fileR = new File(OPENBRAVO_PROPERTIES);
+      FileReader fr = new FileReader(fileR);
+      BufferedReader br = new BufferedReader(fr);
+      // auxiliary file to rewrite
+      File fileW = new File(OPENBRAVO_PROPERTIES_AUX);
+      FileWriter fw = new FileWriter(fileW);
+      // data for restore
+      String line;
+      while ((line = br.readLine()) != null) {
+        if (line.indexOf(searchOption) == 0) {
+          // Replace new option
+          line = line.replace(line, searchOption + changeOption);
+          isFound = true;
+        }
+        fw.write(line + "\n");
+      }
+      if (!isFound) {
+        fw.write(searchOption + changeOption);
+      }
+      fr.close();
+      fw.close();
+      br.close();
+    } catch (Exception e1) {
+      p.log("Excetion reading/writing file: " + e1);
+    }
+    // Second part: Delete Openbravo.properties and rename Openbravo.properties.aux to
+    // Openbravo.properties
+    try {
+      File fileR = new File(OPENBRAVO_PROPERTIES);
+      fileR.delete();
+      File fileW = new File(OPENBRAVO_PROPERTIES_AUX);
+      fileW.renameTo(new File(OPENBRAVO_PROPERTIES));
+    } catch (Exception e2) {
+      p.log("Excetion deleting/rename file: " + e2);
+    }
+  }
+
+  /**
+   * This function SearchOptionsProperties() search an option in fileO file and returns the value of
+   * searchOption.
+   * 
+   * @param fileO
+   * @param searchOption
+   * @return String
+   */
+  private static String searchOptionsProperties(File fileO, String searchOption, Project p) {
+    String valueSearched = "";
+    try {
+      FileReader fr = new FileReader(fileO);
+      BufferedReader br = new BufferedReader(fr);
+      String line;
+      while ((line = br.readLine()) != null) {
+        if (line.indexOf(searchOption) == 0) {
+          valueSearched = line.substring(searchOption.length() + 1);
+          break;
+        }
+      }
+      fr.close();
+      br.close();
+    } catch (Exception e1) {
+      p.log("Excetion reading/writing file: " + e1);
+    }
+    return valueSearched;
+  }
+
+  /**
+   * This function createOP() create first options for configuration. Information is collected from
+   * Openbravo.properties file.
+   * 
+   * @return HashMap<Integer,Option>
+   */
+  private static HashMap<Integer, ConfigureOption> createOP(Project p) {
+    HashMap<Integer, ConfigureOption> options = new HashMap<Integer, ConfigureOption>();
+    File fileO = new File(OPENBRAVO_PROPERTIES);
+
+    String askInfo = "date format: ";
+    ArrayList<String> optChoosen = new ArrayList<String>();
+    optChoosen.add("DDMMYYYY");
+    optChoosen.add("MMDDYYYY");
+    optChoosen.add("YYYYMMDD");
+    ConfigureOption o0 = new ConfigureOption(ConfigureOption.TYPE_OPT_CHOOSE, askInfo, optChoosen);
+    String compareDateformat = searchOptionsProperties(fileO, "dateFormat.sql", p).substring(0, 1);
+    if (compareDateformat.equalsIgnoreCase("d")) {
+      o0.setChooseString("DDMMYYYY");
+    } else if (compareDateformat.equalsIgnoreCase("m")) {
+      o0.setChooseString("MMDDYYYY");
+    } else if (compareDateformat.equalsIgnoreCase("y")) {
+      o0.setChooseString("YYYYMMDD");
+    }
+    options.put(0, o0);
+
+    askInfo = "date separator: ";
+    optChoosen = new ArrayList<String>();
+    optChoosen.add("-");
+    optChoosen.add("/");
+    optChoosen.add(".");
+    optChoosen.add(":");
+    ConfigureOption o1 = new ConfigureOption(ConfigureOption.TYPE_OPT_CHOOSE, askInfo, optChoosen);
+    compareDateformat = searchOptionsProperties(fileO, "dateTimeFormat.sql", p).substring(0, 9);
+    if (compareDateformat.contains("-")) {
+      o1.setChooseString("-");
+    } else if (compareDateformat.contains("/")) {
+      o1.setChooseString("/");
+    } else if (compareDateformat.contains(".")) {
+      o1.setChooseString(".");
+    } else if (compareDateformat.contains(":")) {
+      o1.setChooseString(":");
+    } else {
+      o1.setChooseString("-");
+    }
+    options.put(1, o1);
+
+    askInfo = "time format: ";
+    optChoosen = new ArrayList<String>();
+    optChoosen.add("12h");
+    optChoosen.add("24h");
+    ConfigureOption o2 = new ConfigureOption(ConfigureOption.TYPE_OPT_CHOOSE, askInfo, optChoosen);
+
+    if (searchOptionsProperties(fileO, "dateTimeFormat.java", p).contains("a")) {
+      o2.setChooseString("12h");
+    } else {
+      o2.setChooseString("24h");
+    }
+    options.put(2, o2);
+
+    askInfo = "time separator: ";
+    optChoosen = new ArrayList<String>();
+    optChoosen.add(":");
+    optChoosen.add(".");
+    ConfigureOption o3 = new ConfigureOption(ConfigureOption.TYPE_OPT_CHOOSE, askInfo, optChoosen);
+    compareDateformat = searchOptionsProperties(fileO, "dateTimeFormat.sql", p).substring(10);
+    if (compareDateformat.contains(":")) {
+      o3.setChooseString(":");
+    } else if (compareDateformat.contains(".")) {
+      o3.setChooseString(".");
+    } else {
+      o3.setChooseString(":");
+    }
+    options.put(3, o3);
+
+    askInfo = "Attachments directory: ";
+    ConfigureOption o4 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    String optionValueString = searchOptionsProperties(fileO, "attach.path", p);
+    if (optionValueString.equals("")) {
+      o4.setChooseString("/opt/openbravo/attachments");
+    } else {
+      o4.setChooseString(optionValueString);
+    }
+    options.put(4, o4);
+
+    askInfo = "Context name: ";
+    ConfigureOption o5 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "context.name", p);
+    if (optionValueString.equals("")) {
+      o5.setChooseString("openbravo");
+    } else {
+      o5.setChooseString(optionValueString);
+    }
+    options.put(5, o5);
+
+    askInfo = "Web URL: ";
+    ConfigureOption o6 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "web.url", p);
+    if (optionValueString.equals("")) {
+      o6.setChooseString("@actual_url_context@/web");
+    } else {
+      o6.setChooseString(optionValueString);
+    }
+    options.put(6, o6);
+
+    askInfo = "Context URL :";
+    ConfigureOption o7 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "context.url", p);
+    if (optionValueString.equals("")) {
+      o7.setChooseString("http://localhost:8080/openbravo");
+    } else {
+      o7.setChooseString(optionValueString);
+    }
+    options.put(7, o7);
+
+    askInfo = "Output script location: ";
+    ConfigureOption o8 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "bbdd.outputscript", p);
+    if (optionValueString.equals("")) {
+      o8.setChooseString("databasescript.sql");
+    } else {
+      o8.setChooseString(optionValueString);
+    }
+    options.put(8, o8);
+
+    askInfo = "Database:";
+    optChoosen = new ArrayList<String>();
+    optChoosen.add("Oracle");
+    optChoosen.add("PostgreSQL");
+    ConfigureOption o9 = new ConfigureOption(ConfigureOption.TYPE_OPT_CHOOSE, askInfo, optChoosen);
+    if (searchOptionsProperties(fileO, "bbdd.rdbms", p).equals("ORACLE")) {
+      o9.setChooseString("Oracle");
+    } else if (searchOptionsProperties(fileO, "bbdd.rdbms", p).equals("POSTGRE")) {
+      o9.setChooseString("PostgreSQL");
+    } else {
+      o9.setChooseString("PostgreSQL");
+    }
+    options.put(9, o9);
+
+    return options;
+  }
+
+  /**
+   * 
+   * This function createOP2() create last options for configuration.Information is collected from
+   * Openbravo.properties file.
+   * 
+   * @return HashMap<Integer, Option>
+   */
+  private static HashMap<Integer, ConfigureOption> createOP2(Project p) {
+    HashMap<Integer, ConfigureOption> options = new HashMap<Integer, ConfigureOption>();
+    File fileO = new File(OPENBRAVO_PROPERTIES);
+
+    String askInfo = "Tomcat Manager URL: ";
+    ConfigureOption o0 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    String optionValueString = searchOptionsProperties(fileO, "tomcat.manager.url", p);
+    if (optionValueString.equals("")) {
+      o0.setChooseString("http://localhost:8080/manager");
+    } else {
+      o0.setChooseString(optionValueString);
+    }
+    options.put(0, o0);
+
+    askInfo = "Tomcat manager username: ";
+    ConfigureOption o1 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "tomcat.manager.username", p);
+    if (optionValueString.equals("")) {
+      o1.setChooseString("admin");
+    } else {
+      o1.setChooseString(optionValueString);
+    }
+    options.put(1, o1);
+
+    askInfo = "Tomcat manager password: ";
+    ConfigureOption o2 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "tomcat.manager.password", p);
+    if (optionValueString.equals("")) {
+      o2.setChooseString("admin");
+    } else {
+      o2.setChooseString(optionValueString);
+    }
+    options.put(2, o2);
+
+    askInfo = "Authentication class: ";
+    ConfigureOption o3 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "authentication.class", p);
+    if (optionValueString.equals("")) {
+      o3.setChooseString("");
+    } else {
+      o3.setChooseString(optionValueString);
+    }
+    options.put(3, o3);
+
+    return options;
+  }
+
+  /**
+   * This function createOPOracle() create options of Oracle configuration. Information is collected
+   * from Openbravo.properties file.
+   * 
+   * @return HashMap<Integer, Option>
+   */
+  private static HashMap<Integer, ConfigureOption> createOPOracle(Project p) {
+    HashMap<Integer, ConfigureOption> option = new HashMap<Integer, ConfigureOption>();
+    File fileO = new File(OPENBRAVO_PROPERTIES);
+    // Modify Openbravo.properties file if Oracle's options have been disabled.
+    if (searchOptionsProperties(fileO, "bbdd.rdbms", p).equals("POSTGRE")) {
+      changeOraclePostgresql(p);
+    }
+
+    String askInfo = "SID: ";
+    ConfigureOption o0 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    String optionValueString = searchOptionsProperties(fileO, "bbdd.sid", p);
+    if (optionValueString.equals("")) {
+      o0.setChooseString("xe");
+    } else {
+      o0.setChooseString(optionValueString);
+    }
+    option.put(0, o0);
+
+    askInfo = "System User: ";
+    ConfigureOption o1 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "bbdd.systemUser", p);
+    if (optionValueString.equals("")) {
+      o1.setChooseString("SYSTEM");
+    } else {
+      o1.setChooseString(optionValueString);
+    }
+    option.put(1, o1);
+
+    askInfo = "System Password: ";
+    ConfigureOption o2 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "bbdd.systemPassword", p);
+    if (optionValueString.equals("")) {
+      o2.setChooseString("SYSTEM");
+    } else {
+      o2.setChooseString(optionValueString);
+    }
+    option.put(2, o2);
+
+    askInfo = "DB User: ";
+    ConfigureOption o3 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "bbdd.user", p);
+    if (optionValueString.equals("")) {
+      o3.setChooseString("TAD");
+    } else {
+      o3.setChooseString(optionValueString);
+    }
+    option.put(3, o3);
+
+    askInfo = "DB User Password: ";
+    ConfigureOption o4 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    optionValueString = searchOptionsProperties(fileO, "bbdd.password", p);
+    if (optionValueString.equals("")) {
+      o4.setChooseString("TAD");
+    } else {
+      o4.setChooseString(optionValueString);
+    }
+    option.put(4, o4);
+
+    String separateString = searchOptionsProperties(fileO, "bbdd.url", p);
+    if (separateString.equals("")) {
+      separateString = "jdbc:oracle:thin:@localhost:1521:xe";
+    }
+    String[] separateUrl = separateString.split(":");
+
+    askInfo = "DB Server Address: ";
+    ConfigureOption o5 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o5.setChooseString(separateUrl[3].substring(1));
+    option.put(5, o5);
+
+    askInfo = "DB Server Port: ";
+    ConfigureOption o6 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o6.setChooseString(separateUrl[4]);
+    option.put(6, o6);
+
+    return option;
+  }
+
+  /**
+   * This function createOPPostgreSQL() create options of PostgreSQL configuration.Information is
+   * collected from Openbravo.properties file.
+   * 
+   * @return HashMap<Integer, Option>
+   */
+  private static HashMap<Integer, ConfigureOption> createOPPostgreSQL(Project p) {
+
+    HashMap<Integer, ConfigureOption> option = new HashMap<Integer, ConfigureOption>();
+    String askInfo;
+    File fileO = new File(OPENBRAVO_PROPERTIES);
+    // Modify Openbravo.properties file if PostgreSQL's options have been disabled.
+    if (searchOptionsProperties(fileO, "bbdd.rdbms", p).equals("ORACLE")) {
+      changeOraclePostgresql(p);
+    }
+
+    askInfo = "SID: ";
+    ConfigureOption o0 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o0.setChooseString(searchOptionsProperties(fileO, "bbdd.sid", p));
+    option.put(0, o0);
+
+    askInfo = "System User: ";
+    ConfigureOption o1 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o1.setChooseString(searchOptionsProperties(fileO, "bbdd.systemUser", p));
+    option.put(1, o1);
+
+    askInfo = "System Password: ";
+    ConfigureOption o2 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o2.setChooseString(searchOptionsProperties(fileO, "bbdd.systemPassword", p));
+    option.put(2, o2);
+
+    askInfo = "DB User: ";
+    ConfigureOption o3 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o3.setChooseString(searchOptionsProperties(fileO, "bbdd.user", p));
+    option.put(3, o3);
+
+    askInfo = "DB User Password: ";
+    ConfigureOption o4 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o4.setChooseString(searchOptionsProperties(fileO, "bbdd.password", p));
+    option.put(4, o4);
+
+    String separateString = searchOptionsProperties(fileO, "bbdd.url", p);
+    String[] separateUrl = separateString.split(":");
+
+    askInfo = "DB Server Address: ";
+    ConfigureOption o5 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o5.setChooseString(separateUrl[2].substring(2));
+    option.put(5, o5);
+
+    askInfo = "DB Server Port: ";
+    ConfigureOption o6 = new ConfigureOption(ConfigureOption.TYPE_OPT_STRING, askInfo,
+        new ArrayList<String>());
+    o6.setChooseString(separateUrl[3]);
+    option.put(6, o6);
+
+    return option;
+  }
+
+  /**
+   * This function changeOraclePostgresql() disabling options Oracle or PostgreSQL, using the [#] at
+   * the beginning of the options to disable them.
+   * 
+   */
+  private static void changeOraclePostgresql(Project p) {
+    try {
+      File fileR = new File(OPENBRAVO_PROPERTIES);
+      FileReader fr = new FileReader(fileR);
+      BufferedReader br = new BufferedReader(fr);
+      // Auxiliary file to rewrite
+      File fileW = new File(OPENBRAVO_PROPERTIES_AUX);
+      FileWriter fw = new FileWriter(fileW);
+      String line;
+      while ((line = br.readLine()) != null) {
+        // Searching bbdd.xxx and add/delete "#" symbol.
+        if (line.indexOf("bbdd.") == 0) {
+          // Not considering the following options: bbdd.outputscript and bbdd.verbosity because are
+          // always.
+          if (!(line.contains("bbdd.verbosity") || line.contains("bbdd.outputscript"))) {
+            line = line.replace(line, "# " + line);
+          }
+        } else if (line.indexOf("bbdd.") == 2) {
+          line = line.replace(line, line.substring(2));
+        }
+        fw.write(line + "\n");
+      }
+      fr.close();
+      fw.close();
+      br.close();
+    } catch (Exception e1) {
+      p.log("Excetion reading/writing file: " + e1);
+    }
+    // Second part: Delete Openbravo.properties and rename Openbravo.properties.aux to
+    // Openbravo.properties
+    try {
+      File fileR = new File(OPENBRAVO_PROPERTIES);
+      fileR.delete();
+      File fileW = new File(OPENBRAVO_PROPERTIES_AUX);
+      fileW.renameTo(new File(OPENBRAVO_PROPERTIES));
+    } catch (Exception e2) {
+      p.log("Excetion deleting/rename file: " + e2);
+    }
+  }
+
+  /**
+   * This function FileCopyTemplate() copy a file if it is not exists.
+   * 
+   * @param sourceFile
+   * @param destinationFile
+   */
+  private static void fileCopyTemplate(String sourceFile, String destinationFile, Project p) {
+    try {
+      File inFile = new File(sourceFile);
+      File outFile = new File(destinationFile);
+      if (!outFile.exists()) {
+        FileUtils.copyFile(inFile, outFile);
+      }
+    } catch (IOException e) {
+      p.log("Error in in/out in FileCopyTemplate.");
+    }
+  }
+
+  /**
+   * This function readLicense() show license terms for installing OpenBravo. License is located in
+   * OPENBRAVO_LICENSE.
+   * 
+   * @throws IOException
+   */
+  private static void readLicense(Project p) throws IOException {
+    File license = null;
+    FileReader fr = null;
+    BufferedReader br = null;
+    Scanner in = new Scanner(System.in);
+    int lineConsole = 0;
+
+    try {
+      license = new File(OPENBRAVO_LICENSE);
+      fr = new FileReader(license);
+      br = new BufferedReader(fr);
+      String line;
+      while ((line = br.readLine()) != null) {
+        p.log(line);
+        if (lineConsole == LINES_SHOWING_LICENSE) {
+          p.log("Press [Enter] to continue:");
+          in.nextLine();
+          lineConsole = 0;
+        }
+        lineConsole++;
+      }
+    } catch (Exception e) {
+      e.printStackTrace();
+    } finally {
+      try {
+        fr.close();
+        br.close();
+      } catch (Exception e2) {
+        e2.printStackTrace();
+      }
+    }
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/configuration/ConfigureOption.java	Wed Nov 19 19:11:32 2014 +0100
@@ -0,0 +1,151 @@
+/*
+ *************************************************************************
+ * 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) 2014 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.configuration;
+
+import java.util.ArrayList;
+
+import org.apache.tools.ant.Project;
+
+/**
+ * Option Class is used to the process of configuration of Openbravo.properties and others files, at
+ * the beginning of the installation of OpenBravo.
+ * 
+ * @author inigosanchez
+ * 
+ */
+
+class ConfigureOption {
+
+  static int TYPE_OPT_CHOOSE = 0;
+  static int TYPE_OPT_STRING = 1;
+
+  private String askInfo, chooseString;
+  private ArrayList<String> opt;
+  private int choose, type;
+
+  ConfigureOption(int typ, String info, ArrayList<String> options) {
+    type = typ;
+    askInfo = info;
+    opt = options;
+    choose = 0;
+    chooseString = "";
+  }
+
+  /**
+   * This function setChoose() set a choose numeric option.
+   * 
+   * @param num
+   * @return boolean
+   */
+  boolean setChoose(int num) {
+    if (num >= 0 && num < opt.size()) {
+      choose = num;
+      return true;
+    } else {
+      return false;
+    }
+  }
+
+  /**
+   * This function getMax() return number of numeric option.
+   * 
+   * @return int
+   */
+  int getMax() {
+    return opt.size();
+  }
+
+  /**
+   * This function getChoose() return numeric option.
+   * 
+   * @return int
+   */
+  int getChoose() {
+    return choose;
+  }
+
+  /**
+   * This function setChooseString() set a choose string option.
+   * 
+   * @param String
+   */
+  void setChooseString(String line) {
+    chooseString = line;
+    if (type == TYPE_OPT_CHOOSE) {
+      int i = 0;
+      for (final String opts : opt) {
+        if (opts.equals(chooseString)) {
+          choose = i;
+        }
+        i++;
+      }
+    }
+  }
+
+  String getChooseString() {
+    return chooseString;
+  }
+
+  int getType() {
+    return type;
+  }
+
+  String getAskInfo() {
+    return askInfo;
+  }
+
+  /**
+   * Function getOptions(Project p) list options.
+   */
+  void getOptions(Project p) {
+    // Choose options
+    if (type == TYPE_OPT_CHOOSE) {
+      int i = 0;
+      for (final String opts : opt) {
+        p.log("[" + i++ + "]" + opts);
+      }
+      p.log("\nPlease, choose an option [" + getChoose() + "]: ");
+    } else if (type == TYPE_OPT_STRING) {
+      p.log("\nPlease, introduce here: [" + getChooseString() + "]: ");
+    }
+  }
+
+  /**
+   * Function getOptionChoose() returns choose option.
+   * 
+   * @return option in String
+   */
+  String getOptionChoose() {
+    String res = "";
+    if (type == TYPE_OPT_CHOOSE) {
+      int i = 0;
+      for (final String opts : opt) {
+        if (choose == i) {
+          res = opts;
+        }
+        i++;
+      }
+    } else if (type == TYPE_OPT_STRING) {
+      res = chooseString;
+    }
+    return res;
+  }
+
+}
--- a/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java	Wed Nov 19 19:11:32 2014 +0100
@@ -171,28 +171,32 @@
               Utility.messageBD(this, "TaxNotFound", vars.getLanguage()));
           return myError;
         }
-        // Processing for taxincluded
-        if (order.getPriceList().isPriceIncludesTax()) {
-          BigDecimal grossAmount, grossUnitPrice, qtyOrdered, priceActual;
+        OBContext.setAdminMode(true);
+        try {
+          // Processing for taxincluded
+          if (order.getPriceList().isPriceIncludesTax()) {
+            BigDecimal grossAmount, grossUnitPrice, qtyOrdered, priceActual;
 
-          strGrossUnitPrice = strPriceActual;
-          strGrossBaseUnitPrice = strGrossUnitPrice;
-          grossUnitPrice = (strGrossUnitPrice.equals("") ? ZERO
-              : (new BigDecimal(strGrossUnitPrice))).setScale(pricePrecision,
-              BigDecimal.ROUND_HALF_UP);
-          qtyOrdered = (data[i].qtyordered.equals("") ? ZERO : new BigDecimal(data[i].qtyordered));
-          grossAmount = qtyOrdered.multiply(grossUnitPrice).setScale(stdPrecision,
-              BigDecimal.ROUND_HALF_UP);
-          priceActual = FinancialUtils.calculateNetFromGross(strCTaxID, grossAmount,
-              pricePrecision, grossAmount, qtyOrdered);
+            strGrossUnitPrice = strPriceActual;
+            strGrossBaseUnitPrice = strGrossUnitPrice;
+            grossUnitPrice = (strGrossUnitPrice.equals("") ? ZERO : (new BigDecimal(
+                strGrossUnitPrice))).setScale(pricePrecision, BigDecimal.ROUND_HALF_UP);
+            qtyOrdered = (data[i].qtyordered.equals("") ? ZERO : new BigDecimal(data[i].qtyordered));
+            grossAmount = qtyOrdered.multiply(grossUnitPrice).setScale(stdPrecision,
+                BigDecimal.ROUND_HALF_UP);
+            priceActual = FinancialUtils.calculateNetFromGross(strCTaxID, grossAmount,
+                pricePrecision, grossAmount, qtyOrdered);
 
-          strGrossPriceList = strPriceList;
-          strPriceActual = priceActual.toString();
-          strNetPriceList = priceActual.toString();
-          strPriceLimit = priceActual.toString();
-          strGrossAmount = grossAmount.toString();
-        } else {
-          strNetPriceList = strPriceList;
+            strGrossPriceList = strPriceList;
+            strPriceActual = priceActual.toString();
+            strNetPriceList = priceActual.toString();
+            strPriceLimit = priceActual.toString();
+            strGrossAmount = grossAmount.toString();
+          } else {
+            strNetPriceList = strPriceList;
+          }
+        } finally {
+          OBContext.restorePreviousMode();
         }
 
         int line = Integer.valueOf(orderData[0].line.equals("") ? "0" : orderData[0].line)
@@ -259,8 +263,8 @@
       myError = Utility.translateError(this, vars, vars.getLanguage(), "ProcessRunError");
     }
     try {
+      OBContext.setAdminMode(true);
       for (String strOrderLine : strOrderLineList) {
-        OBContext.setAdminMode(true);
         org.openbravo.model.ad.ui.Process process = OBDal.getInstance().get(
             org.openbravo.model.ad.ui.Process.class, "DFC78024B1F54CBB95DC73425BA6687F");
 
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml	Wed Nov 19 19:11:32 2014 +0100
@@ -789,34 +789,34 @@
 		<variableExpression><![CDATA[($V{QTYREF_SUM10}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{QTY_SUM10}.subtract($V{QTYREF_SUM10}).divide( $V{QTYREF_SUM10}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
-		<variableExpression><![CDATA[($V{MARGIN_1}!=null && $V{MARGINREF_1}!=null )?new BigDecimal(0.0):$V{MARGIN_1}.subtract( $V{MARGINREF_1})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_1}!=null && $V{MARGINREF_1}!=null )?$V{MARGIN_1}.subtract( $V{MARGINREF_1}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
-		<variableExpression><![CDATA[($V{MARGIN_2}!=null && $V{MARGINREF_2}!=null )?new BigDecimal(0.0):$V{MARGIN_2}.subtract( $V{MARGINREF_2})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_2}!=null && $V{MARGINREF_2}!=null )?$V{MARGIN_2}.subtract( $V{MARGINREF_2}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
-		<variableExpression><![CDATA[($V{MARGIN_3}!=null && $V{MARGINREF_3}!=null )?new BigDecimal(0.0):$V{MARGIN_3}.subtract( $V{MARGINREF_3})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_3}!=null && $V{MARGINREF_3}!=null )?$V{MARGIN_3}.subtract( $V{MARGINREF_3}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
-		<variableExpression><![CDATA[($V{MARGIN_4}!=null && $V{MARGINREF_4}!=null )?new BigDecimal(0.0):$V{MARGIN_4}.subtract( $V{MARGINREF_4})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_4}!=null && $V{MARGINREF_4}!=null )?$V{MARGIN_4}.subtract( $V{MARGINREF_4}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
-		<variableExpression><![CDATA[($V{MARGIN_5}!=null && $V{MARGINREF_5}!=null )?new BigDecimal(0.0):$V{MARGIN_5}.subtract( $V{MARGINREF_5})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_5}!=null && $V{MARGINREF_5}!=null )?$V{MARGIN_5}.subtract( $V{MARGINREF_5}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
-		<variableExpression><![CDATA[($V{MARGIN_6}!=null && $V{MARGINREF_6}!=null )?new BigDecimal(0.0):$V{MARGIN_6}.subtract( $V{MARGINREF_6})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_6}!=null && $V{MARGINREF_6}!=null )?$V{MARGIN_6}.subtract( $V{MARGINREF_6}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
-		<variableExpression><![CDATA[($V{MARGIN_7}!=null && $V{MARGINREF_7}!=null )?new BigDecimal(0.0):$V{MARGIN_7}.subtract( $V{MARGINREF_7})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_7}!=null && $V{MARGINREF_7}!=null )?$V{MARGIN_7}.subtract( $V{MARGINREF_7}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
-		<variableExpression><![CDATA[($V{MARGIN_8}!=null && $V{MARGINREF_8}!=null )?new BigDecimal(0.0):$V{MARGIN_8}.subtract( $V{MARGINREF_8})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_8}!=null && $V{MARGINREF_8}!=null )?$V{MARGIN_8}.subtract( $V{MARGINREF_8}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
-		<variableExpression><![CDATA[($V{MARGIN_9}!=null && $V{MARGINREF_9}!=null )?new BigDecimal(0.0):$V{MARGIN_9}.subtract( $V{MARGINREF_9})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_9}!=null && $V{MARGINREF_9}!=null )?$V{MARGIN_9}.subtract( $V{MARGINREF_9}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<variable name="MARGINDIFF_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
-		<variableExpression><![CDATA[($V{MARGIN_10}!=null && $V{MARGINREF_10}!=null )?new BigDecimal(0.0):$V{MARGIN_10}.subtract( $V{MARGINREF_10})]]></variableExpression>
+		<variableExpression><![CDATA[($V{MARGIN_10}!=null && $V{MARGINREF_10}!=null )?$V{MARGIN_10}.subtract( $V{MARGINREF_10}):BigDecimal.ZERO]]></variableExpression>
 	</variable>
 	<group name="TOTALIZE">
 		<groupExpression><![CDATA[]]></groupExpression>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java	Wed Nov 19 19:04:06 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR.java	Wed Nov 19 19:11:32 2014 +0100
@@ -27,6 +27,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.lang.StringUtils;
 import org.openbravo.base.filter.IsIDFilter;
 import org.openbravo.base.filter.IsPositiveIntFilter;
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
@@ -64,6 +65,14 @@
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef", "");
       String strDateToRef = vars.getGlobalVariable("inpDateToRef",
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef", "");
+      String strDateFromRef2 = vars.getGlobalVariable("inpDateFromRef2",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef2", "");
+      String strDateToRef2 = vars.getGlobalVariable("inpDateToRef2",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef2", "");
+      String strDateFromRef3 = vars.getGlobalVariable("inpDateFromRef3",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef3", "");
+      String strDateToRef3 = vars.getGlobalVariable("inpDateToRef3",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef3", "");
       String strPartnerGroup = vars.getGlobalVariable("inpPartnerGroup",
           "ReportInvoiceCustomerDimensionalAnalysesJR|partnerGroup", "");
       String strcBpartnerId = vars.getInGlobalVariable("inpcBPartnerId_IN",
@@ -106,9 +115,9 @@
             "ReportInvoiceCustomerDimensionalAnalysesJR|comparative", "N");
       printPageDataSheet(request, response, vars, strComparative, strDateFrom, strDateTo,
           strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown,
-          strShown, strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId,
-          strProducttype, strcDocTypeId, strOrder, strMayor, strMenor, strPartnerSalesRepId,
-          strCurrencyId);
+          strShown, strDateFromRef, strDateToRef, strDateFromRef2, strDateToRef2, strDateFromRef3,
+          strDateToRef3, strOrg, strsalesrepId, strcProjectId, strProducttype, strcDocTypeId,
+          strOrder, strMayor, strMenor, strPartnerSalesRepId, strCurrencyId);
     } else if (vars.commandIn("EDIT_HTML", "EDIT_HTML_COMPARATIVE")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateFrom");
@@ -118,6 +127,14 @@
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef");
       String strDateToRef = vars.getRequestGlobalVariable("inpDateToRef",
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef");
+      String strDateFromRef2 = vars.getRequestGlobalVariable("inpDateFromRef2",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef2");
+      String strDateToRef2 = vars.getRequestGlobalVariable("inpDateToRef2",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef2");
+      String strDateFromRef3 = vars.getRequestGlobalVariable("inpDateFromRef3",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef3");
+      String strDateToRef3 = vars.getRequestGlobalVariable("inpDateToRef3",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef3");
       String strPartnerGroup = vars.getRequestGlobalVariable("inpPartnerGroup",
           "ReportInvoiceCustomerDimensionalAnalysesJR|partnerGroup");
       String strcBpartnerId = vars.getRequestInGlobalVariable("inpcBPartnerId_IN",
@@ -150,9 +167,9 @@
           "ReportInvoiceCustomerDimensionalAnalysesJR|currency", strUserCurrencyId);
       printPageHtml(request, response, vars, strComparative, strDateFrom, strDateTo,
           strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown,
-          strShown, strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId,
-          strProducttype, strcDocTypeId, strOrder, strMayor, strMenor, strPartnerSalesrepId,
-          strCurrencyId, "html");
+          strShown, strDateFromRef, strDateToRef, strDateFromRef2, strDateToRef2, strDateFromRef3,
+          strDateToRef3, strOrg, strsalesrepId, strcProjectId, strProducttype, strcDocTypeId,
+          strOrder, strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "html");
     } else if (vars.commandIn("EDIT_PDF", "EDIT_PDF_COMPARATIVE")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateFrom");
@@ -162,6 +179,14 @@
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef");
       String strDateToRef = vars.getRequestGlobalVariable("inpDateToRef",
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef");
+      String strDateFromRef2 = vars.getRequestGlobalVariable("inpDateFromRef2",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef2");
+      String strDateToRef2 = vars.getRequestGlobalVariable("inpDateToRef2",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef2");
+      String strDateFromRef3 = vars.getRequestGlobalVariable("inpDateFromRef3",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef3");
+      String strDateToRef3 = vars.getRequestGlobalVariable("inpDateToRef3",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef3");
       String strPartnerGroup = vars.getRequestGlobalVariable("inpPartnerGroup",
           "ReportInvoiceCustomerDimensionalAnalysesJR|partnerGroup");
       String strcBpartnerId = vars.getRequestInGlobalVariable("inpcBPartnerId_IN",
@@ -194,9 +219,9 @@
           "ReportInvoiceCustomerDimensionalAnalysesJR|currency", strUserCurrencyId);
       printPageHtml(request, response, vars, strComparative, strDateFrom, strDateTo,
           strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown,
-          strShown, strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId,
-          strProducttype, strcDocTypeId, strOrder, strMayor, strMenor, strPartnerSalesrepId,
-          strCurrencyId, "pdf");
+          strShown, strDateFromRef, strDateToRef, strDateFromRef2, strDateToRef2, strDateFromRef3,
+          strDateToRef3, strOrg, strsalesrepId, strcProjectId, strProducttype, strcDocTypeId,
+          strOrder, strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "pdf");
     } else if (vars.commandIn("EXCEL")) {
       String strDateFrom = vars.getRequestGlobalVariable("inpDateFrom",
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateFrom");
@@ -206,6 +231,14 @@
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef");
       String strDateToRef = vars.getRequestGlobalVariable("inpDateToRef",
           "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef");
+      String strDateFromRef2 = vars.getRequestGlobalVariable("inpDateFromRef2",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef2");
+      String strDateToRef2 = vars.getRequestGlobalVariable("inpDateToRef2",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef2");
+      String strDateFromRef3 = vars.getRequestGlobalVariable("inpDateFromRef3",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateFromRef3");
+      String strDateToRef3 = vars.getRequestGlobalVariable("inpDateToRef3",
+          "ReportInvoiceCustomerDimensionalAnalysesJR|dateToRef3");
       String strPartnerGroup = vars.getRequestGlobalVariable("inpPartnerGroup",
           "ReportInvoiceCustomerDimensionalAnalysesJR|partnerGroup");
       String strcBpartnerId = vars.getRequestInGlobalVariable("inpcBPartnerId_IN",
@@ -238,9 +271,9 @@
           "ReportInvoiceCustomerDimensionalAnalysesJR|currency", strUserCurrencyId);
       printPageHtml(request, response, vars, strComparative, strDateFrom, strDateTo,
           strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId, strNotShown,
-          strShown, strDateFromRef, strDateToRef, strOrg, strsalesrepId, strcProjectId,
-          strProducttype, strcDocTypeId, strOrder, strMayor, strMenor, strPartnerSalesrepId,
-          strCurrencyId, "xls");
+          strShown, strDateFromRef, strDateToRef, strDateFromRef2, strDateToRef2, strDateFromRef3,
+          strDateToRef3, strOrg, strsalesrepId, strcProjectId, strProducttype, strcDocTypeId,
+          strOrder, strMayor, strMenor, strPartnerSalesrepId, strCurrencyId, "xls");
     } else
       pageErrorPopUp(response);
   }
@@ -249,7 +282,8 @@
       VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo,
       String strPartnerGroup, String strcBpartnerId, String strProductCategory,
       String strmProductId, String strNotShown, String strShown, String strDateFromRef,
-      String strDateToRef, String strOrg, String strsalesrepId, String strcProjectId,
+      String strDateToRef, String strDateFromRef2, String strDateToRef2, String strDateFromRef3,
+      String strDateToRef3, String strOrg, String strsalesrepId, String strcProjectId,
       String strProducttype, String strcDocTypeId, String strOrder, String strMayor,
       String strMenor, String strPartnerSalesrepId, String strCurrencyId) throws IOException,
       ServletException {
@@ -316,6 +350,20 @@
     xmlDocument.setParameter("dateToRef", strDateToRef);
     xmlDocument.setParameter("dateToRefdisplayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
     xmlDocument.setParameter("dateToRefsaveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateFromRef2", strDateFromRef2);
+    xmlDocument
+        .setParameter("dateFromRef2displayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateFromRef2saveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateToRef2", strDateToRef2);
+    xmlDocument.setParameter("dateToRef2displayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateToRef2saveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateFromRef3", strDateFromRef3);
+    xmlDocument
+        .setParameter("dateFromRef3displayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateFromRef3saveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateToRef3", strDateToRef3);
+    xmlDocument.setParameter("dateToRef3displayFormat", vars.getSessionValue("#AD_SqlDateFormat"));
+    xmlDocument.setParameter("dateToRef3saveFormat", vars.getSessionValue("#AD_SqlDateFormat"));
     xmlDocument.setParameter("cBpGroupId", strPartnerGroup);
     xmlDocument.setParameter("mProductCategoryId", strProductCategory);
     xmlDocument.setParameter("adOrgId", strOrg);
@@ -360,7 +408,7 @@
 
     try {
       ComboTableData comboTableData = new ComboTableData(vars, this, "TABLEDIR", "AD_Org_ID", "",
-          "D4DF252DEC3B44858454EE5292A8B836", Utility.getContext(this, vars, "#AccessibleOrgTree",
+          "", Utility.getContext(this, vars, "#AccessibleOrgTree",
               "ReportInvoiceCustomerDimensionalAnalysesJR"), Utility.getContext(this, vars,
               "#User_Client", "ReportInvoiceCustomerDimensionalAnalysesJR"), 0);
       Utility.fillSQLParameters(this, vars, null, comboTableData,
@@ -471,7 +519,8 @@
       VariablesSecureApp vars, String strComparative, String strDateFrom, String strDateTo,
       String strPartnerGroup, String strcBpartnerId, String strProductCategory,
       String strmProductId, String strNotShown, String strShown, String strDateFromRef,
-      String strDateToRef, String strOrg, String strsalesrepId, String strcProjectId,
+      String strDateToRef, String strDateFromRef2, String strDateToRef2, String strDateFromRef3,
+      String strDateToRef3, String strOrg, String strsalesrepId, String strcProjectId,
       String strProducttype, String strcDocTypeId, String strOrder, String strMayor,
       String strMenor, String strPartnerSalesrepId, String strCurrencyId, String strOutput)
       throws IOException, ServletException {
@@ -489,8 +538,25 @@
         "discard", "discard", "discard", "discard", "discard", "discard" };
     if (strOrg.equals(""))
       strOrg = vars.getOrg();
-    if (strComparative.equals("Y"))
+    boolean multiComparative2 = false;
+    boolean multiComparative3 = false;
+    if (strComparative.equals("Y")) {
       discard1[0] = "selEliminarBody2";
+      if (StringUtils.isNotBlank(strDateFromRef2) && StringUtils.isNotBlank(strDateToRef2)) {
+        multiComparative2 = true;
+        if (StringUtils.isNotBlank(strDateFromRef3) && StringUtils.isNotBlank(strDateToRef3)) {
+          multiComparative3 = true;
+        } else {
+          strDateFromRef3 = "";
+          strDateToRef3 = "";
+        }
+      } else {
+        strDateFromRef2 = "";
+        strDateToRef2 = "";
+        strDateFromRef3 = "";
+        strDateToRef3 = "";
+      }
+    }
     String strTitle = "";
     strTitle = Utility.messageBD(this, "From", vars.getLanguage()) + " " + strDateFrom + " "
         + Utility.messageBD(this, "to", vars.getLanguage()) + " " + strDateTo;
@@ -706,7 +772,9 @@
                     strPartnerGroup, strcBpartnerId, strProductCategory, strmProductId,
                     strsalesrepId, strPartnerSalesrepId, strcProjectId, strProducttype,
                     strcDocTypeId, strDateFrom, DateTimeData.nDaysAfter(this, strDateTo, "1"),
-                    strDateFromRef, DateTimeData.nDaysAfter(this, strDateToRef, "1"))
+                    strDateFromRef, DateTimeData.nDaysAfter(this, strDateToRef, "1"),
+                    strDateFromRef2, DateTimeData.nDaysAfter(this, strDateToRef2, "1"),
+                    strDateFromRef3, DateTimeData.nDaysAfter(this, strDateToRef3, "1"))
                 : ReportInvoiceCustomerDimensionalAnalysesJRData.selectNoComparativeCount(this,
                     levelsconcat.toString(), Tree.getMembers(this,
                         TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility.getContext(
@@ -744,16 +812,48 @@
       } else {
         if (strComparative.equals("Y")) {
           try {
-            data = ReportInvoiceCustomerDimensionalAnalysesJRData.select(this, strCurrencyId,
-                strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4],
-                strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8], strTextShow[9],
-                Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg), Utility
-                    .getContext(this, vars, "#User_Client",
+            if (multiComparative2) {
+              if (multiComparative3) {
+                // Multi-comparative B: 1 base date, 3 reference dates
+                data = ReportInvoiceCustomerDimensionalAnalysesJRData.select3(this, strCurrencyId,
+                    strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4],
+                    strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8], strTextShow[9],
+                    Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg),
+                    Utility.getContext(this, vars, "#User_Client",
                         "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData
-                    .nDaysAfter(this, strDateTo, "1"), strPartnerGroup, strcBpartnerId,
-                strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId,
-                strcProjectId, strProducttype, strcDocTypeId, strDateFromRef, DateTimeData
-                    .nDaysAfter(this, strDateToRef, "1"), strOrderby);
+                        .nDaysAfter(this, strDateTo, "1"), strPartnerGroup, strcBpartnerId,
+                    strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId,
+                    strcProjectId, strProducttype, strcDocTypeId, strDateFromRef, DateTimeData
+                        .nDaysAfter(this, strDateToRef, "1"), strDateFromRef2, DateTimeData
+                        .nDaysAfter(this, strDateToRef2, "1"), strDateFromRef3, DateTimeData
+                        .nDaysAfter(this, strDateToRef3, "1"), strOrderby);
+              } else {
+                // Multi-comparative A: 1 base date, 2 reference dates
+                data = ReportInvoiceCustomerDimensionalAnalysesJRData.select2(this, strCurrencyId,
+                    strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4],
+                    strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8], strTextShow[9],
+                    Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg),
+                    Utility.getContext(this, vars, "#User_Client",
+                        "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData
+                        .nDaysAfter(this, strDateTo, "1"), strPartnerGroup, strcBpartnerId,
+                    strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId,
+                    strcProjectId, strProducttype, strcDocTypeId, strDateFromRef, DateTimeData
+                        .nDaysAfter(this, strDateToRef, "1"), strDateFromRef2, DateTimeData
+                        .nDaysAfter(this, strDateToRef2, "1"), strOrderby);
+              }
+            } else {
+              // Regular comparative: 1 base date, 1 reference date
+              data = ReportInvoiceCustomerDimensionalAnalysesJRData.select(this, strCurrencyId,
+                  strTextShow[0], strTextShow[1], strTextShow[2], strTextShow[3], strTextShow[4],
+                  strTextShow[5], strTextShow[6], strTextShow[7], strTextShow[8], strTextShow[9],
+                  Tree.getMembers(this, TreeData.getTreeOrg(this, vars.getClient()), strOrg),
+                  Utility.getContext(this, vars, "#User_Client",
+                      "ReportInvoiceCustomerDimensionalAnalysesJR"), strDateFrom, DateTimeData
+                      .nDaysAfter(this, strDateTo, "1"), strPartnerGroup, strcBpartnerId,
+                  strProductCategory, strmProductId, strsalesrepId, strPartnerSalesrepId,
+                  strcProjectId, strProducttype, strcDocTypeId, strDateFromRef, DateTimeData
+                      .nDaysAfter(this, strDateToRef, "1"), strOrderby);
+            }
           } catch (ServletException ex) {
             myMessage = Utility.translateError(this, vars, vars.getLanguage(), ex.getMessage());
           }
@@ -811,6 +911,12 @@
           String strReportPath;
           if (strComparative.equals("Y")) {
             strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesComparativeJR.jrxml";
+            if (multiComparative2) {
+              strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeJR.jrxml";
+            }
+            if (multiComparative3) {
+              strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml";
+            }
           } else {
             strReportPath = "@basedesign@/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesNoComparativeJR.jrxml";
           }
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html	Wed Nov 19 19:04:06 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.html	Wed Nov 19 19:11:32 2014 +0100
@@ -370,6 +370,98 @@
                   <td class="TitleCell"></td>
                   <td class="ContentCell"></td>
                 </tr>
+                <tr id="selEliminarHeader1">
+                  <td class="TitleCell"><span class="LabelText">From Reference Date</span></td>
+                  <td class="TextBox_btn_ContentCell">
+                    <table border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
+                      <tr>
+                        <td class="TextBox_ContentCell">
+                          <input dojoType="openbravo:DateTextbox" lowerThan="paramDateToRef2" displayFormat="xx" saveFormat="yy"  class="TextBox_btn_OneCell_width" type="text" name="inpDateFromRef2" id="paramDateFromRef2" size="10" maxlength="10" value="" onkeyup="autoCompleteDate(this.textbox, this.displayFormat);return true;"></input><script>djConfig.searchIds.push("paramDateFromRef2");</script>
+                        </td>
+                        <td class="FieldButton_ContentCell">
+                          <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Calendar'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="showCalendar('frmMain.inpDateFromRef2', document.frmMain.inpDateFromRef2.value, false);return false;">
+                          <table class="FieldButton" onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calendar';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+                            <tr>
+                              <td class="FieldButton_bg">
+                                <img alt="Calendar" class="FieldButton_Icon FieldButton_Icon_Calendar" title="Calendar" src="../../../../../web/images/blank.gif" border="0"></img>
+                              </td>
+                            </tr>
+                          </table>
+                          </a>
+                        </td>
+                      </tr>
+                    </table>
+                  </td>
+                  <td class="TitleCell"><span class="LabelText">To Reference Date</span></td>
+                  <td class="TextBox_btn_ContentCell">
+                    <table border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
+                      <tr>
+                        <td class="TextBox_ContentCell">
+                          <input dojoType="openbravo:DateTextbox" greaterThan="paramDateFromRef2" displayFormat="xx" saveFormat="yy"  class="TextBox_btn_OneCell_width" type="text" name="inpDateToRef2" id="paramDateToRef2" maxlength="10" value="" onkeyup="autoCompleteDate(this.textbox, this.displayFormat);return true;"></input><script>djConfig.searchIds.push("paramDateToRef2");</script>
+                        </td>
+                        <td class="FieldButton_ContentCell">
+                          <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Calendar'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="showCalendar('frmMain.inpDateToRef2', document.frmMain.inpDateToRef2.value, false);return false;">
+                          <table class="FieldButton" onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calendar';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+                            <tr>
+                              <td class="FieldButton_bg">
+                                <img alt="Calendar" class="FieldButton_Icon FieldButton_Icon_Calendar" title="Calendar" src="../../../../../web/images/blank.gif" border="0"></img>
+                              </td>
+                            </tr>
+                          </table>
+                          </a>
+                        </td>
+                      </tr>
+                    </table>
+                  </td>
+                  <td class="TitleCell"></td>
+                  <td class="ContentCell"></td>
+                </tr>
+                <tr id="selEliminarHeader1">
+                  <td class="TitleCell"><span class="LabelText">From Reference Date</span></td>
+                  <td class="TextBox_btn_ContentCell">
+                    <table border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
+                      <tr>
+                        <td class="TextBox_ContentCell">
+                          <input dojoType="openbravo:DateTextbox" lowerThan="paramDateToRef3" displayFormat="xx" saveFormat="yy"  class="TextBox_btn_OneCell_width" type="text" name="inpDateFromRef3" id="paramDateFromRef3" size="10" maxlength="10" value="" onkeyup="autoCompleteDate(this.textbox, this.displayFormat);return true;"></input><script>djConfig.searchIds.push("paramDateFromRef3");</script>
+                        </td>
+                        <td class="FieldButton_ContentCell">
+                          <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Calendar'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="showCalendar('frmMain.inpDateFromRef3', document.frmMain.inpDateFromRef3.value, false);return false;">
+                          <table class="FieldButton" onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calendar';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+                            <tr>
+                              <td class="FieldButton_bg">
+                                <img alt="Calendar" class="FieldButton_Icon FieldButton_Icon_Calendar" title="Calendar" src="../../../../../web/images/blank.gif" border="0"></img>
+                              </td>
+                            </tr>
+                          </table>
+                          </a>
+                        </td>
+                      </tr>
+                    </table>
+                  </td>
+                  <td class="TitleCell"><span class="LabelText">To Reference Date</span></td>
+                  <td class="TextBox_btn_ContentCell">
+                    <table border="0" cellspacing="0" cellpadding="0" summary=""  style="padding-top: 0px;">
+                      <tr>
+                        <td class="TextBox_ContentCell">
+                          <input dojoType="openbravo:DateTextbox" greaterThan="paramDateFromRef3" displayFormat="xx" saveFormat="yy"  class="TextBox_btn_OneCell_width" type="text" name="inpDateToRef3" id="paramDateToRef3" maxlength="10" value="" onkeyup="autoCompleteDate(this.textbox, this.displayFormat);return true;"></input><script>djConfig.searchIds.push("paramDateToRef3");</script>
+                        </td>
+                        <td class="FieldButton_ContentCell">
+                          <a class="FieldButtonLink" href="#" onfocus="setWindowElementFocus(this); window.status='Calendar'; return true;" onblur="window.status=''; return true;" onkeypress="this.className='FieldButtonLink_active'; return true;" onkeyup="this.className='FieldButtonLink_focus'; return true;"  onclick="showCalendar('frmMain.inpDateToRef3', document.frmMain.inpDateToRef3.value, false);return false;">
+                          <table class="FieldButton" onmouseout="this.className='FieldButton';window.status='';return true;" onmouseover="this.className='FieldButton_hover';window.status='Show calendar';return true;" onmousedown="this.className='FieldButton_active';return true;" onmouseup="this.className='FieldButton';return true;">
+                            <tr>
+                              <td class="FieldButton_bg">
+                                <img alt="Calendar" class="FieldButton_Icon FieldButton_Icon_Calendar" title="Calendar" src="../../../../../web/images/blank.gif" border="0"></img>
+                              </td>
+                            </tr>
+                          </table>
+                          </a>
+                        </td>
+                      </tr>
+                    </table>
+                  </td>
+                  <td class="TitleCell"></td>
+                  <td class="ContentCell"></td>
+                </tr>
                 <tr>
                   <td class="TitleCell"><span class="LabelText">Amount Greater Than</span></td>
                   <td class="TextBox_ContentCell"> <input dojoType="openbravo:RealNumberTextbox" lowerThan="paramMenor" class="TextBox_OneCell_width" type="text" name="inpMayor" maxlength="10" id="paramMayor" value="" outputformat="euroEdition"></input><script>djConfig.searchIds.push("paramMayor");</script>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.xml	Wed Nov 19 19:04:06 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJRFilter.xml	Wed Nov 19 19:11:32 2014 +0100
@@ -35,6 +35,18 @@
   <PARAMETER id="paramDateToRef" name="dateToRef" attribute="value"/>
   <PARAMETER id="paramDateToRef" name="dateToRefdisplayFormat" attribute="displayformat" replace="xx"/>
   <PARAMETER id="paramDateToRef" name="dateToRefsaveFormat" attribute="saveformat" replace="yy"/>
+  <PARAMETER id="paramDateFromRef2" name="dateFromRef2" attribute="value"/>
+  <PARAMETER id="paramDateFromRef2" name="dateFromRef2displayFormat" attribute="displayformat" replace="xx"/>
+  <PARAMETER id="paramDateFromRef2" name="dateFromRef2saveFormat" attribute="saveformat" replace="yy"/>
+  <PARAMETER id="paramDateToRef2" name="dateToRef2" attribute="value"/>
+  <PARAMETER id="paramDateToRef2" name="dateToRef2displayFormat" attribute="displayformat" replace="xx"/>
+  <PARAMETER id="paramDateToRef2" name="dateToRef2saveFormat" attribute="saveformat" replace="yy"/>
+  <PARAMETER id="paramDateFromRef3" name="dateFromRef3" attribute="value"/>
+  <PARAMETER id="paramDateFromRef3" name="dateFromRef3displayFormat" attribute="displayformat" replace="xx"/>
+  <PARAMETER id="paramDateFromRef3" name="dateFromRef3saveFormat" attribute="saveformat" replace="yy"/>
+  <PARAMETER id="paramDateToRef3" name="dateToRef3" attribute="value"/>
+  <PARAMETER id="paramDateToRef3" name="dateToRef3displayFormat" attribute="displayformat" replace="xx"/>
+  <PARAMETER id="paramDateToRef3" name="dateToRef3saveFormat" attribute="saveformat" replace="yy"/>
   <!--PARAMETER id="paramBPartnerId" name="paramBPartnerId" attribute="value"/>
 <PARAMETER id="paramBPartnerDescription" name="bPartnerDescription" attribute="value"/>
 <PARAMETER id="paramProductId" name="mProduct" attribute="value"/>
--- a/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_data.xsql	Wed Nov 19 19:04:06 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesJR_data.xsql	Wed Nov 19 19:11:32 2014 +0100
@@ -35,7 +35,9 @@
 	  C_CURRENCY_ISOSYM(?) AS CONVISOSYM,
       '' AS ID, '' AS NAME, '' AS TRANSCURRENCYID, '' AS TRANSDATE, '' AS TRANSCLIENTID, '' AS TRANSORGID, SUM(ZZ.COSTCALCULATED) AS COSTCALCULATED,
       '' AS ORG, '' AS PARTNERGROUP, '' AS PARTNER, '' AS DOCUMENTNO, '' AS INVOICEDATE, '' AS PRODCATEGORY, '' AS PRODUCT, 
-      '' AS PROFIT, '' AS MARGIN, '' AS PRICE, '' AS CONTACT, '' AS SALESREP, '' AS PROJECT, '' AS ADDRESS
+      '' AS PROFIT, '' AS MARGIN, '' AS PRICE, '' AS CONTACT, '' AS SALESREP, '' AS PROJECT, '' AS ADDRESS,
+      '' AS AMOUNTREF2, '' AS QTYREF2, '' AS WEIGHTREF2, '' AS COSTREF2, '' AS CONVAMOUNTREF2, '' AS CONVCOSTREF2,
+      '' AS AMOUNTREF3, '' AS QTYREF3, '' AS WEIGHTREF3, '' AS COSTREF3, '' AS CONVAMOUNTREF3, '' AS CONVCOSTREF3
       FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
       SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST, 
       SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT_REF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF,     	  
@@ -193,6 +195,622 @@
     <Parameter name="cDocTypeId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND C_DOCTYPE.C_DOCTYPE_ID IN]]></Parameter>
     <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10" text=", 1"/>
   </SqlMethod>
+  
+  <SqlMethod name="select2" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+    <![CDATA[
+      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST,
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF,
+      SUM(AMOUNTREF2) AS AMOUNTREF2, SUM(QTYREF2) AS QTYREF2, SUM(WEIGHTREF2) AS WEIGHTREF2, SUM(COSTREF2) AS COSTREF2,
+      SUM(CONVAMOUNT) AS CONVAMOUNT,                          
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOST) WHEN SUM(COSTEDAMT) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNT END) = 0 THEN 0 ELSE SUM(CONVCOST)*SUM(CONVAMOUNT)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNT END) END AS CONVCOST,
+      SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOSTREF) WHEN SUM(COSTEDAMTREF) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF END) = 0 THEN 0 ELSE SUM(CONVCOSTREF)*SUM(CONVAMOUNTREF)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF END) END AS CONVCOSTREF,
+      SUM(CONVAMOUNTREF2) AS CONVAMOUNTREF2,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOSTREF2) WHEN SUM(COSTEDAMTREF2) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF2 END) = 0 THEN 0 ELSE SUM(CONVCOSTREF2)*SUM(CONVAMOUNTREF2)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF2 END) END AS CONVCOSTREF2,
+      C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,        
+      C_CURRENCY_ISOSYM(?) AS CONVISOSYM,
+      '' AS ID, '' AS NAME, '' AS TRANSCURRENCYID, '' AS TRANSDATE, '' AS TRANSCLIENTID, '' AS TRANSORGID, SUM(ZZ.COSTCALCULATED) AS COSTCALCULATED,
+      '' AS ORG, '' AS PARTNERGROUP, '' AS PARTNER, '' AS DOCUMENTNO, '' AS INVOICEDATE, '' AS PRODCATEGORY, '' AS PRODUCT, 
+      '' AS PROFIT, '' AS MARGIN, '' AS PRICE, '' AS CONTACT, '' AS SALESREP, '' AS PROJECT, '' AS ADDRESS
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST, 
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT_REF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF,
+      SUM(LINENETREF2) AS AMOUNTREF2, SUM(QTYINVOICEDREF2) AS QTYREF2, SUM(WEIGHT_REF2) AS WEIGHTREF2, SUM(COSTREF2) AS COSTREF2,         
+      C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT, 
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COST) WHEN SUM(COSTEDAMT) = 0 THEN 0 ELSE SUM(COST)*SUM(LINENETAMT)/SUM(COSTEDAMT) END AS CONVCOST,
+      C_CURRENCY_CONVERT(SUM(LINENETREF), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF, 
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COSTREF) WHEN SUM(COSTEDAMTREF) = 0 THEN 0 ELSE SUM(COSTREF)*SUM(LINENETREF)/SUM(COSTEDAMTREF) END AS CONVCOSTREF,
+      C_CURRENCY_CONVERT(SUM(LINENETREF2), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF2, 
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COSTREF2) WHEN SUM(COSTEDAMTREF2) = 0 THEN 0 ELSE SUM(COSTREF2)*SUM(LINENETREF2)/SUM(COSTEDAMTREF2) END AS CONVCOSTREF2,
+      TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID, SUM(AA.COSTCALCULATED) as COSTCALCULATED,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMT), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamt,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMTREF), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamtref,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMTREF2), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamtref2,
+      COUNT(*) AS GROUPCOUNT
+      FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('16') AS NIVEL8, to_char('18') AS NIVEL9, to_char('20') AS NIVEL10,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.LINENETAMT *- 1 ELSE c_invoiceline.LINENETAMT END AS LINENETAMT,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END AS QTYINVOICED,
+      C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF,
+      0 AS LINENETREF2, 0 AS QTYINVOICEDREF2, 0 AS WEIGHT_REF2, 
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END), C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,?,trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END))
+                END AS COST,
+                0 AS COSTREF,
+                0 AS COSTREF2,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMT, 
+                0 AS COSTEDAMTREF, 
+                0 AS COSTEDAMTREF2
+            FROM C_INVOICELINE 
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 0=0 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN ('7')
+      AND 1=1        
+      UNION ALL SELECT to_char('8') AS NIVEL1 , to_char('9') AS NIVEL2 , to_char('10') AS NIVEL3 , to_char('11') AS NIVEL4 , to_char('12') AS NIVEL5 , to_char('13') AS NIVEL6 , to_char('14') AS NIVEL7 , to_char('17') AS NIVEL8 , to_char('19') AS NIVEL9 , to_char('21') AS NIVEL10,
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT, 
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.LINENETAMT *- 1 ELSE c_invoiceline.LINENETAMT END AS LINENETREF,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END AS QTYINVOICEDREF,
+      C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF,
+      0 AS LINENETREF2, 0 AS QTYINVOICEDREF2, 0 AS WEIGHT_REF2,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                0 AS COST,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END), C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,?,trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END))
+                END AS COSTREF,
+                0 AS COSTREF2,
+                0 AS COSTEDAMT,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMTREF,
+                0 AS COSTEDAMTREF2
+            FROM C_INVOICELINE 
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 3=3 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN('14')
+      AND 2=2
+      UNION ALL SELECT  to_char('28') AS NIVEL1 ,to_char('29') AS NIVEL2 ,to_char('30') AS NIVEL3 ,to_char('31') AS NIVEL4 ,to_char('32') AS NIVEL5 ,to_char('33') AS NIVEL6 ,to_char('34') AS NIVEL7 ,to_char('35') AS NIVEL8 ,to_char('36') AS NIVEL9 ,to_char('37') AS NIVEL10,
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.LINENETAMT *- 1 ELSE c_invoiceline.LINENETAMT END AS LINENETREF2,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END AS QTYINVOICEDREF2,
+      C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF2,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                0 AS COST,
+                0 AS COSTREF,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END), C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,?,trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END))
+                END AS COSTREF2,                
+                0 AS COSTEDAMT,
+                0 AS COSTEDAMTREF,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMTREF2                
+            FROM C_INVOICELINE 
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 5=5 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID  IN('38')
+      AND 4=4
+      ORDER BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10) AA
+      GROUP BY  NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 1
+     ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>       
+    <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
+    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
+    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
+    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3, to_char(" text="'4'"/>
+    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4, to_char(" text="'5'"/>
+    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5, to_char(" text="'6'"/>
+    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6, to_char(" text="'7'"/>
+    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7, to_char(" text="'16'"/>
+    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8, to_char(" text="'18'"/>
+    <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9, to_char(" text="'20'"/>
+    <Parameter name="cCurrencyConv"/> 
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'7'"/>
+    <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
+    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
+    <Parameter name="mProductId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
+    <Parameter name="partnerSalesrepId" optional="true" after="AND 1=1"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
+    <Parameter name="cProjectId" optional="true" after="AND 1=1"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
+    <Parameter name="producttype" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
+    <Parameter name="cDocTypeId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND C_DOCTYPE.C_DOCTYPE_ID IN]]></Parameter>
+    <Parameter name="nivel1" type="replace" optional="true" after="UNION ALL SELECT to_char(" text="'8'"/>
+    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1 , to_char(" text="'9'"/>
+    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2 , to_char(" text="'10'"/>
+    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3 , to_char(" text="'11'"/>
+    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4 , to_char(" text="'12'"/>
+    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5 , to_char(" text="'13'"/>
+    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6 , to_char(" text="'14'"/>
+    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7 , to_char(" text="'17'"/>
+    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8 , to_char(" text="'19'"/>
+    <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9 , to_char(" text="'21'"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 3=3 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN(" text="'14'"/>
+    <Parameter name="dateFromRef" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateToRef" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 2=2"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
+    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
+    <Parameter name="mProductId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
+    <Parameter name="partnerSalesrepId" optional="true" after="AND 2=2"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
+    <Parameter name="cProjectId" optional="true" after="AND 2=2"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
+    <Parameter name="producttype" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
+    <Parameter name="cDocTypeId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND C_DOCTYPE.C_DOCTYPE_ID IN]]></Parameter>
+    <Parameter name="nivel1" type="replace" optional="true" after="UNION ALL SELECT  to_char(" text="'28'"/>
+    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1 ,to_char(" text="'29'"/>
+    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2 ,to_char(" text="'30'"/>
+    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3 ,to_char(" text="'31'"/>
+    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4 ,to_char(" text="'32'"/>
+    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5 ,to_char(" text="'33'"/>
+    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6 ,to_char(" text="'34'"/>
+    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7 ,to_char(" text="'35'"/>
+    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8 ,to_char(" text="'36'"/>
+    <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9 ,to_char(" text="'37'"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 5=5 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID  IN(" text="'38'"/>
+    <Parameter name="dateFromRef2" optional="true" after="AND 4=4"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateToRef2" optional="true" after="AND 4=4"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 4=4"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
+    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 4=4"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 4=4"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
+    <Parameter name="mProductId" optional="true" type="argument" after="AND 4=4"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 4=4"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
+    <Parameter name="partnerSalesrepId" optional="true" after="AND 4=4"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
+    <Parameter name="cProjectId" optional="true" after="AND 4=4"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
+    <Parameter name="producttype" optional="true" after="AND 4=4"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
+    <Parameter name="cDocTypeId" optional="true" type="argument" after="AND 4=4"><![CDATA[AND C_DOCTYPE.C_DOCTYPE_ID IN]]></Parameter>
+    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10" text=", 1"/>
+  </SqlMethod>
+  
+  <SqlMethod name="select3" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+    <![CDATA[
+      SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST,
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF,
+      SUM(AMOUNTREF2) AS AMOUNTREF2, SUM(QTYREF2) AS QTYREF2, SUM(WEIGHTREF2) AS WEIGHTREF2, SUM(COSTREF2) AS COSTREF2,
+      SUM(AMOUNTREF3) AS AMOUNTREF3, SUM(QTYREF3) AS QTYREF3, SUM(WEIGHTREF3) AS WEIGHTREF3, SUM(COSTREF3) AS COSTREF3,
+      SUM(CONVAMOUNT) AS CONVAMOUNT,                          
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOST) WHEN SUM(COSTEDAMT) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNT END) = 0 THEN 0 ELSE SUM(CONVCOST)*SUM(CONVAMOUNT)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNT END) END AS CONVCOST,
+      SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOSTREF) WHEN SUM(COSTEDAMTREF) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF END) = 0 THEN 0 ELSE SUM(CONVCOSTREF)*SUM(CONVAMOUNTREF)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF END) END AS CONVCOSTREF,
+      SUM(CONVAMOUNTREF2) AS CONVAMOUNTREF2,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOSTREF2) WHEN SUM(COSTEDAMTREF2) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF2 END) = 0 THEN 0 ELSE SUM(CONVCOSTREF2)*SUM(CONVAMOUNTREF2)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF2 END) END AS CONVCOSTREF2,
+      SUM(CONVAMOUNTREF3) AS CONVAMOUNTREF3,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOSTREF3) WHEN SUM(COSTEDAMTREF3) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF3 END) = 0 THEN 0 ELSE SUM(CONVCOSTREF3)*SUM(CONVAMOUNTREF3)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF3 END) END AS CONVCOSTREF3,
+      C_CURRENCY_SYMBOL(?, 0, 'Y') AS CONVSYM,        
+      C_CURRENCY_ISOSYM(?) AS CONVISOSYM,
+      '' AS ID, '' AS NAME, '' AS TRANSCURRENCYID, '' AS TRANSDATE, '' AS TRANSCLIENTID, '' AS TRANSORGID, SUM(ZZ.COSTCALCULATED) AS COSTCALCULATED,
+      '' AS ORG, '' AS PARTNERGROUP, '' AS PARTNER, '' AS DOCUMENTNO, '' AS INVOICEDATE, '' AS PRODCATEGORY, '' AS PRODUCT, 
+      '' AS PROFIT, '' AS MARGIN, '' AS PRICE, '' AS CONTACT, '' AS SALESREP, '' AS PROJECT, '' AS ADDRESS
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST, 
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT_REF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF,
+      SUM(LINENETREF2) AS AMOUNTREF2, SUM(QTYINVOICEDREF2) AS QTYREF2, SUM(WEIGHT_REF2) AS WEIGHTREF2, SUM(COSTREF2) AS COSTREF2,
+      SUM(LINENETREF3) AS AMOUNTREF3, SUM(QTYINVOICEDREF3) AS QTYREF3, SUM(WEIGHT_REF3) AS WEIGHTREF3, SUM(COSTREF3) AS COSTREF3,         
+      C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT, 
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COST) WHEN SUM(COSTEDAMT) = 0 THEN 0 ELSE SUM(COST)*SUM(LINENETAMT)/SUM(COSTEDAMT) END AS CONVCOST,
+      C_CURRENCY_CONVERT(SUM(LINENETREF), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF, 
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COSTREF) WHEN SUM(COSTEDAMTREF) = 0 THEN 0 ELSE SUM(COSTREF)*SUM(LINENETREF)/SUM(COSTEDAMTREF) END AS CONVCOSTREF,
+      C_CURRENCY_CONVERT(SUM(LINENETREF2), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF2, 
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COSTREF2) WHEN SUM(COSTEDAMTREF2) = 0 THEN 0 ELSE SUM(COSTREF2)*SUM(LINENETREF2)/SUM(COSTEDAMTREF2) END AS CONVCOSTREF2,
+      C_CURRENCY_CONVERT(SUM(LINENETREF3), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF3, 
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COSTREF3) WHEN SUM(COSTEDAMTREF3) = 0 THEN 0 ELSE SUM(COSTREF3)*SUM(LINENETREF3)/SUM(COSTEDAMTREF3) END AS CONVCOSTREF3,
+      TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID, SUM(AA.COSTCALCULATED) as COSTCALCULATED,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMT), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamt,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMTREF), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamtref,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMTREF2), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamtref2,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMTREF3), TRCURRENCYID, ?, TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamtref3,
+      COUNT(*) AS GROUPCOUNT
+      FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('16') AS NIVEL8, to_char('18') AS NIVEL9, to_char('20') AS NIVEL10,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.LINENETAMT *- 1 ELSE c_invoiceline.LINENETAMT END AS LINENETAMT,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END AS QTYINVOICED,
+      C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF,
+      0 AS LINENETREF2, 0 AS QTYINVOICEDREF2, 0 AS WEIGHT_REF2, 
+      0 AS LINENETREF3, 0 AS QTYINVOICEDREF3, 0 AS WEIGHT_REF3, 
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,  
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,      
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,      
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END), C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,?,trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END))
+                END AS COST,
+                0 AS COSTREF,
+                0 AS COSTREF2,
+                0 AS COSTREF3,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMT, 
+                0 AS COSTEDAMTREF, 
+                0 AS COSTEDAMTREF2,
+                0 AS COSTEDAMTREF3
+            FROM C_INVOICELINE 
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 0=0 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN ('7')
+      AND 1=1        
+      UNION ALL SELECT to_char('8') AS NIVEL1 , to_char('9') AS NIVEL2 , to_char('10') AS NIVEL3 , to_char('11') AS NIVEL4 , to_char('12') AS NIVEL5 , to_char('13') AS NIVEL6 , to_char('14') AS NIVEL7 , to_char('17') AS NIVEL8 , to_char('19') AS NIVEL9 , to_char('21') AS NIVEL10,
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT, 
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.LINENETAMT *- 1 ELSE c_invoiceline.LINENETAMT END AS LINENETREF,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END AS QTYINVOICEDREF,
+      C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF,
+      0 AS LINENETREF2, 0 AS QTYINVOICEDREF2, 0 AS WEIGHT_REF2,
+      0 AS LINENETREF3, 0 AS QTYINVOICEDREF3, 0 AS WEIGHT_REF3,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                0 AS COST,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END), C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,?,trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END))
+                END AS COSTREF,
+                0 AS COSTREF2,
+                0 AS COSTREF3,
+                0 AS COSTEDAMT,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMTREF,
+                0 AS COSTEDAMTREF2,
+                0 AS COSTEDAMTREF3
+            FROM C_INVOICELINE 
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 3=3 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN('14')
+      AND 2=2
+      UNION ALL SELECT  to_char('28') AS NIVEL1 ,to_char('29') AS NIVEL2 ,to_char('30') AS NIVEL3 ,to_char('31') AS NIVEL4 ,to_char('32') AS NIVEL5 ,to_char('33') AS NIVEL6 ,to_char('34') AS NIVEL7 ,to_char('35') AS NIVEL8 ,to_char('36') AS NIVEL9 ,to_char('37') AS NIVEL10,
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.LINENETAMT *- 1 ELSE c_invoiceline.LINENETAMT END AS LINENETREF2,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END AS QTYINVOICEDREF2,
+      C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF2,
+      0 AS LINENETREF3, 0 AS QTYINVOICEDREF3, 0 AS WEIGHT_REF3,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                0 AS COST,
+                0 AS COSTREF,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END), C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,?,trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END))
+                END AS COSTREF2, 
+                0 AS COSTREF3,               
+                0 AS COSTEDAMT,
+                0 AS COSTEDAMTREF,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMTREF2,
+                0 AS COSTEDAMTREF3                
+            FROM C_INVOICELINE 
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 5=5 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID  IN('38')
+      AND 4=4
+      UNION ALL  SELECT  to_char('39') AS NIVEL1  ,to_char('40') AS NIVEL2  ,to_char('41') AS NIVEL3  ,to_char('42') AS NIVEL4  ,to_char('43') AS NIVEL5  ,to_char('44') AS NIVEL6  ,to_char('45') AS NIVEL7  ,to_char('46') AS NIVEL8  ,to_char('47') AS NIVEL9  ,to_char('48') AS NIVEL10,
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT, 
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF,
+      0 AS LINENETREF2, 0 AS QTYINVOICEDREF2, 0 AS WEIGHT_REF2,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.LINENETAMT *- 1 ELSE c_invoiceline.LINENETAMT END AS LINENETREF3,
+      CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END AS QTYINVOICEDREF3,
+      C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF3,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                0 AS COST,
+                0 AS COSTREF,
+                0 AS COSTREF2,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END), C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,?,trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*(CASE WHEN c_doctype.docbasetype = 'ARC' THEN c_invoiceline.qtyinvoiced *- 1 ELSE c_invoiceline.qtyinvoiced END))
+                END AS COSTREF3,                
+                0 AS COSTEDAMT,
+                0 AS COSTEDAMTREF,
+                0 AS COSTEDAMTREF2,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMTREF3                
+            FROM C_INVOICELINE 
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 7=7 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND  C_INVOICE.AD_CLIENT_ID  IN('49')
+      AND 6=6
+      ORDER BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10) AA
+      GROUP BY  NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 1
+     ]]></Sql>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/> 
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="cCurrencyConv"/>      
+    <Parameter name="nivel1" type="replace" optional="true" after="FROM (SELECT to_char(" text="'1'"/>
+    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1, to_char(" text="'2'"/>
+    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2, to_char(" text="'3'"/>
+    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3, to_char(" text="'4'"/>
+    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4, to_char(" text="'5'"/>
+    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5, to_char(" text="'6'"/>
+    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6, to_char(" text="'7'"/>
+    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7, to_char(" text="'16'"/>
+    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8, to_char(" text="'18'"/>
+    <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9, to_char(" text="'20'"/>
+    <Parameter name="cCurrencyConv"/> 
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN (" text="'7'"/>
+    <Parameter name="dateFrom" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateTo" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 1=1"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
+    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
+    <Parameter name="mProductId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 1=1"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
+    <Parameter name="partnerSalesrepId" optional="true" after="AND 1=1"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
+    <Parameter name="cProjectId" optional="true" after="AND 1=1"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
+    <Parameter name="producttype" optional="true" after="AND 1=1"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
+    <Parameter name="cDocTypeId" optional="true" type="argument" after="AND 1=1"><![CDATA[AND C_DOCTYPE.C_DOCTYPE_ID IN]]></Parameter>
+    <Parameter name="nivel1" type="replace" optional="true" after="UNION ALL SELECT to_char(" text="'8'"/>
+    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1 , to_char(" text="'9'"/>
+    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2 , to_char(" text="'10'"/>
+    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3 , to_char(" text="'11'"/>
+    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4 , to_char(" text="'12'"/>
+    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5 , to_char(" text="'13'"/>
+    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6 , to_char(" text="'14'"/>
+    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7 , to_char(" text="'17'"/>
+    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8 , to_char(" text="'19'"/>
+    <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9 , to_char(" text="'21'"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 3=3 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID IN(" text="'14'"/>
+    <Parameter name="dateFromRef" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateToRef" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 2=2"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
+    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
+    <Parameter name="mProductId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 2=2"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
+    <Parameter name="partnerSalesrepId" optional="true" after="AND 2=2"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
+    <Parameter name="cProjectId" optional="true" after="AND 2=2"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
+    <Parameter name="producttype" optional="true" after="AND 2=2"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
+    <Parameter name="cDocTypeId" optional="true" type="argument" after="AND 2=2"><![CDATA[AND C_DOCTYPE.C_DOCTYPE_ID IN]]></Parameter>
+    <Parameter name="nivel1" type="replace" optional="true" after="UNION ALL SELECT  to_char(" text="'28'"/>
+    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1 ,to_char(" text="'29'"/>
+    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2 ,to_char(" text="'30'"/>
+    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3 ,to_char(" text="'31'"/>
+    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4 ,to_char(" text="'32'"/>
+    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5 ,to_char(" text="'33'"/>
+    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6 ,to_char(" text="'34'"/>
+    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7 ,to_char(" text="'35'"/>
+    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8 ,to_char(" text="'36'"/>
+    <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9 ,to_char(" text="'37'"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 5=5 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adUserClient" type="replace" optional="true" after="AND C_INVOICE.AD_CLIENT_ID  IN(" text="'38'"/>
+    <Parameter name="dateFromRef2" optional="true" after="AND 4=4"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateToRef2" optional="true" after="AND 4=4"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 4=4"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
+    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 4=4"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 4=4"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
+    <Parameter name="mProductId" optional="true" type="argument" after="AND 4=4"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 4=4"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
+    <Parameter name="partnerSalesrepId" optional="true" after="AND 4=4"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
+    <Parameter name="cProjectId" optional="true" after="AND 4=4"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
+    <Parameter name="producttype" optional="true" after="AND 4=4"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
+    <Parameter name="cDocTypeId" optional="true" type="argument" after="AND 4=4"><![CDATA[AND C_DOCTYPE.C_DOCTYPE_ID IN]]></Parameter>
+    <Parameter name="nivel1" type="replace" optional="true" after="UNION ALL  SELECT  to_char(" text="'39'"/>
+    <Parameter name="nivel2" type="replace" optional="true" after="AS NIVEL1  ,to_char(" text="'40'"/>
+    <Parameter name="nivel3" type="replace" optional="true" after="AS NIVEL2  ,to_char(" text="'41'"/>
+    <Parameter name="nivel4" type="replace" optional="true" after="AS NIVEL3  ,to_char(" text="'42'"/>
+    <Parameter name="nivel5" type="replace" optional="true" after="AS NIVEL4  ,to_char(" text="'43'"/>
+    <Parameter name="nivel6" type="replace" optional="true" after="AS NIVEL5  ,to_char(" text="'44'"/>
+    <Parameter name="nivel7" type="replace" optional="true" after="AS NIVEL6  ,to_char(" text="'45'"/>
+    <Parameter name="nivel8" type="replace" optional="true" after="AS NIVEL7  ,to_char(" text="'46'"/>
+    <Parameter name="nivel9" type="replace" optional="true" after="AS NIVEL8  ,to_char(" text="'47'"/>
+    <Parameter name="nivel10" type="replace" optional="true" after="AS NIVEL9  ,to_char(" text="'48'"/>
+    <Parameter name="cCurrencyConv"/>
+    <Parameter name="adOrgId" optional="true" type="replace" after="AND 7=7 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
+    <Parameter name="adUserClient" type="replace" optional="true" after="AND  C_INVOICE.AD_CLIENT_ID  IN(" text="'49'"/>
+    <Parameter name="dateFromRef3" optional="true" after="AND 6=6"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateToRef3" optional="true" after="AND 6=6"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="cBpartnerGroupId" optional="true" after="AND 6=6"><![CDATA[AND C_BP_GROUP.C_BP_GROUP_ID = ?]]></Parameter>
+    <Parameter name="cBpartnerId" optional="true" type="argument" after="AND 6=6"><![CDATA[AND C_BPARTNER.C_BPARTNER_ID IN]]></Parameter>
+    <Parameter name="mProductCategoryId" optional="true" after="AND 6=6"><![CDATA[AND M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID = ?]]></Parameter>
+    <Parameter name="mProductId" optional="true" type="argument" after="AND 6=6"><![CDATA[AND M_PRODUCT.M_PRODUCT_ID IN]]></Parameter>
+    <Parameter name="salesrepId" optional="true" after="AND 6=6"><![CDATA[AND C_INVOICE.SALESREP_ID = ?]]></Parameter>
+    <Parameter name="partnerSalesrepId" optional="true" after="AND 6=6"><![CDATA[AND CB.C_BPARTNER_ID = ?]]></Parameter>
+    <Parameter name="cProjectId" optional="true" after="AND 6=6"><![CDATA[AND C_PROJECT.C_PROJECT_ID = ?]]></Parameter>
+    <Parameter name="producttype" optional="true" after="AND 6=6"><![CDATA[AND M_PRODUCT.PRODUCTTYPE = ?]]></Parameter>
+    <Parameter name="cDocTypeId" optional="true" type="argument" after="AND 6=6"><![CDATA[AND C_DOCTYPE.C_DOCTYPE_ID IN]]></Parameter>
+    <Parameter name="orderby" type="replace" optional="true" after="GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10" text=", 1"/>
+  </SqlMethod>
 
   <SqlMethod name="selectCount" type="preparedStatement" return="string" default="0">
     <SqlMethodComment></SqlMethodComment>
@@ -217,7 +835,7 @@
       AND C_INVOICE.PROCESSED = 'Y'
       AND 0=0 AND C_INVOICE.AD_ORG_ID IN ('1')
       AND C_INVOICE.AD_CLIENT_ID IN ('8')
-      AND 1=1 AND ((2=2)OR (3=3))
+      AND 1=1 AND ((2=2)OR (3=3)OR (4=4)OR (5=5))
     ]]></Sql>
     <Parameter name="levels" type="replace" optional="true" after="SELECT COUNT( DISTINCT " text="1"/>
     <Parameter name="adOrgId" optional="true" type="replace" after="AND 0=0 AND C_INVOICE.AD_ORG_ID IN (" text="'1'"/>
@@ -235,6 +853,10 @@
     <Parameter name="dateTo" optional="true" after="2=2"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
     <Parameter name="dateFromRef" optional="true" after="3=3"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
     <Parameter name="dateToRef" optional="true" after="3=3"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="dateFromRef2" optional="true" after="4=4"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateToRef2" optional="true" after="4=4"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
+    <Parameter name="dateFromRef3" optional="true" after="5=5"><![CDATA[AND C_INVOICE.DATEINVOICED >= to_date(?)]]></Parameter>
+    <Parameter name="dateToRef3" optional="true" after="5=5"><![CDATA[AND C_INVOICE.DATEINVOICED < to_date(?)]]></Parameter>
   </SqlMethod>
 
   <SqlMethod name="selectNoComparative" type="preparedStatement" return="multiple">
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR.jrxml	Wed Nov 19 19:11:32 2014 +0100
@@ -0,0 +1,7892 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="ReportInvoiceCustomerDimensionalAnalysesMultiComparativeExtendedJR" pageWidth="1650" pageHeight="595" orientation="Landscape" columnWidth="1622" leftMargin="14" rightMargin="14" topMargin="56" bottomMargin="28">
+	<property name="ireport.scriptlethandling" value="0"/>
+	<property name="ireport.encoding" value="UTF-8"/>
+	<property name="ireport.zoom" value="0.55"/>
+	<property name="ireport.x" value="154"/>
+	<property name="ireport.y" value="0"/>
+	<import value="net.sf.jasperreports.engine.*"/>
+	<import value="java.util.*"/>
+	<import value="net.sf.jasperreports.engine.data.*"/>
+	<style name="default" isDefault="true" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="11"/>
+	<style name="Report_Title" fontName="Bitstream Vera Sans" fontSize="18"/>
+	<style name="Report_Subtitle" forecolor="#555555" fontName="Bitstream Vera Sans" fontSize="14"/>
+	<style name="Report_Data_Label" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="11" isBold="true"/>
+	<style name="Report_Data_Field" fontName="Bitstream Vera Sans" fontSize="11" isBold="false"/>
+	<style name="Total_Field" mode="Opaque" forecolor="#000000" backcolor="#CCCCCC" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="true"/>
+	<style name="Detail_Header" mode="Opaque" forecolor="#FFFFFF" backcolor="#5D5D5D" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="9" isBold="true"/>
+	<style name="Detail_Line" fontName="Bitstream Vera Sans" fontSize="8" isBold="true">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==1)]]></conditionExpression>
+			<style mode="Opaque" backcolor="#CCCCCC"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level1_Line" mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==1)&&($V{NIVEL1_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==1)&&($V{NIVEL1_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level2_Line" mode="Opaque" backcolor="#CCCCCC" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==2)&&($V{NIVEL1_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==2)&&($V{NIVEL1_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level3_Line" mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==3)&&($V{NIVEL2_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==3)&&($V{NIVEL2_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level4_Line" mode="Opaque" backcolor="#CCCCCC" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==4)&&($V{NIVEL3_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==4)&&($V{NIVEL3_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level5_Line" mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==5)&&($V{NIVEL4_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==5)&&($V{NIVEL4_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level6_Line" mode="Opaque" backcolor="#CCCCCC" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==6)&&($V{NIVEL5_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==6)&&($V{NIVEL5_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level7_Line" mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==7)&&($V{NIVEL6_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==7)&&($V{NIVEL6_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level8_Line" mode="Opaque" backcolor="#CCCCCC" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==8)&&($V{NIVEL7_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==8)&&($V{NIVEL7_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level9_Line" mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==9)&&($V{NIVEL8_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==9)&&($V{NIVEL8_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Level10_Line" mode="Opaque" backcolor="#CCCCCC" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false">
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==10)&&($V{NIVEL9_COUNT}.intValue()%2==0))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#FFFFFF" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean(($P{DIMENSIONS}.intValue()==10)&&($V{NIVEL9_COUNT}.intValue()%2==1))]]></conditionExpression>
+			<style mode="Opaque" backcolor="#E5E5E5" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="8" isBold="false"/>
+		</conditionalStyle>
+		<conditionalStyle>
+			<conditionExpression><![CDATA[new Boolean($F{COSTCALCULATED}.intValue()>=1)]]></conditionExpression>
+			<style forecolor="#FF0000"/>
+		</conditionalStyle>
+	</style>
+	<style name="Report_Footer" vAlign="Middle" fontName="Bitstream Vera Sans" fontSize="11"/>
+	<style name="Detail_Border" forecolor="#8A8A8A"/>
+	<parameter name="USER_ORG" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["0,1000000"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="USER_CLIENT" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["0,1000000"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="DATEFROM" class="java.util.Date" isForPrompting="false">
+		<defaultValueExpression><![CDATA[(new SimpleDateFormat("dd-MM-yyyy")).parse("01-01-2006")]]></defaultValueExpression>
+	</parameter>
+	<parameter name="DATETO" class="java.util.Date" isForPrompting="false">
+		<defaultValueExpression><![CDATA[(new SimpleDateFormat("dd-MM-yyyy")).parse("01-02-2006")]]></defaultValueExpression>
+	</parameter>
+	<parameter name="cBpGroupId" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
+	</parameter>
+	<parameter name="cBpGroupId_Aux" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[$P{cBpGroupId}.equals("") ? " " : (" AND C_BP_Group.C_BP_Group_ID = " + $P{cBpGroupId})]]></defaultValueExpression>
+	</parameter>
+	<parameter name="cBpartnerId" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
+	</parameter>
+	<parameter name="cBpartnerId_Aux" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[($P{cBpartnerId}.equals(""))?"  ":" AND C_BPartner.C_BPartner_ID IN " + $P{cBpartnerId}]]></defaultValueExpression>
+	</parameter>
+	<parameter name="mProductCategoryId" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
+	</parameter>
+	<parameter name="mProductCategoryId_Aux" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[($P{mProductCategoryId}.equals(""))?"  ":" AND M_Product_Category.M_Product_Category_Id = " + $P{mProductCategoryId}]]></defaultValueExpression>
+	</parameter>
+	<parameter name="mProductId" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
+	</parameter>
+	<parameter name="mProductId_Aux" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[($P{mProductId}.equals(""))?" ":" AND M_Product.M_Product_ID IN " + $P{mProductId}]]></defaultValueExpression>
+	</parameter>
+	<parameter name="orderBy" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA[" ORDER BY 1 "]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_TITLE" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["Purchase Orders Report"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="PRODUCT_LEVEL" class="java.lang.Integer" isForPrompting="false">
+		<defaultValueExpression><![CDATA[new Integer(3)]]></defaultValueExpression>
+	</parameter>
+	<parameter name="THEME" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["Default"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="BASE_WEB" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["/var/lib/tomcat-5.5/webapps/alerts/web"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="REPORT_SUBTITLE" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="LEVEL1_LABEL" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["Partner Group"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="LEVEL2_LABEL" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["Product Category"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="LEVEL3_LABEL" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["Product"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="LEVEL4_LABEL" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["Partner"]]></defaultValueExpression>
+	</parameter>
+	<parameter name="LEVEL5_LABEL" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="LEVEL6_LABEL" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="LEVEL7_LABEL" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="LEVEL8_LABEL" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="LEVEL9_LABEL" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="LEVEL10_LABEL" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="DIMENSIONS" class="java.lang.Integer" isForPrompting="false">
+		<defaultValueExpression><![CDATA[new Integer(5)]]></defaultValueExpression>
+	</parameter>
+	<parameter name="LEVEL_LABEL" class="java.lang.String" isForPrompting="false">
+		<defaultValueExpression><![CDATA["1.- "+$P{LEVEL1_LABEL}
++($P{LEVEL2_LABEL}==""?"":", 2.- "+$P{LEVEL2_LABEL})
++($P{LEVEL3_LABEL}==""?"":", 3.- "+$P{LEVEL3_LABEL})
++($P{LEVEL4_LABEL}==""?"":", 4.- "+$P{LEVEL4_LABEL})
++($P{LEVEL5_LABEL}==""?"":", 5.- "+$P{LEVEL5_LABEL})
++($P{LEVEL6_LABEL}==""?"":", 6.- "+$P{LEVEL6_LABEL})
++($P{LEVEL7_LABEL}==""?"":", 7.- "+$P{LEVEL7_LABEL})
++($P{LEVEL8_LABEL}==""?"":", 8.- "+$P{LEVEL8_LABEL})
++($P{LEVEL9_LABEL}==""?"":", 9.- "+$P{LEVEL9_LABEL})
++($P{LEVEL10_LABEL}==""?"":", 10.- "+$P{LEVEL10_LABEL})]]></defaultValueExpression>
+	</parameter>
+	<parameter name="LOCALE" class="java.util.Locale" isForPrompting="false">
+		<defaultValueExpression><![CDATA[new Locale("en","US")]]></defaultValueExpression>
+	</parameter>
+	<parameter name="NUMBERFORMAT" class="java.text.DecimalFormat" isForPrompting="false"/>
+	<queryString>
+		<![CDATA[SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10,
+      SUM(AMOUNT) AS AMOUNT, SUM(QTY) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST,
+      SUM(AMOUNTREF) AS AMOUNTREF, SUM(QTYREF) AS QTYREF, SUM(WEIGHTREF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF,
+      SUM(AMOUNTREF2) AS AMOUNTREF2, SUM(QTYREF2) AS QTYREF2, SUM(WEIGHTREF2) AS WEIGHTREF2, SUM(COSTREF2) AS COSTREF2,
+      SUM(AMOUNTREF3) AS AMOUNTREF3, SUM(QTYREF3) AS QTYREF3, SUM(WEIGHTREF3) AS WEIGHTREF3, SUM(COSTREF3) AS COSTREF3,
+      SUM(CONVAMOUNT) AS CONVAMOUNT,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOST) WHEN SUM(COSTEDAMT) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNT END) = 0 THEN 0 ELSE SUM(CONVCOST)*SUM(CONVAMOUNT)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNT END) END AS CONVCOST,
+      SUM(CONVAMOUNTREF) AS CONVAMOUNTREF,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOSTREF) WHEN SUM(COSTEDAMTREF) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF END) = 0 THEN 0 ELSE SUM(CONVCOSTREF)*SUM(CONVAMOUNTREF)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF END) END AS CONVCOSTREF,
+      SUM(CONVAMOUNTREF2) AS CONVAMOUNTREF2,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOSTREF2) WHEN SUM(COSTEDAMTREF2) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF2 END) = 0 THEN 0 ELSE SUM(CONVCOSTREF2)*SUM(CONVAMOUNTREF2)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF2 END) END AS CONVCOSTREF2,
+      SUM(CONVAMOUNTREF3) AS CONVAMOUNTREF3,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(CONVCOSTREF3) WHEN SUM(COSTEDAMTREF3) = 0 THEN 0 WHEN SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF3 END) = 0 THEN 0 ELSE SUM(CONVCOSTREF3)*SUM(CONVAMOUNTREF3)/SUM(CASE WHEN GROUPCOUNT = COSTCALCULATED THEN 0 ELSE CONVAMOUNTREF3 END) END AS CONVCOSTREF3,
+      C_CURRENCY_SYMBOL('102', 0, 'Y') AS CONVSYM,
+      C_CURRENCY_ISOSYM('102') AS CONVISOSYM,
+      '' AS ID, '' AS NAME, '' AS TRANSCURRENCYID, '' AS TRANSDATE, '' AS TRANSCLIENTID, '' AS TRANSORGID, SUM(ZZ.COSTCALCULATED) AS COSTCALCULATED,
+      '' AS ORG, '' AS PARTNERGROUP, '' AS PARTNER, '' AS DOCUMENTNO, '' AS INVOICEDATE, '' AS PRODCATEGORY, '' AS PRODUCT,
+      '' AS PROFIT, '' AS MARGIN, '' AS PRICE, '' AS CONTACT, '' AS SALESREP, '' AS PROJECT, '' AS ADDRESS
+      FROM (SELECT NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10,
+      SUM(LINENETAMT) AS AMOUNT, SUM(QTYINVOICED) AS QTY, SUM(WEIGHT) AS WEIGHT, SUM(COST) AS COST,
+      SUM(LINENETREF) AS AMOUNTREF, SUM(QTYINVOICEDREF) AS QTYREF, SUM(WEIGHT_REF) AS WEIGHTREF, SUM(COSTREF) AS COSTREF,
+      SUM(LINENETREF2) AS AMOUNTREF2, SUM(QTYINVOICEDREF2) AS QTYREF2, SUM(WEIGHT_REF2) AS WEIGHTREF2, SUM(COSTREF2) AS COSTREF2,
+      SUM(LINENETREF3) AS AMOUNTREF3, SUM(QTYINVOICEDREF3) AS QTYREF3, SUM(WEIGHT_REF3) AS WEIGHTREF3, SUM(COSTREF3) AS COSTREF3,
+      C_CURRENCY_CONVERT(SUM(LINENETAMT), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNT,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COST) WHEN SUM(COSTEDAMT) = 0 THEN 0 ELSE SUM(COST)*SUM(LINENETAMT)/SUM(COSTEDAMT) END AS CONVCOST,
+      C_CURRENCY_CONVERT(SUM(LINENETREF), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COSTREF) WHEN SUM(COSTEDAMTREF) = 0 THEN 0 ELSE SUM(COSTREF)*SUM(LINENETREF)/SUM(COSTEDAMTREF) END AS CONVCOSTREF,
+      C_CURRENCY_CONVERT(SUM(LINENETREF2), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF2,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COSTREF2) WHEN SUM(COSTEDAMTREF2) = 0 THEN 0 ELSE SUM(COSTREF2)*SUM(LINENETREF2)/SUM(COSTEDAMTREF2) END AS CONVCOSTREF2,
+      C_CURRENCY_CONVERT(SUM(LINENETREF3), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS CONVAMOUNTREF3,
+      CASE WHEN SUM(COSTCALCULATED) = 0 THEN SUM(COSTREF3) WHEN SUM(COSTEDAMTREF3) = 0 THEN 0 ELSE SUM(COSTREF3)*SUM(LINENETREF3)/SUM(COSTEDAMTREF3) END AS CONVCOSTREF3,
+      TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID, SUM(AA.COSTCALCULATED) as COSTCALCULATED,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMT), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamt,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMTREF), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamtref,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMTREF2), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamtref2,
+      C_CURRENCY_CONVERT(SUM(COSTEDAMTREF3), TRCURRENCYID, '102', TO_DATE(TRDATE), NULL, TRCLIENTID, TRORGID) AS costedamtref3,
+      COUNT(*) AS GROUPCOUNT
+      FROM (SELECT to_char('1') AS NIVEL1, to_char('2') AS NIVEL2, to_char('3') AS NIVEL3, to_char('4') AS NIVEL4, to_char('5') AS NIVEL5, to_char('6') AS NIVEL6, to_char('7') AS NIVEL7, to_char('16') AS NIVEL8, to_char('18') AS NIVEL9, to_char('20') AS NIVEL10,
+      C_INVOICELINE.LINENETAMT, C_INVOICELINE.QTYINVOICED, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT,
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF,
+      0 AS LINENETREF2, 0 AS QTYINVOICEDREF2, 0 AS WEIGHT_REF2,
+      0 AS LINENETREF3, 0 AS QTYINVOICEDREF3, 0 AS WEIGHT_REF3,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*c_invoiceline.qtyinvoiced, C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,'102',trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*C_INVOICELINE.QTYINVOICED)
+                END AS COST,
+                0 AS COSTREF,
+                0 AS COSTREF2,
+                0 AS COSTREF3,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMT,
+                0 AS COSTEDAMTREF,
+                0 AS COSTEDAMTREF2,
+                0 AS COSTEDAMTREF3
+            FROM C_INVOICELINE
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 0=0 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN ('7')
+      AND 1=1
+      UNION ALL SELECT to_char('8') AS NIVEL1 , to_char('9') AS NIVEL2 , to_char('10') AS NIVEL3 , to_char('11') AS NIVEL4 , to_char('12') AS NIVEL5 , to_char('13') AS NIVEL6 , to_char('14') AS NIVEL7 , to_char('17') AS NIVEL8 , to_char('19') AS NIVEL9 , to_char('21') AS NIVEL10,
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT,
+      C_INVOICELINE.LINENETAMT AS LINENETREF, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF,
+      0 AS LINENETREF2, 0 AS QTYINVOICEDREF2, 0 AS WEIGHT_REF2,
+      0 AS LINENETREF3, 0 AS QTYINVOICEDREF3, 0 AS WEIGHT_REF3,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                0 AS COST,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*c_invoiceline.qtyinvoiced, C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,'102',trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*C_INVOICELINE.QTYINVOICED)
+                END AS COSTREF,
+                0 AS COSTREF2,
+                0 AS COSTREF3,
+                0 AS COSTEDAMT,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMTREF,
+                0 AS COSTEDAMTREF2,
+                0 AS COSTEDAMTREF3
+            FROM C_INVOICELINE
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 3=3 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID IN('14')
+      AND 2=2
+      UNION ALL SELECT  to_char('28') AS NIVEL1 ,to_char('29') AS NIVEL2 ,to_char('30') AS NIVEL3 ,to_char('31') AS NIVEL4 ,to_char('32') AS NIVEL5 ,to_char('33') AS NIVEL6 ,to_char('34') AS NIVEL7 ,to_char('35') AS NIVEL8 ,to_char('36') AS NIVEL9 ,to_char('37') AS NIVEL10,
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT,
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF,
+      C_INVOICELINE.LINENETAMT AS LINENETREF2, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF2, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF2,
+      0 AS LINENETREF3, 0 AS QTYINVOICEDREF3, 0 AS WEIGHT_REF3,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                0 AS COST,
+                0 AS COSTREF,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*c_invoiceline.qtyinvoiced, C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,'102',trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*C_INVOICELINE.QTYINVOICED)
+                END AS COSTREF2,
+                0 AS COSTREF3,
+                0 AS COSTEDAMT,
+                0 AS COSTEDAMTREF,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMTREF2,
+                0 AS COSTEDAMTREF3
+            FROM C_INVOICELINE
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 5=5 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND C_INVOICE.AD_CLIENT_ID  IN('38')
+      AND 4=4
+      UNION ALL  SELECT  to_char('39') AS NIVEL1  ,to_char('40') AS NIVEL2  ,to_char('41') AS NIVEL3  ,to_char('42') AS NIVEL4  ,to_char('43') AS NIVEL5  ,to_char('44') AS NIVEL6  ,to_char('45') AS NIVEL7  ,to_char('46') AS NIVEL8  ,to_char('47') AS NIVEL9  ,to_char('48') AS NIVEL10,
+      0 AS LINENETAMT, 0 AS QTYINVOICED, 0 AS WEIGHT,
+      0 AS LINENETREF, 0 AS QTYINVOICEDREF, 0 AS WEIGHT_REF,
+      0 AS LINENETREF2, 0 AS QTYINVOICEDREF2, 0 AS WEIGHT_REF2,
+      C_INVOICELINE.LINENETAMT AS LINENETREF3, C_INVOICELINE.QTYINVOICED AS QTYINVOICEDREF3, C_INVOICELINE.QTYINVOICED*M_PRODUCT.WEIGHT AS WEIGHT_REF3,
+      C_UOM.UOMSYMBOL,
+      C_INVOICE.C_CURRENCY_ID AS TRCURRENCYID,
+      TO_DATE(COALESCE(C_INVOICE.DATEINVOICED, NOW())) AS TRDATE,
+      C_INVOICELINE.AD_CLIENT_ID AS TRCLIENTID,
+      C_INVOICELINE.AD_ORG_ID AS TRORGID,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 1 ELSE 0
+                END AS COSTCALCULATED,
+                0 AS COST,
+                0 AS COSTREF,
+                0 AS COSTREF2,
+                CASE WHEN (M_PRODUCT.ISSTOCKED='Y' AND M_PRODUCT.PRODUCTTYPE='I') THEN (CASE WHEN trx.movementqty = 0 THEN 0 ELSE COALESCE(C_CURRENCY_CONVERT_PRECISION (ROUND(trxcost.cost/abs(trx.movementqty)*c_invoiceline.qtyinvoiced, C_GET_CURRENCY_PRECISION(trxcost.c_currency_id, 'C')), trxcost.c_currency_id,'102',trx.movementdate,NULL,trx.ad_client_id,trx.ad_org_id,'C'), 0) END)
+                     ELSE (COALESCE(M_GET_NO_TRX_PRODUCT_COST(M_PRODUCT.M_PRODUCT_ID, C_INVOICE.DATEINVOICED, 'STA', ad_org.ad_org_id, null, C_INVOICE.C_CURRENCY_ID), 0)*C_INVOICELINE.QTYINVOICED)
+                END AS COSTREF3,
+                0 AS COSTEDAMT,
+                0 AS COSTEDAMTREF,
+                0 AS COSTEDAMTREF2,
+                CASE WHEN trxcost.cost is null AND m_product.isstocked = 'Y' AND m_product.producttype = 'I' THEN 0
+                     ELSE CASE WHEN C_DOCTYPE.DOCBASETYPE='ARC' THEN C_INVOICELINE.LINENETAMT*-1 ELSE C_INVOICELINE.LINENETAMT END
+                END AS COSTEDAMTREF3
+            FROM C_INVOICELINE
+                join C_INVOICE on C_INVOICE.C_INVOICE_ID = C_INVOICELINE.C_INVOICE_ID
+                join C_BPARTNER on C_INVOICE.C_BPARTNER_ID = C_BPARTNER.C_BPARTNER_ID
+                join C_BP_GROUP on C_BPARTNER.C_BP_GROUP_ID = C_BP_GROUP.C_BP_GROUP_ID
+                join AD_ORG on C_INVOICE.AD_ORG_ID = AD_ORG.AD_ORG_ID
+                left join C_BPARTNER CB on C_BPARTNER.SALESREP_ID = CB.C_BPARTNER_ID
+                left join AD_USER on C_INVOICE.SALESREP_ID = AD_USER.AD_USER_ID
+                left join C_PROJECT on C_INVOICE.C_PROJECT_ID = C_PROJECT.C_PROJECT_ID
+                left join C_DOCTYPE on C_INVOICE.C_DOCTYPE_ID=C_DOCTYPE.C_DOCTYPE_ID
+                left join M_PRODUCT on C_INVOICELINE.M_PRODUCT_ID = M_PRODUCT.M_PRODUCT_ID
+                left join C_UOM on C_INVOICELINE.C_UOM_ID = C_UOM.C_UOM_ID
+                left join M_PRODUCT_CATEGORY on M_PRODUCT.M_PRODUCT_CATEGORY_ID = M_PRODUCT_CATEGORY.M_PRODUCT_CATEGORY_ID
+                left join M_INOUTLINE on C_INVOICELINE.M_INOUTLINE_ID = M_INOUTLINE.M_INOUTLINE_ID
+                left join M_INOUT ON M_INOUTLINE.M_INOUT_ID = M_INOUT.M_INOUT_ID
+                left join m_transaction trx ON trx.m_inoutline_id = m_inoutline.m_inoutline_id
+                left join (SELECT SUM(cost) as cost, m_transaction_id, c_currency_id
+                           FROM m_transaction_cost
+                           GROUP BY m_transaction_id, c_currency_id
+                          ) trxcost ON trx.m_transaction_id = trxcost.m_transaction_id
+      WHERE C_INVOICE.ISSOTRX = 'Y'
+      AND C_INVOICE.PROCESSED = 'Y'
+      AND 7=7 AND C_INVOICE.AD_ORG_ID IN ('1')
+      AND  C_INVOICE.AD_CLIENT_ID  IN('49')
+      AND 6=6
+      ORDER BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10) AA
+      GROUP BY  NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, TRCURRENCYID, TRDATE, TRCLIENTID, TRORGID) ZZ
+      GROUP BY NIVEL1, NIVEL2, NIVEL3, NIVEL4, NIVEL5, NIVEL6, NIVEL7, NIVEL8, NIVEL9, NIVEL10, 1]]>
+	</queryString>
+	<field name="NIVEL1" class="java.lang.String"/>
+	<field name="NIVEL2" class="java.lang.String"/>
+	<field name="NIVEL3" class="java.lang.String"/>
+	<field name="NIVEL4" class="java.lang.String"/>
+	<field name="NIVEL5" class="java.lang.String"/>
+	<field name="NIVEL6" class="java.lang.String"/>
+	<field name="NIVEL7" class="java.lang.String"/>
+	<field name="NIVEL8" class="java.lang.String"/>
+	<field name="NIVEL9" class="java.lang.String"/>
+	<field name="NIVEL10" class="java.lang.String"/>
+	<field name="AMOUNT" class="java.math.BigDecimal"/>
+	<field name="QTY" class="java.math.BigDecimal"/>
+	<field name="COST" class="java.math.BigDecimal"/>
+	<field name="AMOUNTREF" class="java.math.BigDecimal"/>
+	<field name="QTYREF" class="java.math.BigDecimal"/>
+	<field name="COSTREF" class="java.math.BigDecimal"/>
+	<field name="AMOUNTREF2" class="java.math.BigDecimal"/>
+	<field name="QTYREF2" class="java.math.BigDecimal"/>
+	<field name="COSTREF2" class="java.math.BigDecimal"/>
+	<field name="AMOUNTREF3" class="java.math.BigDecimal"/>
+	<field name="QTYREF3" class="java.math.BigDecimal"/>
+	<field name="COSTREF3" class="java.math.BigDecimal"/>
+	<field name="WEIGHT" class="java.math.BigDecimal"/>
+	<field name="WEIGHTREF" class="java.math.BigDecimal"/>
+	<field name="WEIGHTREF2" class="java.math.BigDecimal"/>
+	<field name="WEIGHTREF3" class="java.math.BigDecimal"/>
+	<field name="ID" class="java.lang.String"/>
+	<field name="NAME" class="java.lang.String"/>
+	<field name="CONVAMOUNT" class="java.math.BigDecimal"/>
+	<field name="CONVCOST" class="java.math.BigDecimal"/>
+	<field name="CONVAMOUNTREF" class="java.math.BigDecimal"/>
+	<field name="CONVCOSTREF" class="java.math.BigDecimal"/>
+	<field name="CONVAMOUNTREF2" class="java.math.BigDecimal"/>
+	<field name="CONVCOSTREF2" class="java.math.BigDecimal"/>
+	<field name="CONVAMOUNTREF3" class="java.math.BigDecimal"/>
+	<field name="CONVCOSTREF3" class="java.math.BigDecimal"/>
+	<field name="CONVSYM" class="java.lang.String"/>
+	<field name="CONVISOSYM" class="java.lang.String"/>
+	<field name="COSTCALCULATED" class="java.lang.Integer"/>
+	<variable name="QTY_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTY_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTY}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF2_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF2}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="QTYREF3_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{QTYREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_TOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNT}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_TOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_TOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF2_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_TOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNTREF3_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVAMOUNTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COST_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOST}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF2_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF2}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="COSTREF3_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{CONVCOSTREF3}]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM1}.subtract($V{COST_SUM1})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM2}.subtract($V{COST_SUM2})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM3}.subtract($V{COST_SUM3})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM4}.subtract($V{COST_SUM4})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM5}.subtract($V{COST_SUM5})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM6}.subtract($V{COST_SUM6})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM7}.subtract($V{COST_SUM7})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM8}.subtract($V{COST_SUM8})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM9}.subtract($V{COST_SUM9})]]></variableExpression>
+	</variable>
+	<variable name="PROFIT_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[$V{AMOUNT_SUM10}.subtract($V{COST_SUM10})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM1}.subtract($V{COSTREF_SUM1})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM2}.subtract($V{COSTREF_SUM2})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM3}.subtract($V{COSTREF_SUM3})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM4}.subtract($V{COSTREF_SUM4})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM5}.subtract($V{COSTREF_SUM5})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM6}.subtract($V{COSTREF_SUM6})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM7}.subtract($V{COSTREF_SUM7})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM8}.subtract($V{COSTREF_SUM8})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM9}.subtract($V{COSTREF_SUM9})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[$V{AMOUNTREF_SUM10}.subtract($V{COSTREF_SUM10})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM1}.subtract($V{COSTREF2_SUM1})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM2}.subtract($V{COSTREF2_SUM2})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM3}.subtract($V{COSTREF2_SUM3})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM4}.subtract($V{COSTREF2_SUM4})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM5}.subtract($V{COSTREF2_SUM5})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM6}.subtract($V{COSTREF2_SUM6})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM7}.subtract($V{COSTREF2_SUM7})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM8}.subtract($V{COSTREF2_SUM8})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM9}.subtract($V{COSTREF2_SUM9})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF2_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[$V{AMOUNTREF2_SUM10}.subtract($V{COSTREF2_SUM10})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM1}.subtract($V{COSTREF3_SUM1})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM2}.subtract($V{COSTREF3_SUM2})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM3}.subtract($V{COSTREF3_SUM3})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM4}.subtract($V{COSTREF3_SUM4})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM5}.subtract($V{COSTREF3_SUM5})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM6}.subtract($V{COSTREF3_SUM6})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM7}.subtract($V{COSTREF3_SUM7})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM8}.subtract($V{COSTREF3_SUM8})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM9}.subtract($V{COSTREF3_SUM9})]]></variableExpression>
+	</variable>
+	<variable name="PROFITREF3_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[$V{AMOUNTREF3_SUM10}.subtract($V{COSTREF3_SUM10})]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM1}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_1}.divide( $V{AMOUNT_SUM1}, 4, BigDecimal.ROUND_HALF_UP ).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_1}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM2}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_2}.divide( $V{AMOUNT_SUM2}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_2}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM3}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_3}.divide( $V{AMOUNT_SUM3}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_3}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM4}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_4}.divide( $V{AMOUNT_SUM4}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_4}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM5}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_5}.divide( $V{AMOUNT_SUM5}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_5}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM6}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_6}.divide( $V{AMOUNT_SUM6}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_6}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM7}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_7}.divide( $V{AMOUNT_SUM7}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_7}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM8}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_8}.divide( $V{AMOUNT_SUM8}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_8}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM9}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFIT_9}.divide( $V{AMOUNT_SUM9}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_9}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGIN_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[($V{AMOUNT_SUM10}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{PROFIT_10}.divide( $V{AMOUNT_SUM10}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFIT_10}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM1}.compareTo( new BigDecimal(0.0) )==0)?new BigDecimal(0.0): $V{PROFITREF_1}.divide( $V{AMOUNTREF_SUM1}, 4, BigDecimal.ROUND_HALF_UP ).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_1}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM2}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF_2}.divide( $V{AMOUNTREF_SUM2}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_2}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM3}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF_3}.divide( $V{AMOUNTREF_SUM3}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_3}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM4}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF_4}.divide( $V{AMOUNTREF_SUM4}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_4}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM5}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF_5}.divide( $V{AMOUNTREF_SUM5}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_5}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM6}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF_6}.divide( $V{AMOUNTREF_SUM6}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_6}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM7}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF_7}.divide( $V{AMOUNTREF_SUM7}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_7}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM8}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF_8}.divide( $V{AMOUNTREF_SUM8}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_8}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM9}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF_9}.divide( $V{AMOUNTREF_SUM9}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_9}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM10}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{PROFITREF_10}.divide( $V{AMOUNTREF_SUM10}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF_10}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM1}.compareTo( new BigDecimal(0.0) )==0)?new BigDecimal(0.0): $V{PROFITREF2_1}.divide( $V{AMOUNTREF2_SUM1}, 4, BigDecimal.ROUND_HALF_UP ).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_1}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM2}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF2_2}.divide( $V{AMOUNTREF2_SUM2}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_2}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM3}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF2_3}.divide( $V{AMOUNTREF2_SUM3}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_3}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM4}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF2_4}.divide( $V{AMOUNTREF2_SUM4}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_4}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM5}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF2_5}.divide( $V{AMOUNTREF2_SUM5}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_5}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM6}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF2_6}.divide( $V{AMOUNTREF2_SUM6}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_6}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM7}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF2_7}.divide( $V{AMOUNTREF2_SUM7}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_7}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM8}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF2_8}.divide( $V{AMOUNTREF2_SUM8}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_8}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM9}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF2_9}.divide( $V{AMOUNTREF2_SUM9}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_9}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF2_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM10}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{PROFITREF2_10}.divide( $V{AMOUNTREF2_SUM10}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF2_10}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM1}.compareTo( new BigDecimal(0.0) )==0)?new BigDecimal(0.0):$V{PROFITREF3_1}.divide( $V{AMOUNTREF3_SUM1}, 4, BigDecimal.ROUND_HALF_UP ).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_1}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM2}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF3_2}.divide( $V{AMOUNTREF3_SUM2}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_2}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM3}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF3_3}.divide( $V{AMOUNTREF3_SUM3}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_3}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM4}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF3_4}.divide( $V{AMOUNTREF3_SUM4}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_4}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM5}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF3_5}.divide( $V{AMOUNTREF3_SUM5}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_5}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM6}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF3_6}.divide( $V{AMOUNTREF3_SUM6}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_6}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM7}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF3_7}.divide( $V{AMOUNTREF3_SUM7}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_7}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM8}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF3_8}.divide( $V{AMOUNTREF3_SUM8}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_8}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM9}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0): $V{PROFITREF3_9}.divide( $V{AMOUNTREF3_SUM9}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_9}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="MARGINREF3_10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[($V{AMOUNTREF3_SUM10}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{PROFITREF3_10}.divide( $V{AMOUNTREF3_SUM10}, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0)).multiply(new BigDecimal($V{PROFITREF3_10}.signum()))]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHT_TOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHT}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF_TOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF2_TOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF2}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_SUM10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="WEIGHTREF3_TOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[$F{WEIGHTREF3}]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM1}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM1}.subtract($V{AMOUNTREF_SUM1}).divide( $V{AMOUNTREF_SUM1}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM2}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM2}.subtract($V{AMOUNTREF_SUM2}).divide( $V{AMOUNTREF_SUM2}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM3}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM3}.subtract($V{AMOUNTREF_SUM3}).divide( $V{AMOUNTREF_SUM3}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM4}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM4}.subtract($V{AMOUNTREF_SUM4}).divide( $V{AMOUNTREF_SUM4}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM5}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM5}.subtract($V{AMOUNTREF_SUM5}).divide( $V{AMOUNTREF_SUM5}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER6" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL6">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM6}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM6}.subtract($V{AMOUNTREF_SUM6}).divide( $V{AMOUNTREF_SUM6}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER7" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL7">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM7}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM7}.subtract($V{AMOUNTREF_SUM7}).divide( $V{AMOUNTREF_SUM7}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER8" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL8">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM8}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM8}.subtract($V{AMOUNTREF_SUM8}).divide( $V{AMOUNTREF_SUM8}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER9" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL9">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM9}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM9}.subtract($V{AMOUNTREF_SUM9}).divide( $V{AMOUNTREF_SUM9}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PER10" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL10">
+		<variableExpression><![CDATA[($V{AMOUNTREF_SUM10}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM10}.subtract($V{AMOUNTREF_SUM10}).divide( $V{AMOUNTREF_SUM10}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT_PERTOTAL" class="java.math.BigDecimal" calculation="Sum">
+		<variableExpression><![CDATA[($V{AMOUNTREF_TOTAL}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_TOTAL}.subtract($V{AMOUNTREF_TOTAL}).divide( $V{AMOUNTREF_TOTAL}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT2_PER1" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL1">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM1}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM1}.subtract($V{AMOUNTREF2_SUM1}).divide( $V{AMOUNTREF2_SUM1}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT2_PER2" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL2">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM2}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM2}.subtract($V{AMOUNTREF2_SUM2}).divide( $V{AMOUNTREF2_SUM2}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT2_PER3" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL3">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM3}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM3}.subtract($V{AMOUNTREF2_SUM3}).divide( $V{AMOUNTREF2_SUM3}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT2_PER4" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL4">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM4}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM4}.subtract($V{AMOUNTREF2_SUM4}).divide( $V{AMOUNTREF2_SUM4}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable>
+	<variable name="AMOUNT2_PER5" class="java.math.BigDecimal" resetType="Group" resetGroup="NIVEL5">
+		<variableExpression><![CDATA[($V{AMOUNTREF2_SUM5}.compareTo( new BigDecimal(0.0) )==0)? new BigDecimal(0.0):$V{AMOUNT_SUM5}.subtract($V{AMOUNTREF2_SUM5}).divide( $V{AMOUNTREF2_SUM5}, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(100.0))]]></variableExpression>
+	</variable><