[OpenbravoERP-commits] devel/pi: 2 new changesets

2015-06-10 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/ec9a491fe07d
changeset: 26888:ec9a491fe07d
user:  RM packaging bot staff.rm at openbravo.com
date:  Wed Jun 10 12:55:27 2015 +
summary:   CI: update AD_MODULE to version 26887

details:   https://code.openbravo.com/erp/devel/pi/rev/f7a872ac28de
changeset: 26889:f7a872ac28de
user:  RM packaging bot staff.rm at openbravo.com
date:  Wed Jun 10 13:12:40 2015 +
summary:   CI: merge back from main

diffstat:

 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml  
   |   2 +-
 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |   4 +-
 modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml   
   |   2 +-
 
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
   |   2 +-
 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
 |   2 +-
 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |   8 +-
 
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml
  |   2 +-
 
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
   |   2 +-
 modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml   
   |   2 +-
 
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
   |   6 +-
 modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml 
   |   2 +-
 
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |   4 +-
 
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml 
  |   2 +-
 
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
|   2 +-
 modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml  
   |   2 +-
 
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |   2 +-
 
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml
|   2 +-
 
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |   2 +-
 
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml
 |   2 +-
 
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |   2 +-
 
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml
 |   2 +-
 
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |  10 ++--
 
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml
 |   2 +-
 
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |   4 +-
 
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml
 |   2 +-
 
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |   2 +-
 modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml
   |   2 +-
 
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
|   2 +-
 
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml
 |   2 +-
 
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |  12 ++--
 
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE.xml
|   2 +-
 
modules/org.openbravo.userinterface.skin.250to300Comp/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |   2 +-
 
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE.xml
  |   2 +-
 
modules/org.openbravo.userinterface.smartclient/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
   |   6 +-
 
modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE.xml
|   2 +-
 
modules/org.openbravo.utility.cleanup.log/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |   2 +-
 modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE.xml 
   |   2 +-
 
modules/org.openbravo.v3.datasets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |   6 +-
 

[OpenbravoERP-commits] devel/main: 6 new changesets

2015-06-10 Thread hg
details:   https://code.openbravo.com/erp/devel/main/rev/195dff675189
changeset: 26883:195dff675189
user:  Alvaro Ferraz alvaro.ferraz at openbravo.com
date:  Thu Jun 04 17:47:14 2015 +0200
summary:   Fixes issue 30095: BP current balance not properly updated

Change condition in FIN_PaymentProcess to take into account when the paymend 
does not have order nor invoice related (when it only has a g/l item, when we 
are genereting credit or when we are refunding amount).

details:   https://code.openbravo.com/erp/devel/main/rev/420fd55d666d
changeset: 26884:420fd55d666d
user:  RM packaging bot staff.rm at openbravo.com
date:  Tue Jun 09 12:20:08 2015 +
summary:   CI: merge back from main

details:   https://code.openbravo.com/erp/devel/main/rev/780731085f0c
changeset: 26885:780731085f0c
user:  Carlos Aristu carlos.aristu at openbravo.com
date:  Tue Jun 09 18:01:36 2015 +0200
summary:   Fixes issue 30069: Critical bug with decimals only in PostgreSQL 9.3

A new build validation has been added. This way, when executing update.database 
the result returned by the to_number() procedure is evaluated.
In case it does not return the expected result, the task will fail, showing a 
message with the link to the documentation

details:   https://code.openbravo.com/erp/devel/main/rev/ee157fef9c33
changeset: 26886:ee157fef9c33
user:  Carlos Aristu carlos.aristu at openbravo.com
date:  Tue Jun 09 18:14:54 2015 +0200
summary:   Fixes issue 30060: Select Payments PickEdit window is not working 
properly

When selecting a record in a PE grid, the request done to the FIC was not 
using the correct mode. Now, when selecting a record, the request is properly 
done using the EDIT mode.

details:   https://code.openbravo.com/erp/devel/main/rev/ba6a63e37880
changeset: 26887:ba6a63e37880
user:  Carlos Aristu carlos.aristu at openbravo.com
date:  Wed Jun 10 09:05:57 2015 +0200
summary:   Fixes issue 30096: Cannot filter the bp field by ' symbol in 
selector drop down

The CustomQuerySelectorDatasource was not handling the parameters of the query 
properly. For that reason characters like ' were not replaced as expected.
Now the parameters are mapped into a list, and replaced in the query using the 
setParameter() method

