Package org.openbravo.costing
Class AverageAlgorithm
- java.lang.Object
-
- org.openbravo.costing.CostingAlgorithm
-
- org.openbravo.costing.AverageAlgorithm
-
public class AverageAlgorithm extends CostingAlgorithm
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openbravo.costing.CostingAlgorithm
CostingAlgorithm.CostDimension
-
-
Field Summary
-
Fields inherited from class org.openbravo.costing.CostingAlgorithm
costCurrency, costDimensions, costingRule, costOrg, log4j, transaction, trxType
-
-
Constructor Summary
Constructors Constructor Description AverageAlgorithm()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected BigDecimal
getDefaultCost()
In case the Default Cost is used it prioritizes the existence of an average cost.protected static Costing
getLastCumulatedCosting(Date date, Product product, HashMap<CostingAlgorithm.CostDimension,BaseOBObject> costDimensions, Organization costOrg)
protected BigDecimal
getOutgoingTransactionCost()
Calculates the total cost amount of an outgoing transaction.protected static Costing
getProductCost(Date date, Product product, HashMap<CostingAlgorithm.CostDimension,BaseOBObject> costDimensions, Organization costOrg)
protected BigDecimal
getReceiptDefaultCost()
BigDecimal
getTransactionCost()
Based on the transaction type, calls the corresponding method to calculate and return the total cost amount of the transaction.protected static boolean
modifiesAverage(CostingServer.TrxType trxType)
Return true if the transaction type should be modify the average-
Methods inherited from class org.openbravo.costing.CostingAlgorithm
getBOMPartCost, getBOMProductCost, getCostCurrency, getInternalConsCost, getInternalConsNegativeCost, getInternalConsVoidCost, getIntMovementFromCost, getIntMovementToCost, getInventoryClosingCost, getInventoryDecreaseCost, getInventoryIncreaseCost, getInventoryOpeningCost, getOriginalInOutLineCost, getPriceListCost, getReceiptCost, getReceiptNegativeCost, getReceiptReturnCost, getReceiptVoidCost, getReturnedInOutLineCost, getShipmentCost, getShipmentNegativeCost, getShipmentReturnCost, getShipmentVoidCost, getTransactionStandardCost, getZeroMovementQtyCost, init
-
-
-
-
Method Detail
-
getTransactionCost
public BigDecimal getTransactionCost()
Description copied from class:CostingAlgorithm
Based on the transaction type, calls the corresponding method to calculate and return the total cost amount of the transaction.- Overrides:
getTransactionCost
in classCostingAlgorithm
- Returns:
- the total cost amount of the transaction.
-
getOutgoingTransactionCost
protected BigDecimal getOutgoingTransactionCost()
Description copied from class:CostingAlgorithm
Calculates the total cost amount of an outgoing transaction.- Specified by:
getOutgoingTransactionCost
in classCostingAlgorithm
-
getDefaultCost
protected BigDecimal getDefaultCost()
In case the Default Cost is used it prioritizes the existence of an average cost.- Overrides:
getDefaultCost
in classCostingAlgorithm
-
getReceiptDefaultCost
protected BigDecimal getReceiptDefaultCost()
- Overrides:
getReceiptDefaultCost
in classCostingAlgorithm
-
getProductCost
protected static Costing getProductCost(Date date, Product product, HashMap<CostingAlgorithm.CostDimension,BaseOBObject> costDimensions, Organization costOrg)
-
getLastCumulatedCosting
protected static Costing getLastCumulatedCosting(Date date, Product product, HashMap<CostingAlgorithm.CostDimension,BaseOBObject> costDimensions, Organization costOrg)
-
modifiesAverage
protected static boolean modifiesAverage(CostingServer.TrxType trxType)
Return true if the transaction type should be modify the average
-
-