Пример #1
0
        public GetToGoordersResponse GetToGoOrders()
        {
            Utils.ToCardLog("GetToGoOrdersExternal from ext");
            var res = new GetToGoordersResponse();

            res.Checks = AlohaTSClass.GetToGoOrdersExternal();

            try
            {
                MemoryStream stream1 = new MemoryStream();
                var          ds      = new DataContractJsonSerializer(typeof(GetToGoordersResponse));
                ds.WriteObject(stream1, res);
                stream1.Position = 0;
                StreamReader sr = new StreamReader(stream1);
                Utils.ToCardLog("JSON res: ");
                string s = sr.ReadToEnd();
                Utils.ToCardLog(s);
            }
            catch (Exception e)
            {
                Utils.ToCardLog("Error GetToGoOrdersExternal show JSON res " + e.Message);
            }

            Utils.ToCardLog("GetToGoOrdersExternal return");
            return(res);
        }
Пример #2
0
 private void BtnYes_Click(object sender, EventArgs e)
 {
     AlohaTSClass.SetWaterToCurentCheck(WNumber);
     this.Close();
     AlohaTSClass.ShowMessage("Назначил чек официанту " + WNumber);
     this.Dispose();
 }
        public static void CloseAlohaTableLocalCurentUser(int ChkId, int PaymentId, decimal Summ)
        {
            int TermNum = AlohaTSClass.GetTermNum();

            try
            {
                Check Chk = AlohaTSClass.GetCheckById(ChkId);
                Utils.ToCardLog("[CloseAlohaTableLocalCurentUser] Пытаюсь закрть чек локально" + Chk.AlohaCheckNum + " Терминал " + TermNum);
                AlohaTSClass.ApplyPayment(TermNum, Chk.AlohaCheckNum, (double)Summ / 100, PaymentId);
                AlohaTSClass.CloseCheck(TermNum, Chk.AlohaCheckNum);
                if (!AlohaTSClass.CheckIsClosed(Chk.AlohaCheckNum))
                {
                    //Сообщение
                }
                else
                {
                    Utils.ToCardLog("[CloseAlohaTableLocalCurentUser] Чек закрыл" + Chk.AlohaCheckNum);
                    if (AlohaTSClass.IsAlohaTS())
                    {
                        AlohaTSClass.CloseTable(TermNum, Chk.TableId);
                        Utils.ToCardLog("[CloseAlohaTableLocalCurentUser] Стол закрыл" + Chk.AlohaCheckNum);

                        //AlohaTSClass.LogOut();
                        //AlohaTSClass.LogIn(AlohaTSClass.GetTermNum(), 1354);
                        AlohaTSClass.RefreshCheckDisplay();
                    }
                }
            }
            catch (Exception e)
            {
                Utils.ToCardLog("Error CloseAlohaTableLocalCurentUser" + e.Message);
            }
        }
Пример #4
0
        public static void OrderItems(bool All)
        {
            AlohaTSClass.CheckWindow();
            List <OrderDish> OdList = new List <OrderDish>();

            OdList = AlohaTSClass.GetSelectedItems(All);

            List <OrderDish> OdListKitchen = new List <OrderDish>();
            List <OrderDish> OdListOther   = new List <OrderDish>();

            foreach (OrderDish Od in OdList)
            {
                if (KitchenGroups.Contains(Od.Vrouting))
                {
                    OdListKitchen.Add(Od);
                }
                else
                {
                    OdListOther.Add(Od);
                }
            }
            AlohaTSClass.OrderListDish(OdListKitchen);
            AlohaTSClass.OrderListDish(OdListOther);
            AlohaTSClass.RefreshCheckDisplay();
        }
        static private void PrintSlip(string Slip)
        {
            if (iniFile.CreditCardSlipPrintPreCheck)
            {
                try
                {
                    // string[] stringSeparators = new string[] { "\n\r", "\n\n", Environment.NewLine};

                    string[] stringSeparators = new string[] { "\n" };

                    string sres = Slip.Replace("\r", "");

                    AlohaTSClass.PrintCardSlip(sres.Split(stringSeparators, StringSplitOptions.None).ToList());
                }
                catch (Exception e)
                {
                    Utils.ToCardLog("Ошибка печати слипа " + e.Message);
                }
            }
            else
            {
                Slip += Convert.ToChar(31);
                ToShtrih.PrintCardCheck(Slip);
            }
        }
