public void Recalculate(Ticket ticket) { ticket.Recalculate(AppServices.SettingService.AutoRoundDiscount, AppServices.CurrentLoggedInUser.Id); }
public void RecalculateTicket(Ticket ticket) { var total = ticket.TotalAmount; ticket.Calculations.Where(x => x.CalculationType == 5).ToList().ForEach( x => x.Amount = _expressionService.EvalCommand(FunctionNames.Calculation, "_" + x.Name, new { Ticket = ticket }, 0m)); ticket.Recalculate(); if (total != ticket.TotalAmount) { _applicationState.NotifyEvent(RuleEventNames.TicketTotalChanged, new { Ticket = ticket, PreviousTotal = total, TicketTotal = ticket.GetSum(), DiscountTotal = ticket.GetPreTaxServicesTotal(), PaymentTotal = ticket.GetPaymentAmount(), RemainingAmount = ticket.GetRemainingAmount() }); } }
public void RecalculateTicket(Ticket ticket) { var total = ticket.TotalAmount; ticket.Recalculate(); if (total != ticket.TotalAmount) { _automationService.NotifyEvent(RuleEventNames.TicketTotalChanged, new { Ticket = ticket, PreviousTotal = total, TicketTotal = ticket.GetSum(), DiscountTotal = ticket.GetPreTaxServicesTotal(), PaymentTotal = ticket.GetPaymentAmount(), RemainingAmount = ticket.GetRemainingAmount() }); } }