details:   https://code.openbravo.com/erp/devel/main/rev/f8b937eb67f2
changeset: 26782:f8b937eb67f2
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Tue May 26 18:20:34 2015 +0200
summary:   Fixed bug 30002: Error in Requisition To Order window

When creating a purchase order from the Requisition To Order window, an error 
was raised when lines[i].quantityorder is empty.
Now the SQL query returns quantityorder = 0 when it's null. Then, when 
inserting the purchase order line, the process inserts "" if quantityorder = 0

details:   https://code.openbravo.com/erp/devel/main/rev/ed79488b19b5
changeset: 26783:ed79488b19b5
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Wed May 27 09:44:35 2015 +0200
summary:   Fixed bug 30021: Requisition To Order with several secondary UOMs 
per product

The system was grouping requisition lines by product without taking into 
account the secondary UOM.
Now the code takes into account the M_Product_UOM_Id column too to group/split 
the purchase order line.

details:   https://code.openbravo.com/erp/devel/main/rev/9c4cd496fbbf
changeset: 26784:9c4cd496fbbf
user:      RM packaging bot <staff.rm <at> openbravo.com>
date:      Wed May 27 13:36:32 2015 +0000
summary:   CI: merge back from main

details:   https://code.openbravo.com/erp/devel/main/rev/f46b56001fbd
changeset: 26785:f46b56001fbd
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Wed May 27 15:41:58 2015 +0200
summary:   fixed bug 30016: upgrading from 2.50 to pi some FKs are missing

  There were 2 scenarios where this occurred:
   * FKs from recreated to non recreated tables in case none of them are in AD
   * both tables participating in the FK are recreated and the referenced one
     is loaded before the referencing one in the model

details:   https://code.openbravo.com/erp/devel/main/rev/56a6bfc4e4c7
changeset: 26786:56a6bfc4e4c7
user:      Naroa Iriarte <naroa.iriarte <at> openbravo.com>
date:      Wed May 27 16:05:43 2015 +0200
summary:   Related with issue 29709: Some test cases have been created.

Some test have been created for testing the correct behaviour of the 
OB.Utilities.Number.roundJSNumber,
OB.Utilities.Number.ScientificToDecimal and 
OB.Utilities.Number.OBMaskedToOBPlain functions.

details:   https://code.openbravo.com/erp/devel/main/rev/83734f0b006e
changeset: 26787:83734f0b006e
user:      Sandra Huguet <sandra.huguet <at> openbravo.com>
date:      Wed May 27 09:41:59 2015 +0200
summary:   Fixed bug 29904 Performance improvements for orderloading in finance 
core

review flush () and .list () in FIN_PaymentProcess and FIN_TransactionProcess

details:   https://code.openbravo.com/erp/devel/main/rev/9eb109c1f121
changeset: 26788:9eb109c1f121
user:      Carlos Aristu <carlos.aristu <at> openbravo.com>
date:      Wed May 27 16:31:12 2015 +0200
summary:   Related to issue 29566: fixes deprecated method calls in 
ReportDesignBO

details:   https://code.openbravo.com/erp/devel/main/rev/f89eff26d185
changeset: 26789:f89eff26d185
user:      Jorge Garcia <jorge.garcia <at> openbravo.com>
date:      Wed May 20 18:17:08 2015 +0200
summary:   Fixed issue 25278: Long time to update a warehouse with thousends of 
locators

On an environment with 60.000 locators for one of the warehouse, when updating
a field of the warehouse it takes a long time to save the record.

Part of the problem is the update of the m_warehouse table. When updated, the
trigger launch an update of the organization id for M_LOCATOR and
M_WAREHOUSE_ACCT tables.

The solution is to check if the organization has changed and, if not, avoid the
unnecessary update of those tables.

details:   https://code.openbravo.com/erp/devel/main/rev/ef5da8dc7f38
changeset: 26790:ef5da8dc7f38
user:      Víctor Martínez Romanos <victor.martinez <at> openbravo.com>
date:      Wed May 27 17:14:52 2015 +0200
summary:   Related to issue 25278: updated copyright and fixed indentation

