From ecd176e1ba22bb7e2af97825a5d43e4c96c52073 Mon Sep 17 00:00:00 2001 From: uthadehikaru Date: Wed, 11 Apr 2012 08:27:08 +0700 Subject: [PATCH] exception handling processIt on MPaySelectionCheck --- .../src/org/compiere/model/MPaySelectionCheck.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java b/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java index 03d4e1a606..8b1bf6ee5f 100644 --- a/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java +++ b/org.adempiere.base/src/org/compiere/model/MPaySelectionCheck.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.Properties; import java.util.logging.Level; +import org.adempiere.exceptions.AdempiereException; import org.compiere.process.DocAction; import org.compiere.util.CLogger; import org.compiere.util.DB; @@ -326,8 +327,10 @@ public final class MPaySelectionCheck extends X_C_PaySelectionCheck { check.setC_Payment_ID (C_Payment_ID); check.saveEx(); // Payment process needs it - // Should start WF - payment.processIt(DocAction.ACTION_Complete); + // added AdempiereException by Amir Sehan + if (!payment.processIt(DocAction.ACTION_Complete)) + throw new AdempiereException("FAiled Processing Document - " + payment); + // end added if (!payment.save()) s_log.log(Level.SEVERE, "Payment not saved: " + payment); }