details:   /erp/devel/pi/rev/b46c3cec13b2
changeset: 8496:b46c3cec13b2
user:      Anandan Narasimachari Monnin <anandan.monnin <at> openbravo.com>
date:      Tue Oct 05 12:54:56 2010 +0530
summary:   Fixes 14594 The Payment Method is selected then Financial Account is 
automatically set

diffstat:

 src/org/openbravo/erpCommon/ad_callouts/SE_PaymentMethod_FinAccount.java |  10 
++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (25 lines):

diff -r 578dcf9eafae -r b46c3cec13b2 
src/org/openbravo/erpCommon/ad_callouts/SE_PaymentMethod_FinAccount.java
--- a/src/org/openbravo/erpCommon/ad_callouts/SE_PaymentMethod_FinAccount.java  
Mon Oct 04 13:14:33 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_callouts/SE_PaymentMethod_FinAccount.java  
Tue Oct 05 12:54:56 2010 +0530
@@ -69,15 +69,17 @@
       obc.add(Expression.eq(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD, 
paymentMethod));
 
       for (FinAccPaymentMethod accPm : obc.list()) {
-        if (srtSelectedFinancialAccount.equals(accPm.getAccount().getId()))
+        if (srtSelectedFinancialAccount.equals(accPm.getAccount().getId())) {
           info
               .addSelectResult(accPm.getAccount().getId(), 
accPm.getAccount().getIdentifier(), true);
-        else
+        } else if (srtSelectedFinancialAccount.isEmpty()) {
+          srtSelectedFinancialAccount = accPm.getAccount().getIdentifier();
+          info.addSelectResult(accPm.getAccount().getId(), 
srtSelectedFinancialAccount, true);
+        } else {
           info.addSelectResult(accPm.getAccount().getId(), 
accPm.getAccount().getIdentifier());
+        }
       }
     }
-
     info.endSelect();
-
   }
 }

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to