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

2015-06-19 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/53058d80de1d
changeset: 26979:53058d80de1d
user:  RM packaging bot  openbravo.com>
date:  Fri Jun 19 21:40:22 2015 +
summary:   CI: update AD_MODULE to version 26978

details:   https://code.openbravo.com/erp/devel/pi/rev/744d5e3326f5
changeset: 26980:744d5e3326f5
user:  RM packaging bot  openbravo.com>
date:  Fri Jun 19 21:56:30 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 +-
 modules/org.openbravo.v3.framework/src-db/database/

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

2015-06-19 Thread hg
details:   https://code.openbravo.com/erp/devel/main/rev/a6b30e56aa48
changeset: 26973:a6b30e56aa48
user:  Sandra Huguet  openbravo.com>
date:  Thu Jun 18 13:07:42 2015 +0200
summary:   related to issue 29904

details:   https://code.openbravo.com/erp/devel/main/rev/0609c9593fc7
changeset: 26974:0609c9593fc7
user:  Carlos Aristu  openbravo.com>
date:  Thu Jun 18 16:59:22 2015 +0200
summary:   Fixes issue 30187: prevent build in unsupported PG versions

details:   https://code.openbravo.com/erp/devel/main/rev/d2f6d6977bfa
changeset: 26975:d2f6d6977bfa
user:  RM packaging bot  openbravo.com>
date:  Thu Jun 18 16:31:55 2015 +
summary:   CI: merge back from main

details:   https://code.openbravo.com/erp/devel/main/rev/a1b8bf010d17
changeset: 26976:a1b8bf010d17
user:  Alvaro Ferraz  openbravo.com>
date:  Wed Jun 17 18:53:46 2015 +0200
summary:   Fixes issue 30007: Payment schedule amount incorrectly calculated

FIN_PaymentProcess was not setting isinvoicepaid = true when processing a 
payment related to an order.
Also, APRM_ISPAYMENTCONFIRMED function, was not taking into account 
isinvoicepaid when checking if a payment related to an order was confirmed.
Name of preference in UpdatePaymentPlan modulescript has been update to run it 
again and fix wrong data created by the issue.

details:   https://code.openbravo.com/erp/devel/main/rev/fcc755f5f885
changeset: 26977:fcc755f5f885
user:  Carlos Aristu  openbravo.com>
date:  Fri Jun 19 12:54:35 2015 +0200
summary:   Fixes issue 29675: check DB and Tomcat have the same time at Tomcat 
start

details:   https://code.openbravo.com/erp/devel/main/rev/8dd350ae50f3
changeset: 26978:8dd350ae50f3
user:  RM packaging bot  openbravo.com>
date:  Fri Jun 19 13:39:11 2015 +0200
summary:   Merge back from main

details:   https://code.openbravo.com/erp/devel/main/rev/53058d80de1d
changeset: 26979:53058d80de1d
user:  RM packaging bot  openbravo.com>
date:  Fri Jun 19 21:40:22 2015 +
summary:   CI: update AD_MODULE to version 26978

diffstat:

 .hgsigs
   |1 +
 .hgtags
   |1 +
 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml
  |9 +-
 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
 |   11 +-
 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.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java
 |   44 +++
 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

[OpenbravoERP-commits] devel/pi: Fixes issue 29675: check DB and Tomcat have the same t...

2015-06-19 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/fcc755f5f885
changeset: 26949:fcc755f5f885
user:  Carlos Aristu  openbravo.com>
date:  Fri Jun 19 12:54:35 2015 +0200
summary:   Fixes issue 29675: check DB and Tomcat have the same time at Tomcat 
start

diffstat:

 
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java
 |  44 ++
 src/org/openbravo/erpCommon/utility/DateTime_data.xsql 
   |   7 +
 2 files changed, 51 insertions(+), 0 deletions(-)

diffs (90 lines):

