Package org.compiere.model
Class MProductPricing
- java.lang.Object
-
- org.adempiere.base.AbstractProductPricing
-
- org.compiere.model.MProductPricing
-
- All Implemented Interfaces:
IProductPricing
public class MProductPricing extends AbstractProductPricing
Product Price Calculations- Version:
- $Id: MProductPricing.java,v 1.2 2006/07/30 00:51:02 jjanke Exp $
- Author:
- Jorg Janke
-
-
Field Summary
Fields Modifier and Type Field Description protected CLogger
log
Logger-
Fields inherited from class org.adempiere.base.AbstractProductPricing
m_C_BPartner_ID, m_isSOTrx, m_M_PriceList_ID, m_M_PriceList_Version_ID, m_M_Product_ID, m_PriceDate, m_Qty, trxName
-
-
Constructor Summary
Constructors Constructor Description MProductPricing()
New constructor to be used with the ProductPriceFactoriesMProductPricing(int M_Product_ID, int C_BPartner_ID, BigDecimal Qty, boolean isSOTrx)
Deprecated.Use constructor with explicit trxName parameterMProductPricing(int M_Product_ID, int C_BPartner_ID, BigDecimal Qty, boolean isSOTrx, String trxName)
Old Constructor to keep backward compatibility
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
calculatePrice()
Calculate Priceint
getC_Currency_ID()
Get Price List Currencyint
getC_UOM_ID()
Get C_UOM_IDBigDecimal
getDiscount()
Calculate Discount Percentage based on Standard/List Priceint
getM_PriceList_Version_ID()
Get PriceList Versionint
getPrecision()
Get PrecisionBigDecimal
getPriceLimit()
Get Price LimitBigDecimal
getPriceList()
Get Price ListBigDecimal
getPriceStd()
Get Price Stdboolean
isCalculated()
Is the Price Calculated (i.e. found)?boolean
isDiscountSchema()
Is a DiscountSchema active?boolean
isEnforcePriceLimit()
Is Price List enforded?boolean
isTaxIncluded()
Is Tax Includedvoid
setInitialValues(int M_Product_ID, int C_BPartner_ID, BigDecimal qty, boolean isSOTrx, String trxName)
Set the initial values that the old MProductPricing uses for backward compatibilityvoid
setInvoiceLine(I_C_InvoiceLine invoiceLine, String trxName)
Set invoice line and calculate the parameters from itvoid
setM_PriceList_ID(int M_PriceList_ID)
Set PriceListvoid
setM_PriceList_Version_ID(int M_PriceList_Version_ID)
Set PriceList Versionvoid
setOrderLine(I_C_OrderLine orderLine, String trxName)
Set order line and calculate the parameters from itvoid
setPriceDate(Timestamp priceDate)
Set Price Datevoid
setProjectLine(I_C_ProjectLine projectLine, String trxName)
Set project line and calculate the parameters from itvoid
setRequisitionLine(I_M_RequisitionLine reqLine, String trxName)
Set requisition line and calculate the parameters from itvoid
setRMALine(I_M_RMALine rmaLine, String trxName)
Set rma line and calculate the parameters from it-
Methods inherited from class org.adempiere.base.AbstractProductPricing
getM_PriceList_ID, getM_Product_ID, getPriceDate, setQty
-
-
-
-
Field Detail
-
log
protected CLogger log
Logger
-
-
Constructor Detail
-
MProductPricing
public MProductPricing()
New constructor to be used with the ProductPriceFactories
-
MProductPricing
public MProductPricing(int M_Product_ID, int C_BPartner_ID, BigDecimal Qty, boolean isSOTrx, String trxName)
Old Constructor to keep backward compatibility- Parameters:
M_Product_ID
- productC_BPartner_ID
- partnerQty
- quantityisSOTrx
- SO or POtrxName
- the transaction
-
MProductPricing
public MProductPricing(int M_Product_ID, int C_BPartner_ID, BigDecimal Qty, boolean isSOTrx)
Deprecated.Use constructor with explicit trxName parameterConstructor- Parameters:
M_Product_ID
- productC_BPartner_ID
- partnerQty
- quantityisSOTrx
- SO or PO
-
-
Method Detail
-
setInitialValues
public void setInitialValues(int M_Product_ID, int C_BPartner_ID, BigDecimal qty, boolean isSOTrx, String trxName)
Description copied from interface:IProductPricing
Set the initial values that the old MProductPricing uses for backward compatibility- Specified by:
setInitialValues
in interfaceIProductPricing
- Overrides:
setInitialValues
in classAbstractProductPricing
-
calculatePrice
public boolean calculatePrice()
Calculate Price- Returns:
- true if calculated
-
isTaxIncluded
public boolean isTaxIncluded()
Is Tax Included- Returns:
- tax included
-
getDiscount
public BigDecimal getDiscount()
Calculate Discount Percentage based on Standard/List Price- Returns:
- Discount
-
setM_PriceList_ID
public void setM_PriceList_ID(int M_PriceList_ID)
Set PriceList- Specified by:
setM_PriceList_ID
in interfaceIProductPricing
- Overrides:
setM_PriceList_ID
in classAbstractProductPricing
- Parameters:
M_PriceList_ID
- pl
-
getM_PriceList_Version_ID
public int getM_PriceList_Version_ID()
Get PriceList Version- Returns:
- plv
-
setM_PriceList_Version_ID
public void setM_PriceList_Version_ID(int M_PriceList_Version_ID)
Set PriceList Version- Specified by:
setM_PriceList_Version_ID
in interfaceIProductPricing
- Overrides:
setM_PriceList_Version_ID
in classAbstractProductPricing
- Parameters:
M_PriceList_Version_ID
- plv
-
setPriceDate
public void setPriceDate(Timestamp priceDate)
Set Price Date- Specified by:
setPriceDate
in interfaceIProductPricing
- Overrides:
setPriceDate
in classAbstractProductPricing
- Parameters:
priceDate
- date
-
getPrecision
public int getPrecision()
Get Precision- Returns:
- precision - -1 = no rounding
-
getC_UOM_ID
public int getC_UOM_ID()
Get C_UOM_ID- Returns:
- uom
-
getPriceList
public BigDecimal getPriceList()
Get Price List- Returns:
- list
-
getPriceStd
public BigDecimal getPriceStd()
Get Price Std- Returns:
- std
-
getPriceLimit
public BigDecimal getPriceLimit()
Get Price Limit- Returns:
- limit
-
getC_Currency_ID
public int getC_Currency_ID()
Get Price List Currency- Returns:
- currency
-
isEnforcePriceLimit
public boolean isEnforcePriceLimit()
Is Price List enforded?- Returns:
- enforce limit
-
isDiscountSchema
public boolean isDiscountSchema()
Is a DiscountSchema active?- Returns:
- active Discount Schema
-
isCalculated
public boolean isCalculated()
Is the Price Calculated (i.e. found)?- Returns:
- calculated
-
setOrderLine
public void setOrderLine(I_C_OrderLine orderLine, String trxName)
Description copied from interface:IProductPricing
Set order line and calculate the parameters from it- Specified by:
setOrderLine
in interfaceIProductPricing
- Overrides:
setOrderLine
in classAbstractProductPricing
-
setInvoiceLine
public void setInvoiceLine(I_C_InvoiceLine invoiceLine, String trxName)
Description copied from interface:IProductPricing
Set invoice line and calculate the parameters from it- Specified by:
setInvoiceLine
in interfaceIProductPricing
- Overrides:
setInvoiceLine
in classAbstractProductPricing
-
setProjectLine
public void setProjectLine(I_C_ProjectLine projectLine, String trxName)
Description copied from interface:IProductPricing
Set project line and calculate the parameters from it- Specified by:
setProjectLine
in interfaceIProductPricing
- Overrides:
setProjectLine
in classAbstractProductPricing
-
setRequisitionLine
public void setRequisitionLine(I_M_RequisitionLine reqLine, String trxName)
Description copied from interface:IProductPricing
Set requisition line and calculate the parameters from it- Specified by:
setRequisitionLine
in interfaceIProductPricing
- Overrides:
setRequisitionLine
in classAbstractProductPricing
-
setRMALine
public void setRMALine(I_M_RMALine rmaLine, String trxName)
Description copied from interface:IProductPricing
Set rma line and calculate the parameters from it- Specified by:
setRMALine
in interfaceIProductPricing
- Overrides:
setRMALine
in classAbstractProductPricing
-
-