Example #1
0
        /*
         * internal static string  GetClishe()
         * {
         *  string tmp = "";
         *  Shtrih.Password = 30;
         *  Shtrih.TableNumber = 4;
         *
         *  Shtrih.FieldNumber = 1;
         *  for (int i = 11; i < 17; i++)
         *  {
         *      Shtrih.RowNumber = i;
         *      Shtrih.GetFieldStruct();
         *      Shtrih.ReadTable();
         *      string k="";
         *      if (Shtrih.ValueOfFieldString != null)
         *      {
         *          k = Shtrih.ValueOfFieldString.Replace(" ", "");
         *      }
         *      if (k.Length > 0)
         *      {
         *          tmp += Shtrih.ValueOfFieldString+Environment.NewLine  ;
         *      }
         *  }
         *  return tmp;
         * }
         */

        /*
         * public  static void CloseCheck(double Pr, DateTime dt)
         * {
         *  SetTime(dt);
         *  CloseCheck((decimal )Pr);
         *
         * }
         */
        /*
         * private static void mSale()
         * {
         *  /*
         *  MessageForm Mf = new MessageForm(Shtrih.ResultCodeDescription);
         *  do
         *  {
         *      Shtrih.Sale();
         *
         *      if (Shtrih.ResultCode == 0)
         *      {
         *          Shtrih.WaitForPrinting();
         *      }
         *      else if (Shtrih.ResultCode == 88)
         *      {
         *          Shtrih.ContinuePrint();
         *      }
         *      else
         *      {
         *          Mf.SetCpt(Shtrih.ResultCodeDescription);
         *          Mf.ShowDialog();
         *      }
         *  } while ((Mf.Result == 1)&&(Shtrih.ResultCode != 0));
         *  Mf.Close();
         *  Mf.Dispose ();
         * */
        //        Shtrih.Sale();
        //  }

        //private static void mReturnSale()
        //{

        /*
         * MessageForm Mf = new MessageForm(Shtrih.ResultCodeDescription);
         * do
         * {
         *  Shtrih.ReturnSale ();
         *
         *  if (Shtrih.ResultCode == 0)
         *  {
         *      Shtrih.WaitForPrinting();
         *  }
         *  else if (Shtrih.ResultCode == 88)
         *  {
         *      Shtrih.ContinuePrint();
         *  }
         *  else
         *  {
         *      Mf.SetCpt(Shtrih.ResultCodeDescription);
         *      Mf.ShowDialog();
         *  }
         * } while ((Mf.Result == 1) && (Shtrih.ResultCode != 0));
         * Mf.Close();
         * Mf.Dispose();
         * */
        //  Shtrih.ReturnSale ();
        // }

        //private static void mCloseCheck()
        //{

        /*
         * MessageForm Mf = new MessageForm(Shtrih.ResultCodeDescription);
         *
         * do{
         * Shtrih.CloseCheck ();
         *
         * if (Shtrih.ResultCode == 0)
         * {
         *  Shtrih.WaitForPrinting();
         * }
         * else if (Shtrih.ResultCode == 88)
         * {
         *  Shtrih.ContinuePrint();
         * }
         * else
         * {
         *  Mf.SetCpt(Shtrih.ResultCodeDescription);
         *  Mf.ShowDialog();
         * }
         * } while ((Mf.Result == 1)&&(Shtrih.ResultCode != 0));
         * Mf.Close();
         * Mf.Dispose ();
         * */
        //       Shtrih.CloseCheck();
        //  }

        //    private static int mPrintString()
        //   {

        /*
         * MessageForm Mf = new MessageForm(Shtrih.ResultCodeDescription);
         *
         * int res = 0;
         * do
         * {
         *  Utils.ToLog(Shtrih.StringForPrinting);
         *  Shtrih.PrintString ();
         *
         *  if (Shtrih.ResultCode == 0)
         *  {
         *      Shtrih.WaitForPrinting();
         *  }
         *  else if (Shtrih.ResultCode == 88)
         *  {
         *      Shtrih.ContinuePrint();
         *  }
         *  else
         *  {
         *      Mf.TopMost = true;
         *     // Mf.button3.Visible = true;
         *      Mf.SetCpt(Shtrih.ResultCodeDescription);
         *      Mf.ShowDialog();
         *      res = Mf.Result;
         *  }
         * } while ((Mf.Result != -1) && (Shtrih.ResultCode != 0));
         * Mf.Close();
         *
         * Mf.Dispose();
         * if (Shtrih.ResultCode == 0)
         * {
         *  res = 0;
         * }
         * return res;
         * */
        //        Shtrih.PrintString();
        //       return 0;
        //  }

        //        private static void mPrintStringWithFont()
        //      {

        /*
         * MessageForm Mf = new MessageForm(Shtrih.ResultCodeDescription);
         *
         * do
         * {
         *  Shtrih.PrintStringWithFont ();
         *
         *  if (Shtrih.ResultCode == 0)
         *  {
         *      Shtrih.WaitForPrinting();
         *  }
         *  else if (Shtrih.ResultCode == 88)
         *  {
         *      Shtrih.ContinuePrint();
         *  }
         *  else
         *  {
         *      Mf.SetCpt(Shtrih.ResultCodeDescription);
         *      Mf.ShowDialog();
         *  }
         * } while ((Mf.Result == 1) && (Shtrih.ResultCode != 0));
         * Mf.Close();
         * Mf.Dispose();
         * */
        //       Shtrih.PrintStringWithFont();
        //  }



        public static void ZReportWithCashIncome(decimal IncomeSumm)
        {
            ShtrihCommandBlock CashIncomeCommandBlock = new ShtrihCommandBlock();

            string status = "";

            if (Shtrih2.ClosedSmena(out status))
            {
                CashIncomeCommandBlock.Sale(1, 0, "", 1, 0);
                CashIncomeCommandBlock.CloseCheck(0, 0, 0, 0, 1, 0, 0, 0, "", null);
            }

            CashIncomeCommandBlock.WriteTableInt(1, 1, 2, 1, new List <int>());
            CashIncomeCommandBlock.PrintReportWithCleaning();
            if (IncomeSumm > 0)
            {
                CashIncomeCommandBlock.CashIncome(IncomeSumm);
            }
            CashIncomeCommandBlock.CommandBlockToQwery();
        }
