(warning) Deprecated. PriceIncreaseEngine of Accelerate Price Setting Package will be reworked to provide this functionality and wrap these functions.
This code enables you to calculate the cost using the cost plus strategy. For the calculation, cost and margin are required.
def baseCost = 12.5
def materialCost = 10
def laborCost = 2
def margin = 0.15
def fixedMargin = 20
def costPlus = libs.PriceListManagement.CostPlus
def calculator = costPlus.calculator(margin,baseCost,materialCost,laborCost)
def percentageBasedCost = calculator/*.percentageBased()*/.calculate() // Percentage based is default
def sellingPriceBasedCost = calculator.sellingPriceBased().calculate()
def absoluteMarginBasedCost = calculator.absoluteMarginBased().setMargin(fixedMargin).calculate()