details:   https://code.openbravo.com/erp/devel/main/rev/53a25921251d
changeset: 26216:53a25921251d
user:      Jon Alegría <jon.alegria <at> openbravo.com>
date:      Mon Mar 23 12:52:19 2015 +0100
summary:   Fixes issue 0029370: Exception in Purchase Invoice dimensional
report, comparative option set

details:   https://code.openbravo.com/erp/devel/main/rev/41e10f964f97
changeset: 26217:41e10f964f97
user:      Unai Martirena <unai.martirena <at> openbravo.com>
date:      Mon Mar 16 17:07:49 2015 +0100
summary:   Fixes bug 29252: Payment method in add payment does not display 
inactive values

The whereClause of fin_payment_method combo in add payment has been changed to 
not display never payment methods that are inactive.

Also the default values of Add Payment window that are opened from all windows 
has been changed to not set as default a Payment Method that is inactive, even 
if it is marked as default in the financial account or if is the default 
payment method of the Business Partner.

A change has also been done in OB.APRM.AddPayment.paymentMethodMulticurrency 
javascript function. In Add Payment window, while clearing Payment Method combo 
manually, the Financial Account was also being cleared. This was causing a 
problem when opening from Financial Account, because in this case novalues were 
displayed on both combos any more. It has been fixed to not to clear the 
Financial Account combo in this case as always is going to be the same, so it 
is no necessary to clear it.

details:   https://code.openbravo.com/erp/devel/main/rev/df7e81f69e35
changeset: 26218:df7e81f69e35
user:      Sandra Huguet <sandra.huguet <at> openbravo.com>
date:      Mon Mar 23 12:56:19 2015 +0100
summary:   related to issue 29252 update Copyright

details:   https://code.openbravo.com/erp/devel/main/rev/b9ec4f6b4ca3
changeset: 26219:b9ec4f6b4ca3
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Tue Mar 17 11:56:11 2015 +0100
summary:   Fixes issue 29257: Avoid error when posting a multi-general ledger 
G/L Journal

General Ledger will be taken from G/L Item instead from Simple G/L Journal when 
it is marked as multi-general ledger, because in this case General Ledger from 
Simple G/L Journal will be empty

details:   https://code.openbravo.com/erp/devel/main/rev/ed3abcacc08c
changeset: 26220:ed3abcacc08c
user:      RM packaging bot <staff.rm <at> openbravo.com>
date:      Mon Mar 23 15:23:47 2015 +0000
summary:   CI: merge back from main

details:   https://code.openbravo.com/erp/devel/main/rev/3da15b275c37
changeset: 26221:3da15b275c37
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Mon Mar 23 17:14:45 2015 +0100
summary:   Fixes bug 29374: Warehouse field of Manage Reservation P&E shows a 
proper value

The is a bug in that P&E, reported here [1], that makes the FIC return the 
wrong value for the warehouse field of the Manage Reservation P&E window. 
Before [2] was fixed, [1] did not have any consequences, as the value returned 
by the FIC was not set to the row being edited.

To fix this, the values returned by the FIC are only set if the field is 
editable. [1] will have to be fixed anyway, because even if now it does not 
crete problems in this flow, it could be causing problems in others.

[1] https://issues.openbravo.com/view.php?id=29381
[2] https://issues.openbravo.com/view.php?id=28727

details:   https://code.openbravo.com/erp/devel/main/rev/bf012d0fa4b1
changeset: 26222:bf012d0fa4b1
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Tue Mar 17 13:03:33 2015 +0100
summary:   Fixes issue 29315: Wrong accounts when posting multi-general ledger 
G/L Journal

When getting accounts from GL Item (while posting a Simple G/L Journal setted 
as multi-general ledger), they were setted wrongly to accounting lines

details:   https://code.openbravo.com/erp/devel/main/rev/e4c0edce1bc9
changeset: 26223:e4c0edce1bc9
user:      Unai Martirena <unai.martirena <at> openbravo.com>
date:      Mon Mar 23 17:22:40 2015 +0100
summary:   Related to bug 29315: Add copyright header

details:   https://code.openbravo.com/erp/devel/main/rev/c2fb827a4f00
changeset: 26224:c2fb827a4f00
user:      Reinaldo Guerra <reinaldo.guerra <at> peoplewalking.com>
date:      Wed Mar 18 16:47:06 2015 -0500
summary:   Fixed bug 29162: Add Transaction process does not consider well 
amounts of 0.00

The "compareTo" method was taken into account instead of "equals", to compare 
BigDecimal.ZERO value with 0.00 (a BigDecimal value with a scale), inside 
AddTransactionFilterExpression class.
This change was made because BigDecimal "equals", compares the value and the 
scale, returning false when comparing 0 with 0.00, while "compareTo" only 
compares values, so considers amounts 0.00 and 0 as the same values. Now 
transaction type is correctly set to BP Deposit, when "dramount" field is set 
to 0.00.