Example #2
0
        public static void CloseCheck2(Check Ch)
        {
            Utils.ToCardLog("CloseCheck2  Start" + Ch.CheckShortNum);

            ShtrihCommandBlock CloseCheckCommandBlock = new ShtrihCommandBlock();

            CloseCheckCommandBlock.ChkOwner = Ch;

            string cassirName = AlohaTSClass.GetCurentWaterName();

            if (cassirName == "")
            {
                cassirName = "Администратор";
            }

            CloseCheckCommandBlock.WriteTableStr(2, 30, 2, AlohaTSClass.GetCurentWaterName(), new List <int>());//Пишем имя кассира

            if (!iniFile.FRModeDisabled)
            {
                SetCurentTime(CloseCheckCommandBlock);
                ChangePos(Ch.OpenTimem == 1, CloseCheckCommandBlock);
                ChangePrint(true, CloseCheckCommandBlock);
                ChangeCut(true, CloseCheckCommandBlock);
            }

            int FChType = 0;

            if (Ch.Vozvr)
            {
                FChType = 2;
            }
            CloseCheckCommandBlock.OpenCheck(FChType);
            decimal Summ = 0;

            foreach (string s in Ch.FrStringsBefore)
            {
                if (s.Length > 36)
                {
                    CloseCheckCommandBlock.PrintString(s.Substring(0, 35));
                }
                else
                {
                    CloseCheckCommandBlock.PrintString(s);
                }
            }

            /*
             * if (AlohaTSClass.GetVip(Ch.AlohaCheckNum))
             * {
             *  CloseCheckCommandBlock.PrintString("ЧЕК " + Ch.CheckShortNum + "   (" + AlohainiFile.DepNum.ToString() + ")" + "   Стол" + Ch.TableNumber);
             * }
             * else
             * {
             *  CloseCheckCommandBlock.PrintString("ЧЕК " + Ch.CheckShortNum + "   (" + AlohainiFile.DepNum.ToString() + ")" + "   Стол " + Ch.TableNumber);
             * }
             */
            List <Dish> Tmp = new List <Dish>();

            if (iniFile.DishConsolidate)
            {
                Tmp = Ch.ConSolidateDishez;
            }
            else
            {
                Tmp = Ch.Dishez;
            }
            foreach (Dish D in Tmp)
            {
                Summ += D.OPrice * D.Count;
                if (!Ch.Vozvr)
                {
                    //  CloseCheckCommandBlock.Sale((double)(D.QUANTITY * D.Count), Math.Abs((decimal)D.OPrice), D.Name + " " + D.CardPrefix + D.CardNumber, 1, 0);
                    //

                    int Tax = 1;
                    if (iniFile.FRNoTax)
                    {
                        Tax = 0;
                    }
                    decimal Price = Math.Abs((decimal)D.OPrice) + Math.Abs((decimal)D.ServiceChargeSumm) / ((decimal)(D.QUANTITY * D.Count));
                    if (iniFile.FRPriceFromDisplay)
                    {
                        Price = Math.Abs((decimal)D.DISP_PRICE) + Math.Abs((decimal)D.ServiceChargeSumm) / ((decimal)(D.QUANTITY * D.Count));
                    }
                    if (iniFile.FRDiscountMode)
                    {
                        Price = Math.Abs((decimal)D.Price) + Math.Abs((decimal)D.ServiceChargeSumm) / ((decimal)(D.QUANTITY * D.Count));
                    }
                    CloseCheckCommandBlock.Sale((double)(D.QUANTITY * D.Count), Price, D.CHITNAME + " " + D.CardPrefix + D.CardNumber, Tax, 0);
                }
                else
                {
                    if (D.OPrice > 0)
                    {
                        CloseCheckCommandBlock.Discount(Math.Abs(D.OPrice), "Комплексная");
                    }
                    else
                    {
                        int Tax = 1;
                        if (iniFile.FRNoTax)
                        {
                            Tax = 0;
                        }
                        decimal Price = Math.Abs((decimal)D.OPrice) + Math.Abs((decimal)D.ServiceChargeSumm) / ((decimal)(D.QUANTITY * D.Count));
                        if (iniFile.FRPriceFromDisplay)
                        {
                            Price = Math.Abs((decimal)D.DISP_PRICE) + Math.Abs((decimal)D.ServiceChargeSumm) / ((decimal)(D.QUANTITY * D.Count));;
                        }
                        if (iniFile.FRDiscountMode)
                        {
                            Price = Math.Abs((decimal)D.Price) + Math.Abs((decimal)D.ServiceChargeSumm) / ((decimal)(D.QUANTITY * D.Count));
                        }
                        //CloseCheckCommandBlock.ReturnSale((double)(D.QUANTITY * D.Count), Math.Abs((decimal)D.OPrice), D.Name, 1, 0);

                        CloseCheckCommandBlock.ReturnSale((double)(D.QUANTITY * D.Count), Price, D.CHITNAME, Tax, 0);
                    }
                }
            }

            if (Math.Abs(Ch.Comp) > 0)
            {
                string DiscCaption = "Комплексная";
                if (Ch.CompId == AlohaTSClass.BonusCompId)
                {
                    DiscCaption = "Оплата баллами";
                }

                if (iniFile.FRDiscountMode)
                {
                    CloseCheckCommandBlock.PrintString(DiscCaption + " скидка              =" + Math.Abs(Ch.Comp).ToString("0.00"));
                }
                else
                {
                    CloseCheckCommandBlock.Discount(Math.Abs(Ch.Comp), DiscCaption);
                }
            }

            if (Ch.Comps.Count > 1)
            {
                foreach (AlohaComp Cmp in Ch.Comps)
                {
                    if (Cmp != Ch.Comps.First())
                    {
                        if (iniFile.FRDiscountMode)
                        {
                            CloseCheckCommandBlock.PrintString(Cmp.Name + "               =-" + Math.Abs(Cmp.Amount).ToString("0.00"));
                        }
                    }
                }
            }

            foreach (string s in Ch.FrStringsAfter)
            {
                if (s.Length > 36)
                {
                    CloseCheckCommandBlock.PrintString(s.Substring(0, 35));
                }
                else
                {
                    CloseCheckCommandBlock.PrintString(s);
                }
            }

            /*
             * if (Ch.LoyaltyCard != "")
             * {
             *
             *  CloseCheckCommandBlock.PrintString("    ");
             *  CloseCheckCommandBlock.PrintString("   Программа лояльности КОФЕМАНИЯ АЭРО");
             *  CloseCheckCommandBlock.PrintString("   Начисление баллов");
             *  CloseCheckCommandBlock.PrintString("   Карта " + Ch.LoyaltyCard);
             *  CloseCheckCommandBlock.PrintString("   Начислено " + Ch.LoyaltyBonus.ToString("0.00") + " баллов");
             * }
             *
             *
             *
             * foreach (AlohaTender AT in Ch.CreditPayments())
             * {
             *
             *  CloseCheckCommandBlock.PrintString("    ");
             *  CloseCheckCommandBlock.PrintString("   Списание средств");
             *  CloseCheckCommandBlock.PrintString("   Карта " + AT.Ident);
             *  CloseCheckCommandBlock.PrintString("   Списано " + AT.Summ.ToString("0.00"));
             *
             *
             *  DateTime dt = DateTime.Now;
             *  string Err = "";
             *  decimal Bal = Loyalty.LoyaltyBasik.GetASVCardBalance(AT.Ident, out dt, out Err);
             *  if (Bal != -1)
             *  {
             *      CloseCheckCommandBlock.PrintString("   Текущий баланс " + Bal.ToString("0.00"));
             *      CloseCheckCommandBlock.PrintString("   Срок действия карты " + dt.ToString("dd.MM.yyyy"));
             *  }
             *  CloseCheckCommandBlock.PrintString("    ");
             *  //CloseCheckCommandBlock.PrintString("Доступных баллов: " + Ch.ASVCardBalance.ToString("0.00"));
             * }
             */
            /*
             * if (Ch.IsNal)
             * {
             *  CloseCheckCommandBlock.CloseCheck(Math.Abs(Ch.Oplata), 0, 0, 0, 0, 1, 0, 0, 0, "", 0);
             *
             * }
             * else if (Ch.Tender == TenderType.GloryCash)
             * {
             *  CloseCheckCommandBlock.CloseCheck(0, Math.Abs(Ch.Summ), 0, 0, 0, 1, 0, 0, 0, "", 0);
             *
             * }
             * else if (Ch.Tender == TenderType.Credit)
             * {
             *  CloseCheckCommandBlock.CloseCheck(0, Math.Abs(Ch.Summ), 0, 0, 0, 1, 0, 0, 0, "", 0);
             * }
             * else
             * {
             *  CloseCheckCommandBlock.CloseCheck(0, 0, 0, Math.Abs(Ch.Oplata), 0, 1, 0, 0, 0, "", 0);
             * }
             */
            CloseCheckCommandBlock.CloseCheck(Math.Abs(Ch.CashSummWithOverpayment2), Math.Abs(Ch.CreditSumm2), 0, Math.Abs(Ch.CardSumm2), 1, 0, 0, 0, "", Ch);



            CloseCheckCommandBlock.CommandBlockToQwery();
            Utils.ToCardLog("CloseCheck2  End" + Ch.CheckShortNum);
        }