Fixes Issue 31457:Invoice with negative amount with an order with lower
authorAtul Gaware <atul.gaware@openbravo.com>
Tue, 29 Dec 2015 15:37:32 +0530
changeset 28256 cac91026199d
parent 28255 27ef13611fff
child 28257 e913a860b967
Fixes Issue 31457:Invoice with negative amount with an order with lower
amount is set as not paid. Positive and negative schedule details pending

Negative amount comparison in Add Payment Action Handler changed.
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java	Wed Jan 13 17:43:20 2016 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java	Tue Dec 29 15:37:32 2015 +0530
@@ -333,7 +333,7 @@
         // Manage negative amounts
         if ((remainingAmount.signum() > 0 && remainingAmount.compareTo(outstandingAmount) >= 0)
             || ((remainingAmount.signum() < 0 && outstandingAmount.signum() < 0) && (remainingAmount
-                .compareTo(outstandingAmount) <= 0))) {
+                .compareTo(outstandingAmount) >= 0))) {
           assignAmount = outstandingAmount;
           remainingAmount = remainingAmount.subtract(outstandingAmount);
         } else {