details:   https://code.openbravo.com/erp/devel/main/rev/31a785774e3e
changeset: 26225:31a785774e3e
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Mon Mar 23 17:05:15 2015 +0100
summary:   Related to issue 29162: Update copyright

details:   https://code.openbravo.com/erp/devel/main/rev/86f26739f045
changeset: 26226:86f26739f045
user:      Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
date:      Mon Mar 23 17:27:10 2015 +0100
summary:   Related to issue 29162: Make code more clear

details:   https://code.openbravo.com/erp/devel/main/rev/63f9617f42fb
changeset: 26227:63f9617f42fb
user:      RM packaging bot <staff.rm <at> openbravo.com>
date:      Tue Mar 24 02:28:46 2015 +0000
summary:   CI: update AD_MODULE to version 26226

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-db/database/sourcedata/OBUISEL_SELECTOR.xml
                                           |   2 +-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesHandler.java
     |  39 ++++++++-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddTransactionFilterExpression.java
     |  25 +++++-
 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDefaultValues.java
 |  16 ++-
 
modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
                                 |   7 +-
 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
           |   4 +-
 
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/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/sourcedata/AD_MODULE.xml                                       
                                                |   4 +-
 src/org/openbravo/erpCommon/ad_forms/DocGLJournal_data.xsql                    
                                                |   4 +-
 src/org/openbravo/erpCommon/ad_forms/DocLine_GLJournal.java                    
                                                |  22 +++++-
 src/org/openbravo/erpCommon/ad_reports/SimpleDimensionalComparative.jrxml      
                                                |   2 +-
 52 files changed, 181 insertions(+), 110 deletions(-)

diffs (truncated from 1207 to 300 lines):

diff -r 35a4e54c3ffc -r 63f9617f42fb 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml 
    Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml 
    Tue Mar 24 02:28:46 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.26211]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  
<VERSION><![CDATA[3.0.26226]]></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 35a4e54c3ffc -r 63f9617f42fb 
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
  Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
  Tue Mar 24 02:28:46 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.26211]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  
<STARTVERSION><![CDATA[2.1.26226]]></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.26211]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  
<STARTVERSION><![CDATA[3.0.26226]]></STARTVERSION>
 <!--B97FC854C6DD41E692161585645A900F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--B97FC854C6DD41E692161585645A900F-->  
<DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--B97FC854C6DD41E692161585645A900F-->  
<DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
diff -r 35a4e54c3ffc -r 63f9617f42fb 
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml
--- 
a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml
      Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml
      Tue Mar 24 02:28:46 2015 +0000
@@ -186,7 +186,7 @@
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <NAME><![CDATA[Payment 
Method]]></NAME>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  
<AD_REFERENCE_ID><![CDATA[E664E415582A483DBBC91DEF256FB9E6]]></AD_REFERENCE_ID>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  
<AD_TABLE_ID><![CDATA[0B44DF7A2A854784BF34AD49C58647D7]]></AD_TABLE_ID>
-<!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <WHERECLAUSE><![CDATA[exists (select 
1 from FinancialMgmtFinAccPaymentMethod fpm where fpm.paymentMethod = e  and  
(case when @issotrx@ = 'true' then fpm.payinAllow else fpm.payoutAllow end) = 
true   and (fpm.account.id =  @fin_financial_account_id@ or @inpwindowId@ <> 
'94EAA455D2644E04AB25D93BE5157B6D'))]]></WHERECLAUSE>
+<!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <WHERECLAUSE><![CDATA[exists (select 
1 from FinancialMgmtFinAccPaymentMethod fpm where fpm.paymentMethod = e  and  
(case when @issotrx@ = 'true' then fpm.payinAllow else fpm.payoutAllow end) = 
true   and (fpm.account.id =  @fin_financial_account_id@ or @inpwindowId@ <> 
'94EAA455D2644E04AB25D93BE5157B6D') and fpm.active = true)]]></WHERECLAUSE>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  
<OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  
<SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
diff -r 35a4e54c3ffc -r 63f9617f42fb 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesHandler.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesHandler.java
        Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesHandler.java
        Tue Mar 24 02:28:46 2015 +0000
@@ -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):  ______________________________________.
  ************************************************************************
@@ -27,17 +27,21 @@
 import org.apache.commons.lang.StringUtils;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
+import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.security.OrganizationStructureProvider;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
+import org.openbravo.model.financialmgmt.payment.FIN_PaymentMethod;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentScheduleDetail;
+import org.openbravo.model.financialmgmt.payment.FinAccPaymentMethod;
 
 @RequestScoped
 // Public class to allow extend the functionality, for example Add Payment 
