예제 #1
0
        private static void LogDecreasedTicketItemLateCancels(Ticket ticket, TicketItem ticketItem)
        {
            int originalQuantity = ticketItem.GetCurrentQuantity();

            if (ticketItem.QuantityPending.HasValue && (ticketItem.QuantityPending < originalQuantity))
            {
                int             difference = originalQuantity - ticketItem.QuantityPending.Value;
                Item            item       = Item.Get(ticketItem.ItemId);
                PosDialogWindow window     =
                    CancelMadeUnmadeControl.CreateInDefaultWindow("Cancel: " + item.FullName +
                                                                  " (" + difference + ")");
                var control = window.DockedControl as CancelMadeUnmadeControl;
                window.ShowDialog();
                if (control != null && !control.IsMade.HasValue)
                {
                    ticketItem.SetQuantity(originalQuantity);
                }
                else
                {
                    TicketItem canceledTicketItem =
                        TicketItem.Add(ticket.PrimaryKey, ticketItem.ItemId, difference, ticketItem.Price,
                                       ticketItem.OrderTime, ticketItem.PreparedTime);
                    DuplicateItemOptions(ticketItem, canceledTicketItem);
                    Employee employee = SessionManager.PseudoEmployee ?? SessionManager.ActiveEmployee;
                    canceledTicketItem.Cancel(CancelType.DecreasedQuantity,
                                              employee.Id, control != null && control.IsMade.Value);
                }
            }
        }
예제 #2
0
        public static bool?ConfirmCancelPrompt(TicketItem ticketItem)
        {
            PosDialogWindow window  = CancelMadeUnmadeControl.CreateInDefaultWindow(Types.Strings.CancelTicketItem);
            var             control = window.DockedControl as CancelMadeUnmadeControl;

            if (control == null)
            {
                return(null);
            }
            window.IsClosable = false;
            PosDialogWindow.ShowPosDialogWindow(window);
            return(control.IsMade);
        }
예제 #3
0
        public static TicketRefundType?ConfirmRefundPrompt()
        {
            PosDialogWindow window  = CancelMadeUnmadeControl.CreateInDefaultWindow(Types.Strings.RefundTicket, true);
            var             control = window.DockedControl as CancelMadeUnmadeControl;

            if (control == null)
            {
                return(null);
            }
            window.IsClosable = false;
            PosDialogWindow.ShowPosDialogWindow(window);
            return(control.RefundMode);
        }