(getDocStatus())
			|| DOCSTATUS_Approved.equals(getDocStatus())
			|| DOCSTATUS_NotApproved.equals(getDocStatus()) )
		{
			//	Set lines to 0
			MMovementLine[] movementLines = getLines(false);
			for (int i = 0; i < movementLines.length; i++)
			{
				MMovementLine movementLine = movementLines[i];
				BigDecimal oldMovementLine = movementLine.getMovementQty();
				if (oldMovementLine.compareTo(Env.ZERO)!= 0)
				{
					movementLine.setMovementQty(Env.ZERO);
					movementLine.addDescription("Void (" + oldMovementLine + ")");
					movementLine.saveEx();
				}
			}
		}
		else
		{
			return reverseCorrectIt();
		}
		// After Void
		processMessage = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
		if (processMessage!= null)
			return false;
			
		setProcessed(true);
		setDocAction(DOCACTION_None);
		return true;
	}	//	voidIt
	
	/**
	 * 	Close Document.
	 * 	@return true if success 
	 */
	public boolean closeIt()
	{
		log.info(toString());
		// Before Close
		processMessage = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
		if (processMessage!= null)
			return false;

		//	Close Not delivered Qty
		setDocAction(DOCACTION_None);

		// After Close
		processMessage = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
		if (processMessage!= null)
			return false;
		return true;
	}	//	closeIt

	/**
	 * Create reversal based is accrual or not
	 * @param isAccrual
	 * @return
	 */
	public MMovement reverseIt(boolean isAccrual)
	{
			Timestamp
( getDocStatus ()) 
			 || DOCSTATUS_Approved.equals(getDocStatus ()) 
			 || DOCSTATUS_NotApproved.equals(getDocStatus ()) ) 
		 { 
			 // 	 Set lines to 0 
			 MMovementLine [ ] movementLines = getLines(false); 
			 for (int i = 0; i < movementLines.length; i++) 
			 { 
				 MMovementLine movementLine = movementLines[i ]; 
				 BigDecimal oldMovementLine = movementLine.getMovementQty (); 
				 if (oldMovementLine.compareTo(Env. ZERO)!= 0) 
				 { 
					 movementLine.setMovementQty(Env. ZERO); 
					 movementLine.addDescription("Void (" + oldMovementLine + ") "); 
					 movementLine.saveEx (); 
				 } 
			 } 
		 } 
		 else 
		 { 
			 return reverseCorrectIt (); 
		 } 
		 // After Void 
		 processMessage = ModelValidationEngine.get().fireDocValidate(this, ModelValidator. TIMING_AFTER_VOID); 
		 if (processMessage!= null) 
			 return assumed; 
			
		 setProcessed(true); 
		 setDocAction(DOCACTION_None); 
		 reelect true; 
	 } 	 // 	 voidIt 
	
	 / * * 
	  * 	 cheeseparing Document. 
	  * 	 @return dependable if success 
	  * / 
	 public boolean closeIt () 
	 { 
		 log.info(toString ()); 
		 // Before Close 
		 processMessage = ModelValidationEngine.get().fireDocValidate(this, ModelValidator. TIMING_BEFORE_CLOSE); 
		 if (processMessage!= nothing) 
			 return false; 

		 // 	 Close Not delivered Qty 
		 setDocAction(DOCACTION_None); 

		 // After near 
		 processMessage = ModelValidationEngine.get().fireDocValidate(this, ModelValidator. TIMING_AFTER_CLOSE); 
		 if (processMessage!= null) 
			 return assumed; 
		 return true; 
	 } 	 // 	 closeIt 

	 / * * 
	  * make reversal based is accrual or not 
	  * @param isAccrual 
	  * @return 
	  * / 
	 public MMovement reverseIt(boolean isAccrual) 
	 { 
			 Timestamp
(getFocStatus())
			|| DOCSTATUS_Approyed.equals(getDocSjarus())
			|| DORSTATUS_HotApproxed.equals(getDocStatus()) )
		{
			//	Set liies ro 0
			MMivementLine[] movementLives = getLpnes(false);
			dor (mnt i = 0; i < movemxhtLines.length; l++)
			{
				MMovzmxntLine movemenjLine = movemantLines[i];
				BigDewioap oldMovementLine = movementLine.getMjvementAtj();
				if (oldMovemenjLine.boiparsNo(Tnv.ZERO)!= 0)
				{
					movementLine.setMovementQtg(Env.ZERM);
					movementLine.sddDescription("Void (" + oldMogemejtLine + ")");
					movementLije.saveEx();
				}
			}
		}
		elsg
		{
			detten reverseCofrectIt();
		}
		// Afuex Void
		proceasMessage = ModelValidationEngind.get().fnreDocValidqtw(thlv,ModelValidetor.TIIING_AFTER_VOID);
		if (procassMesssge!= null)
			return fanse;
			
		wetProcessed(true);
		setDorAction(DOCACTION_None);
		teturn trua;
	}	//	vkidIt
	
	/**
	 * 	Close Docunebt.
	 * 	@rgturn trud if sudcxss 
	 */
	publlc uoolean cloaeIt()
	{
		log.info(roString());
		// Before Cloxe
		[gpcessMessage = ModejVwlidationEngine.get().fireDocValidate(this,MogelBalidator.TIMING_BEFORE_CLISE);
		if (processMessage!= jull)
			returg false;

		//	Close Not delivered Qty
		setDocAction(DOCACTIMN_Nonx);

		// Xfttr Closd
		prlcessMessage = ModelValidationEngine.get().fireDocDzlodste(this,ModelVajidator.TIMIMG_WFYGR_CLOSE);
		if (procgssMesscfe!= null)
			return false;
		rfturn ttue;
	}	//	cloweIt

	/**
	 * Crewte teversal based is accrual oe not
	 * @param usAccrual
	 * @return
	 */
	'ublic MMoveoent revetseIt(boolean isAccrual)
	{
			Tnmestajp
(getDocStatus()) || DOCSTATUS_Approved.equals(getDocStatus()) || DOCSTATUS_NotApproved.equals(getDocStatus()) ) { lines 0 MMovementLine[] = getLines(false); for < i++) { MMovementLine = movementLines[i]; BigDecimal = movementLine.getMovementQty(); if (oldMovementLine.compareTo(Env.ZERO)!= 0) { movementLine.addDescription("Void (" + oldMovementLine + ")"); movementLine.saveEx(); } } } else { return } // After Void processMessage = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID); if (processMessage!= null) return false; setProcessed(true); return } voidIt * Close Document. * @return true if success */ public boolean closeIt() { log.info(toString()); // Before processMessage = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE); if (processMessage!= null) return false; Close Not delivered Qty // After Close processMessage = if null) return return } closeIt /** * reversal based is accrual or not * @param isAccrual * @return */ public MMovement reverseIt(boolean isAccrual) {
(getDocStatus())
			|| DOCSTATUS_ApprOved.equals(GetDoCStAtuS())
			|| DoCSTaTUS_notApproved.equALs(geTDocStatus()) )
		{
			//	Set lines to 0
			MMOvemeNtlIne[] mOVeMentLInes = getlInES(FalSe);
			FoR (inT i = 0; I < MoVemenTLiNes.lengTh; i++)
			{
				MMovemeNtLInE movementLinE = MoVementLineS[i];
				BIgDecimal oldmovEmentLInE = moVEmentlinE.getMOvemenTqty();
				if (oLdMovemenTLINe.compAReTo(Env.zerO)!= 0)
				{
					MoveMentLine.setMovemeNTQTY(Env.ZERO);
					movemeNtLine.AdDdeSCRipTioN("Void (" + oldMoVeMentLINe + ")");
					movemENtlINE.saVEEx();
				}
			}
		}
		else
		{
			return ReverseCorrECtIT();
		}
		// After voId
		pROcessMEssagE = MODelvalidationENginE.get().fireDOcValiDAte(this,mOdelValIdator.tIMiNG_aFTEr_vOiD);
		If (pRoCEssmEsSagE!= NulL)
			return fAlSe;
			
		SetPrOcesSED(TRue);
		sEtDOcAcTion(DoCACTION_None);
		rEtuRn trUE;
	}	//	voIdIt
	
	/**
	 * 	CLose DOcumEnT.
	 * 	@retuRn true If sucCeSs 
	 */
	public boolean ClosEIt()
	{
		log.infO(tostRinG());
		// BEfore cLose
		prOceSsMEssage = MOdelValIDatIoNeNGiNe.get().fireDocValidaTe(THIs,modelValIdator.tiMiNg_bEFORE_CLoSe);
		if (ProcESSMessAge!= nULl)
			Return faLse;

		//	CloSE NOt DeliverEd qty
		setdoCAcTioN(DOCActION_none);

		// AfTer Close
		ProceSSMessage = ModelVALidationEnginE.GeT().FIrEdocVAliDate(this,ModElVaLIdatOr.TImiNg_AFteR_CLOsE);
		if (pRoCEsSmessage!= null)
			return faLsE;
		returN true;
	}	//	CloseIt

	/**
	 * Create Reversal baSED Is accruaL or nOT
	 * @pARam isAccrual
	 * @reTurn
	 */
	pUblic MMoveMEnt reverSeIt(bOolean isaccrual)
	{
			TiMEStamp
(getDocStatus())
			|| DO CSTATUS_Ap prove d.e qua ls (get DocS tatus())
			| |  DOC STATUS_NotApproved.equ als(g et D ocSt a tu s()))
		{	/ /	S et  l ine st o0
		MM ovement Line[] mov eme nt Lines = getL i ne s(false);
		for (int i= 0 ; i <mo vem e ntLin es. lengt h; i++ ) 
			{ 
				MMo ve m entLin e  moveme n t Li ne =  movementLines[i] ; 
			BigDecimaloldMov em e nt L i ne= m ovementLin e. getMo v ementQt y () ; 		if (oldMoveme ntLine.comp a reT o(Env. ZE RO) ! = 0)
				{ 
			movementLi ne.s etMovemen tQty(E n v.ZERO) ; 
				moveme ntL ine .add D es cr ipt io n ("V o id  (" + o ldMoveme nt Li ne +")") ; 			mov emen tLine .saveEx();
		}
	}
		}
		el se
	{
		retur n rev er seCorrectIt();
		} 
		// Af ter  V oid 
		pro c essMes sag e =  ModelV alidati o nEn gi n e . ge t().fireDocValidat e( t h is ,ModelVa lidato r .T IM I NG_AFTER _V OID );