details:   https://code.openbravo.com/erp/devel/main/rev/ae25da3bd47f
changeset: 26791:ae25da3bd47f
user:      RM packaging bot <staff.rm <at> openbravo.com>
date:      Wed May 27 22:53:11 2015 +0000
summary:   CI: update AD_MODULE to version 26790

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/dao/TransactionsDao.java
                    |    1 +
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
             |   64 +-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
         |   12 +-
 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/src/org/openbravo/client/application/ApplicationComponentProvider.java
   |    1 +
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/test/ob-utilities-number-test.js
 |  218 ++++++++++
 
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/web/org.openbravo.client.kernel/ui-test-suite/index.html
                      |    1 +
 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/sourcedata/AD_MODULE.xml    
                                   |    2 +-
 
modules/org.openbravo.v3.framework/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
                            |   24 +-
 modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE.xml              
                                   |    2 +-
 modules/org.openbravo.v3/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml   
                                   |   20 +-
 src-db/database/lib/dbsourcemanager.jar                                        
                                   |    0 
 src-db/database/model/triggers/M_WAREHOUSE_TRG.xml                             
                                   |   12 +-
 src-db/database/sourcedata/AD_MODULE.xml                                       
                                   |    4 +-
 src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java                   
                                   |   37 +-
 src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder_data.xsql              
                                   |    6 +-
 src/org/openbravo/erpCommon/utility/ReportDesignBO.java                        
                                   |    7 +-
 54 files changed, 392 insertions(+), 137 deletions(-)

diffs (truncated from 1536 to 300 lines):

diff -r 03456ea1fc63 -r ae25da3bd47f 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml 
    Tue May 26 17:30:26 2015 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml 
    Wed May 27 22:53:11 2015 +0000
@@ -6,7 +6,7 @@
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <NAME><![CDATA[Advanced Payables and 
Receivables Mngmt]]></NAME>
-<!--A918E3331C404B889D69AA9BFAFB23AC-->  
<VERSION><![CDATA[3.0.26774]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  
<VERSION><![CDATA[3.0.26790]]></VERSION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <DESCRIPTION><![CDATA[Managing your 
finances with an ERP does not have to be difficult. Enjoy a radically improved 
user experience that combines the power of an enterprise grade financial 
application with the simplicity and ease of a web 2.0 personal accounting 
service.]]></DESCRIPTION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <HELP><![CDATA[Advanced Payables and 
Receivables Management simplifies and automates the business processes around 
the management of financial accounts, from the receipt and issue of payment, to 
the reconciliation of those events with bank statements.
 If you would like to help shape this module you are welcome to take part in 
the forum discussions or register feature requests or issues in the 
corresponding (Forum and Bug Tracking) sections in the Advanced Payables and 
Receivable project in the OB Forge.]]></HELP>
diff -r 03456ea1fc63 -r ae25da3bd47f 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  Tue May 26 17:30:26 2015 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  Wed May 27 22:53:11 2015 +0000
@@ -7,7 +7,7 @@
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID>
-<!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<STARTVERSION><![CDATA[2.1.26774]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<STARTVERSION><![CDATA[2.1.26790]]></STARTVERSION>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <DEPENDANT_MODULE_NAME><![CDATA[User 
Interface Selector]]></DEPENDANT_MODULE_NAME>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--B97FC854C6DD41E692161585645A900F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--B97FC854C6DD41E692161585645A900F-->  
<AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--B97FC854C6DD41E692161585645A900F-->  
<AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--B97FC854C6DD41E692161585645A900F-->  
<STARTVERSION><![CDATA[3.0.26774]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  
<STARTVERSION><![CDATA[3.0.26790]]></STARTVERSION>
 <!--B97FC854C6DD41E692161585645A900F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--B97FC854C6DD41E692161585645A900F-->  
<DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--B97FC854C6DD41E692161585645A900F-->  
<DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
diff -r 03456ea1fc63 -r ae25da3bd47f 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java
    Tue May 26 17:30:26 2015 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java
    Wed May 27 22:53:11 2015 +0000
@@ -131,6 +131,7 @@
         
newTransaction.setForeignConversionRate(payment.getFinancialTransactionConvertRate());
         newTransaction.setForeignAmount(payment.getAmount());
       }
+      payment.getFINFinaccTransactionList().add(newTransaction);
       OBDal.getInstance().save(newTransaction);
       OBDal.getInstance().flush();
     } finally {
diff -r 03456ea1fc63 -r ae25da3bd47f 
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
     Tue May 26 17:30:26 2015 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
     Wed May 27 22:53:11 2015 +0000
@@ -21,6 +21,8 @@
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
@@ -155,14 +157,14 @@
         }
       }
 
