public void CloseBalance()
        {
            decimal cashoutCurrentAmount = 0;

            BusinessPropsHelper.GetAccountingAmount(out _cashinCurrentAmount, out cashoutCurrentAmount);

            var text = TranslationProvider.Translate(MultistringTags.TERMINAL_COLLECT_CASH, _cashinCurrentAmount, StationRepository.Currency);

            QuestionWindowService.ShowMessage(text, null, null, askWindow_YesClick, null);
        }
        private void OnTestModeCommand()
        {
            decimal cashoutCurrentAmount = 0;

            BusinessPropsHelper.GetAccountingAmount(out _cashinCurrentAmount, out cashoutCurrentAmount);

            if (_cashinCurrentAmount - cashoutCurrentAmount > 0)
            {
                ShowError(TranslationProvider.Translate(MultistringTags.TERMINAL_PRODUCE_EMPTY_BOX).ToString(), null, false, 3);
            }
            else
            {
                Mediator.SendMessage("testmode", MsgTag.RestartInTestMode);
            }
        }
        private void OnVerifyStation()
        {
            decimal cashoutCurrentAmount = 0;
            decimal cashinCurrentAmount  = 0;

            BusinessPropsHelper.GetAccountingAmount(out cashinCurrentAmount, out cashoutCurrentAmount);
            if (cashinCurrentAmount - cashoutCurrentAmount > 0)
            {
                var text          = TranslationProvider.Translate(MultistringTags.TERMINAL_EMPTY_BOX_BEFORE_VALIDATION).ToString();
                var yesButtonText = TranslationProvider.Translate(MultistringTags.SHOP_FORM_OK) as string;
                var noButtonText  = TranslationProvider.Translate(MultistringTags.SHOP_FORM_CANCEL) as string;
                QuestionWindowService.ShowMessage(text, yesButtonText, noButtonText, OnCloseBalance, null);
                return;
            }

            OnAcceptCommand();
        }
        private bool CheckForEmptyBox()
        {
            bool    result = false;
            decimal cashoutCurrentAmount = 0;
            decimal _cashinCurrentAmount = 0;

            if (ChangeTracker.CurrentUser.ViewEmptyBox)
            {
                BusinessPropsHelper.GetAccountingAmount(out _cashinCurrentAmount, out cashoutCurrentAmount);

                if (_cashinCurrentAmount - cashoutCurrentAmount > 0)
                {
                    result = true;
                }
            }
            return(result);
        }
        public AccountingBaseViewModel()
        {
            ShowCommand = new Command(ShowOverview);
            //CloseCommand = new Command(CloseWindow);
            CreateCheckpointCommand = new Command(OnCheckPoint);
            ShowCreditCommand       = new Command(OnCredit);
            ShowCheckPointsCommand  = new Command(OnShowCheckPoints);
            CheckPointsCommand      = new Command(OnCheckPoints);
            BackCommand             = new Command(OnBackCommand);

            EnabledCheckPoint      = ChangeTracker.CurrentUser.CloseBalance;
            EnabledShowCheckPoints = ChangeTracker.CurrentUser.ViewStationBalance;
            EnabledCredit          = ChangeTracker.CurrentUser.Credit;
            if (ChangeTracker.CurrentUser != null)
            {
                decimal cashinCurrentAmount, cashoutCurrentAmount;
                BusinessPropsHelper.GetAccountingAmount(out cashinCurrentAmount, out cashoutCurrentAmount);
                IsEnabledCloseBalance = cashinCurrentAmount - cashoutCurrentAmount > 0 && ChangeTracker.CurrentUser.EmptyBox;
            }
        }
        public void PleaseWaitCloseBalance()
        {
            PrinterHandler.InitPrinter(true);
            if (StationRepository.PrinterStatus == 0)
            {
                ShowPrinterErrorMessage();
                return;
            }

            long cashoutId = GetLastCashoutId() + 1;
            Dictionary <Decimal, int> CashinNotes = GetNotesValuesAndCount(cashoutId);
            decimal cashoutCurrentAmount          = 0;

            TransactionQueueHelper.TryRegisterMoneyOnHub(StationRepository.GetUid(ChangeTracker.CurrentUser), BusinessPropsHelper.GetNextTransactionId(), ref _cashinCurrentAmount, false, "STATION_CASH_OUT", (int)ChangeTracker.CurrentUser.AccountId, true);
            foreach (var cashinNote in CashinNotes)
            {
                Log.Debug("cashin notes:" + cashinNote.Key + " amount: " + cashinNote.Value);
            }
            PrinterHandler.PrintCashBalance(CashinNotes, StartDate, DateTime.Now, _cashinCurrentAmount, 0, _cashinCurrentAmount, false, false, ChangeTracker.CurrentUser.Username, GetNumberOfCheckpoints() + 1);
            BusinessPropsHelper.GetAccountingAmount(out _cashinCurrentAmount, out cashoutCurrentAmount);
            IsEnabledCloseBalance = _cashinCurrentAmount - cashoutCurrentAmount > 0;
        }