private bool CanSelectCalculationSelector(CalculationSelector calculationSelector)
 {
     if (calculationSelector == null) return false;
     if (_paymentEditor.SelectedTicket != null && (_paymentEditor.SelectedTicket.IsLocked || _paymentEditor.SelectedTicket.IsClosed)) return false;
     if (_paymentEditor.SelectedTicket != null && _paymentEditor.SelectedTicket.GetRemainingAmount() == 0 && _paymentEditor.SelectedTicket != null && !calculationSelector.CalculationTypes.Any(x => _paymentEditor.SelectedTicket.Calculations.Any(y => y.CalculationTypeId == x.Id))) return false;
     return !calculationSelector.CalculationTypes.Any(x => x.MaxAmount > 0 && _tenderedValueViewModel.GetTenderedValue() > x.MaxAmount);
 }
 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();
 }
Пример #3
0
 private void OnSelectCalculationSelector(CalculationSelector calculationSelector)
 {
     foreach (var calculationType in calculationSelector.CalculationTypes)
     {
         var amount = calculationType.Amount;
         if (amount == 0) amount = GetTenderedValue();
         if (calculationType.CalculationMethod == 0 || calculationType.CalculationMethod == 1) amount = amount / ExchangeRate;
         SelectedTicket.AddCalculation(calculationType, amount);
     }
     UpdatePaymentAmount(0);
     OrderSelector.UpdateTicket(SelectedTicket);
     RefreshValues();
 }
Пример #4
0
 private bool CanSelectCalculationSelector(CalculationSelector calculationSelector)
 {
     if (calculationSelector == null) return false;
     if (SelectedTicket != null && (SelectedTicket.Locked || SelectedTicket.IsClosed)) return false;
     if (GetPaymentDueValue() == 0 && SelectedTicket != null && !calculationSelector.CalculationTypes.Any(x => SelectedTicket.Calculations.Any(y => y.CalculationTypeId == x.Id))) return false;
     return !calculationSelector.CalculationTypes.Any(x => x.MaxAmount > 0 && GetTenderedValue() > x.MaxAmount);
 }
        private void OnSelectCalculationSelector(CalculationSelector calculationSelector)
        {
            foreach (var calculationTemplate in calculationSelector.CalculationTemplates)
            {
                var amount = calculationTemplate.Amount;
                if (amount == 0) amount = GetTenderedValue();
                SelectedTicket.AddCalculation(calculationTemplate, amount);
            }

            PaymentAmount = "";
            PrepareMergedItems();
            RefreshValues();
        }
 private bool CanSelectCalculationSelector(CalculationSelector calculationSelector)
 {
     return calculationSelector == null || !calculationSelector.CalculationTemplates.Any(x => x.MaxAmount > 0 && GetTenderedValue() > x.MaxAmount);
 }