Fixes issue 22850: Impossible creating Refund Payment refunding credit amount.
authorIoritz Cia <ioritz.cia@openbravo.com>
Mon, 21 Jan 2013 10:48:37 +0100
changeset 19367 c669075b9985
parent 19366 a7c5b8bf4433
child 19368 445835932ea4
Fixes issue 22850: Impossible creating Refund Payment refunding credit amount.
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	Mon Jan 21 10:24:55 2013 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java	Mon Jan 21 10:48:37 2013 +0100
@@ -276,7 +276,7 @@
                   (strAction.equals("PRP") || strAction.equals("PPP")) ? "P" : "D", payment);
             }
             if (strDifferenceAction.equals("refund")
-                && !"Error".equalsIgnoreCase(message.getType())) {
+                && (message == null || !"Error".equalsIgnoreCase(message.getType()))) {
               Boolean newPayment = !payment.getFINPaymentDetailList().isEmpty();
               FIN_Payment refundPayment = FIN_AddPayment.createRefundPayment(this, vars, payment,
                   refundAmount.negate(), exchangeRate);