Пример #6
0
        public static void EndSVSale(bool res, string CardNum, double Summ)
        {
            try
            {
                MainClass.RemoveRegCardSubscr(SVSistem.Main.GetCardFromMagReader);
                if (!res)
                {
                    Utils.ToCardLog("Продажа карты неуспешна. Удаляю блюдо");
                    AlohaTSClass.DeleteCardEntry(CurentCardEntryParams.CheckId, CurentCardEntryParams.EntryId);

                    /*
                     * CurentTryDeleteCount = 0;
                     * T1 = new System.Timers.Timer();
                     * T1.Elapsed += new System.Timers.ElapsedEventHandler(T1_Elapsed);
                     * T1.Interval = 1000;
                     * T1.Start();
                     * */
                }
                else
                {
                    Utils.ToCardLog("Продажа карты успешна. Добавляю атрибут " + CardNum);
                    AlohaTSClass.SetSVCardSaleAttr(CurentCardEntryParams.CheckId, CardNum);
                }
            }
            catch (Exception e)
            {
                Utils.ToCardLog("[Error] EndSVSale" + e.Message);
            }
        }
 private static MBProxi.MyTermSettings GetSettings()
 {
     try
     {
         Utils.ToLog("GetSettings ");
         var request = new MBProxi.TermSettingsRequest
         {
             DepartmentNumber = AlohainiFile.DepNum,
             TerminalNumber   = AlohaTSClass.GetTermNum()
         };
         MBProxi.CardServiceClient client = GetWCFClient();
         var result = client.GetSettingsForTerm(request);
         if (result.Success)
         {
             Utils.ToLog("GetSettings ok result.Result = " + result.Result.Precheck.QrPrint);
             return(result.Result);
         }
         return(null);
     }
     catch (Exception e)
     {
         Utils.ToLog("Error GetSettings " + e.Message);
         return(null);
     }
 }
Пример #8
0
 internal static void ApplyBonusPayment(int ManagerId, int EmployeeId, int QueueId, int TableId, int CheckId, int TenderId, int PaymentId)
 {
     if ((TenderId == AlohaTender.CreditTenderIdIn) && (EmployeeId != iniFile.RemoteCloseEmployee))
     {
         Utils.ToCardLog("Добавлена оплата бонусами. ");
         if (CheckId != ApplyBonusPaymentByCodeCheckId)
         {
             PDiscountCard.SV.CardEntryParams mCardEntryParams = new SV.CardEntryParams()
             {
                 CheckId = CheckId,
                 EntryId = PaymentId,
                 TableId = TableId
             };
             double Summ = AlohaTSClass.GetPaymentSumm(PaymentId);
             if (Summ == 0)
             {
                 return;
             }
             SV.SVClass.StartSVPayment((decimal)Summ, CheckId, mCardEntryParams);
         }
         else
         {
             ApplyBonusPaymentByCodeCheckId = 0;
         }
     }
 }
