Fixes issue 21899: Wrong error when processing payment
authorIoritz Cia <ioritz.cia@openbravo.com>
Tue, 20 Nov 2012 15:48:41 +0100
changeset 18586 b506447bc782
parent 18585 c0bf245121ad
child 18587 59865865bbe8
Fixes issue 21899: Wrong error when processing payment
choosing 'Refund to customer' option.
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java	Tue Nov 20 10:43:12 2012 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java	Tue Nov 20 15:48:41 2012 +0100
@@ -226,7 +226,8 @@
               message = FIN_AddPayment.processPayment(vars, this,
                   (strAction.equals("PRP") || strAction.equals("PPP")) ? "P" : "D", payment);
             }
-            if (strDifferenceAction.equals("refund")) {
+            if (strDifferenceAction.equals("refund")
+                && !"Error".equalsIgnoreCase(message.getType())) {
               Boolean newPayment = !payment.getFINPaymentDetailList().isEmpty();
               FIN_Payment refundPayment = FIN_AddPayment.createRefundPayment(this, vars, payment,
                   refundAmount.negate(), exchangeRate);