Adempiere 3.5.2a

org.compiere.acct
Class DocLine

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

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

Field Summary
protected  CLogger log
          Log
protected  PO p_po
          Persistent Object
 
Constructor Summary
DocLine(PO po, Doc doc)
          Create Document Line
 
Method Summary
 int get_ID()
          Get Line ID
 MAccount getAccount()
          Get GL Journal Account
 MAccount getAccount(int AcctType, MAcctSchema as)
          Line Account from Product (or Charge).
 int getAD_Org_ID()
          Get AD_Org_ID
 int getAD_OrgTrx_ID()
          Get TrxOrg
 BigDecimal getAmtAcctCr()
          Line Journal Accounted Cr Amount
 BigDecimal getAmtAcctDr()
          Line Journal Accounted Dr Amount
 BigDecimal getAmtSource()
          Line Net Amount or Dr-Cr
 BigDecimal getAmtSourceCr()
          Get (Journal) Line Source Cr Amount
 BigDecimal getAmtSourceDr()
          Get (Journal) Line Source Dr Amount
 int getC_AcctSchema_ID()
          Get (Journal) AcctSchema
 int getC_Activity_ID()
          Get Activity
 int getC_BPartner_ID()
          Get BPartner
 int getC_BPartner_Location_ID()
          Get C_BPartner_Location_ID
 int getC_Campaign_ID()
          Get Campaign
protected  int getC_Charge_ID()
          Get Charge
 int getC_ConversionType_ID()
          Get Conversion Type
 int getC_Currency_ID()
          Get Currency
 int getC_LocFrom_ID()
          Get C_LocFrom_ID
 int getC_LocTo_ID()
          Get C_LocTo_ID
 int getC_OrderLine_ID()
          Get Order Line Reference
protected  int getC_Period_ID()
          Get Period
 int getC_Project_ID()
          Get Project
 int getC_RevenueRecognition_ID()
          Get Revenue Recognition
 int getC_SalesRegion_ID()
          Get SalesRegion
 int getC_Tax_ID()
          Line Tax
 int getC_UOM_ID()
          Quantity UOM
 MAccount getChargeAccount(MAcctSchema as, BigDecimal amount)
          Get Charge Account
 BigDecimal getChargeAmt()
          Charge Amount
 Timestamp getDateAcct()
          Get Accounting Date
 Timestamp getDateDoc()
          Get Document Date
 String getDescription()
          Description
 BigDecimal getDiscount()
          Line Discount
 int getLine()
          Get Line Number
 BigDecimal getListAmount()
          Line List Amount
 int getM_AttributeSetInstance_ID()
          ASI
 int getM_Locator_ID()
          Get Warehouse Locator (from)
 int getM_LocatorTo_ID()
          Get Warehouse Locator To
 int getM_Product_ID()
          Product
 int getM_ProductionPlan_ID()
          Get Production Plan
 int getOrder_Org_ID()
          Get Order AD_Org_ID
 MProduct getProduct()
          Get Product
 ProductCost getProductCost()
          Get Product Cost Info
 BigDecimal getProductCosts(MAcctSchema as, int AD_Org_ID, boolean zeroCostsOK)
          Get Total Product Costs
 BigDecimal getProductCosts(MAcctSchema as, int AD_Org_ID, boolean zeroCostsOK, String whereClause)
          Get Total Product Costs from Cost Detail or from Current Cost
 BigDecimal getQty()
          Quantity
 int getUser1_ID()
          Get User 1
 int getUser2_ID()
          Get User 2
 int getValue(String ColumnName)
          Get User Defined Column
 boolean isItem()
          Is this an Item Product (vs. not a Service, a charge)
 boolean isProductionBOM()
          Is this the BOM to be produced
 void setAccount(MAccount acct)
          Set GL Journal Account
 void setAmount(BigDecimal sourceAmt)
          Set Amount (DR)
 void setAmount(BigDecimal amtSourceDr, BigDecimal amtSourceCr)
          Set Amounts
 void setAmount(BigDecimal LineNetAmt, BigDecimal PriceList, BigDecimal Qty)
          Set Product Amounts
protected  void setC_BPartner_ID(int C_BPartner_ID)
          Set C_BPartner_ID
protected  void setC_ConversionType_ID(int C_ConversionType_ID)
          Set C_ConversionType_ID
 void setC_LocFrom_ID(int C_LocFrom_ID)
          Set C_LocFrom_ID
 void setC_LocTo_ID(int C_LocTo_ID)
          Set C_LocTo_ID
protected  void setC_Period_ID(int C_Period_ID)
          Set C_Period_ID
 void setConvertedAmt(int C_AcctSchema_ID, BigDecimal amtAcctDr, BigDecimal amtAcctCr)
          Set Converted Amounts
 void setDateAcct(Timestamp dateAcct)
          Set Accounting Date
 void setDateDoc(Timestamp dateDoc)
          Set Document Date
 void setLineNetAmtDifference(BigDecimal diff)
          Set Line Net Amt Difference
 void setProductionBOM(boolean productionBOM)
          Set Production BOM flag
 void setQty(BigDecimal qty, boolean isSOTrx)
          Quantity
 String toString()
          String representation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

p_po

protected PO p_po
Persistent Object


log

protected CLogger log
Log

Constructor Detail

DocLine

public DocLine(PO po,
               Doc doc)
Create Document Line

Parameters:
po - line persistent object
doc - header
Method Detail

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

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 - acct date

getDateAcct

public Timestamp getDateAcct()
Get Accounting Date

Returns:
accounting 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

getAD_Org_ID

public int getAD_Org_ID()
Get AD_Org_ID

Returns:
org

getOrder_Org_ID

public int getOrder_Org_ID()
Get Order AD_Org_ID

Returns:
order org 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

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:
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_ProductionPlan_ID

public int getM_ProductionPlan_ID()
Get Production Plan

Returns:
M_ProductionPlan_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:
loc from

setC_LocFrom_ID

public void setC_LocFrom_ID(int C_LocFrom_ID)
Set C_LocFrom_ID

Parameters:
C_LocFrom_ID - loc from

getC_LocTo_ID

public int getC_LocTo_ID()
Get C_LocTo_ID

Returns:
loc 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 M_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:
BPartner Location

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_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 1

Returns:
user defined 1

getUser2_ID

public int getUser2_ID()
Get User 2

Returns:
user defined 2

getValue

public int getValue(String ColumnName)
Get User Defined Column

Parameters:
ColumnName - column name
Returns:
user defined column value

toString

public String toString()
String representation

Overrides:
toString in class Object
Returns:
String

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.