details:   https://code.openbravo.com/erp/devel/main/rev/ec9a491fe07d
changeset: 26888:ec9a491fe07d
user:  RM packaging bot staff.rm at openbravo.com
date:  Wed Jun 10 12:55:27 2015 +
summary:   CI: update AD_MODULE to version 26887

diffstat:

 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml  
  |2 +-
 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |4 +-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
|2 +
 modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml   
  |2 +-
 
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |2 +-
 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
|2 +-
 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |8 +-
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/process/ob-pick-and-execute-grid.js
 |8 +-
 
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml
 |2 +-
 
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |2 +-
 modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml   
  |2 +-
 
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |6 +-
 modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml 
  |2 +-
 
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
|4 +-
 
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml 
 |2 +-
 
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
   |2 +-
 modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml  
  |2 +-
 
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |2 +-
 

[OpenbravoERP-commits] devel/pi: Fixed issue 30092: the bo.xslt template is working wrong.

2015-06-10 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/34641a1a0c78
changeset: 26890:34641a1a0c78
user:  Naroa Iriarte naroa.iriarte at openbravo.com
date:  Wed Jun 10 15:51:06 2015 +0200
summary:   Fixed issue 30092: the bo.xslt template is working wrong.

The problem was that it was not possible to get the correct url by clicking
in the links. For example, if you went to the url:

https://livebuilds.openbravo.com/erp_main_pgsql/ws/dal/ADUser?template=bo.xslt

And you click in some link, the obtained url was:

https://livebuilds.openbravo.com/erp_main_pgsql/ws/ADUser/100?template=bo.xslt

instead of:

https://livebuilds.openbravo.com/erp_main_pgsql/ws/dal/ADUser/100?template=bo.xslt

The problem was in the bo.xslt template, in the href variable. It was being set 
wrong in some cases,
it removed one extra level from the url. This is OK when the url has the id 
after the entity name, like:

https://livebuilds.openbravo.com/erp_main_pgsql/ws/dal/ADUser/100?template=bo.xslt

But in the case of not having the id after the entity name in the url, it is 
wrong to substract a level
from the url.

In this case, that does not have the id after the entity name, didn't work well:

https://livebuilds.openbravo.com/erp_main_pgsql/ws/dal/ADUser?template=bo.xslt

The substraction of the level retuned a bad url, the /dal is missing:

https://livebuilds.openbravo.com/erp_main_pgsql/ws/ADUser/100?template=bo.xslt

To fix this the bo.xslt has been changed, now it takes into account if the url 
contains the id after
the entity name. If it does, a level is substracted. If not, no.

The WebServiceUtil.applyTemplate method has been changed too. Now the parameter 
hasId is set here and is
passed to the bo.xslt. This boolean parameter is true if the url has the id 
after the entity name,
and false if not.

diffstat:

 src/org/openbravo/service/rest/bo.xslt|  30 --
 src/org/openbravo/service/web/WebServiceUtil.java |  13 +-
 2 files changed, 34 insertions(+), 9 deletions(-)

diffs (89 lines):

diff -r f7a872ac28de -r 34641a1a0c78 src/org/openbravo/service/rest/bo.xslt
--- a/src/org/openbravo/service/rest/bo.xsltWed Jun 10 13:12:40 2015 +
+++ b/src/org/openbravo/service/rest/bo.xsltWed Jun 10 15:51:06 2015 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2015 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  __.
  
@@ -23,6 +23,7 @@
Note if the namespace of openbravo changes then the namespace
declaration above has to be changed
-- 
+xsl:param name=hasId/xsl:param
xsl:template match=ob:Openbravo
xsl:for-each select=*
xsl:call-template name=handleEntity /
@@ -113,12 +114,25 @@
/
xsl:value-of select=@id /
/xsl:variable
-   a href=../{$href}?template=bo.xslt
-   xsl:value-of select=@identifier /
-   (
-   xsl:value-of select=@id /
-   )
-   /a
-   a href=../{$href} (xml)/a
+xsl:choose
+xsl:when test=$hasId = 'true'
+a href=../{$href}?template=bo.xslt
+xsl:value-of select=@identifier /
+(
+xsl:value-of select=@id /
+)
+/a
+a href=../{$href} (xml)/a
+/xsl:when
+xsl:otherwise
+a href={$href}?template=bo.xslt
+xsl:value-of select=@identifier /
+(
+xsl:value-of select=@id /
+)
+/a
+a href={$href} (xml)/a
+/xsl:otherwise
+/xsl:choose
/xsl:template
 /xsl:stylesheet