Пример #9
0
        private static void CloseAlohaTable(int Deposit, FCCIntegration.FCCCheck Chk)
        {
            if (AlohaTSClass.IsAlohaTS())
            {
                AlohaTSClass.LogOut(AlohaTSClass.GetTermNum());
                AlohaTSClass.RefreshCheckDisplay();

                if (Chk.AllChkOnTable)
                {
                    int CurId = 1;
                    foreach (FCCIntegration.FCCDish ChekinTable in Chk.Dishes)
                    {
                        decimal oplata = ChekinTable.Price;
                        if (CurId == Chk.Dishes.Count)
                        {
                            oplata += ChekinTable.Price + (Deposit - Chk.Ammount);
                        }
                        CurId++;
                        RemoteCloseCheck.AddRemoteChkToQuere(ChekinTable.AlohaCheckNum, 1, CurrentEmpl, (decimal)((double)oplata / (double)100));
                    }
                }
                else
                {
                    RemoteCloseCheck.AddRemoteChkToQuere(Chk.AlohId, 1, CurrentEmpl, (decimal)((Deposit) / (double)100));
                }
            }
            else
            {
                RemoteCloseCheck.CloseAlohaTableLocalCurentUser(Chk.AlohId, 1, (decimal)(Deposit));
                if (iniFile.CreditCardAutoOpenCheck)
                {
                    AlohaTSClass.OpenEmptyCheck();
                }
            }
        }
Пример #10
0
        internal static void ShowfrmModifItem()
        {
            Check Ch       = null;
            int   SelCount = 0;
            Dish  D        = AlohaTSClass.GetSelectedDish(out Ch, out SelCount);

            if (SelCount == 0)
            {
                AlohaTSClass.ShowMessage("Выделите блюда для модифицирования");
                return;
            }
            if (SelCount > 1)
            {
                AlohaTSClass.ShowMessage("Выделенно более одного блюда");
                return;
            }
            if (D.IsOrdered)
            {
                AlohaTSClass.ShowMessage("Нельзя модифицировать заказанные бюда");
                return;
            }


            if (AlohaTSClass.SelectedDishOnOtherTable(Ch))
            {
                AlohaTSClass.ShowMessage("Присутствуют выделенные блюда на другом чеке");
                return;
            }

            RusMessage.FrmRussMessage fRM = new RusMessage.FrmRussMessage(D.LongName);



            fRM.ShowDialog();

            if ((fRM.AddModif) && (fRM.ModifTxt.Length > 0))
            {
                List <string> tmp = new List <string>();

                foreach (string str in fRM.ModifTxt.Split((Environment.NewLine.ToCharArray())))
                {
                    if (str.Replace(" ", "") == "")
                    {
                        continue;
                    }
                    tmp.Add(str);
                }
                //   tmp.Reverse();
                AlohaTSClass.AddRussMessage2(D, Ch, tmp);

                /*
                 * foreach (string str in tmp)
                 * {
                 *
                 *
                 *  AlohaTSClass.AddRussMessage(D, Ch, str);
                 * }
                 * */
            }
        }
        static void SendRefreshCheck(int CheckId, bool SendTotal, bool CloseCheck)
        {
            //Check Ch = AlohaTSClass.GetCheckById(CheckId);
            Check Ch = AlohaTSClass.GetCheckByIdShort(CheckId);

            SendRefreshCheck(Ch, SendTotal, CloseCheck);
        }
Пример #12
0
        public static void CloseCheck()
        {
            Utils.ToCardLog("CloseCheckFromActiv");

            AlohaTSClass.CheckWindow();
            Check Chk = AlohaTSClass.GetCheckById((int)AlohaTSClass.AlohaCurentState.CheckId);

            /*
             * if (!AlcCheck(Chk))
             * {
             *  return;
             * }
             */
            if (Chk.HasUnorderedItems)
            {
                if (iniFile.AutoOrderBeforeWaiterClose)
                {
                    AlohaTSClass.OrderAllDishez(AlohaTSClass.AlohaCurentState.TerminalId, (int)AlohaTSClass.AlohaCurentState.CheckId, (int)AlohaTSClass.AlohaCurentState.TableId);
                }
                else
                {
                    frmAllertMessage Mf = new frmAllertMessage("В чеке есть незаказаные блюда. ");
                    Utils.ToLog("В чеке есть незаказаные блюда. Выхожу");
                    Mf.ShowDialog();
                    return;
                }
            }
            AlohaTSClass.CloseCheck(AlohaTSClass.GetTermNum(), Chk.AlohaCheckNum);
        }
