Exemplo n.º 1
0
        public void Apply(ODataOrderHeader order, DdfDiscount discount)
        {
            order.DiscountId     = discount.DiscountId;
            order.DiscountAmount = discount.DiscountAmount;
            order.OrderTotal     = Calculate(order.DealerNetListTotal, discount.DiscountAmount);

            if (order.OrderTotal < 0)
            {
                ThrowNegativeTotalException(order.OrderId.ToString());
            }
        }
Exemplo n.º 2
0
        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());
            }
        }
Exemplo n.º 3
0
 /// <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);
 }