Esempio n. 1
0
 public void Close()
 {
     if (RemainingAmount == 0 && !HasActiveTimers())
     {
         IsClosed = true;
         PaidItems.Clear();
     }
 }
Esempio n. 2
0
        public void AddPayment(PaymentType paymentType, Account account, decimal amount, decimal exchangeRate, int userId)
        {
            var transaction = TransactionDocument.AddNewTransaction(paymentType.AccountTransactionType, GetTicketAccounts(account), amount, exchangeRate);
            var payment     = new Payment {
                AccountTransaction = transaction, Amount = amount, Name = account.Name, PaymentTypeId = paymentType.Id
            };

            Payments.Add(payment);
            LastPaymentDate = DateTime.Now;
            RemainingAmount = GetRemainingAmount();
            if (RemainingAmount == 0)
            {
                PaidItems.Clear();
            }
        }
Esempio n. 3
0
        public void PersistPaidItems()
        {
            foreach (var newPaidItem in NewPaidItems)
            {
                var item  = newPaidItem;
                var pitem = PaidItems.SingleOrDefault(
                    x => x.MenuItemId == item.MenuItemId && x.Price == item.Price);
                if (pitem != null)
                {
                    pitem.Quantity += newPaidItem.Quantity;
                }
                else
                {
                    PaidItems.Add(newPaidItem);
                }
            }

            NewPaidItems.Clear();
            FontWeight = FontWeights.Normal;
            Refresh();
        }
Esempio n. 4
0
 private decimal GetPaidItemsQuantity()
 {
     return(PaidItems.Sum(x => x.Quantity) + NewPaidItems.Sum(x => x.Quantity));
 }