-      OBDal.getInstance().flush();
       if (strAction.equals("P") || strAction.equals("D")) {
         // Guess if this is a refund payment
         boolean isRefund = false;
         OBContext.setAdminMode(false);
         try {
-          if (payment.getFINPaymentDetailList().size() > 0) {
-            for (FIN_PaymentDetail det : payment.getFINPaymentDetailList()) {
+          List<FIN_PaymentDetail> paymentDetailList = 
payment.getFINPaymentDetailList();
+          if (paymentDetailList.size() > 0) {
+            for (FIN_PaymentDetail det : paymentDetailList) {
               if (det.isRefund()) {
                 isRefund = true;
                 break;
@@ -178,13 +180,14 @@
           OBDal.getInstance().save(payment);
         }
 
-        boolean orgLegalWithAccounting = 
FIN_Utility.periodControlOpened(FIN_Payment.TABLE_NAME,
-            payment.getId(), FIN_Payment.TABLE_NAME + "_ID", "LE");
         boolean documentEnabled = getDocumentConfirmation(null, 
payment.getId());
-        if (documentEnabled
+        boolean periodNotAvailable = documentEnabled
             && !FIN_Utility.isPeriodOpen(payment.getClient().getId(), 
payment.getDocumentType()
                 .getDocumentCategory(), payment.getOrganization().getId(), 
OBDateUtils
-                .formatDate(payment.getPaymentDate())) && 
orgLegalWithAccounting) {
+                .formatDate(payment.getPaymentDate()))
+            && FIN_Utility.periodControlOpened(FIN_Payment.TABLE_NAME, 
payment.getId(),
+                FIN_Payment.TABLE_NAME + "_ID", "LE");
+        if (periodNotAvailable) {
           msg = OBMessageUtils.messageBD("PeriodNotAvailable");
           throw new OBException(msg);
         }
@@ -204,6 +207,7 @@
         // FIXME: added to access the FIN_PaymentSchedule and 
FIN_PaymentScheduleDetail tables to be
         // removed when new security implementation is done
         OBContext.setAdminMode();
+        boolean flushDone = false;
         try {
           String strRefundCredit = "";
           // update payment schedule amount
@@ -313,8 +317,9 @@
             }
           }
           // Execution Process
-          if (dao.isAutomatedExecutionPayment(payment.getAccount(), 
payment.getPaymentMethod(),
-              payment.isReceipt())) {
+          if (!isPosOrder
+              && dao.isAutomatedExecutionPayment(payment.getAccount(), 
payment.getPaymentMethod(),
+                  payment.isReceipt())) {
             try {
               payment.setStatus("RPAE");
 
@@ -359,16 +364,26 @@
                 decreaseCustomerCredit(businessPartner, 
payment.getUsedCredit());
               }
             }
+
             for (FIN_PaymentDetail paymentDetail : 
payment.getFINPaymentDetailList()) {
+
+              List<FIN_PaymentScheduleDetail> orderPaymentScheduleDetails = 
new ArrayList<FIN_PaymentScheduleDetail>(
+                  paymentDetail.getFINPaymentScheduleDetailList());
+
               // Get payment schedule detail list ordered by amount asc.
               // First negative if they exist and then positives
-              OBCriteria<FIN_PaymentScheduleDetail> obcPSD = 
OBDal.getInstance().createCriteria(
-                  FIN_PaymentScheduleDetail.class);
-              
obcPSD.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS,
-                  paymentDetail));
-              obcPSD.addOrderBy(FIN_PaymentScheduleDetail.PROPERTY_AMOUNT, 
true);
+              if (orderPaymentScheduleDetails.size() > 1) {
+                Collections.sort(orderPaymentScheduleDetails,
+                    new Comparator<FIN_PaymentScheduleDetail>() {
+                      @Override
+                      public int compare(FIN_PaymentScheduleDetail o1, 
FIN_PaymentScheduleDetail o2) {
+                        // TODO Auto-generated method stub
+                        return o1.getAmount().compareTo(o2.getAmount());
+                      }
+                    });
+              }
 
-              for (FIN_PaymentScheduleDetail paymentScheduleDetail : 
obcPSD.list()) {
+              for (FIN_PaymentScheduleDetail paymentScheduleDetail : 
orderPaymentScheduleDetails) {
                 BigDecimal amount = paymentScheduleDetail.getAmount().add(
                     paymentScheduleDetail.getWriteoffAmount());
                 // Do not restore paid amounts if the payment is awaiting 
execution.
@@ -378,7 +393,7 @@
                 paymentScheduleDetail.setInvoicePaid(false);
                 // Payment = 0 when the payment is generated by a invoice that 
consume credit
                 if (invoicePaidAmounts
-                    | (payment.getAmount().compareTo(new BigDecimal("0.00")) 
== 0)) {
+                    || (payment.getAmount().compareTo(new BigDecimal("0.00")) 
== 0)) {
                   if (paymentScheduleDetail.getInvoicePaymentSchedule() != 
null) {
                     // BP SO_CreditUsed
                     businessPartner = 
paymentScheduleDetail.getInvoicePaymentSchedule()
@@ -458,14 +473,18 @@
                 && payment.getAmount().compareTo(BigDecimal.ZERO) != 0
                 && !"TRANSACTION".equals(comingFrom)) {
               triggerAutomaticFinancialAccountTransaction(payment);
+              flushDone = true;
             }
           }
           if (!payment.getAccount().getCurrency().equals(payment.getCurrency())
               && getConversionRateDocument(payment).size() == 0) {
             insertConversionRateDocument(payment);
+            flushDone = true;
           }
         } finally {
-          OBDal.getInstance().flush();
+          if (!flushDone) {
+            OBDal.getInstance().flush();
+          }
           OBContext.restorePreviousMode();
         }
 
@@ -1320,14 +1339,8 @@
     OBContext.setAdminMode();
     try {
       FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, 
strRecordId);
-      OBCriteria<FinAccPaymentMethod> obCriteria = 
OBDal.getInstance().createCriteria(
-          FinAccPaymentMethod.class);
-      obCriteria.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_ACCOUNT, 
payment.getAccount()));
-      
obCriteria.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD,
-          payment.getPaymentMethod()));
-      obCriteria.setFilterOnReadableClients(false);
-      obCriteria.setFilterOnReadableOrganization(false);
-      List<FinAccPaymentMethod> lines = obCriteria.list();
+      List<FinAccPaymentMethod> lines = payment.getPaymentMethod()
+          .getFinancialMgmtFinAccPaymentMethodList();
       List<FIN_FinancialAccountAccounting> accounts = payment.getAccount()
           .getFINFinancialAccountAcctList();
       for (FIN_FinancialAccountAccounting account : accounts) {
@@ -1360,6 +1373,7 @@
         }
       }
     } catch (Exception e) {
+      // TODO no logging... ??
       return confirmation;
     } finally {
       OBContext.restorePreviousMode();
diff -r 03456ea1fc63 -r ae25da3bd47f 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
 Tue May 26 17:30:26 2015 +0200
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
 Wed May 27 22:53:11 2015 +0000
@@ -99,6 +99,7 @@
         // ***********************
         // Process Transaction
         // ***********************
+
         boolean orgLegalWithAccounting = FIN_Utility.periodControlOpened(
             FIN_FinaccTransaction.TABLE_NAME, transaction.getId(), 
FIN_FinaccTransaction.TABLE_NAME
                 + "_ID", "LE");
@@ -110,6 +111,7 @@
           msg = OBMessageUtils.messageBD("PeriodNotAvailable");
           throw new OBException(msg);
         }