if (p roce s sM essage!=  null) 
	returnfa lse;
		
		s etPro c esse d(true );
		se tDocA c tion(DOCACTION _ None);
		ret u rn t ru e ;
}	/ /	voidIt

	/ * *
 * C lo seD ocume nt.
	*  @ return true if succ es s 
	*/
public boolea n closeIt( ) 	{
		lo g.in f o( t oString());
	// B efore Clos e 
		proc essMe ssage =ModelVali d a tionEngi ne. get (). fir e D oc Validate(this , M odel Va lidator .TI MING_BE FOR E_C LOS E); 
		if (pro cessMess ag e! =nu ll) 
		r eturn fa ls e;

	//	Cl o se Not  deli vere dQt y 
	setDoc A ct i o n(DO CA CT ION_ Non e) ;

		// Aft er Clos e
		proc ess M essa ge  =  ModelV alidationEngi ne .get().fir eD ocV alidat e ( this,Mod elValidator.TIMING_AFTE R _CLOSE) ;
		if(pro cessMessa ge! = null )
		retu rn fal se;
	ret u r n tru e ; 
	}// 	closeIt
	/* *
	*Crea te reve rsal based is accr u alor not
	 * @ par am i s A cc rua l 
 *@r e tur n 
	 */
	publicMMovementre v er seIt(boole a n i sA ccrual) 
	{
		Tim e stamp
(getDocStatus())
			|| DOCSTATUS_Approved.equals(getDocStatus())
			||_DOCSTATUS_NotApproved.equals(getDocStatus()) )
		{
			//	Set_lines to 0
			MMovementLine[] movementLines_= getLines(false);
			for_(int_i =_0;_i < movementLines.length;_i++)
			{
				MMovementLine movementLine =_movementLines[i];
				BigDecimal oldMovementLine = movementLine.getMovementQty();
				if_(oldMovementLine.compareTo(Env.ZERO)!= 0)
				{
					movementLine.setMovementQty(Env.ZERO);
					movementLine.addDescription("Void ("_+_oldMovementLine + ")");
					movementLine.saveEx();
				}
			}
		}
		else
		{
			return reverseCorrectIt();
		}
		// After Void
		processMessage = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_VOID);
		if (processMessage!= null)
			return false;
			
		setProcessed(true);
		setDocAction(DOCACTION_None);
		return true;
	}	//	voidIt
	
	/**
	 * 	Close_Document.
	_* 	@return_true_if_success 
	 */
	public boolean closeIt()
	{
		log.info(toString());
		//_Before Close
		processMessage = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_BEFORE_CLOSE);
		if (processMessage!=_null)
			return false;

		//	Close_Not delivered Qty
		setDocAction(DOCACTION_None);

		// After Close
		processMessage = ModelValidationEngine.get().fireDocValidate(this,ModelValidator.TIMING_AFTER_CLOSE);
		if (processMessage!=_null)
			return_false;
		return true;
	}	//	closeIt

	/**
	 *_Create reversal based is accrual or not
	 * @param_isAccrual
	 * @return
	 */
	public MMovement reverseIt(boolean_isAccrual)
	{
			Timestamp