Fixes IDEMPIERE-63 - Document number is updated again when document completed after reactivation

This commit is contained in:
Dirk Niemeyer 2011-08-24 09:42:29 -05:00
parent c252c4475c
commit d0e3514ba6
1 changed files with 10 additions and 4 deletions

View File

@ -1833,14 +1833,20 @@ public class MOrder extends X_C_Order implements DocAction
private void setDefiniteDocumentNo() { private void setDefiniteDocumentNo() {
MDocType dt = MDocType.get(getCtx(), getC_DocType_ID()); MDocType dt = MDocType.get(getCtx(), getC_DocType_ID());
if (dt.isOverwriteDateOnComplete()) { if (dt.isOverwriteDateOnComplete()) {
/* a42niem - BF IDEMPIERE-63 - check if document has been completed before */
if (this.getProcessedOn().compareTo(Env.ZERO) == 0) {
setDateOrdered(new Timestamp (System.currentTimeMillis())); setDateOrdered(new Timestamp (System.currentTimeMillis()));
} }
}
if (dt.isOverwriteSeqOnComplete()) { if (dt.isOverwriteSeqOnComplete()) {
/* a42niem - BF IDEMPIERE-63 - check if document has been completed before */
if (this.getProcessedOn().compareTo(Env.ZERO) == 0) {
String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this); String value = DB.getDocumentNo(getC_DocType_ID(), get_TrxName(), true, this);
if (value != null) if (value != null)
setDocumentNo(value); setDocumentNo(value);
} }
} }
}
/** /**
* Create Shipment * Create Shipment