public static Money CalculateDefaultPriceReduction(Money originalPrice, int itemQuantity, IPromotionData data) { Money priceReduction = null; Money promotionPrice = new Money(originalPrice, 0); promotionPrice.Amount = data.PromotionAmount; promotionPrice.Multiply(itemQuantity); switch (data.PromotionAmountType) { case PromotionAmountType.PercentReduction: if (data.PromotionAmount <= 100 && data.PromotionAmount > 0) { priceReduction = new Money(originalPrice); priceReduction.RoundingMode = RoundingMode.AlwaysRoundUp; priceReduction.Multiply(data.PromotionAmount / 100); } else { priceReduction = originalPrice; } break; case PromotionAmountType.AbsolutePrice: priceReduction = new Money(originalPrice); priceReduction.Subtract(promotionPrice); break; case PromotionAmountType.AbsoluteReduction: priceReduction = promotionPrice; break; default: LogManager.GetLogger(typeof(GenericPromotion)).Error("Unknown PromotionAmountType"); break; } return priceReduction; }
public FreeDeliveryBasketPromotion(IPromotionData data) : base(data) { }
public SimpleBasketPromotion(IPromotionData data) : base(data) { }
public MinimumSpendBasketPromotion(IPromotionData data) : base(data) { }
public BuyNGetOneFreeBasketLinePromotion(IPromotionData data) : base(data) { }