Class MDistribution

    • Constructor Detail

      • 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)
        Parameters:
        copy -
    • Method Detail

      • 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

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

        public static MDistribution[] get​(int Account_ID)
        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 - 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