Package org.compiere.model
Class ProductCost
- java.lang.Object
-
- org.compiere.model.ProductCost
-
public class ProductCost extends Object
Product Cost Model. Summarizes Info in MCost- Version:
- $Id: ProductCost.java,v 1.3 2006/07/30 00:51:03 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACCTTYPE_P_Asset
Product Asset Acctstatic int
ACCTTYPE_P_AverageCostVariance
Average costing variancestatic int
ACCTTYPE_P_Burden
Burdenstatic int
ACCTTYPE_P_Cogs
Product COGS Acctstatic int
ACCTTYPE_P_CostAdjustment
Cost Adjustmentstatic int
ACCTTYPE_P_CostOfProduction
Cost Productionstatic int
ACCTTYPE_P_Expense
Product Expense Acctstatic int
ACCTTYPE_P_FloorStock
Floor Stockstatic int
ACCTTYPE_P_InventoryClearing
Inventory Clearingstatic int
ACCTTYPE_P_IPV
Invoice Price Variancestatic int
ACCTTYPE_P_Labor
Laborstatic int
ACCTTYPE_P_LandedCostClearing
Landed cost clearingstatic int
ACCTTYPE_P_MethodChangeVariance
Method Change Variancestatic int
ACCTTYPE_P_MixVariance
Mix Variancestatic int
ACCTTYPE_P_OutsideProcessing
Outside Processingstatic int
ACCTTYPE_P_Overhead
Outside Overheadstatic int
ACCTTYPE_P_PPV
Purchase Price Variancestatic int
ACCTTYPE_P_RateVariance
Material Rate Variancestatic int
ACCTTYPE_P_Revenue
Product Revenue Acctstatic int
ACCTTYPE_P_Scrap
Outside Processingstatic int
ACCTTYPE_P_TDiscountGrant
Trade Discount Costsstatic int
ACCTTYPE_P_TDiscountRec
Trade Discount Revenuestatic int
ACCTTYPE_P_UsageVariance
Material Usage Variancestatic int
ACCTTYPE_P_WorkInProcess
Work in Process
-
Constructor Summary
Constructors Constructor Description ProductCost(Properties ctx, int M_Product_ID, int M_AttributeSetInstance_ID, String trxName)
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MAccount
getAccount(int AcctType, MAcctSchema as)
Line Account from ProductMAccount
getAccountDefault(int AcctType, MAcctSchema as)
Account from Default Product CategoryMProduct
getProduct()
Get ProductBigDecimal
getProductCosts(MAcctSchema as, int AD_Org_ID, String costingMethod, int C_OrderLine_ID, boolean zeroCostsOK)
Get Total Costs (amt*qty) in Accounting Schema Currencyboolean
isService()
Is this a Servicevoid
setM_M_AttributeSetInstance_ID(int M_AttributeSetInstance_ID)
void
setQty(BigDecimal qty)
Set Quantity in Storage UOMvoid
setQty(BigDecimal qty, int C_UOM_ID)
Set Quantity in UOMString
toString()
String Representation
-
-
-
Field Detail
-
ACCTTYPE_P_Revenue
public static final int ACCTTYPE_P_Revenue
Product Revenue Acct- See Also:
- Constant Field Values
-
ACCTTYPE_P_Expense
public static final int ACCTTYPE_P_Expense
Product Expense Acct- See Also:
- Constant Field Values
-
ACCTTYPE_P_Asset
public static final int ACCTTYPE_P_Asset
Product Asset Acct- See Also:
- Constant Field Values
-
ACCTTYPE_P_Cogs
public static final int ACCTTYPE_P_Cogs
Product COGS Acct- See Also:
- Constant Field Values
-
ACCTTYPE_P_PPV
public static final int ACCTTYPE_P_PPV
Purchase Price Variance- See Also:
- Constant Field Values
-
ACCTTYPE_P_IPV
public static final int ACCTTYPE_P_IPV
Invoice Price Variance- See Also:
- Constant Field Values
-
ACCTTYPE_P_TDiscountRec
public static final int ACCTTYPE_P_TDiscountRec
Trade Discount Revenue- See Also:
- Constant Field Values
-
ACCTTYPE_P_TDiscountGrant
public static final int ACCTTYPE_P_TDiscountGrant
Trade Discount Costs- See Also:
- Constant Field Values
-
ACCTTYPE_P_CostAdjustment
public static final int ACCTTYPE_P_CostAdjustment
Cost Adjustment- See Also:
- Constant Field Values
-
ACCTTYPE_P_InventoryClearing
public static final int ACCTTYPE_P_InventoryClearing
Inventory Clearing- See Also:
- Constant Field Values
-
ACCTTYPE_P_WorkInProcess
public static final int ACCTTYPE_P_WorkInProcess
Work in Process- See Also:
- Constant Field Values
-
ACCTTYPE_P_MethodChangeVariance
public static final int ACCTTYPE_P_MethodChangeVariance
Method Change Variance- See Also:
- Constant Field Values
-
ACCTTYPE_P_UsageVariance
public static final int ACCTTYPE_P_UsageVariance
Material Usage Variance- See Also:
- Constant Field Values
-
ACCTTYPE_P_RateVariance
public static final int ACCTTYPE_P_RateVariance
Material Rate Variance- See Also:
- Constant Field Values
-
ACCTTYPE_P_MixVariance
public static final int ACCTTYPE_P_MixVariance
Mix Variance- See Also:
- Constant Field Values
-
ACCTTYPE_P_FloorStock
public static final int ACCTTYPE_P_FloorStock
Floor Stock- See Also:
- Constant Field Values
-
ACCTTYPE_P_CostOfProduction
public static final int ACCTTYPE_P_CostOfProduction
Cost Production- See Also:
- Constant Field Values
-
ACCTTYPE_P_Labor
public static final int ACCTTYPE_P_Labor
Labor- See Also:
- Constant Field Values
-
ACCTTYPE_P_Burden
public static final int ACCTTYPE_P_Burden
Burden- See Also:
- Constant Field Values
-
ACCTTYPE_P_OutsideProcessing
public static final int ACCTTYPE_P_OutsideProcessing
Outside Processing- See Also:
- Constant Field Values
-
ACCTTYPE_P_Overhead
public static final int ACCTTYPE_P_Overhead
Outside Overhead- See Also:
- Constant Field Values
-
ACCTTYPE_P_Scrap
public static final int ACCTTYPE_P_Scrap
Outside Processing- See Also:
- Constant Field Values
-
ACCTTYPE_P_AverageCostVariance
public static final int ACCTTYPE_P_AverageCostVariance
Average costing variance- See Also:
- Constant Field Values
-
ACCTTYPE_P_LandedCostClearing
public static final int ACCTTYPE_P_LandedCostClearing
Landed cost clearing- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ProductCost
public ProductCost(Properties ctx, int M_Product_ID, int M_AttributeSetInstance_ID, String trxName)
Constructor- Parameters:
ctx
- contextM_Product_ID
- productM_AttributeSetInstance_ID
- asitrxName
- trx
-
-
Method Detail
-
getProduct
public MProduct getProduct()
Get Product- Returns:
- Product might be null
-
isService
public boolean isService()
Is this a Service- Returns:
- true if service
-
setQty
public void setQty(BigDecimal qty)
Set Quantity in Storage UOM- Parameters:
qty
- quantity
-
setQty
public void setQty(BigDecimal qty, int C_UOM_ID)
Set Quantity in UOM- Parameters:
qty
- quantityC_UOM_ID
- UOM
-
getAccount
public MAccount getAccount(int AcctType, MAcctSchema as)
Line Account from Product- Parameters:
AcctType
- see ACCTTYPE_* (1..8)as
- Accounting Schema- Returns:
- Requested Product Account
-
getAccountDefault
public MAccount getAccountDefault(int AcctType, MAcctSchema as)
Account from Default Product Category- Parameters:
AcctType
- see ACCTTYPE_* (1..8)as
- accounting schema- Returns:
- Requested Product Account
-
getProductCosts
public BigDecimal getProductCosts(MAcctSchema as, int AD_Org_ID, String costingMethod, int C_OrderLine_ID, boolean zeroCostsOK)
Get Total Costs (amt*qty) in Accounting Schema Currency- Parameters:
as
- accounting schemaAD_Org_ID
- trx orgcostingMethod
- if null uses Accounting Schema - AcctSchema.COSTINGMETHOD_*C_OrderLine_ID
- optional order linezeroCostsOK
- zero/no costs are OK- Returns:
- cost or null, if qty or costs cannot be determined
-
toString
public String toString()
String Representation
-
setM_M_AttributeSetInstance_ID
public void setM_M_AttributeSetInstance_ID(int M_AttributeSetInstance_ID)
- Parameters:
M_AttributeSetInstance_ID
- the m_M_AttributeSetInstance_ID to set
-
-