+
         final FIN_FinancialAccount financialAccount = transaction.getAccount();
         
financialAccount.setCurrentBalance(financialAccount.getCurrentBalance().add(
             
transaction.getDepositAmount().subtract(transaction.getPaymentAmount())));
@@ -165,7 +167,6 @@
         transaction.setAprmProcessed("R");
         OBDal.getInstance().save(financialAccount);
         OBDal.getInstance().save(transaction);
-        OBDal.getInstance().flush();
 
       } else if (strAction.equals("R")) {
         // ***********************
@@ -196,10 +197,14 @@
               ConversionRateDoc.class);
           
obc.add(Restrictions.eq(ConversionRateDoc.PROPERTY_FINANCIALACCOUNTTRANSACTION,
               transaction));
+          boolean dataRemoved = false;
           for (ConversionRateDoc conversionRateDoc : obc.list()) {
+            dataRemoved = true;
             OBDal.getInstance().remove(conversionRateDoc);
           }
-          OBDal.getInstance().flush();
+          if (dataRemoved) {
+            OBDal.getInstance().flush();
+          }
         } finally {
           OBContext.restorePreviousMode();
         }
@@ -209,7 +214,6 @@
             
.subtract(transaction.getDepositAmount()).add(transaction.getPaymentAmount()));
         OBDal.getInstance().save(financialAccount);
         OBDal.getInstance().save(transaction);
