[ 1566090 ] Allow to reuse doc no sequence

This commit is contained in:
armenrz 2007-02-28 05:15:16 +00:00
parent 13fbebd155
commit eee0bbbd57
1 changed files with 22 additions and 0 deletions

View File

@ -137,6 +137,11 @@ public class MInOut extends X_M_InOut implements DocAction
return retValue;
} // createFrom
// Goodwill.co.id (Goodwill)
/** Reversal Indicator */
private static String REVERSE_INDICATOR = "^";
// end Goodwill.co.id
/**
* Create new Shipment by copying
* @param from shipment
@ -156,6 +161,14 @@ public class MInOut extends X_M_InOut implements DocAction
copyValues(from, to, from.getAD_Client_ID(), from.getAD_Org_ID());
to.set_ValueNoCheck ("M_InOut_ID", I_ZERO);
to.set_ValueNoCheck ("DocumentNo", null);
// Goodwill.co.id (Goodwill)
// old :
// to.set_ValueNoCheck ("DocumentNo", null);
// new :
to.setDocumentNo(REVERSE_INDICATOR + from.getDocumentNo());
// end Goodwill.co.id
//
to.setDocStatus (DOCSTATUS_Drafted); // Draft
to.setDocAction(DOCACTION_Complete);
@ -1670,6 +1683,10 @@ public class MInOut extends X_M_InOut implements DocAction
line.save(get_TrxName());
}
}
// Goodwill.co.id (Goodwill)
// for voided Document, M_InOut_ID is added as suffix for Document No
setDocumentNo(getDocumentNo() + "#" + getM_InOut_ID());
// end Goodwill.co.id
}
else
{
@ -1746,6 +1763,11 @@ public class MInOut extends X_M_InOut implements DocAction
}
}
}
//Added New Lines By Goodwill.co.id
//Reason: To Change Document No when Reverse
setDocumentNo(getDocumentNo() + "#" + getM_InOut_ID());
//End Of Added Lines
// Deep Copy
MInOut reversal = copyFrom (this, getMovementDate(),