\ No newline at end of file
diff -r f7a872ac28de -r 34641a1a0c78 
src/org/openbravo/service/web/WebServiceUtil.java
--- a/src/org/openbravo/service/web/WebServiceUtil.java Wed Jun 10 13:12:40 
2015 +
+++ b/src/org/openbravo/service/web/WebServiceUtil.java Wed Jun 10 15:51:06 
2015 +0200
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2008-2010 Openbravo SLU 
+ * All portions are Copyright (C) 2008-2015 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  __.
  
@@ -230,11 +230,22 @@
*/
   public String applyTemplate(String xml, InputStream template, String url) 

[OpenbravoERP-commits] devel/pi: 2 new changesets

2015-06-10 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/ba00fcc9d5bf
changeset: 26891:ba00fcc9d5bf
user:  Atul Gaware atul.gaware at openbravo.com
date:  Wed Jun 10 09:56:13 2015 +0530
summary:   Fixes Issue 30120:ScrollableResults object should be closed

ScrollableResults objects are closed in a finally block.

details:   https://code.openbravo.com/erp/devel/pi/rev/4c6de7a747e1
changeset: 26892:4c6de7a747e1
user:  Víctor Martínez Romanos victor.martinez at openbravo.com
date:  Wed Jun 10 17:02:19 2015 +0200
summary:   Related to issue 30120: Applied OB code format

diffstat:

 src/org/openbravo/costing/LCMatchingProcess.java  |  40 +
 src/org/openbravo/costing/LandedCostDistributionByAmount.java |  30 ---
 src/org/openbravo/costing/LandedCostProcess.java  |  46 +-
 src/org/openbravo/costing/StandardCostAdjustment.java |  36 ---
 src/org/openbravo/event/GLJournalEventHandler.java|  12 +-
 5 files changed, 91 insertions(+), 73 deletions(-)

diffs (249 lines):

diff -r 34641a1a0c78 -r 4c6de7a747e1 
src/org/openbravo/costing/LCMatchingProcess.java
--- a/src/org/openbravo/costing/LCMatchingProcess.java  Wed Jun 10 15:51:06 
2015 +0200
+++ b/src/org/openbravo/costing/LCMatchingProcess.java  Wed Jun 10 17:02:19 
2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  __.
  *
@@ -166,25 +166,29 @@
 
 ScrollableResults receiptamts = qryLCRLA.scroll(ScrollMode.FORWARD_ONLY);
 int i = 0;