Пример #13
0
        // delegate void DoPaymentsOperDelegate(int PaymentsCount, Check Chk);

        static private void DoPaymentsOper(int PaymentsCount, Check Chk)
        {
            Utils.ToCardLog("DoPaymentsOper TenderType = " + PaymentsCount.ToString());
            if (PaymentsCount == 1)
            {
                FCC.SetBill();
            }
            else if (PaymentsCount == 2)
            {
                /*
                 * if (iniFile.InPasEnabled)
                 * {
                 *  DualConnector.DualConnectorMain.Sale();
                 * }
                 * */
                //   else if (iniFile.Arcus2Enabled)
                if (CreditCardAlohaIntegration.CreditCardConnectorEnabled)
                {
                    string err = "";

                    CreditCardAlohaIntegration.RunOper(Chk);
                    //DualConnector.DualConnectorMain.Sale();
                }
            }
            else if (PaymentsCount == 4)
            {
                AlohaTSClass.LogOut();
                RemoteCloseCheck.AddRemoteChkToQuere(Chk.AlohaCheckNum, 30, Chk.Waiter, Chk.Summ);
            }
            GC.Collect();
            Utils.ToCardLog("Exit from DoPaymentsOper TenderType = " + PaymentsCount.ToString());
            GC.Collect();
        }
Пример #14
0
        internal static void CloseCheck(int EmployeeId, int QueueId, int TableId, int CheckId)
        {
            try
            {
                Utils.ToLog("Закрытие чека. Читаю настройки PDiscount.ini", 2);
                if (iniFile.CloseCheck)
                {
                    Utils.ToLog("(iniFile.Read(Options, CloseCheck) == TRUE) . Читаю параметры чека № " + CheckId, 5);
                    Check Ch = AlohaTSClass.GetCheckById(CheckId);
                    if (Ch == null)
                    {
                        Utils.ToLog("Ch == null. Выхожу");
                        return;
                    }
                    if (Ch.Dishez.Count == 0)
                    {
                        Utils.ToLog("Ch.Dishez.Count == 0. Выхожу");
                        return;
                    }

                    Ch.SystemDate = DateTime.Now;

                    PDiscountCard.CloseCheck.mCloseCheck(Ch);
                    Utils.ToLog("Чек закрыл. Выхожу", 2);
                }
            }
            catch (Exception e)
            {
                Utils.ToLog(e.Message);
            }
        }
Пример #15
0
        internal static void AddScaleDish2(string Arg)
        {
            int    BarCode = Convert.ToInt32(Arg.Substring(5));
            string DName   = AlohaTSClass.GetDishName(BarCode);

            Scale.Scale2.GetItmWeight(BarCode, DName);
        }
Пример #16
0
        private AlohaCheckInfo GetAlohaCheckInfo(Check Chk)
        {
            AlohaCheckInfo Tmp = new AlohaCheckInfo()
            {
                AlohaId       = Chk.AlohaCheckNum,
                CheckId       = Chk.AlohaCheckNum,
                TableId       = Chk.TableId,
                TableNum      = Chk.TableNumber,
                Summ          = Chk.Summ,
                IsClosed      = Chk.IsClosed,
                TimeOfOpen    = Chk.SystemDateOfOpen,
                TimeOfClose   = Chk.SystemDateOfClose2,
                WaiterId      = Chk.Waiter,
                WaiterName    = AlohaTSClass.GetWaterName(Chk.Waiter),
                DiscountSumm  = Chk.Comp,
                NumberInTable = Chk.NumberInTable
            };

            foreach (Dish D in Chk.Dishez)
            {
                Tmp.Dishez.Add(GetAlohaDishInfo(D));
            }

            return(Tmp);
        }
