Class GenericPO

java.lang.Object
org.compiere.model.PO
org.adempiere.model.GenericPO
All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, DocAction, Evaluatee

public class GenericPO extends PO implements DocAction
Generic PO implementation, this can be use together with ModelValidator as alternative to the classic generated model class and extend ( X_ and M_ ) approach.

Originally for used to insert/update data from adempieredata.xml file in 2pack.

Author:
Marco LOMBARDO
See Also:
  • Field Details

    • AD_ORGTRX_ID_AD_Reference_ID

      public static final int AD_ORGTRX_ID_AD_Reference_ID
      See Also:
  • Constructor Details

    • GenericPO

      public GenericPO(String tableName, Properties ctx, int ID)
      Parameters:
      tableName -
      ctx -
      ID -
    • GenericPO

      public GenericPO(String tableName, Properties ctx, ResultSet rs)
      Parameters:
      tableName -
      ctx -
      rs -
    • GenericPO

      public GenericPO(String tableName, Properties ctx, int ID, String trxName)
      Parameters:
      tableName -
      ctx -
      ID -
      trxName -
    • GenericPO

      public GenericPO(String tableName, Properties ctx, ResultSet rs, String trxName)
      Parameters:
      tableName -
      ctx -
      rs -
      trxName -
  • Method Details

    • initPO

      protected POInfo initPO(Properties ctx)
      Load Meta Data
      Specified by:
      initPO in class PO
      Parameters:
      ctx - context
      Returns:
      POInfo
    • toString

      public String toString()
      Description copied from class: PO
      String representation
      Overrides:
      toString in class PO
      Returns:
      String representation
    • setAD_OrgTrx_ID

      public void setAD_OrgTrx_ID(int AD_OrgTrx_ID)
      Set Trx Organization. Performing or initiating organization
    • getAD_OrgTrx_ID

      public int getAD_OrgTrx_ID()
      Get Trx Organization. Performing or initiating organization
    • get_AccessLevel

      protected int get_AccessLevel()
      Description copied from class: PO
      Get Table Access Level
      Specified by:
      get_AccessLevel in class PO
      Returns:
      Access Level
    • setDocStatus

      public void setDocStatus(String DocStatus)
      Set Document Status.
      Specified by:
      setDocStatus in interface DocAction
      Parameters:
      DocStatus - The current status of the document
    • getDocStatus

      public String getDocStatus()
      Get Document Status.
      Specified by:
      getDocStatus in interface DocAction
      Returns:
      The current status of the document
    • processIt

      public boolean processIt(String processAction)
      Process document
      Specified by:
      processIt in interface DocAction
      Parameters:
      processAction - document action
      Returns:
      true if performed
    • unlockIt

      public boolean unlockIt()
      Unlock Document.
      Specified by:
      unlockIt in interface DocAction
      Returns:
      true if success
    • getDocAction

      public String getDocAction()
      Get Document Action.
      Specified by:
      getDocAction in interface DocAction
      Returns:
      The targeted status of the document
    • invalidateIt

      public boolean invalidateIt()
      Invalidate Document
      Specified by:
      invalidateIt in interface DocAction
      Returns:
      true if success
    • prepareIt

      public String prepareIt()
      Prepare Document
      Specified by:
      prepareIt in interface DocAction
      Returns:
      new status (In Progress or Invalid)
    • approveIt

      public boolean approveIt()
      Approve Document
      Specified by:
      approveIt in interface DocAction
      Returns:
      true if success
    • rejectIt

      public boolean rejectIt()
      Reject Approval
      Specified by:
      rejectIt in interface DocAction
      Returns:
      true if success
    • completeIt

      public String completeIt()
      Complete Document
      Specified by:
      completeIt in interface DocAction
      Returns:
      new status (Complete, In Progress, Invalid, Waiting ..)
    • voidIt

      public boolean voidIt()
      Void Document.
      Specified by:
      voidIt in interface DocAction
      Returns:
      true if success
    • closeIt

      public boolean closeIt()
      Close Document.
      Specified by:
      closeIt in interface DocAction
      Returns:
      true if success
    • reverseCorrectIt

      public boolean reverseCorrectIt()
      Reverse Correction - same date
      Specified by:
      reverseCorrectIt in interface DocAction
      Returns:
      true if success
    • reverseAccrualIt

      public boolean reverseAccrualIt()
      Reverse Accrual - none
      Specified by:
      reverseAccrualIt in interface DocAction
      Returns:
      false
    • reActivateIt

      public boolean reActivateIt()
      Re-activate.
      Specified by:
      reActivateIt in interface DocAction
      Returns:
      true if success
    • getSummary

      public String getSummary()
      Get Summary
      Specified by:
      getSummary in interface DocAction
      Returns:
      Summary of Document
    • getDocumentNo

      public String getDocumentNo()
      Description copied from interface: DocAction
      Get Document No
      Specified by:
      getDocumentNo in interface DocAction
      Returns:
      Document No
    • getDocumentInfo

      public String getDocumentInfo()
      Get Document Info
      Specified by:
      getDocumentInfo in interface DocAction
      Returns:
      document info (untranslated)
    • createPDF

      public File createPDF()
      Description copied from interface: DocAction
      Create PDF
      Specified by:
      createPDF in interface DocAction
      Returns:
      file
    • getProcessMsg

      public String getProcessMsg()
      Get Process Message
      Specified by:
      getProcessMsg in interface DocAction
      Returns:
      clear text error message
    • getDoc_User_ID

      public int getDoc_User_ID()
      Description copied from interface: DocAction
      Get Document Owner
      Specified by:
      getDoc_User_ID in interface DocAction
      Returns:
      AD_User_ID
    • getC_Currency_ID

      public int getC_Currency_ID()
      Get Currency.
      Specified by:
      getC_Currency_ID in interface DocAction
      Returns:
      The Currency for this record
    • getApprovalAmt

      public BigDecimal getApprovalAmt()
      Description copied from interface: DocAction
      Get Document Approval Amount
      Specified by:
      getApprovalAmt in interface DocAction
      Returns:
      amount