popup opening from menu
@@ -316,6 +320,8 @@
    */
   public String getDefaultPaymentMethod(Map<String, String> requestMap) throws 
JSONException {
     String strContext = requestMap.get("context");
+    String strFinPaymentMethodId = null;
+    String strFinancialAccountId = null;
     if (strContext == null) {
       return "";
     }
@@ -323,16 +329,28 @@
     if (context.has("inpfinPaymentmethodId")
         && context.get("inpfinPaymentmethodId") != JSONObject.NULL
         && StringUtils.isNotEmpty(context.getString("inpfinPaymentmethodId"))) 
{
-      return context.getString("inpfinPaymentmethodId");
+      strFinPaymentMethodId = context.getString("inpfinPaymentmethodId");
+    }
+    strFinancialAccountId = getDefaultFinancialAccount(requestMap);
+    if (strFinPaymentMethodId != null && strFinancialAccountId != null) {
+      if (getFinancialAccountPaymentMethod(strFinPaymentMethodId, 
strFinancialAccountId) != null) {
+        return strFinPaymentMethodId;
+      }
     }
     String strBPartnerId = getDefaultReceivedFrom(requestMap);
     if (StringUtils.isNotEmpty(strBPartnerId)) {
       BusinessPartner businessPartner = 
OBDal.getInstance().get(BusinessPartner.class,
           strBPartnerId);
       boolean isSOTrx = "Y".equals(getDefaultIsSOTrx(requestMap));
-      if (isSOTrx && businessPartner.getPaymentMethod() != null) {
+      if (isSOTrx
+          && businessPartner.getPaymentMethod() != null
+          && 
getFinancialAccountPaymentMethod(businessPartner.getPaymentMethod().getId(),
+              strFinancialAccountId) != null) {
         return businessPartner.getPaymentMethod().getId();
-      } else if (!isSOTrx && businessPartner.getPOPaymentMethod() != null) {
+      } else if (!isSOTrx
+          && businessPartner.getPOPaymentMethod() != null
+          && 
getFinancialAccountPaymentMethod(businessPartner.getPOPaymentMethod().getId(),
+              strFinancialAccountId) != null) {
         return businessPartner.getPOPaymentMethod().getId();
       }
     }
@@ -404,4 +422,17 @@
     }
   }
 
+  private FinAccPaymentMethod getFinancialAccountPaymentMethod(String 
paymentMethodId,
+      String financialAccountId) {
+    OBCriteria<FinAccPaymentMethod> obc = OBDal.getInstance().createCriteria(
+        FinAccPaymentMethod.class);
+    obc.setFilterOnReadableOrganization(false);
+    obc.setMaxResults(1);
+    obc.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_ACCOUNT,
+        OBDal.getInstance().get(FIN_FinancialAccount.class, 
financialAccountId)));
+    obc.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD,
+        OBDal.getInstance().get(FIN_PaymentMethod.class, paymentMethodId)));
+    return (FinAccPaymentMethod) obc.uniqueResult();
+  }
+
 }
diff -r 35a4e54c3ffc -r 63f9617f42fb 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddTransactionFilterExpression.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddTransactionFilterExpression.java
        Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddTransactionFilterExpression.java
        Tue Mar 24 02:28:46 2015 +0000