-while (receiptamts.next()) {
-  Object[] receiptAmt = receiptamts.get();
-  BigDecimal amt = (BigDecimal) receiptAmt[0];
-  ShipmentInOutLine receiptLine = 
OBDal.getInstance().get(ShipmentInOutLine.class,
-  receiptAmt[1]);
-  MaterialTransaction trx = 
receiptLine.getMaterialMgmtMaterialTransactionList().get(0);
-  CostAdjustmentLine cal = 
CostAdjustmentUtils.insertCostAdjustmentLine(trx, ca, amt, true,
-  referenceDate);
-  cal.setNeedsPosting(Boolean.FALSE);
-  cal.setUnitCost(Boolean.FALSE);
-  cal.setCurrency(lcCost.getCurrency());
-  OBDal.getInstance().save(cal);
+try {
+  while (receiptamts.next()) {
+Object[] receiptAmt = receiptamts.get();
+BigDecimal amt = (BigDecimal) receiptAmt[0];
+ShipmentInOutLine receiptLine = 
OBDal.getInstance().get(ShipmentInOutLine.class,
+receiptAmt[1]);
+MaterialTransaction trx = 
receiptLine.getMaterialMgmtMaterialTransactionList().get(0);
+CostAdjustmentLine cal = 
CostAdjustmentUtils.insertCostAdjustmentLine(trx, ca, amt, true,
+referenceDate);
+cal.setNeedsPosting(Boolean.FALSE);
+cal.setUnitCost(Boolean.FALSE);
+cal.setCurrency(lcCost.getCurrency());
+OBDal.getInstance().save(cal);
 
-  if (i % 100 == 0) {
-OBDal.getInstance().flush();
-OBDal.getInstance().getSession().clear();
-ca = OBDal.getInstance().get(CostAdjustment.class, ca.getId());
+if (i % 100 == 0) {
+  OBDal.getInstance().flush();
+  OBDal.getInstance().getSession().clear();
+  ca = OBDal.getInstance().get(CostAdjustment.class, ca.getId());
+}
+i++;
   }
-  i++;
+} finally {
+  receiptamts.close();
 }
 ca = OBDal.getInstance().get(CostAdjustment.class, ca.getId());
 CostAdjustmentProcess.doProcessCostAdjustment(ca);
diff -r 34641a1a0c78 -r 4c6de7a747e1 
src/org/openbravo/costing/LandedCostDistributionByAmount.java
--- a/src/org/openbravo/costing/LandedCostDistributionByAmount.java Wed Jun 
10 15:51:06 2015 +0200
+++ b/src/org/openbravo/costing/LandedCostDistributionByAmount.java Wed Jun 
10 17:02:19 2015 +0200
@@ -67,20 +67,24 @@
 critLCRL.add(Restrictions.eq(LCReceipt.PROPERTY_LANDEDCOST, landedCost));
 ScrollableResults receiptCosts = getReceiptCosts(landedCost, false);
 int i = 0;
-while (receiptCosts.next()) {
-  String strTrxCur = (String) receiptCosts.get()[2];
-  BigDecimal trxAmt = (BigDecimal) receiptCosts.get()[3];
-  if (!strTrxCur.equals(strCurId)) {
-trxAmt = getConvertedAmount(trxAmt, strTrxCur, strCurId, 
dateReference, strOrgId);
+try {
+  while (receiptCosts.next()) {
+String strTrxCur = (String) receiptCosts.get()[2];
+BigDecimal trxAmt = (BigDecimal) receiptCosts.get()[3];
+if (!strTrxCur.equals(strCurId)) {
+  trxAmt = getConvertedAmount(trxAmt, strTrxCur, strCurId, 
dateReference, strOrgId);
+}
+
+totalAmt = totalAmt.add(trxAmt);
+
+if (i % 100 == 0) {
+  

[OpenbravoERP-commits] devel/pi: Fixes issue 30096: Cannot filter the bp field by ' sym...

2015-06-10 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/ba6a63e37880
changeset: 26887:ba6a63e37880
user:  Carlos Aristu carlos.aristu at openbravo.com
date:  Wed Jun 10 09:05:57 2015 +0200
summary:   Fixes issue 30096: Cannot filter the bp field by ' symbol in 
selector drop down

The CustomQuerySelectorDatasource was not handling the parameters of the query 
properly. For that reason characters like ' were not replaced as expected.
Now the parameters are mapped into a list, and replaced in the query using the 
setParameter() method

diffstat:

 
modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java
 |  65 ++---
 1 files changed, 45 insertions(+), 20 deletions(-)

diffs (182 lines):

diff -r ee157fef9c33 -r ba6a63e37880 
modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java
--- 
a/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java
  Tue Jun 09 18:14:54 2015 +0200
+++ 
b/modules/org.openbravo.userinterface.selector/src/org/openbravo/userinterface/selector/CustomQuerySelectorDatasource.java
  Wed Jun 10 09:05:57 2015 +0200
@@ -11,13 +11,14 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011-2014 Openbravo SLU
+ * All portions are Copyright (C) 2011-2015 Openbravo SLU
  * All Rights Reserved. 
  * Contributor(s):  __.
  
  */
 package org.openbravo.userinterface.selector;
 
+import java.math.BigDecimal;
 import java.sql.Timestamp;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
@@ -64,6 +65,7 @@
   private static final String ADDITIONAL_FILTERS = @additional_filters@;
   private static final String NEW_FILTER_CLAUSE = \n AND ;
   private static final String NEW_OR_FILTER_CLAUSE = \n OR ;
+  private static final String ALIAS_PREFIX = alias_;
 
   @Override
   protected int getCount(MapString, String parameters) {
@@ -78,6 +80,7 @@
 final SimpleDateFormat xmlDateFormat = JsonUtils.createDateFormat();
 final SimpleDateFormat xmlDateTimeFormat = 
JsonUtils.createDateTimeFormat();
 final ListMapString, Object result = new ArrayListMapString, 
Object();
+final ListObject typedParameters = new ArrayListObject();
 // Defaulted to endRow + 2 to check for more records while scrolling.
 int totalRows = endRow + 2, rowCount = 0;
 
@@ -99,12 +102,15 @@
   Hibernate.initialize(fields);
 
   // Parse the HQL in case that optional filters are required
-  String HQL = parseOptionalFilters(parameters, sel, xmlDateFormat);
+  String HQL = parseOptionalFilters(parameters, sel, xmlDateFormat, 
typedParameters);
 
   String sortBy = parameters.get(_sortBy);
   HQL += getSortClause(sortBy, sel);
 
   Query selQuery = OBDal.getInstance().getSession().createQuery(HQL);
+  for (int i = 0; i  typedParameters.size(); i++) {
+selQuery.setParameter(ALIAS_PREFIX + Integer.toString(i), 
typedParameters.get(i));
+  }
   String[] queryAliases = selQuery.getReturnAliases();
 
   if (startRow  0) {
@@ -180,7 +186,7 @@
*/
 
   private String parseOptionalFilters(MapString, String parameters, Selector 
sel,
-  SimpleDateFormat xmlDateFormat) {
+  SimpleDateFormat xmlDateFormat, ListObject typedParameters) {
 String HQL = sel.getHQL();
 if (!HQL.contains(ADDITIONAL_FILTERS)) {
   return HQL;
@@ -238,14 +244,15 @@
   if (StringUtils.isNotEmpty(defaultValue)) {
 defaultExpressionsFilter.append(NEW_FILTER_CLAUSE);
 defaultExpressionsFilter.append(getWhereClause(operator, 
defaultValue, field,
-xmlDateFormat, operatorvalue));
+xmlDateFormat, operatorvalue, typedParameters));
   }
 } catch (Exception e) {
   log.error(Error evaluating filter expression:  + e.getMessage(), 
e);
 }
   }
   if (field.isFilterable()  StringUtils.isNotEmpty(value)) {
-String whereClause = getWhereClause(operator, value, field, 
xmlDateFormat, operatorvalue);
+String whereClause = getWhereClause(operator, value, field, 
xmlDateFormat, operatorvalue,
+typedParameters);
 if (!hasFilter) {
   additionalFilter.append(NEW_FILTER_CLAUSE);
   additionalFilter.append( ();
@@ -296,7 +303,7 @@
* @return a String with the HQL where clause to filter the field by the 
given value.
*/
   private String getWhereClause(String operator, String value, SelectorField 
field,
-  SimpleDateFormat xmlDateFormat, String[] operatorvalue) {
+  SimpleDateFormat xmlDateFormat, String[] operatorvalue, ListObject 
typedParameters) {
 String whereClause = ;
 
 if (operator != null 

[OpenbravoERP-commits] devel/pi: 2 new changesets

2015-06-10 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/0e8c70499208
changeset: 26893:0e8c70499208
user:  Alvaro Ferraz alvaro.ferraz at openbravo.com
date:  Wed Jun 03 18:12:35 2015 +0200
summary:   Fixes issue 28886: Error in Refund Payment from Match Statement

ob-aprm-addPayment.js has been changed to check if Overpayment Action field is 
visible in order to raise APRM_ZEROAMOUNTPAYMENTTRANSACTION or not.
AddPaymentActionHandler.java has been changed to do a commit at the end of 
createNewPayment method and avoid error when retrieving the created payment 
later.

details:   https://code.openbravo.com/erp/devel/pi/rev/2a75107a6f00
changeset: 26894:2a75107a6f00
user:  Víctor Martínez Romanos victor.martinez at openbravo.com
date:  Wed Jun 10 18:04:18 2015 +0200
summary:   Related to issue 28886: Applied JS Beautify

diffstat:

 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
 |  5 -
 
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
   |  4 ++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diffs (50 lines):

diff -r 4c6de7a747e1 -r 2a75107a6f00 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
  Wed Jun 10 17:02:19 2015 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
  Wed Jun 10 18:04:18 2015 +0200
@@ -19,6 +19,7 @@
 package org.openbravo.advpaymentmngt.actionHandler;
 
 import java.math.BigDecimal;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -239,7 +240,8 @@
 
   private FIN_Payment createNewPayment(JSONObject jsonparams, boolean 
isReceipt, Organization org,
   BusinessPartner bPartner, Date paymentDate, Currency currency, 
BigDecimal conversionRate,
-  BigDecimal convertedAmt, String strActualPayment) throws OBException, 
JSONException {
+  BigDecimal convertedAmt, String strActualPayment) throws OBException, 
JSONException,
+  SQLException {
 
 String strPaymentDocumentNo = jsonparams.getString(payment_documentno);
 String strReferenceNo = ;
@@ -290,6 +292,7 @@
 FIN_Payment payment = (new AdvPaymentMngtDao()).getNewPayment(isReceipt, 
org, documentType,
 strPaymentDocumentNo, bPartner, paymentMethod, finAccount, 
strPaymentAmount, paymentDate,
 strReferenceNo, currency, conversionRate, convertedAmt);
+OBDal.getInstance().getConnection(true).commit();
 return payment;
   }
 
diff -r 4c6de7a747e1 -r 2a75107a6f00 
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
--- 
a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
Wed Jun 10 17:02:19 2015 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
Wed Jun 10 18:04:18 2015 +0200
@@ -866,7 +866,7 @@
   if (!actualConverted  !exchangeRate) {
 return;
   }
-  
+
   exchangeRate = new BigDecimal(String(exchangeRate || 1));
   actualConverted = new BigDecimal(String(actualConverted || 0));
   if (!actualConverted || !exchangeRate) {
@@ -1142,7 +1142,7 @@
 return clientSideValidationFail();
   }
 
-  if (document !== null  document !== ''  
actualPayment.compareTo(BigDecimal.prototype.ZERO) === 0  view.parentWindow 
 view.parentWindow.windowId) {
+  if (document !== null  document !== ''  
actualPayment.compareTo(BigDecimal.prototype.ZERO) === 0  view.parentWindow 
 view.parentWindow.windowId  !overpaymentAction) {
 view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, 
OB.I18N.getLabel('APRM_ZEROAMOUNTPAYMENTTRANSACTION'));
 return clientSideValidationFail();
   }

--
___
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits


[OpenbravoERP-commits] devel/pi: Fixes issue 30119: ScrollableResults object should be ...

2015-06-10 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/4775fc0c799b
changeset: 26895:4775fc0c799b
user:  Carlos Aristu carlos.aristu at openbravo.com
date:  Wed Jun 10 18:23:19 2015 +0200
summary:   Fixes issue 30119: ScrollableResults object should be closed

diffstat:

 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java
   |   51 +-
 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java
 |  150 +
 2 files changed, 107 insertions(+), 94 deletions(-)

diffs (233 lines):

diff -r 2a75107a6f00 -r 4775fc0c799b 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java
--- 
a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java
Wed Jun 10 18:04:18 2015 +0200
+++ 
b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java
Wed Jun 10 18:23:19 2015 +0200
@@ -288,31 +288,36 @@
 int ENTITY = 4;
 int cont = 0;
 ScrollableResults scrollNodes = 
obq.createQuery().scroll(ScrollMode.FORWARD_ONLY);
-while (scrollNodes.next()) {
-  Object[] node = scrollNodes.get();
-  JSONObject value = null;
-  BaseOBObject bob = (BaseOBObject) node[ENTITY];
-  try {
-value = toJsonConverter.toJsonObject(bob, DataResolvingMode.FULL);
-value.put(nodeId, bob.getId().toString());
-if (fetchRoot) {
-  value.put(parentId, ROOT_NODE_CLIENT);
-} else {
-  value.put(parentId, node[PARENT_ID]);
+try {
+  while (scrollNodes.next()) {
+Object[] node = scrollNodes.get();
+JSONObject value = null;
+BaseOBObject bob = (BaseOBObject) node[ENTITY];
+try {
+  value = toJsonConverter.toJsonObject(bob, DataResolvingMode.FULL);
+  value.put(nodeId, bob.getId().toString());
+  if (fetchRoot) {
+value.put(parentId, ROOT_NODE_CLIENT);
+  } else {
+value.put(parentId, node[PARENT_ID]);
+  }
+  addNodeCommonAttributes(entity, bob, value);
+  value.put(seqno, node[SEQNO]);
+  value
+  .put(_hasChildren, (this.nodeHasChildren(entity, (String) 
node[NODE_ID],
+  hqlWhereClause)) ? true : false);
+} catch (JSONException e) {
+  logger.error(Error while constructing JSON reponse, e);
 }
-addNodeCommonAttributes(entity, bob, value);
-value.put(seqno, node[SEQNO]);
-value.put(_hasChildren,
-(this.nodeHasChildren(entity, (String) node[NODE_ID], 
hqlWhereClause)) ? true : false);
-  } catch (JSONException e) {
-logger.error(Error while constructing JSON reponse, e);
+responseData.put(value);
+if ((cont % 100) == 0) {
+  OBDal.getInstance().flush();
+  OBDal.getInstance().getSession().clear();
+}
+cont++;
   }
-  responseData.put(value);
-  if ((cont % 100) == 0) {
-OBDal.getInstance().flush();
-OBDal.getInstance().getSession().clear();
-  }
-  cont++;
+} finally {
+  scrollNodes.close();
 }
 return responseData;
   }
diff -r 2a75107a6f00 -r 4775fc0c799b 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java
--- 
a/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java
  Wed Jun 10 18:04:18 2015 +0200
+++ 
b/modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java
  Wed Jun 10 18:23:19 2015 +0200
@@ -284,44 +284,48 @@
 }
 int count = 0;
 final ScrollableResults scrollableResults = 
query.scroll(ScrollMode.FORWARD_ONLY);
-while (scrollableResults.next()) {
-  BaseOBObject bob = (BaseOBObject) scrollableResults.get()[0];
-  final JSONObject json = toJsonConverter.toJsonObject(bob, 
DataResolvingMode.FULL);
-  if (fetchRoot) {
-json.put(parentId, ROOT_NODE_CLIENT);
-  } else {
-json.put(parentId, parentId);
+try {
+  while (scrollableResults.next()) {
+BaseOBObject bob = (BaseOBObject) scrollableResults.get()[0];
+final JSONObject json = toJsonConverter.toJsonObject(bob, 
DataResolvingMode.FULL);
+if (fetchRoot) {
+  json.put(parentId, ROOT_NODE_CLIENT);
+} else {
+  json.put(parentId, parentId);
+}
+Object nodeId = bob.get(nodeIdProperty.getName());
+String nodeIdStr = null;
+if (nodeId instanceof String) {
+  nodeIdStr = (String) nodeId;
+} else if (nodeId instanceof BaseOBObject) {
+  nodeIdStr = ((BaseOBObject) nodeId).getId().toString();
+}
+
+Object parentNodeId = 

[OpenbravoERP-commits] devel/pi: 2 new changesets

2015-06-10 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/29888743cfde
changeset: 26896:29888743cfde
user:  RM packaging bot staff.rm at openbravo.com
date:  Wed Jun 10 22:31:01 2015 +
summary:   CI: update AD_MODULE to version 26892

details:   https://code.openbravo.com/erp/devel/pi/rev/aab70f0c1a50
changeset: 26897:aab70f0c1a50
user:  RM packaging bot staff.rm at openbravo.com
date:  Wed Jun 10 22:46:44 2015 +
summary:   CI: merge back from main

diffstat:

 modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml  
  |2 +-
 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |4 +-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
 |5 +-
 
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
   |4 +-
 modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml   
  |2 +-
 
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |2 +-
 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
|2 +-
 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |8 +-
 
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE.xml
 |2 +-
 
modules/org.openbravo.client.htmlwidget/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |2 +-
 modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE.xml   
  |2 +-
 
modules/org.openbravo.client.kernel/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  |6 +-
 modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE.xml 
  |2 +-
 
modules/org.openbravo.client.myob/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
|4 +-
 
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE.xml 
 |2 +-
 
modules/org.openbravo.client.querylist/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
   |2 +-
 modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE.xml  
  |2 +-
 
modules/org.openbravo.client.widgets/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |2 +-
 
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE.xml
   |2 +-
 
modules/org.openbravo.financial.paymentreport/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
|2 +-
 
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE.xml
|2 +-
 
modules/org.openbravo.reports.ordersawaitingdelivery/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |2 +-
 
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE.xml
|2 +-
 
modules/org.openbravo.service.datasource/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |   10 +-
 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/ADTreeDatasourceService.java
   |   51 +-
 
modules/org.openbravo.service.datasource/src/org/openbravo/service/datasource/LinkToParentTreeDatasourceService.java
 |  150 +
 
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE.xml
|2 +-
 
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |4 +-
 
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE.xml
|2 +-
 
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |2 +-
 modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE.xml
  |2 +-
 
modules/org.openbravo.service.json/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
   |2 +-
 
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE.xml
|2 +-
 
modules/org.openbravo.userinterface.selector/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
 |   12 +-