IDEMPIERE-1088 Problem with Reverse-Accrual with payment allocation
This commit is contained in:
parent
ac1a8e486c
commit
0e80967351
|
@ -21,6 +21,7 @@ import java.sql.ResultSet;
|
|||
import java.sql.Timestamp;
|
||||
import java.util.logging.Level;
|
||||
|
||||
import org.adempiere.exceptions.AdempiereException;
|
||||
import org.compiere.model.MAllocationHdr;
|
||||
import org.compiere.util.AdempiereUserError;
|
||||
import org.compiere.util.DB;
|
||||
|
@ -110,6 +111,8 @@ public class AllocationReset extends SvrProcess
|
|||
MAllocationHdr hdr = new MAllocationHdr(getCtx(), p_C_AllocationHdr_ID, m_trx.getTrxName());
|
||||
if (delete(hdr))
|
||||
count++;
|
||||
else
|
||||
throw new AdempiereException("Cannot delete");
|
||||
m_trx.close();
|
||||
StringBuilder msgreturn = new StringBuilder("@Deleted@ #").append(count);
|
||||
return msgreturn.toString();
|
||||
|
|
|
@ -407,6 +407,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
|||
}
|
||||
|
||||
// Stop the Document Workflow if invoice to allocate is as paid
|
||||
if (!isReversal()) {
|
||||
for (MAllocationLine line :m_lines)
|
||||
{
|
||||
if (line.getC_Invoice_ID() != 0)
|
||||
|
@ -422,6 +423,7 @@ public final class MAllocationHdr extends X_C_AllocationHdr implements DocAction
|
|||
throw new AdempiereException("@ValidationError@ @C_Invoice_ID@ @IsPaid@");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Add up Amounts & validate
|
||||
BigDecimal approval = Env.ZERO;
|
||||
|
|
Loading…
Reference in New Issue