From eee0bbbd571f7873a587b0dc632dfc3cf0377475 Mon Sep 17 00:00:00 2001 From: armenrz Date: Wed, 28 Feb 2007 05:15:16 +0000 Subject: [PATCH] [ 1566090 ] Allow to reuse doc no sequence --- base/src/org/compiere/model/MInOut.java | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/base/src/org/compiere/model/MInOut.java b/base/src/org/compiere/model/MInOut.java index d3d0e8a072..5becc0fac5 100644 --- a/base/src/org/compiere/model/MInOut.java +++ b/base/src/org/compiere/model/MInOut.java @@ -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(),