Class DocLine

java.lang.Object
org.compiere.acct.DocLine
Direct Known Subclasses:
DocLine_Allocation, DocLine_Bank, DocLine_Cash, DocLine_InOut

public class DocLine extends Object
Standard Document Line
Version:
$Id: DocLine.java,v 1.2 2006/07/30 00:53:33 jjanke Exp $
Author:
Jorg Janke, Armen Rizal, Goodwill Consulting
  • BF [ 1745154 ] Cost in Reversing Material Related Docs
    • Field Details

      • p_po

        protected PO p_po
        Persistent Object
      • log

        protected transient CLogger log
        Log
    • Constructor Details

      • DocLine

        public DocLine(PO po, Doc doc)
        Create Document Line
        Parameters:
        po - line persistent object
        doc - header
    • Method Details

      • getC_Currency_ID

        public int getC_Currency_ID()
        Get Currency
        Returns:
        C_Currency_ID
      • getC_ConversionType_ID

        public int getC_ConversionType_ID()
        Get Conversion Type
        Returns:
        C_ConversionType_ID
      • setC_ConversionType_ID

        protected void setC_ConversionType_ID(int C_ConversionType_ID)
        Set C_ConversionType_ID
        Parameters:
        C_ConversionType_ID - id
      • getCurrencyRate

        public BigDecimal getCurrencyRate()
        Returns:
        Currency rate
      • setCurrencyRate

        protected void setCurrencyRate(BigDecimal currencyRate)
        Parameters:
        currencyRate -
      • setAmount

        public void setAmount(BigDecimal sourceAmt)
        Set Amount (DR)
        Parameters:
        sourceAmt - source amt
      • setAmount

        public void setAmount(BigDecimal amtSourceDr, BigDecimal amtSourceCr)
        Set Amounts
        Parameters:
        amtSourceDr - source amount dr
        amtSourceCr - source amount cr
      • setConvertedAmt

        public void setConvertedAmt(int C_AcctSchema_ID, BigDecimal amtAcctDr, BigDecimal amtAcctCr)
        Set Converted Amounts
        Parameters:
        C_AcctSchema_ID - acct schema
        amtAcctDr - acct amount dr
        amtAcctCr - acct amount cr
      • getAmtSource

        public BigDecimal getAmtSource()
        Line Net Amount or Dr-Cr
        Returns:
        balance
      • getAmtSourceDr

        public BigDecimal getAmtSourceDr()
        Get (Journal) Line Source Dr Amount
        Returns:
        DR source amount
      • getAmtSourceCr

        public BigDecimal getAmtSourceCr()
        Get (Journal) Line Source Cr Amount
        Returns:
        CR source amount
      • getAmtAcctDr

        public BigDecimal getAmtAcctDr()
        Line Journal Accounted Dr Amount
        Returns:
        DR accounted amount
      • getAmtAcctCr

        public BigDecimal getAmtAcctCr()
        Line Journal Accounted Cr Amount
        Returns:
        CR accounted amount
      • getChargeAmt

        public BigDecimal getChargeAmt()
        Charge Amount
        Returns:
        charge amount
      • setAmount

        public void setAmount(BigDecimal LineNetAmt, BigDecimal PriceList, BigDecimal Qty)
        Set Product Amounts
        Parameters:
        LineNetAmt - Line Net Amt
        PriceList - Price List
        Qty - Qty for discount calc
      • getDiscount

        public BigDecimal getDiscount()
        Line Discount
        Returns:
        discount amount
      • getListAmount

        public BigDecimal getListAmount()
        Line List Amount
        Returns:
        list amount
      • setLineNetAmtDifference

        public void setLineNetAmtDifference(BigDecimal diff)
        Set Line Net Amt Difference
        Parameters:
        diff - difference (to be subtracted)
      • setDateAcct

        public void setDateAcct(Timestamp dateAcct)
        Set Accounting Date
        Parameters:
        dateAcct - accounting date
      • getDateAcct

        public Timestamp getDateAcct()
        Get Accounting Date
        Returns:
        accounting date
      • getDateConv

        public Timestamp getDateConv()
        Get FX Conversion Date The foreign exchange rate conversion date may be different from the accounting posting date in some cases (e.g. bank statement)
        Returns:
        FX conversion date
      • setDateDoc

        public void setDateDoc(Timestamp dateDoc)
        Set Document Date
        Parameters:
        dateDoc - doc date
      • getDateDoc

        public Timestamp getDateDoc()
        Get Document Date
        Returns:
        document date
      • setAccount

        public void setAccount(MAccount acct)
        Set GL Journal Account
        Parameters:
        acct - account
      • getAccount

        public MAccount getAccount()
        Get GL Journal Account
        Returns:
        account
      • getAccount

        public MAccount getAccount(int AcctType, MAcctSchema as)
        Line Account from Product (or Charge).
        Parameters:
        AcctType - see ProductCost.ACCTTYPE_* (0..3)
        as - Accounting schema
        Returns:
        Requested Product Account
      • getC_Charge_ID

        protected int getC_Charge_ID()
        Get Charge
        Returns:
        C_Charge_ID
      • getChargeAccount

        public MAccount getChargeAccount(MAcctSchema as, BigDecimal amount)
        Get Charge Account
        Parameters:
        as - account schema
        amount - amount for expense(+)/revenue(-)
        Returns:
        Charge Account or null
      • getC_Period_ID

        protected int getC_Period_ID()
        Get Period
        Returns:
        C_Period_ID
      • setC_Period_ID

        protected void setC_Period_ID(int C_Period_ID)
        Set C_Period_ID
        Parameters:
        C_Period_ID - id
      • getC_AcctSchema_ID

        public int getC_AcctSchema_ID()
        Get (Journal) AcctSchema
        Returns:
        C_AcctSchema_ID
      • get_ID

        public int get_ID()
        Get Line ID
        Returns:
        id of line PO
      • getAD_Org_ID

        public int getAD_Org_ID()
        Get AD_Org_ID
        Returns:
        AD_Org_ID
      • getOrder_Org_ID

        public int getOrder_Org_ID()
        Get Order AD_Org_ID
        Returns:
        order AD_Org_ID if defined
      • getM_Product_ID

        public int getM_Product_ID()
        Product
        Returns:
        M_Product_ID
      • isItem

        public boolean isItem()
        Is this an Item Product (vs. not a Service, a charge)
        Returns:
        true if product is of type item
      • getM_AttributeSetInstance_ID

        public int getM_AttributeSetInstance_ID()
        ASI
        Returns:
        M_AttributeSetInstance_ID
      • getM_Locator_ID

        public int getM_Locator_ID()
        Get Warehouse Locator (from)
        Returns:
        M_Locator_ID
      • getM_LocatorTo_ID

        public int getM_LocatorTo_ID()
        Get Warehouse Locator To
        Returns:
        to M_Locator_ID
      • setProductionBOM

        public void setProductionBOM(boolean productionBOM)
        Set Production BOM flag
        Parameters:
        productionBOM - flag
      • isProductionBOM

        public boolean isProductionBOM()
        Is this the BOM to be produced
        Returns:
        true if BOM
      • getM_Production_ID

        public int getM_Production_ID()
        Get Production Header
        Returns:
        M_Production_ID
      • getC_OrderLine_ID

        public int getC_OrderLine_ID()
        Get Order Line Reference
        Returns:
        C_OrderLine_ID
      • getC_LocFrom_ID

        public int getC_LocFrom_ID()
        Get C_LocFrom_ID
        Returns:
        C_Location_ID from
      • setC_LocFrom_ID

        public void setC_LocFrom_ID(int C_LocFrom_ID)
        Set C_LocFrom_ID
        Parameters:
        C_LocFrom_ID - loc from
      • getPP_Cost_Collector_ID

        public int getPP_Cost_Collector_ID()
        Get PP_Cost_Collector_ID
        Returns:
        Cost Collector ID
      • setPP_Cost_Collector_ID

        public int setPP_Cost_Collector_ID(int PP_Cost_Collector_ID)
        Get PP_Cost_Collector_ID
        Returns:
        Cost Collector ID
      • getC_LocTo_ID

        public int getC_LocTo_ID()
        Get C_LocTo_ID
        Returns:
        C_Location_ID to
      • setC_LocTo_ID

        public void setC_LocTo_ID(int C_LocTo_ID)
        Set C_LocTo_ID
        Parameters:
        C_LocTo_ID - loc to
      • getProductCost

        public ProductCost getProductCost()
        Get Product Cost Info
        Returns:
        product cost
      • getProductCosts

        public BigDecimal getProductCosts(MAcctSchema as, int AD_Org_ID, boolean zeroCostsOK, String whereClause)
        Get Total Product Costs from Cost Detail or from Current Cost
        Parameters:
        as - accounting schema
        AD_Org_ID - trx org
        zeroCostsOK - zero/no costs are OK
        whereClause - null are OK
        Returns:
        costs
      • getProductCosts

        public BigDecimal getProductCosts(MAcctSchema as, int AD_Org_ID, boolean zeroCostsOK)
        Get Total Product Costs
        Parameters:
        as - accounting schema
        AD_Org_ID - trx org
        zeroCostsOK - zero/no costs are OK
        Returns:
        costs
      • getProduct

        public MProduct getProduct()
        Get Product
        Returns:
        product or null if no product
      • getC_RevenueRecognition_ID

        public int getC_RevenueRecognition_ID()
        Get Revenue Recognition
        Returns:
        C_RevenueRecognition_ID or 0
      • getC_UOM_ID

        public int getC_UOM_ID()
        Quantity UOM
        Returns:
        Transaction or Storage C_UOM_ID
      • setQty

        public void setQty(BigDecimal qty, boolean isSOTrx)
        Quantity
        Parameters:
        qty - transaction Qty
        isSOTrx - SL order trx (i.e. negative qty)
      • getQty

        public BigDecimal getQty()
        Quantity
        Returns:
        transaction Qty
      • getDescription

        public String getDescription()
        Description
        Returns:
        doc line description
      • getC_Tax_ID

        public int getC_Tax_ID()
        Line Tax
        Returns:
        C_Tax_ID
      • getLine

        public int getLine()
        Get Line Number
        Returns:
        line no
      • getC_BPartner_ID

        public int getC_BPartner_ID()
        Get BPartner
        Returns:
        C_BPartner_ID
      • setC_BPartner_ID

        protected void setC_BPartner_ID(int C_BPartner_ID)
        Set C_BPartner_ID
        Parameters:
        C_BPartner_ID - id
      • getC_BPartner_Location_ID

        public int getC_BPartner_Location_ID()
        Get C_BPartner_Location_ID
        Returns:
        C_BPartner_Location_ID
      • getAD_OrgTrx_ID

        public int getAD_OrgTrx_ID()
        Get TrxOrg
        Returns:
        AD_OrgTrx_ID
      • getC_SalesRegion_ID

        public int getC_SalesRegion_ID()
        Get SalesRegion. - get Sales Region from BPartner
        Returns:
        C_SalesRegion_ID
      • getC_Project_ID

        public int getC_Project_ID()
        Get Project
        Returns:
        C_Project_ID
      • getC_ProjectPhase_ID

        public int getC_ProjectPhase_ID()
        Get Project Phase
        Returns:
        C_ProjectPhase_ID
      • getC_ProjectTask_ID

        public int getC_ProjectTask_ID()
        Get Project Task
        Returns:
        C_ProjectTask_ID
      • getC_Campaign_ID

        public int getC_Campaign_ID()
        Get Campaign
        Returns:
        C_Campaign_ID
      • getC_Activity_ID

        public int getC_Activity_ID()
        Get Activity
        Returns:
        C_Activity_ID
      • getUser1_ID

        public int getUser1_ID()
        Get user defined id 1
        Returns:
        User1_ID
      • getUser2_ID

        public int getUser2_ID()
        Get user defined id 2
        Returns:
        User2_ID
      • getValue

        public int getValue(String ColumnName)
        Get column value
        Parameters:
        ColumnName - column name
        Returns:
        column value or 0 (if column doesn't exist)
      • setReversalLine_ID

        public void setReversalLine_ID(int ReversalLine_ID)
        Set ReversalLine_ID store original (voided/reversed) document line
        Parameters:
        ReversalLine_ID -
      • getReversalLine_ID

        public int getReversalLine_ID()
        Get ReversalLine_ID get original (voided/reversed) document line
        Returns:
        ReversalLine_ID
      • getPO

        public PO getPO()
        Returns:
        line PO
      • toString

        public String toString()
        String representation
        Overrides:
        toString in class Object
        Returns:
        String