private void TenderAll()
        {
            if (_tenderedValueViewModel.GetTenderedValue() > _paymentEditor.GetRemainingAmount())
            {
                _tenderedValueViewModel.UpdatePaymentAmount(0);
            }

            _tenderedValueViewModel.TenderedAmount = _tenderedValueViewModel.PaymentDueAmount;
            ResetAmount = true;
            OnTypedValueChanged();
        }
 private void OnSelectCalculationSelector(CalculationSelector calculationSelector)
 {
     foreach (var calculationType in calculationSelector.CalculationTypes)
     {
         var amount = calculationType.Amount;
         if (amount == 0)
         {
             amount = _tenderedValueViewModel.GetTenderedValue();
         }
         if (calculationType.CalculationMethod == 0 || calculationType.CalculationMethod == 1)
         {
             amount = amount / _paymentEditor.ExchangeRate;
         }
         _paymentEditor.SelectedTicket.AddCalculation(calculationType, amount);
     }
     _tenderedValueViewModel.UpdatePaymentAmount(0);
     _orderSelectorViewModel.UpdateTicket(_paymentEditor.SelectedTicket);
     _numberPadViewModel.ResetValues();
 }
 private bool CanMakePayment(PaymentType arg)
 {
     if (arg == null)
     {
         return(false);
     }
     if (_paymentEditor.AccountMode && _tenderedValueViewModel.GetTenderedValue() > _tenderedValueViewModel.GetPaymentDueValue())
     {
         return(false);
     }
     if (_paymentEditor.AccountMode && arg.Account == null)
     {
         return(false);
     }
     return(_paymentEditor.SelectedTicket != null &&
            !_paymentEditor.SelectedTicket.IsClosed &&
            _tenderedValueViewModel.GetTenderedValue() != 0 &&
            _paymentEditor.GetRemainingAmount() != 0 &&
            (arg.Account != null || _paymentEditor.SelectedTicket.TicketEntities.Any(x =>
                                                                                     _ticketService.CanMakeAccountTransaction(x, arg.AccountTransactionType, _accountBalances.GetAccountBalance(x.AccountId) + _tenderedValueViewModel.GetTenderedValue()))));
 }