Fixes Issue 25651. Fixes wrong code position.
authorDavid Miguelez <david.miguelez@openbravo.com>
Tue, 04 Feb 2014 17:44:22 +0100
changeset 22026 76d795dfdcd7
parent 22025 51ffa3676eca
child 22027 76dfa3fc16df
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
@@ -2852,6 +2852,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
@@ -2883,11 +2888,6 @@
       }
     }
 
-    // In any other case
-    amountAndWriteOff.put("amount", paymentDetails.get(currentPaymentDetailIndex).getAmount());
-    amountAndWriteOff.put("writeoff", paymentDetails.get(currentPaymentDetailIndex)
-        .getWriteoffAmount());
-
     return amountAndWriteOff;
 
   }