Ejemplo n.º 1
0
        static public void ApplyPaymentEventAsync(object stateInfo)
        {
            try
            {
                if (!iniFile.DisplayBoardEnabled)
                {
                    return;
                }
                Utils.ToCardLog("ApplyPaymentEventAsync");

                double Pr      = 0;
                int    CheckId = 0;
                if (stateInfo != null)
                {
                    try
                    {
                        CheckId = (int)stateInfo;
                        Pr      = (double)AlohaTSClass.GetCheckSum(CheckId);
                    }
                    catch
                    {
                    }
                }
                else
                {
                    Pr = (double)AlohaTSClass.GetCurentCheckSumm();
                }
                if (iniFile.DisplayBoardEnabled)
                {
                    SendString("ИТОГО: ", Pr.ToString("0.00"));
                }

                /*
                 * if (iniFile.RemoteEventEnabled)
                 * {
                 *  AlohaEvent.ShowTotalVoid(Pr.ToString("0.00"));
                 * }
                 * */
            }
            catch (Exception e)
            {
                Utils.ToCardLog("[Error] ApplyPaymentEvent" + e);
            }
        }
Ejemplo n.º 2
0
        internal static void ShowTotalSumm()
        {
            string Name = "";
            int    Id   = 0;
            string str  = "Итого: " + AlohaTSClass.GetCurentCheckSumm().ToString("0.00") + " руб." + Environment.NewLine;

            if (AlohaTSClass.CheckWindow())
            {
                if (AlohaTSClass.AlohaCurentState.CompIsAppled)
                {
                    str += AlohaTSClass.GetCompName(AlohaTSClass.AlohaCurentState.CompId) + Environment.NewLine;
                    str += "Скидка: " + AlohaTSClass.AlohaCurentState.CompSumm.ToString("0.00") + " руб." + Environment.NewLine;

                    if ((AlohaTSClass.AlohaCurentState.CompId > 10) && (AlohaTSClass.AlohaCurentState.CompId < 25))
                    {
                        if (AlohaTSClass.GetManagerDiscountAttr((int)AlohaTSClass.AlohaCurentState.CheckId, out Name, out Id))
                        {
                            if (Id > 0)
                            {
                                str += Id.ToString() + " ";
                            }
                            str += Name;
                        }
                    }
                }
                int P = 0;
                int V = 0;

                string PreCard = AlohaTSClass.GetDiscountAttr((int)AlohaTSClass.AlohaCurentState.CheckId, out P, out V);
                if (PreCard.Length > 4)
                {
                    if (PreCard.Substring(0, 3).ToUpper() == "PRE")
                    {
                        str += "Проведена карта друга " + PreCard + Environment.NewLine;
                        str += "Отсталось посещений " + V.ToString() + " Осталось дней: " + P.ToString();
                    }
                }
            }
            AlohaTSClass.ShowMessage(str);
        }
Ejemplo n.º 3
0
        private void EndApplyComp()
        {
            AlohaTSClass.CheckWindow();
            string outMess = "";

            //int OrderMode = ((DType==20)?10:1);
            bool OrderRes = AlohaTSClass.OrderAllDishez(AlohaTSClass.AlohaCurentState.TerminalId, (int)AlohaTSClass.AlohaCurentState.CheckId, (int)AlohaTSClass.AlohaCurentState.TableId);

            if (!OrderRes)
            {
                frmAllertMessage Mf = new frmAllertMessage("Не могу заказать блюда. Попробуйте еще раз. Либо закажите самостоятельно. Если ошибка будет повторяться свяжитесь со службой техподдержки для перезагрузки Алохи.");
                Utils.ToLog("Не могу заказать блюда. Выхожу");
                Mf.ShowDialog();
                return;
            }


            int CompId = AlohaTSClass.ApplyComp(DType, "", out outMess);

            if (AlohaTSClass.GetCurentCheckSumm() != 0)
            {
                AlohaTSClass.ShowMessage("Не смог наложить 100% компенсацию. Проверьте, что все блюда чека входят в группу соответствующую скидки " + DType.ToString());
                AlohaTSClass.DeleteComp(CompId);
                return;
            }


            if (outMess != "")
            {
                AlohaTSClass.ShowMessage(outMess);
            }
            else
            {
                if (CurrentEmp == null)
                {
                    if (CurrentComment != "")
                    {
                        AlohaTSClass.SetManagerDiscountAttr((int)AlohaTSClass.AlohaCurentState.CheckId, CurrentComment, AlohaTSClass.AlohaCurentState.EmployeeNumberCode);
                    }
                }
                else
                {
                    if (CurrentComment != "")
                    {
                        AlohaTSClass.SetManagerDiscountAttr((int)AlohaTSClass.AlohaCurentState.CheckId, CurrentComment, CurrentEmp.Id);
                    }
                    else
                    {
                        AlohaTSClass.SetManagerDiscountAttr((int)AlohaTSClass.AlohaCurentState.CheckId, CurrentEmp.Name, CurrentEmp.Id);
                    }
                }

                if (DType == 20)
                {
                    for (int i = 0; i < ctrlHotelBreakfastCount1.GuestCount; i++)
                    {
                        double price = ctrlHotelBreakfastCount1.Price;
                        if (ctrlHotelBreakfastCount1.IsSmall)
                        {
                            AlohaTSClass.AddDishToCurentChk(iniFile.HotelBreakfastBarCodeSmall, price);
                        }
                        else
                        {
                            AlohaTSClass.AddDishToCurentChk(iniFile.HotelBreakfastBarCode, price);
                        }
                    }



                    //    AlohaTSClass.ApplyFullPaymentToCurentChk(iniFile.HotelBreakfastPaymentId);
                }
                if (DType != 20)
                {
                    AlohaTSClass.CloseCurentCheckAndTableByCurentUser();
                }

                AlohaTSClass.ShowMessage("Компенсация успешно применена");
            }
            this.Close();
        }