Пример #17
0
        static private void AddDishEventAsinc(object stateInfo)
        {
            try
            {
                Utils.ToCardLog("AddDishEventAsync ");
                if (iniFile.DisplayBoardEnabled)
                {
                    string Pr = "";
                    double Q  = 0;
                    string s  = AlohaTSClass.GetDisplayBoardInfo(CurentCheckId, CurentEntryId, out Pr, out Q);
                    Utils.ToCardLog("AddDishEvent " + s);
                    if (Q > 1)
                    {
                        s  = s + " x" + Q.ToString();
                        Pr = (Utils.ConvertToDoubleWithRepDemSep(Pr) * Q).ToString();
                    }

                    SendString(s, Pr);
                }
            }
            catch (Exception e)
            {
                Utils.ToCardLog("[Error] AddDishEvent" + e);
            }
        }
Пример #18
0
        public static void SendCurentChk()
        {
            Check chk = AlohaTSClass.GetCurentCheck();

            if (chk.Dishez.Any(d => d.BarCode == IdItem))
            {
                string messageIdStr = chk.Dishez.First(d => d.BarCode == IdItem).Name;
                if (!string.IsNullOrWhiteSpace(messageIdStr))
                {
                    if (messageIdStr.IndexOf(':') > -1)
                    {
                        string idStr = new string(messageIdStr.Substring(messageIdStr.IndexOf(':')).Where(c => char.IsDigit(c)).ToArray());

                        if (!string.IsNullOrWhiteSpace(idStr))
                        {
                            long id = long.Parse(idStr);

                            if (id > 0)
                            {
                                var customer = AuthWithoutWindow(id);

                                if (customer != null && customer.Auth)
                                {
                                    ShowInfohWnd(chk, customer);
                                }
                                else
                                {
                                    AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                                    ShowAuthWnd(chk);
                                }
                            }
                            else
                            {
                                AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                                ShowAuthWnd(chk);
                            }
                        }
                        else
                        {
                            AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                            ShowAuthWnd(chk);
                        }
                    }
                    else
                    {
                        AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                        ShowAuthWnd(chk);
                    }
                }
                else
                {
                    AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
                    ShowAuthWnd(chk);
                }
            }
            else
            {
                ShowAuthWnd(chk);
            }
        }
Пример #19
0
        private AlohaCheckInfo GetAlohaCheckInfo(Check Chk)
        {
            AlohaCheckInfo Tmp = new AlohaCheckInfo()
            {
                AlohaId       = Chk.AlohaCheckNum,
                CheckId       = Chk.AlohaCheckNum,
                TableId       = Chk.TableId,
                TableNum      = Chk.TableNumber,
                Summ          = Chk.Summ,
                IsClosed      = Chk.IsClosed,
                TimeOfOpen    = Chk.SystemDateOfOpen,
                TimeOfClose   = Chk.SystemDateOfClose2,
                WaiterId      = Chk.Waiter,
                WaiterName    = AlohaTSClass.GetWaterName(Chk.Waiter),
                DiscountSumm  = Chk.Comp,
                NumberInTable = Chk.NumberInTable
            };

            foreach (Dish D in Chk.Dishez)
            {
                if (Chk.Dishez.SelectMany(a => a.CurentModificators).Any(a => a.AlohaNum == D.AlohaNum))
                {
                    continue;
                }
                Tmp.Dishez.Add(GetAlohaDishInfo(D));
            }

            return(Tmp);
        }
Пример #20
0
 internal static void ApplyPayment(double summ)
 {
     if (AlohaTSClass.CheckWindow())
     {
         AlohaTSClass.ApplyPayment(AlohaTSClass.AlohaCurentState.TerminalId, (int)AlohaTSClass.AlohaCurentState.CheckId, (int)AlohaTSClass.AlohaCurentState.TableId, summ, 1);
     }
 }
Пример #21
0
 internal static void OrderItems()
 {
     if (AlohaTSClass.CheckWindow())
     {
         AlohaTSClass.OrderAllDishez(AlohaTSClass.AlohaCurentState.TerminalId, (int)AlohaTSClass.AlohaCurentState.CheckId, (int)AlohaTSClass.AlohaCurentState.TableId);
     }
 }
 void digitKeyboard_OnOk(object sender, double Value)
 {
     if (digitKeyboard.CurentDouble > 0)
     {
         AlohaTSClass.SetGuestCountAttr((int)digitKeyboard.CurentDouble);
         OwnerWnd.Close();
     }
 }
