Compiere 3.1

org.compiere.process
Class DocumentEngine

java.lang.Object
  extended by org.compiere.process.DocumentEngine
All Implemented Interfaces:
DocAction

public class DocumentEngine
extends Object
implements DocAction

Document Action Engine

Version:
$Id: DocumentEngine.java,v 1.2 2006/07/30 00:54:44 jjanke Exp $
Author:
Jorg Janke

Field Summary
 
Fields inherited from interface org.compiere.process.DocAction
ACTION_Approve, ACTION_Close, ACTION_Complete, ACTION_Invalidate, ACTION_None, ACTION_Post, ACTION_Prepare, ACTION_ReActivate, ACTION_Reject, ACTION_ReOpen, ACTION_Reverse_Accrual, ACTION_Reverse_Correct, ACTION_Unlock, ACTION_Void, ACTION_WaitComplete, STATUS_Approved, STATUS_Closed, STATUS_Completed, STATUS_Drafted, STATUS_InProgress, STATUS_Invalid, STATUS_NotApproved, STATUS_Reversed, STATUS_Unknown, STATUS_Voided, STATUS_WaitingConfirmation, STATUS_WaitingPayment
 
Constructor Summary
DocumentEngine(DocAction po)
          Doc Engine (Drafted)
DocumentEngine(DocAction po, String docStatus)
          Doc Engine
 
Method Summary
 boolean approveIt()
          Approve Document.
 boolean closeIt()
          Close Document.
 String completeIt()
          Complete Document.
 File createPDF()
          CreatePDF
 int get_ID()
          Get ID of record
 CLogger get_Logger()
          Get Logger
 int get_Table_ID()
          Get AD_Table_ID
 String get_TrxName()
          Get Transaction
 String[] getActionOptions()
          Get Action Options based on current Status
 int getAD_Client_ID()
          Get Document Client
 int getAD_Org_ID()
          Get Document Organization
 BigDecimal getApprovalAmt()
          Get Document Approval Amount
 int getC_Currency_ID()
          Get Document Currency
 Ctx getCtx()
          Get Context
 int getDoc_User_ID()
          Get Document Owner
 String getDocAction()
          Get Doc Action
 String getDocStatus()
          Get Doc Status
 String getDocumentInfo()
          Get Document Info
 String getDocumentNo()
          Get Document No
 String getProcessMsg()
          Get Process Message
 String getSummary()
          Get Summary
 boolean invalidateIt()
          Invalidate Document.
 boolean isApproved()
          Document is Approved
 boolean isClosed()
          Document is Closed
 boolean isCompleted()
          Document is Completed
 boolean isDrafted()
          Document is Drafted
 boolean isInProgress()
          Document is In Progress
 boolean isInvalid()
          Document is Invalid
 boolean isNotApproved()
          Document is Not Approved
 boolean isReversed()
          Document is Reversed
 boolean isUnknown()
          Document Status is Unknown
 boolean isValidAction(String action)
          Is The Action Valid based on current state
 boolean isVoided()
          Document is Voided
 boolean isWaiting()
          Document is Waiting Payment or Confirmation
 boolean postIt()
          Post Document Does not change status
 String prepareIt()
          Process Document.
 boolean processIt(String action)
          Process actual document - do not call directly.
 boolean processIt(String processAction, String docAction)
          Process actual document.
 boolean reActivateIt()
          Re-activate Document.
 boolean rejectIt()
          Reject Approval.
 boolean reverseAccrualIt()
          Reverse Accrual Document.
 boolean reverseCorrectIt()
          Reverse Correct Document.
 boolean save()
          Save Document
 void setDocStatus(String ignored)
          Set Doc Status - Ignored
 void setProcessMsg(String msg)
          Get Process Message
 boolean unlockIt()
          Unlock Document.
 boolean voidIt()
          Void Document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentEngine

public DocumentEngine(DocAction po)
Doc Engine (Drafted)

Parameters:
po - document

DocumentEngine

public DocumentEngine(DocAction po,
                      String docStatus)
Doc Engine

Parameters:
po - document
docStatus - initial document status
Method Detail

getDocStatus

public String getDocStatus()
Get Doc Status

Specified by:
getDocStatus in interface DocAction
Returns:
document status

setDocStatus

public void setDocStatus(String ignored)
Set Doc Status - Ignored

Specified by:
setDocStatus in interface DocAction
Parameters:
ignored - Status is not set directly
See Also:
DocAction.setDocStatus(String)

isDrafted

public boolean isDrafted()
Document is Drafted

Returns:
true if drafted

isInvalid

public boolean isInvalid()
Document is Invalid

Returns:
true if Invalid

isInProgress

public boolean isInProgress()
Document is In Progress

Returns:
true if In Progress

isApproved

public boolean isApproved()
Document is Approved

Returns:
true if Approved

isNotApproved

public boolean isNotApproved()
Document is Not Approved

Returns:
true if Not Approved

isWaiting

public boolean isWaiting()
Document is Waiting Payment or Confirmation

Returns:
true if Waiting Payment

isCompleted

public boolean isCompleted()
Document is Completed

Returns:
true if Completed

isReversed

public boolean isReversed()
Document is Reversed

Returns:
true if Reversed

isClosed

public boolean isClosed()
Document is Closed

Returns:
true if Closed

isVoided

public boolean isVoided()
Document is Voided

Returns:
true if Voided

isUnknown

public boolean isUnknown()
Document Status is Unknown

Returns:
true if unknown

processIt

public boolean processIt(String processAction,
                         String docAction)
