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
This commit is contained in:
Carlos Ruiz 2009-03-09 21:00:29 +00:00
parent d7134aedd2
commit 66e7a7d0ff
1 changed files with 6 additions and 1 deletions

View File

@ -1599,6 +1599,11 @@ public final class MPayment extends X_C_Payment
if (m_processMsg != null) if (m_processMsg != null)
return DocAction.STATUS_Invalid; 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? // Std Period open?
if (!MPeriod.isOpen(getCtx(), getDateAcct(), if (!MPeriod.isOpen(getCtx(), getDateAcct(),
isReceipt() ? X_C_DocType.DOCBASETYPE_ARReceipt : X_C_DocType.DOCBASETYPE_APPayment, getAD_Org_ID())) 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@"; m_processMsg = "@PeriodClosed@";
return DocAction.STATUS_Invalid; return DocAction.STATUS_Invalid;
} }
// Unsuccessful Online Payment // Unsuccessful Online Payment
if (isOnline() && !isApproved()) if (isOnline() && !isApproved())
{ {