details:   /erp/devel/pi/rev/72eb9a320f5f
changeset: 7792:72eb9a320f5f
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Thu Jul 01 16:30:29 2010 +0200
summary:   Fixes issue 0013859: Wrong error message for accounting of new 
payment flow documents

details:   /erp/devel/pi/rev/f9da16b458d1
changeset: 7793:f9da16b458d1
user:      Eduardo Argal Guibert <eduardo.argal <at> openbravo.com>
date:      Thu Jul 01 16:33:12 2010 +0200
summary:   Merge

diffstat:

 src-db/database/lib/dbsourcemanager.jar                           |    0 
 src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java |   55 
++++---
 src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java           |   17 +-
 src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java    |   69 
+++++----
 4 files changed, 85 insertions(+), 56 deletions(-)

diffs (truncated from 351 to 300 lines):

diff -r c74447443fa3 -r f9da16b458d1 src-db/database/lib/dbsourcemanager.jar
Binary file src-db/database/lib/dbsourcemanager.jar has changed
diff -r c74447443fa3 -r f9da16b458d1 
src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java Thu Jul 
01 16:30:59 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINFinAccTransaction.java Thu Jul 
01 16:33:12 2010 +0200
@@ -378,27 +378,29 @@
           .getFINFinancialAccountAcctList();
       for (FIN_FinancialAccountAccounting account : accounts) {
         if (payment.isReceipt()) {
-          if (lines.get(0).getUponReceiptUse().equals("INT")
+          if (("INT").equals(lines.get(0).getUponReceiptUse())
               && account.getInTransitPaymentAccountIN() != null)
             confirmation = true;
-          else if (lines.get(0).getUponReceiptUse().equals("DEP")
+          else if (("DEP").equals(lines.get(0).getUponReceiptUse())
               && account.getDepositAccount() != null)
             confirmation = true;
-          else if (lines.get(0).getUponReceiptUse().equals("CLE")
+          else if (("CLE").equals(lines.get(0).getUponReceiptUse())
               && account.getClearedPaymentAccount() != null)
             confirmation = true;
         } else {
-          if (lines.get(0).getUponPaymentUse().equals("INT")
+          if (("INT").equals(lines.get(0).getUponPaymentUse())
               && account.getFINOutIntransitAcct() != null)
             confirmation = true;
-          else if (lines.get(0).getUponPaymentUse().equals("WIT")
+          else if (("WIT").equals(lines.get(0).getUponPaymentUse())
               && account.getWithdrawalAccount() != null)
             confirmation = true;
-          else if (lines.get(0).getUponPaymentUse().equals("CLE")
+          else if (("CLE").equals(lines.get(0).getUponPaymentUse())
               && account.getClearedPaymentAccountOUT() != null)
             confirmation = true;
         }
       }
+    } catch (Exception e) {
+      return confirmation;
     } finally {
       OBContext.restorePreviousMode();
     }
@@ -423,28 +425,32 @@
       List<FIN_FinancialAccountAccounting> accounts = payment.getAccount()
           .getFINFinancialAccountAcctList();
       for (FIN_FinancialAccountAccounting account : accounts) {
+        if (confirmation)
+          return confirmation;
         if (payment.isReceipt()) {
-          if (lines.get(0).getUponDepositUse().equals("INT")
+          if (("INT").equals(lines.get(0).getUponDepositUse())
               && account.getInTransitPaymentAccountIN() != null)
             confirmation = true;
-          else if (lines.get(0).getUponDepositUse().equals("DEP")
+          else if (("DEP").equals(lines.get(0).getUponDepositUse())
               && account.getDepositAccount() != null)
             confirmation = true;
-          else if (lines.get(0).getUponDepositUse().equals("CLE")
+          else if (("CLE").equals(lines.get(0).getUponDepositUse())
               && account.getClearedPaymentAccount() != null)
             confirmation = true;
         } else {
-          if (lines.get(0).getUponWithdrawalUse().equals("INT")
+          if (("INT").equals(lines.get(0).getUponWithdrawalUse())
               && account.getFINOutIntransitAcct() != null)
             confirmation = true;
-          else if (lines.get(0).getUponWithdrawalUse().equals("WIT")
+          else if (("WIT").equals(lines.get(0).getUponWithdrawalUse())
               && account.getWithdrawalAccount() != null)
             confirmation = true;
-          else if (lines.get(0).getUponWithdrawalUse().equals("CLE")
+          else if (("CLE").equals(lines.get(0).getUponWithdrawalUse())
               && account.getClearedPaymentAccountOUT() != null)
             confirmation = true;
         }
       }
+    } catch (Exception e) {
+      return confirmation;
     } finally {
       OBContext.restorePreviousMode();
     }
@@ -474,39 +480,46 @@
         obCriteria.setFilterOnReadableOrganization(false);
         List<FinAccPaymentMethod> lines = obCriteria.list();
         for (FIN_FinancialAccountAccounting account : accounts) {
+          if (confirmation)
+            return confirmation;
           if (payment.isReceipt()) {
-            if (lines.get(0).getUponDepositUse().equals("INT")
+            if (("INT").equals(lines.get(0).getUponDepositUse())
                 && account.getInTransitPaymentAccountIN() != null)
               confirmation = true;
-            else if (lines.get(0).getUponDepositUse().equals("DEP")
+            else if (("DEP").equals(lines.get(0).getUponDepositUse())
                 && account.getDepositAccount() != null)
               confirmation = true;
-            else if (lines.get(0).getUponDepositUse().equals("CLE")
+            else if (("CLE").equals(lines.get(0).getUponDepositUse())
                 && account.getClearedPaymentAccount() != null)
               confirmation = true;
           } else {
-            if (lines.get(0).getUponWithdrawalUse().equals("INT")
+            if (("INT").equals(lines.get(0).getUponWithdrawalUse())
                 && account.getFINOutIntransitAcct() != null)
               confirmation = true;
-            else if (lines.get(0).getUponWithdrawalUse().equals("WIT")
+            else if (("WIT").equals(lines.get(0).getUponWithdrawalUse())
                 && account.getWithdrawalAccount() != null)
               confirmation = true;
-            else if (lines.get(0).getUponWithdrawalUse().equals("CLE")
+            else if (("CLE").equals(lines.get(0).getUponWithdrawalUse())
                 && account.getClearedPaymentAccountOUT() != null)
               confirmation = true;
           }
         }
       } else {
         for (FIN_FinancialAccountAccounting account : accounts) {
-          if ((transaction.getTransactionType().equals(TRXTYPE_BPDeposit) && 
account
+          if (confirmation)
+            return confirmation;
+          if ((TRXTYPE_BPDeposit.equals(transaction.getTransactionType()) && 
account
               .getDepositAccount() != null)
-              || 
(transaction.getTransactionType().equals(TRXTYPE_BPWithdrawal) && account
+              || 
(TRXTYPE_BPWithdrawal.equals(transaction.getTransactionType()) && account
                   .getWithdrawalAccount() != null)
-              || (transaction.getTransactionType().equals(TRXTYPE_BankFee) && 
account
+              || (TRXTYPE_BankFee.equals(transaction.getTransactionType()) && 
account
                   .getWithdrawalAccount() != null))
             confirmation = true;
         }
       }
+    } catch (Exception e) {
+      setStatus(STATUS_DocumentDisabled);
+      return confirmation;
     } finally {
       OBContext.restorePreviousMode();
     }
diff -r c74447443fa3 -r f9da16b458d1 
src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java   Thu Jul 01 
16:30:59 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINPayment.java   Thu Jul 01 
16:33:12 2010 +0200
@@ -248,29 +248,34 @@
         List<FIN_FinancialAccountAccounting> accounts = payment.getAccount()
             .getFINFinancialAccountAcctList();
         for (FIN_FinancialAccountAccounting account : accounts) {
+          if (confirmation)
+            return confirmation;
           if (payment.isReceipt()) {
-            if (lines.get(0).getUponReceiptUse().equals("INT")
+            if (("INT").equals(lines.get(0).getUponReceiptUse())
                 && account.getInTransitPaymentAccountIN() != null)
               confirmation = true;
-            else if (lines.get(0).getUponReceiptUse().equals("DEP")
+            else if (("DEP").equals(lines.get(0).getUponReceiptUse())
                 && account.getDepositAccount() != null)
               confirmation = true;
-            else if (lines.get(0).getUponReceiptUse().equals("CLE")
+            else if (("CLE").equals(lines.get(0).getUponReceiptUse())
                 && account.getClearedPaymentAccount() != null)
               confirmation = true;
           } else {
-            if (lines.get(0).getUponPaymentUse().equals("INT")
+            if (("INT").equals(lines.get(0).getUponPaymentUse())
                 && account.getFINOutIntransitAcct() != null)
               confirmation = true;
-            else if (lines.get(0).getUponPaymentUse().equals("WIT")
+            else if (("WIT").equals(lines.get(0).getUponPaymentUse())
                 && account.getWithdrawalAccount() != null)
               confirmation = true;
-            else if (lines.get(0).getUponPaymentUse().equals("CLE")
+            else if (("CLE").equals(lines.get(0).getUponPaymentUse())
                 && account.getClearedPaymentAccountOUT() != null)
               confirmation = true;
           }
         }
       }
+    } catch (Exception e) {
+      setStatus(STATUS_DocumentDisabled);
+      return confirmation;
     } finally {
       OBContext.restorePreviousMode();
     }
diff -r c74447443fa3 -r f9da16b458d1 
src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java    Thu Jul 
01 16:30:59 2010 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocFINReconciliation.java    Thu Jul 
01 16:33:12 2010 +0200
@@ -478,27 +478,29 @@
           .getFINFinancialAccountAcctList();
       for (FIN_FinancialAccountAccounting account : accounts) {
         if (payment.isReceipt()) {
-          if (lines.get(0).getUponReceiptUse().equals("INT")
+          if (("INT").equals(lines.get(0).getUponReceiptUse())
               && account.getInTransitPaymentAccountIN() != null)
             confirmation = true;
-          else if (lines.get(0).getUponReceiptUse().equals("DEP")
+          else if (("DEP").equals(lines.get(0).getUponReceiptUse())
               && account.getDepositAccount() != null)
             confirmation = true;
-          else if (lines.get(0).getUponReceiptUse().equals("CLE")
+          else if (("CLE").equals(lines.get(0).getUponReceiptUse())
               && account.getClearedPaymentAccount() != null)
             confirmation = true;
         } else {
-          if (lines.get(0).getUponPaymentUse().equals("INT")
+          if (("INT").equals(lines.get(0).getUponPaymentUse())
               && account.getFINOutIntransitAcct() != null)
             confirmation = true;
-          else if (lines.get(0).getUponPaymentUse().equals("WIT")
+          else if (("WIT").equals(lines.get(0).getUponPaymentUse())
               && account.getWithdrawalAccount() != null)
             confirmation = true;
-          else if (lines.get(0).getUponPaymentUse().equals("CLE")
+          else if (("CLE").equals(lines.get(0).getUponPaymentUse())
               && account.getClearedPaymentAccountOUT() != null)
             confirmation = true;
         }
       }
+    } catch (Exception e) {
+      return confirmation;
     } finally {
       OBContext.restorePreviousMode();
     }
@@ -522,39 +524,45 @@
         obCriteria.setFilterOnReadableOrganization(false);
         List<FinAccPaymentMethod> lines = obCriteria.list();
         for (FIN_FinancialAccountAccounting account : accounts) {
+          if (confirmation)
+            return confirmation;
           if (payment.isReceipt()) {
-            if (lines.get(0).getUponDepositUse().equals("INT")
+            if (("INT").equals(lines.get(0).getUponDepositUse())
                 && account.getInTransitPaymentAccountIN() != null)
               confirmation = true;
-            else if (lines.get(0).getUponDepositUse().equals("DEP")
+            else if (("DEP").equals(lines.get(0).getUponDepositUse())
                 && account.getDepositAccount() != null)
               confirmation = true;
-            else if (lines.get(0).getUponDepositUse().equals("CLE")
+            else if (("CLE").equals(lines.get(0).getUponDepositUse())
                 && account.getClearedPaymentAccount() != null)
               confirmation = true;
           } else {
-            if (lines.get(0).getUponWithdrawalUse().equals("INT")
+            if (("INT").equals(lines.get(0).getUponWithdrawalUse())
                 && account.getFINOutIntransitAcct() != null)
               confirmation = true;
-            else if (lines.get(0).getUponWithdrawalUse().equals("WIT")
+            else if (("WIT").equals(lines.get(0).getUponWithdrawalUse())
                 && account.getWithdrawalAccount() != null)
               confirmation = true;
-            else if (lines.get(0).getUponWithdrawalUse().equals("CLE")
+            else if (("CLE").equals(lines.get(0).getUponWithdrawalUse())
                 && account.getClearedPaymentAccountOUT() != null)
               confirmation = true;
           }
         }
       } else {
         for (FIN_FinancialAccountAccounting account : accounts) {
-          if ((transaction.getTransactionType().equals(TRXTYPE_BPDeposit) && 
account
+          if (confirmation)
+            return confirmation;
+          if ((TRXTYPE_BPDeposit.equals(transaction.getTransactionType()) && 
account
               .getDepositAccount() != null)
-              || 
(transaction.getTransactionType().equals(TRXTYPE_BPWithdrawal) && account
+              || 
(TRXTYPE_BPWithdrawal.equals(transaction.getTransactionType()) && account
                   .getWithdrawalAccount() != null)
-              || (transaction.getTransactionType().equals(TRXTYPE_BankFee) && 
account
+              || (TRXTYPE_BankFee.equals(transaction.getTransactionType()) && 
account
                   .getWithdrawalAccount() != null))
             confirmation = true;
         }
       }
+    } catch (Exception e) {
+      return confirmation;
     } finally {
       OBContext.restorePreviousMode();
     }
@@ -593,25 +601,25 @@
           List<FinAccPaymentMethod> lines = obCriteria.list();
           for (FIN_FinancialAccountAccounting account : accounts) {
             if (confirmation)
-              break;
+              return confirmation;
             if (payment.isReceipt()) {
-              if (lines.get(0).getINUponClearingUse().equals("INT")
+              if (("INT").equals(lines.get(0).getINUponClearingUse())
                   && account.getInTransitPaymentAccountIN() != null)
                 confirmation = true;
-              else if (lines.get(0).getINUponClearingUse().equals("DEP")
+              else if (("DEP").equals(lines.get(0).getINUponClearingUse())
                   && account.getDepositAccount() != null)
                 confirmation = true;
-              else if (lines.get(0).getINUponClearingUse().equals("CLE")
+              else if (("CLE").equals(lines.get(0).getINUponClearingUse())
                   && account.getClearedPaymentAccount() != null)
                 confirmation = true;
             } else {
-              if (lines.get(0).getOUTUponClearingUse().equals("INT")
+              if (("INT").equals(lines.get(0).getOUTUponClearingUse())
                   && account.getFINOutIntransitAcct() != null)
                 confirmation = true;
-              else if (lines.get(0).getOUTUponClearingUse().equals("WIT")
+              else if (("WIT").equals(lines.get(0).getOUTUponClearingUse())

------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to