From 66e7a7d0ff80ab7e0909141bee9929f3be63a113 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Mon, 9 Mar 2009 21:00:29 +0000 Subject: [PATCH] Fix [ adempiere-Bugs-2676108 ] Error creating payment selection line and check https://sourceforge.net/tracker2/?func=detail&atid=879332&aid=2676108&group_id=176962 Thanks to Susanne Calderon for reporting --- base/src/org/compiere/model/MPayment.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/base/src/org/compiere/model/MPayment.java b/base/src/org/compiere/model/MPayment.java index ae03887c4a..385f75b755 100644 --- a/base/src/org/compiere/model/MPayment.java +++ b/base/src/org/compiere/model/MPayment.java @@ -1599,6 +1599,11 @@ public final class MPayment extends X_C_Payment if (m_processMsg != null) return DocAction.STATUS_Invalid; + if (! MPaySelectionCheck.deleteGeneratedDraft(getCtx(), getC_Payment_ID(), get_TrxName())) { + m_processMsg = "Could not delete draft generated payment selection lines"; + return DocAction.STATUS_Invalid; + } + // Std Period open? if (!MPeriod.isOpen(getCtx(), getDateAcct(), isReceipt() ? X_C_DocType.DOCBASETYPE_ARReceipt : X_C_DocType.DOCBASETYPE_APPayment, getAD_Org_ID())) @@ -1606,7 +1611,7 @@ public final class MPayment extends X_C_Payment m_processMsg = "@PeriodClosed@"; return DocAction.STATUS_Invalid; } - + // Unsuccessful Online Payment if (isOnline() && !isApproved()) {