Class MDistribution

All Implemented Interfaces:
Serializable, Cloneable, Comparator<Object>, I_GL_Distribution, I_Persistent, Evaluatee

public class MDistribution extends X_GL_Distribution
GL Distribution Model
Version:
$Id: MDistribution.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
Author:
Jorg Janke, red1 FR: [ 2214883 ] Remove SQL code and Replace for Query
See Also:
  • Constructor Details

    • MDistribution

      public MDistribution(Properties ctx, String GL_Distribution_UU, String trxName)
      UUID based Constructor
      Parameters:
      ctx - Context
      GL_Distribution_UU - UUID key
      trxName - Transaction
    • MDistribution

      public MDistribution(Properties ctx, int GL_Distribution_ID, String trxName)
      Standard Constructor
      Parameters:
      ctx - context
      GL_Distribution_ID - id
      trxName - transaction
    • MDistribution

      public MDistribution(Properties ctx, ResultSet rs, String trxName)
      Load Constructor
      Parameters:
      ctx - context
      rs - result set
      trxName - transaction
    • MDistribution

      public MDistribution(MDistribution copy)
      Copy constructor
      Parameters:
      copy -
    • MDistribution

      public MDistribution(Properties ctx, MDistribution copy)
      Copy constructor
      Parameters:
      ctx -
      copy -
    • MDistribution

      public MDistribution(Properties ctx, MDistribution copy, String trxName)
      Copy constructor
      Parameters:
      ctx -
      copy -
      trxName -
  • Method Details

    • get

      public static MDistribution[] get(MAccount acct, String PostingType, int C_DocType_ID, Timestamp dateAcct)
      Get Distribution for combination
      Parameters:
      acct - account (ValidCombination)
      PostingType - only posting type
      C_DocType_ID - only document type
      dateAcct - date (to be tested with ValidFrom/ValidTo)
      Returns:
      array of distributions
    • get

      public static MDistribution[] get(int C_AcctSchema_ID, String PostingType, int C_DocType_ID, Timestamp dateAcct, int AD_Org_ID, int Account_ID, int M_Product_ID, int C_BPartner_ID, int C_Project_ID, int C_Campaign_ID, int C_Activity_ID, int AD_OrgTrx_ID, int C_SalesRegion_ID, int C_LocTo_ID, int C_LocFrom_ID, int User1_ID, int User2_ID)
      Get Distributions for combination
      Parameters:
      C_AcctSchema_ID - schema
      PostingType - posting type
      C_DocType_ID - document type
      dateAcct - date (to be tested with ValidFrom/ValidTo)
      AD_Org_ID - org
      Account_ID - account
      M_Product_ID - product
      C_BPartner_ID - partner
      C_Project_ID - project
      C_Campaign_ID - campaign
      C_Activity_ID - activity
      AD_OrgTrx_ID - trx org
      C_SalesRegion_ID -
      C_LocTo_ID - location to
      C_LocFrom_ID - location from
      User1_ID - user 1
      User2_ID - user 2
      Returns:
      array of distributions or null
    • get

      public static MDistribution[] get(Properties ctx, int C_AcctSchema_ID, String PostingType, int C_DocType_ID, Timestamp dateAcct, int AD_Org_ID, int Account_ID, int M_Product_ID, int C_BPartner_ID, int C_Project_ID, int C_Campaign_ID, int C_Activity_ID, int AD_OrgTrx_ID, int C_SalesRegion_ID, int C_LocTo_ID, int C_LocFrom_ID, int User1_ID, int User2_ID)
      Get Distributions for combination
      Parameters:
      ctx - context
      C_AcctSchema_ID - schema
      PostingType - posting type
      C_DocType_ID - document type
      AD_Org_ID - org
      Account_ID - account
      M_Product_ID - product
      C_BPartner_ID - partner
      C_Project_ID - project
      C_Campaign_ID - campaign
      C_Activity_ID - activity
      AD_OrgTrx_ID - trx org
      C_SalesRegion_ID -
      C_LocTo_ID - location to
      C_LocFrom_ID - location from
      User1_ID - user 1
      User2_ID - user 2
      Returns:
      array of distributions or null
    • get

      @Deprecated public static MDistribution[] get(Properties ctx, int Account_ID)
      Deprecated.
      Get Distributions for Account
      Parameters:
      ctx - ignore
      Account_ID - id
      Returns:
      array of distributions
    • get

      @Deprecated public static MDistribution[] get(int Account_ID)
      Deprecated.
      - using the method to get a specific account ID doesn't make sense because of the flag IsAnyAcct use method getAll() instead
      Get Distributions for Account
      Parameters:
      Account_ID - id
      Returns:
      array of distributions
    • getAll

      @Deprecated public static MDistribution[] getAll(Properties ctx)
      Deprecated.
      Get All Distributions
      Parameters:
      ctx - ignore
      Returns:
      array of distributions
    • getAll

      public static MDistribution[] getAll()
      Get All Distributions
      Returns:
      array of distributions
    • getLines

      public MDistributionLine[] getLines(boolean reload)
      Get Lines and calculate total
      Parameters:
      reload - true to reload data
      Returns:
      array of lines
    • validate

      public String validate()
      Validate Distribution
      Returns:
      error message or null
    • distribute

      public void distribute(MAccount acct, BigDecimal Amt, BigDecimal Qty, int C_Currency_ID)
      Distribute Amount to Lines
      Parameters:
      acct - account
      Amt - amount
      Qty -
      C_Currency_ID - currency
    • beforeSave

      protected boolean beforeSave(boolean newRecord)
      Before Save
      Overrides:
      beforeSave in class PO
      Parameters:
      newRecord - new
      Returns:
      true