Fixes Issue 25651. Fixes wrong code position.
authorDavid Miguelez <david.miguelez@openbravo.com>
Tue, 04 Feb 2014 17:44:22 +0100
changeset 21995 903b4584a72e
parent 21994 766e530af00f
child 21996 fd2c8a575d9f
Fixes Issue 25651. Fixes wrong code position.
src/org/openbravo/erpCommon/ad_forms/AcctServer.java
--- a/src/org/openbravo/erpCommon/ad_forms/AcctServer.java	Fri Jan 31 13:43:17 2014 +0100
+++ b/src/org/openbravo/erpCommon/ad_forms/AcctServer.java	Tue Feb 04 17:44:22 2014 +0100
@@ -2848,6 +2848,11 @@
 
     HashMap<String, BigDecimal> amountAndWriteOff = new HashMap<String, BigDecimal>();
 
+    // Default return values
+    amountAndWriteOff.put("amount", paymentDetails.get(currentPaymentDetailIndex).getAmount());
+    amountAndWriteOff.put("writeoff", paymentDetails.get(currentPaymentDetailIndex)
+        .getWriteoffAmount());
+
     // If the Payment Detail has either an Invoice or an Order associated to it
     if (psi != null || pso != null) {
       // If the Payment Detail has no Order associated to it, or it has an Invoice associated and is
@@ -2879,11 +2884,6 @@
       }
     }
 
-    // In any other case
-    amountAndWriteOff.put("amount", paymentDetails.get(currentPaymentDetailIndex).getAmount());
-    amountAndWriteOff.put("writeoff", paymentDetails.get(currentPaymentDetailIndex)
-        .getWriteoffAmount());
-
     return amountAndWriteOff;
 
   }