Ejemplo n.º 1
0
 public static decimal CalculateTicketItemTotal(Ticket ticket, TicketItem ticketItem)
 {
     var discount = ticket.GetDiscountAndRoundingTotal();
     if (discount != 0)
     {
         var tsum = ticket.GetSumWithoutTax() + discount;
         var rate = tsum > 0 ? (discount * 100) / tsum : 100;
         var tiTotal = ticketItem.GetTotal();
         var itemDiscount = (tiTotal * rate) / 100;
         return tiTotal - itemDiscount;
     }
     return ticketItem.GetTotal();
 }