@@ -1,3 +1,22 @@
+/*
+ *************************************************************************
+ * 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-2015 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
 package org.openbravo.advpaymentmngt.filterexpression;
 
 import java.math.BigDecimal;
@@ -91,7 +110,7 @@
     String bankStatementLineId = context.getString("bankStatementLineId");
     FIN_BankStatementLine bankstatementline = 
OBDal.getInstance().get(FIN_BankStatementLine.class,
         bankStatementLineId);
-    if (!(bankstatementline.getDramount().equals(BigDecimal.ZERO))) {
+    if (bankstatementline.getDramount().compareTo(BigDecimal.ZERO) != 0) {
       return "BPW";
     } else {
       return "BPD";
@@ -137,7 +156,7 @@
     String bankStatementLineId = context.getString("bankStatementLineId");
     FIN_BankStatementLine bankstatementline = 
OBDal.getInstance().get(FIN_BankStatementLine.class,
         bankStatementLineId);
-    if (!(bankstatementline.getDramount().equals(BigDecimal.ZERO))) {
+    if (bankstatementline.getDramount().compareTo(BigDecimal.ZERO) != 0) {
       return "0.00";
     } else {
       return bankstatementline.getCramount().toString();
@@ -149,7 +168,7 @@
     String bankStatementLineId = context.getString("bankStatementLineId");
     FIN_BankStatementLine bankstatementline = 
OBDal.getInstance().get(FIN_BankStatementLine.class,
         bankStatementLineId);
-    if (!(bankstatementline.getDramount().equals(BigDecimal.ZERO))) {
+    if (bankstatementline.getDramount().compareTo(BigDecimal.ZERO) != 0) {
       return bankstatementline.getDramount().toString();
     } else {
       return "0.00";
diff -r 35a4e54c3ffc -r 63f9617f42fb 
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDefaultValues.java
--- 
a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDefaultValues.java
    Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDefaultValues.java
    Tue Mar 24 02:28:46 2015 +0000
@@ -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):  ______________________________________.
  ************************************************************************
@@ -170,16 +170,18 @@
     FinAccPaymentMethod anyFinAccPaymentMethod = null;
     for (FinAccPaymentMethod finAccPaymentMethod : 
getFinancialAccount(requestMap)
         .getFinancialMgmtFinAccPaymentMethodList()) {
-      if (finAccPaymentMethod.isDefault()) {
+      if (finAccPaymentMethod.isActive()) {
+        if (finAccPaymentMethod.isDefault()) {
+          if ((isReceipt && finAccPaymentMethod.isPayinAllow())
+              || (!isReceipt && finAccPaymentMethod.isPayoutAllow())) {
+            return finAccPaymentMethod.getPaymentMethod().getId();
+          }
+        }
         if ((isReceipt && finAccPaymentMethod.isPayinAllow())
             || (!isReceipt && finAccPaymentMethod.isPayoutAllow())) {
-          return finAccPaymentMethod.getPaymentMethod().getId();
+          anyFinAccPaymentMethod = finAccPaymentMethod;
         }
       }
-      if ((isReceipt && finAccPaymentMethod.isPayinAllow())
-          || (!isReceipt && finAccPaymentMethod.isPayoutAllow())) {
-        anyFinAccPaymentMethod = finAccPaymentMethod;
-      }
     }
     return anyFinAccPaymentMethod != null ? 
anyFinAccPaymentMethod.getPaymentMethod().getId() : "";
   }
diff -r 35a4e54c3ffc -r 63f9617f42fb 
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 Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js
    Tue Mar 24 02:28:46 2015 +0000
@@ -161,7 +161,8 @@
       isSOTrx = form.getItem('issotrx').getValue(),
       currencyId = form.getItem('c_currency_id').getValue(),
       paymentDate = form.getItem('payment_date').getValue(),
-      orgId = form.getItem('ad_org_id').getValue();
+      orgId = form.getItem('ad_org_id').getValue(),
+      trxtype = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() 
: "";
 
   callback = function (response, data, request) {
     var isShown = false;
@@ -173,9 +174,9 @@
       form.getItem('c_currency_id').valueMap[data.currencyId] = 
data.currencyIdIdentifier;
     }
     isShown = data.isPayIsMulticurrency && currencyId !== data.currencyToId && 
currencyId !== undefined;
-    if (data.isWrongFinancialAccount) {
+    if (data.isWrongFinancialAccount && trxtype === "") {
       form.getItem('fin_financial_account_id').setValue('');
-    } else {
+    } else if (!data.isWrongFinancialAccount){
       if (!form.getItem('c_currency_to_id').valueMap) {
         form.getItem('c_currency_to_id').valueMap = {};
       }
diff -r 35a4e54c3ffc -r 63f9617f42fb 
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  
Wed Mar 11 13:52:26 2015 +0100
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml  
Tue Mar 24 02:28:46 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.26211]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  
<VERSION><![CDATA[1.1.26226]]></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 35a4e54c3ffc -r 63f9617f42fb 
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
       Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
       Tue Mar 24 02:28:46 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.26211]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<STARTVERSION><![CDATA[3.0.26226]]></STARTVERSION>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  
<DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
diff -r 35a4e54c3ffc -r 63f9617f42fb 
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
 Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE.xml
 Tue Mar 24 02:28:46 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.26211]]></VERSION>
+<!--9BA0836A3CD74EE4AB48753A47211BCC-->  
<VERSION><![CDATA[2.1.26226]]></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 35a4e54c3ffc -r 63f9617f42fb 
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
      Wed Mar 11 13:52:26 2015 +0100
+++ 
b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml
      Tue Mar 24 02:28:46 2015 +0000
@@ -7,7 +7,7 @@
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  
<AD_DEPENDENT_MODULE_ID><![CDATA[A44B9BA75C354D8FB2E3F7D6EB6BFDC4]]></AD_DEPENDENT_MODULE_ID>
-<!--15D7CE8D95D043189162DBABA54A1F61-->  
<STARTVERSION><![CDATA[2.1.26211]]></STARTVERSION>
+<!--15D7CE8D95D043189162DBABA54A1F61-->  
<STARTVERSION><![CDATA[2.1.26226]]></STARTVERSION>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--15D7CE8D95D043189162DBABA54A1F61-->  <DEPENDANT_MODULE_NAME><![CDATA[JSON 
Datasource]]></DEPENDANT_MODULE_NAME>

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to