diff --git a/org.adempiere.base/src/org/compiere/model/MPayment.java b/org.adempiere.base/src/org/compiere/model/MPayment.java index 1a81d59235..8d1c01f583 100644 --- a/org.adempiere.base/src/org/compiere/model/MPayment.java +++ b/org.adempiere.base/src/org/compiere/model/MPayment.java @@ -1659,8 +1659,10 @@ public final class MPayment extends X_C_Payment order.setC_Payment_ID(getC_Payment_ID()); order.setDocAction(X_C_Order.DOCACTION_WaitComplete); order.set_TrxName(get_TrxName()); - // boolean ok = - order.processIt (X_C_Order.DOCACTION_WaitComplete); + // added AdempiereException by Amir Sehan + if (!order.processIt (X_C_Order.DOCACTION_WaitComplete)) + throw new AdempiereException("Failed Processing Document - " + order); + // end added m_processMsg = order.getProcessMsg(); order.saveEx(get_TrxName()); // Set Invoice @@ -1991,7 +1993,10 @@ public final class MPayment extends X_C_Payment if (counterDT.getDocAction() != null) { counter.setDocAction(counterDT.getDocAction()); - counter.processIt(counterDT.getDocAction()); + // added AdempiereException by Amir Sehan + if (!counter.processIt(counterDT.getDocAction())) + throw new AdempiereException("Failed Processing DOcument - " + counter); + // end added counter.saveEx(get_TrxName()); } } @@ -2055,8 +2060,10 @@ public final class MPayment extends X_C_Payment pa.saveEx(); } } - // Should start WF - alloc.processIt(DocAction.ACTION_Complete); + // added AdempiereException by Amir Sehan + if (!alloc.processIt(DocAction.ACTION_Complete)) + throw new AdempiereException("Failed Processing Document - " + alloc); + // end added m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); return alloc.save(get_TrxName()); } // allocateIt @@ -2088,8 +2095,10 @@ public final class MPayment extends X_C_Payment aLine.setDocInfo(getC_BPartner_ID(), 0, getC_Invoice_ID()); aLine.setC_Payment_ID(getC_Payment_ID()); aLine.saveEx(get_TrxName()); - // Should start WF - alloc.processIt(DocAction.ACTION_Complete); + // added AdempiereException by Amir Sehan + if (!alloc.processIt(DocAction.ACTION_Complete)) + throw new AdempiereException("Failed Processing Document - " + alloc); + // end added alloc.saveEx(get_TrxName()); m_processMsg = "@C_AllocationHdr_ID@: " + alloc.getDocumentNo(); @@ -2417,7 +2426,10 @@ public final class MPayment extends X_C_Payment if (!aLine.save(get_TrxName())) log.warning("Automatic allocation - reversal line not saved"); } - alloc.processIt(DocAction.ACTION_Complete); + // added AdempiereException by Amir Sehan + if (!alloc.processIt(DocAction.ACTION_Complete)) + throw new AdempiereException("Failed Processing Document - " + alloc); + // end added alloc.saveEx(get_TrxName()); // StringBuffer info = new StringBuffer (reversal.getDocumentNo());