-        OBDal.getInstance().flush();
         if (payment != null) {
           Boolean invoicePaidold = false;
           for (FIN_PaymentDetail pd : payment.getFINPaymentDetailList()) {
@@ -233,9 +237,9 @@
         }
         transaction.setAprmProcessed("P");
         OBDal.getInstance().save(transaction);
-        OBDal.getInstance().flush();
       }
     } finally {
+      OBDal.getInstance().flush();
       OBContext.restorePreviousMode();
     }
   }
diff -r 03456ea1fc63 -r ae25da3bd47f 
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml  
Tue May 26 17:30:26 2015 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml  
Wed May 27 22:53:11 2015 +0000
@@ -6,7 +6,7 @@
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <NAME><![CDATA[JBoss Weld]]></NAME>
-<!--C70732EA90A14EC0916078B85CC33D2D-->  
<VERSION><![CDATA[1.1.26774]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  
<VERSION><![CDATA[1.1.26790]]></VERSION>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <DESCRIPTION><![CDATA[JBoss 
Weld]]></DESCRIPTION>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <HELP><![CDATA[Provides the JBoss 
Weld framework: Java Contexts and Dependency Injection for the Java EE platform 
(CDI). For more information see http://seamframework.org/Weld]]></HELP>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  
<URL><![CDATA[http://forge.openbravo.com/projects/weld]]></URL>
diff -r 03456ea1fc63 -r ae25da3bd47f 
modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
--- 
a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
       Tue May 26 17:30:26 2015 +0200
+++ 
b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
       Wed May 27 22:53:11 2015 +0000
@@ -7,7 +7,7 @@
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<AD_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_MODULE_ID>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<STARTVERSION><![CDATA[3.0.26774]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<STARTVERSION><![CDATA[3.0.26790]]></STARTVERSION>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
diff -r 03456ea1fc63 -r ae25da3bd47f 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
--- 
a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
 Tue May 26 17:30:26 2015 +0200
+++ 
b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
 Wed May 27 22:53:11 2015 +0000
@@ -6,7 +6,7 @@
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <NAME><![CDATA[User Interface 
Application]]></NAME>
-<!--9BA0836A3CD74EE4AB48753A47211BCC-->  
<VERSION><![CDATA[2.1.26774]]></VERSION>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  
<VERSION><![CDATA[2.1.26790]]></VERSION>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <DESCRIPTION><![CDATA[Provides the 
main application components for the openbravo user interface]]></DESCRIPTION>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  <HELP><![CDATA[Provides the main 
application components for the openbravo user interface. The main layout 
incorporates a navigation bar and a main view area.]]></HELP>
 <!--9BA0836A3CD74EE4AB48753A47211BCC-->  
<URL><![CDATA[http://forge.openbravo.com/projects/clientapplication]]></URL>
diff -r 03456ea1fc63 -r ae25da3bd47f 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
--- 
a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
      Tue May 26 17:30:26 2015 +0200

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

Reply via email to