diff -r a1b8bf010d17 -r fcc755f5f885 
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java
--- 
a/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java
 Wed Jun 17 18:53:46 2015 +0200
+++ 
b/modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/KernelApplicationInitializer.java
 Fri Jun 19 12:54:35 2015 +0200
@@ -18,11 +18,17 @@
  */
 package org.openbravo.client.kernel;
 
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
 import javax.enterprise.context.ApplicationScoped;
 
+import org.apache.log4j.Logger;
 import org.hibernate.dialect.function.StandardSQLFunction;
 import org.hibernate.type.StringType;
 import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.utility.DateTimeData;
+import org.openbravo.service.db.DalConnectionProvider;
 
 /**
  * An example {@link ApplicationInitializer}.
@@ -31,8 +37,17 @@
  */
 @ApplicationScoped
 public class KernelApplicationInitializer implements ApplicationInitializer {
+  private static Logger log4j = 
Logger.getLogger(KernelApplicationInitializer.class);
+  private static final String sqlDateTimeFormat = "DD-MM- HH24:MI:SS";
+  private static final String javaDateTimeFormat = "dd-MM- HH:mm:ss";
+  private static final long THRESHOLD = 5000; // 5 seconds
 
   public void initialize() {
+registerSQLFunctions();
+checkDatabaseAndTomcatDateTime();
+  }
+
+  private void registerSQLFunctions() {
 OBDal.getInstance().registerSQLFunction("ad_org_getcalendarowner",
 new StandardSQLFunction("ad_org_getcalendarowner", new StringType()));
 OBDal.getInstance().registerSQLFunction("ad_org_getperiodcontrolallow",
@@ -40,4 +55,33 @@
 OBDal.getInstance().registerSQLFunction("m_isparent_ch_value",
 new StandardSQLFunction("m_isparent_ch_value", new StringType()));
   }
+
+  private void checkDatabaseAndTomcatDateTime() {
+// This method checks if both Tomcat and DB are configured to use the same 
time zone. If there
+// is a difference bigger than a few seconds, it logs a warning.
+try {
+  Date tomcatDate = new Date(); // Tomcat time
+  Date dbDate = getDatabaseDateTime(); // Database time
+  log4j.info("Tomcat Time: " + tomcatDate + ", Database Time: " + dbDate);
+  if (dbDate != null) {
+long difference = Math.abs(tomcatDate.getTime() - dbDate.getTime());
+if (difference > THRESHOLD) {
+  log4j.warn("Tomcat and Database are in different timezones.");
+}
+  }
+} catch (Exception ex) {
+}
+  }
+
+  private Date getDatabaseDateTime() {
+Date date = null;
+try {
+  // We retrieve the time from the database, without considering the time 
zone information
+  String now = DateTimeData.now(new DalConnectionProvider(), 
sqlDateTimeFormat);
+  SimpleDateFormat formatter = new SimpleDateFormat(javaDateTimeFormat);
+  date = formatter.parse(now);
+} catch (Exception ex) {
+}
+return date;
+  }
 }
diff -r a1b8bf010d17 -r fcc755f5f885 
src/org/openbravo/erpCommon/utility/DateTime_data.xsql
--- a/src/org/openbravo/erpCommon/utility/DateTime_data.xsqlWed Jun 17 
18:53:46 2015 +0200
+++ b/src/org/openbravo/erpCommon/utility/DateTime_data.xsqlFri Jun 19 
12:54:35 2015 +0200
@@ -44,6 +44,13 @@
   
   

+   
+  
+  
+SELECT TO_CHAR(now(),?) AS now FROM DUAL
+  
+  
+   

   
   

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


[OpenbravoERP-commits] devel/pi: Fixes issue 30007: Payment schedule amount incorrectly...

2015-06-19 Thread hg
details:   https://code.openbravo.com/erp/devel/pi/rev/a1b8bf010d17
changeset: 26948:a1b8bf010d17
user:  Alvaro Ferraz  openbravo.com>
date:  Wed Jun 17 18:53:46 2015 +0200
summary:   Fixes issue 30007: Payment schedule amount incorrectly calculated

FIN_PaymentProcess was not setting isinvoicepaid = true when processing a 
payment related to an order.
Also, APRM_ISPAYMENTCONFIRMED function, was not taking into account 
isinvoicepaid when checking if a payment related to an order was confirmed.
Name of preference in UpdatePaymentPlan modulescript has been update to run it 
again and fix wrong data created by the issue.

diffstat:

 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml
  |9 +
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
 |1 +
 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdatePaymentPlanData.class
|0 
 
src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql
  |4 ++--
 4 files changed, 8 insertions(+), 6 deletions(-)

diffs (71 lines):

diff -r d2f6d6977bfa -r a1b8bf010d17 
modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml
  Thu Jun 18 16:31:55 2015 +
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml
  Wed Jun 17 18:53:46 2015 +0200
@@ -19,7 +19,7 @@
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2011-2014 Openbravo SLU
+* All portions are Copyright (C) 2011-2015 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  __.
 /
@@ -33,6 +33,7 @@
   TYPE RECORD IS REF CURSOR;
   Cur_Dbprefix RECORD;
   v_invoicepaidstatus  VARCHAR2(32);
+  v_fin_payment_schedule_order VARCHAR(32);
   v_fin_payment_schedule_invoice VARCHAR(32);
   v_p_fin_psd_id VARCHAR(32);
 BEGIN
@@ -52,13 +53,13 @@
   END IF;
   
   IF (v_p_fin_psd_id is not null ) THEN
-  select isinvoicepaid , fin_payment_schedule_invoice
-  into v_isinvoicepaid , v_fin_payment_schedule_invoice
+  select isinvoicepaid, fin_payment_schedule_order, 
fin_payment_schedule_invoice
+  into v_isinvoicepaid, v_fin_payment_schedule_order, 
v_fin_payment_schedule_invoice
   from fin_payment_scheduledetail
   where fin_payment_scheduledetail_id=v_p_fin_psd_id;
   END IF;
 
-  IF (v_fin_payment_schedule_invoice is not null)THEN
+  IF (v_fin_payment_schedule_order is not null OR 
v_fin_payment_schedule_invoice is not null) THEN
 IF(v_isinvoicepaid='Y')THEN
 -- core intermediate statuses
 v_isPaymentConfirmed := 'Y';
diff -r d2f6d6977bfa -r a1b8bf010d17 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
 Thu Jun 18 16:31:55 2015 +
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
 Wed Jun 17 18:53:46 2015 +0200
@@ -451,6 +451,7 @@
 paymentScheduleDetail.getOrderPaymentSchedule(),
 paymentScheduleDetail.getAmount(),
 paymentScheduleDetail.getWriteoffAmount());
+paymentScheduleDetail.setInvoicePaid(true);
   }
   // when generating credit for a BP SO_CreditUsed is also 
updated
   if (paymentScheduleDetail.getInvoicePaymentSchedule() == null
diff -r d2f6d6977bfa -r a1b8bf010d17 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdatePaymentPlanData.class
Binary file 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdatePaymentPlanData.class
 has changed
diff -r d2f6d6977bfa -r a1b8bf010d17 
src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql
--- 
a/src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql
  Thu Jun 18 16:31:55 2015 +
+++ 
b/src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql
  Wed Jun 17 18:53:46 2015 +0200
@@ -54,7 +54,7 @@
 SELECT count(*) as exist
 FROM DUAL
 WHERE EXISTS (SELECT 1 FROM ad_preference
-  WHERE attribute = 'PaymentPlanUpdatedV2')
+  WHERE attribute = 'PaymentPlanUpdatedV4')
   ]]>
 
   
@@ -66,7 +66,7 @@
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(),'PaymentPlanUpda