Пример #23
0
 static void MainClass2_OnCancelChange(FCCIntegration.FCCCheck Chk, int Change)
 {
     if (!iniFile.FCCSync)
     {
         AlohaTSClass.UnLockTable(iniFile.FCCTerminal, iniFile.FCCEmployee);
     }
     CCustomerDisplay.CancelChange(Change);
 }
Пример #24
0
        public static void mShowPagerDialog()
        {
            //Уезжаем в другой поток, чтобы не глючило
            AlohaTSClass.CheckWindow();
            int EmpNum = AlohaTSClass.AlohaCurentState.EmployeeNumberCode;

            Pager((IntPtr)EmpNum, Utils.GetFileServerName());
        }
Пример #25
0
        public GetEmloyeeListResponse GetEmployeeList()
        {
            Utils.ToCardLog("GetEmployeeList from ext");
            var res = new GetEmloyeeListResponse();

            res.Empls = AlohaTSClass.GetEmplListExternal();
            return(res);
        }
Пример #26
0
 internal static void AuthClear()
 {
     try
     {
         AlohaTSClass.TryDeleteItemOnCurentCheck(IdItem);
     }
     catch { }
 }
Пример #27
0
        public static void ZReport(DateTime BD)
        {
            Utils.ToCardLog("FClient.ZReport");
            FRSSrv.RemoteDataClient FClient = GetFRSClient();
            //DateTime BD = AlohainiFile.BDate;

            if (FClient != null)
            {
                FRSSrv.ZReportResponce Res = null;
                try
                {
                    Res = FClient.ZReport(AlohainiFile.DepNum, AlohaTSClass.GetTermNum(), BD);
                }
                catch (Exception e)
                {
                    Utils.ToCardLog("Error  FClient.ZReport" + e.Message);
                    ZReportAskSaver.SaveZRepFRSAsk(BD);
                }
                if (Res != null)
                {
                    if (Res.Result)
                    {
                        if (iniFile.XFromGes)
                        {
                            decimal cash = 0;
                            decimal card = 0;
                            GesData.GetGesData(AlohainiFile.BDate, AlohainiFile.DepNum, out cash, out card);
                            decimal VCash = 0;
                            try { VCash = Res.OutData.VoidPayments.Where(a => a.ExternalId == 1 && a.Term == 0).First().Summ; }
                            catch { }
                            try { Res.OutData.Payments.Where(a => a.ExternalId == 1 && a.Term == 0).First().Summ = cash + VCash; }
                            catch { }
                        }


                        //if (iniFile.FRSPrintCheck)
                        {
                            if (Res.OutData.Payments.Count() > 0)
                            {
                                Utils.ToCardLog("FClient.ZReport print");
                                PrintOnWinPrinter.PrintDoc2(FiscalCheckCreator.GetEndOfSmenaVisual(Res));
                            }
                            else
                            {
                                PrintOnWinPrinter.PrintDoc2(FiscalCheckCreator.GetZReportVisual(Res));
                            }
                        }
                    }
                }
                FClient.Close();
            }
            else
            {
                Utils.ToCardLog("FClient == null");
                ZReportAskSaver.SaveZRepFRSAsk(BD);
            }
        }
Пример #28
0
        public static void GenSpoolFromTr()
        {
            List <Check> AllChk = AlohaTSClass.GetAllChecks();

            foreach (Check ch in AllChk.OrderBy(a => a.SystemDate))
            {
                AddToSpoolFile(ch);
            }
        }
        internal static void RemoteDeleteCheck(int ChkId)
        {
            int TermNum = iniFile.RemoteOrderTerminalNumber;

            AlohaTSClass.LogOut(TermNum);
            AlohaTSClass.LogIn(TermNum, iniFile.RemoteOrderWaterNumber);
            AlohaTSClass.DeleteAllItemsOnCurentCheckandClose2(TermNum, iniFile.RemoteOrderWaterNumber, ChkId);
            AlohaTSClass.LogOut(TermNum);
        }
