/// <summary> /// Get Base value for Cost Distribution /// </summary> /// <param name="CostDistribution">Cost Distribution</param> /// <returns>base number</returns> public Decimal GetBase(String CostDistribution) { if (MLandedCost.LANDEDCOSTDISTRIBUTION_Costs.Equals(CostDistribution)) { // TODO Costs! log.Severe("Not Implemented yet - Cost"); return(Env.ZERO); } else if (MLandedCost.LANDEDCOSTDISTRIBUTION_Line.Equals(CostDistribution)) { return(Env.ONE); } else if (MLandedCost.LANDEDCOSTDISTRIBUTION_Quantity.Equals(CostDistribution)) { return(GetMovementQty()); } else if (MLandedCost.LANDEDCOSTDISTRIBUTION_Volume.Equals(CostDistribution)) { MProduct product = GetProduct(); if (product == null) { log.Severe("No Product"); return(Env.ZERO); } return(Decimal.Multiply(GetMovementQty(), (Decimal)product.GetVolume())); } else if (MLandedCost.LANDEDCOSTDISTRIBUTION_Weight.Equals(CostDistribution)) { MProduct product = GetProduct(); if (product == null) { log.Severe("No Product"); return(Env.ZERO); } return(Decimal.Multiply(GetMovementQty(), product.GetWeight())); } log.Severe("Invalid Criteria: " + CostDistribution); return(Env.ZERO); }