Process actual document. Checks if user (document) action is valid and then process action Calls the individual actions which call the document action

Parameters:
processAction - document action based on workflow
docAction - document action based on document
Returns:
true if performed

processIt

public boolean processIt(String action)
Process actual document - do not call directly. Calls the individual actions which call the document action

Specified by:
processIt in interface DocAction
Parameters:
action - document action
Returns:
true if performed

unlockIt

public boolean unlockIt()
Unlock Document. Status: Drafted

Specified by:
unlockIt in interface DocAction
Returns:
true if success
See Also:
DocAction.unlockIt()

invalidateIt

public boolean invalidateIt()
Invalidate Document. Status: Invalid

Specified by:
invalidateIt in interface DocAction
Returns:
true if success
See Also:
DocAction.invalidateIt()

prepareIt

public String prepareIt()
Process Document. Status is set by process

Specified by:
prepareIt in interface DocAction
Returns:
new status (In Progress or Invalid)
See Also:
DocAction.prepareIt()

approveIt

public boolean approveIt()
Approve Document. Status: Approved

Specified by:
approveIt in interface DocAction
Returns:
true if success
See Also:
DocAction.approveIt()

rejectIt

public boolean rejectIt()
Reject Approval. Status: Not Approved

Specified by:
rejectIt in interface DocAction
Returns:
true if success
See Also:
DocAction.rejectIt()

completeIt

public String completeIt()
Complete Document. Status is set by process

Specified by:
completeIt in interface DocAction
Returns:
new document status (Complete, In Progress, Invalid, Waiting ..)
See Also:
DocAction.completeIt()

postIt

public boolean postIt()
Post Document Does not change status

Returns:
true if success

voidIt

public boolean voidIt()
Void Document. Status: Voided

Specified by:
voidIt in interface DocAction
Returns:
true if success
See Also:
DocAction.voidIt()

closeIt

public boolean closeIt()
Close Document. Status: Closed

Specified by:
closeIt in interface DocAction
Returns:
true if success
See Also:
DocAction.closeIt()

reverseCorrectIt

public boolean reverseCorrectIt()
Reverse Correct Document. Status: Reversed

Specified by:
reverseCorrectIt in interface DocAction
Returns:
true if success
See Also:
DocAction.reverseCorrectIt()

reverseAccrualIt

public boolean reverseAccrualIt()
Reverse Accrual Document. Status: Reversed

Specified by:
reverseAccrualIt in interface DocAction
Returns:
true if success
See Also:
DocAction.reverseAccrualIt()

reActivateIt

public boolean reActivateIt()
Re-activate Document. Status: In Progress

Specified by:
reActivateIt in interface DocAction
Returns:
true if success
See Also:
DocAction.reActivateIt()

getActionOptions

public String[] getActionOptions()
Get Action Options based on current Status

Returns:
array of actions

isValidAction

public boolean isValidAction(String action)
Is The Action Valid based on current state

Parameters:
action - action
Returns:
true if valid

getProcessMsg

public String getProcessMsg()
Get Process Message

Specified by:
getProcessMsg in interface DocAction
Returns:
clear text error message

setProcessMsg

public void setProcessMsg(String msg)
Get Process Message

Parameters:
msg - clear text error message

getSummary

public String getSummary()
Get Summary

Specified by:
getSummary in interface DocAction
Returns:
throw exception

getDocumentNo

public String getDocumentNo()
Get Document No

Specified by:
getDocumentNo in interface DocAction
Returns:
throw exception

getDocumentInfo

public String getDocumentInfo()
Get Document Info

Specified by:
getDocumentInfo in interface DocAction
Returns:
throw exception

getDoc_User_ID

public int getDoc_User_ID()
Get Document Owner

Specified by:
getDoc_User_ID in interface DocAction
Returns:
throw exception

getC_Currency_ID

public int getC_Currency_ID()
Get Document Currency

Specified by:
getC_Currency_ID in interface DocAction
Returns:
throw exception

getApprovalAmt

public BigDecimal getApprovalAmt()
Get Document Approval Amount

Specified by:
getApprovalAmt in interface DocAction
Returns:
throw exception

getAD_Client_ID

public int getAD_Client_ID()
Get Document Client

Specified by:
getAD_Client_ID in interface DocAction
Returns:
throw exception

getAD_Org_ID

public int getAD_Org_ID()
Get Document Organization

Specified by:
getAD_Org_ID in interface DocAction
Returns:
throw exception

getDocAction

public String getDocAction()
Get Doc Action

Specified by:
getDocAction in interface DocAction
Returns:
Document Action

save

public boolean save()
Save Document

Specified by:
save in interface DocAction
Returns:
throw exception

getCtx

public Ctx getCtx()
Get Context

Specified by:
getCtx in interface DocAction
Returns:
context

get_ID

public int get_ID()
Get ID of record

Specified by:
get_ID in interface DocAction
Returns:
ID

get_Table_ID

public int get_Table_ID()
Get AD_Table_ID

Specified by:
get_Table_ID in interface DocAction
Returns:
AD_Table_ID

get_Logger

public CLogger get_Logger()
Get Logger

Specified by:
get_Logger in interface DocAction
Returns:
logger

get_TrxName

public String get_TrxName()
Get Transaction

Specified by:
get_TrxName in interface DocAction
Returns:
trx name

createPDF

public File createPDF()
CreatePDF

Specified by:
createPDF in interface DocAction
Returns:
null

Compiere 3.1

Compiere® is a registered trademark of ComPiere, Inc. ©2004-2008 HumanFlash.com All rights reserved.