Пример #30
0
        internal static List <FiscalCheckVisualString> GetXReportVisualPaymentsTerm(FRSSrv.XRepFiskalPayment[] Payments, FRSSrv.XRepFiskalPayment[] VoidPayments)
        {
            List <FiscalCheckVisualString> Res = new List <FiscalCheckVisualString>();

            Res.Add(new FiscalCheckVisualString("Чеков за смену: ", (Payments.Sum(a => a.Count) + VoidPayments.Sum(a => a.Count)).ToString()));
            //     Res.Add(new FiscalCheckVisualString("   "));
            //   Res.Add(new FiscalCheckVisualString("Чеков прихода: ", ""));
            Res.Add(new FiscalCheckVisualString(Payments.Where(a => a.Id > 0).Sum(a => a.Count).ToString(), String.Format("≡{0}", Payments.Where(a => a.Id > 0).Sum(a => a.Summ).ToString("0.00").Replace(",", ".")), true));
            foreach (FRSSrv.XRepFiskalPayment Fp in Payments.Where(a => a.Id > 0))
            {
                if (String.IsNullOrWhiteSpace(Fp.Name))
                {
                    Fp.Name = AlohaTSClass.GetTenderName(Fp.ExternalId);
                }
                Res.Add(new FiscalCheckVisualString(Fp.Name, String.Format("≡{0}", Fp.Summ.ToString("0.00").Replace(",", "."))));
            }
            if (Payments.Where(a => a.Id == 0).Count() > 0)
            {
                Res.Add(new FiscalCheckVisualString("--------------------------"));
                foreach (FRSSrv.XRepFiskalPayment Fp in Payments.Where(a => a.Id == 0))
                {
                    if (String.IsNullOrWhiteSpace(Fp.Name))
                    {
                        Fp.Name = AlohaTSClass.GetTenderName(Fp.ExternalId);
                    }
                    Res.Add(new FiscalCheckVisualString(Fp.Name, String.Format("≡{0}", Fp.Summ.ToString("0.00").Replace(",", "."))));
                }
                Res.Add(new FiscalCheckVisualString("--------------------------"));
            }

            Res.Add(new FiscalCheckVisualString("Чеков возврата прихода: ", ""));
            Res.Add(new FiscalCheckVisualString(VoidPayments.Sum(a => a.Count).ToString(), String.Format("≡{0}", VoidPayments.Sum(a => a.Summ).ToString("0.00").Replace(",", "."))));
            foreach (FRSSrv.XRepFiskalPayment Fp in VoidPayments)
            {
                if (String.IsNullOrWhiteSpace(Fp.Name))
                {
                    Fp.Name = AlohaTSClass.GetTenderName(Fp.ExternalId);
                }
                Res.Add(new FiscalCheckVisualString(Fp.Name, String.Format("≡{0}", Fp.Summ.ToString("0.00").Replace(",", "."))));
            }
            decimal Nal = 0;

            if (Payments.Where(a => a.Id == 1).Count() > 0)
            {
                Nal = Payments.Where(a => a.Id == 1).Sum(b => b.Summ) - VoidPayments.Where(a => a.Id == 1).Sum(b => b.Summ);
            }

            decimal CashFlow = 0;

            CashFlow = Payments.Where(a => a.Id > 0).Sum(b => b.Summ) - VoidPayments.Where(a => a.Id > 0).Sum(b => b.Summ);

            Res.Add(new FiscalCheckVisualString("Нал. в кассе", String.Format("≡{0}", Nal.ToString("0.00").Replace(",", "."))));
            Res.Add(new FiscalCheckVisualString("Выручка", String.Format("≡{0}", CashFlow.ToString("0.00").Replace(",", "."))));
            Res.Add(new FiscalCheckVisualString("   "));
            Res.Add(new FiscalCheckVisualString("   "));
            return(Res);
        }