public void Apply(OrderHeader order, DdfDiscount discount) { order.DiscountId = discount.DiscountId; order.OrderPricing.DiscountAmount = discount.DiscountAmount; order.OrderPricing.DealerTotal = Calculate(order.OrderPricing.DealerNetListTotal.Value, discount.DiscountAmount); if (order.OrderPricing.DealerTotal < 0) { ThrowNegativeTotalException(order.OrderId.ToString()); } }
public void Apply(ODataOrderHeader order, DdfDiscount discount) { order.DiscountId = discount.DiscountId; order.DiscountAmount = discount.DiscountAmount; order.DiscountDollarAmount = (discount.DiscountAmount.ConvertToPercentage() * order.DealerNetListTotal).ApplyBankersRounding(); order.OrderTotal = Calculate(order.DealerNetListTotal, order.DiscountDollarAmount); if (order.OrderTotal < 0) { ThrowNegativeTotalException(order.OrderId.ToString()); } }
/// <summary> /// Calculate the order discount and apply it to the order. /// </summary> /// <param name="order">The OrderHeader including OrderProcess and OrderPricing models</param> /// <param name="discountData">The DdfDiscount model containg the discount data</param> public void Apply(OrderHeader order, DdfDiscount discountData) { discount.Apply(order, discountData); }
/// <summary> /// Calculate the order discount and apply it to the order. /// </summary> /// <param name="currentOrder">The ODataOrderHeader for the current order.</param> /// <param name="discountAmount">The decimal for the discount amount.</param> public void Apply(ODataOrderHeader currentOrder, DdfDiscount discountData) { discount.Apply(currentOrder, discountData); }