Ejemplo n.º 1
0
 public static bool CloseCheck(FiskalCheck FCh)
 {
     if (KeeperLogic.GetColor(FCh))
     {
         return(_driver.CloseCheck(FCh));
     }
     return(true);
 }
Ejemplo n.º 2
0
 public static bool PrintPreCheck(FiskalCheck FCh)
 {
     return(_driver.PrintPreCheck(FCh));
 }
Ejemplo n.º 3
0
 public static void CloseCheck(FiskalCheck FCh)
 {
     if (KeeperLogic.GetColor(FCh))
     {
     }
 }
Ejemplo n.º 4
0
        public bool PrintPreCheck(FiskalCheck FskChk)
        {
            Utils.ToLog("PrintPreCheck " + FskChk.CheckNum);

            bool Sucsecc   = false;
            bool ErrorExit = false;

            AtollInteruptDrviver.DeviceEnabled = true;
            while (!Sucsecc && (!ErrorExit))
            {
                AtollInteruptDrviver.Password = 30;
                AtollInteruptDrviver.Mode     = 1;
                AtollInteruptDrviver.SetMode();
                foreach (String s in FskChk.CaptionInfoStrings)
                {
                    Utils.ToLog("PrintString " + s);
                    AtollInteruptDrviver.Caption = s;
                    AtollInteruptDrviver.PrintString();
                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                    Utils.ToLog("PrintString ok" + s);
                }


                AtollInteruptDrviver.Caption = new string(" "[0], CheckWidth);
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }

                /*
                 * AtollInteruptDrviver.Caption = "Блюдо                    Кол-во   Сумма";
                 * AtollInteruptDrviver.PrintString();
                 * if (!CheckState(true, out ErrorExit)) continue;
                 *
                 * AtollInteruptDrviver.Caption = new String("-"[0], CheckWidth);
                 * AtollInteruptDrviver.PrintString();
                 * if (!CheckState(true, out ErrorExit)) continue;
                 *
                 * foreach (FiskalDish item in FskChk.Dishes)
                 * {
                 *  Utils.ToLog(String.Format("{0} , {1}, {2}", item.Name, item.Price, item.Quantity));
                 *  if (item.Price == 0)
                 *  {
                 *      continue;
                 *
                 *  }
                 *  AtollInteruptDrviver.Caption = AtollInteruptDrviver.Name.PadRight(CheckWidth-10) + (AtollInteruptDrviver.Quantity.ToString("") + "x" + AtollInteruptDrviver.Price.ToString("0.00")).PadLeft(9);
                 *  AtollInteruptDrviver.PrintString();
                 *
                 *  if (!CheckState(true, out ErrorExit)) continue;
                 * }
                 *
                 * AtollInteruptDrviver.Caption = new String("-"[0], CheckWidth);
                 * AtollInteruptDrviver.PrintString();
                 * if (!CheckState(true, out ErrorExit)) continue;
                 */
                if (FskChk.Discount > 0)
                {
                    AtollInteruptDrviver.Caption = "Скидка".PadRight(CheckWidth - 10) + FskChk.Discount.ToString("0.00").PadLeft(9);
                    AtollInteruptDrviver.PrintString();
                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }
                if (FskChk.Charge > 0)
                {
                    AtollInteruptDrviver.Caption = "Надбавка".PadRight(CheckWidth - 10) + FskChk.Charge.ToString("0.00").PadLeft(9);
                    AtollInteruptDrviver.PrintString();
                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }
                AtollInteruptDrviver.Caption = "Оплата                       ";
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }
                foreach (FiskalPayment P in FskChk.Payments)
                {
                    AtollInteruptDrviver.Caption = P.Name.PadRight(30) + P.Summ.ToString("0.00").PadLeft(9);
                    AtollInteruptDrviver.PrintString();
                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }
                AtollInteruptDrviver.Caption = "ИТОГ".PadRight(CheckWidth - 10) + FskChk.Summ.ToString().PadLeft(9);
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }
                Sucsecc = true;
            }
            AtollInteruptDrviver.DeviceEnabled = false;
            return(Sucsecc && (!ErrorExit));
        }
Ejemplo n.º 5
0
        public bool CloseCheck(FiskalCheck FskChk)
        {
            bool Sucsecc   = false;
            bool ErrorExit = false;

            AtollInteruptDrviver.DeviceEnabled = true;
            while (!Sucsecc && (!ErrorExit))
            {
                //AtollInteruptDrviver.setParam(1021, "Кассир Иванов И.");
                AtollInteruptDrviver.Password = 30;
                AtollInteruptDrviver.Mode     = 1;
                AtollInteruptDrviver.SetMode();
                AtollInteruptDrviver.NewDocument();
                Utils.ToLog("AtollInteruptDrviver.NewDocument();");
                if (!CheckState(false, out ErrorExit))
                {
                    continue;
                }

                if (FskChk.IsVoid)
                {
                    AtollInteruptDrviver.CheckType = 2;
                }
                else
                {
                    AtollInteruptDrviver.CheckType = 1;
                }

                AtollInteruptDrviver.OpenCheck();
                Utils.ToLog("AtollInteruptDrviver.OpenCheck();");
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }
                foreach (String s in FskChk.CaptionInfoStrings)
                {
                    AtollInteruptDrviver.Caption = s;
                    AtollInteruptDrviver.PrintString();
                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }

                AtollInteruptDrviver.Caption = new string(" "[0], CheckWidth);
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }

                AtollInteruptDrviver.Caption = "Блюдо                    Кол-во   Сумма";
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }

                AtollInteruptDrviver.Caption = new String("-"[0], CheckWidth);
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }

                foreach (FiskalDish item in FskChk.Dishes)
                {
                    Utils.ToLog(String.Format("{0} , {1}, {2}", item.Name, item.Price, item.Quantity));
                    if (item.Price == 0)
                    {
                        continue;
                    }
                    AtollInteruptDrviver.Department           = 0;
                    AtollInteruptDrviver.AdvancedRegistration = true;
                    AtollInteruptDrviver.Name     = item.GetNameAndCountString();
                    AtollInteruptDrviver.Price    = item.Price;
                    AtollInteruptDrviver.Quantity = item.Quantity;
                    if (FskChk.IsVoid)
                    {
                        AtollInteruptDrviver.EnableCheckSumm = false;
                        AtollInteruptDrviver.Return();
                    }
                    else
                    {
                        Utils.ToLog("AtollInteruptDrviver.Registration();");
                        AtollInteruptDrviver.Registration();
                    }

                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }

                AtollInteruptDrviver.Caption = new String("-"[0], CheckWidth);
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }

                if (FskChk.Discount > 0)
                {
                    /*
                     * AtollInteruptDrviver.Destination = 0;
                     * AtollInteruptDrviver.Summ = FskChk.Discount;
                     * Utils.ToLog("AtollInteruptDrviver.SummDiscount() " + FskChk.Discount);
                     * AtollInteruptDrviver.SummDiscount();
                     * */

                    string discStr = FskChk.DiscountName;
                    AtollInteruptDrviver.Caption = FskChk.GetDiscountString(CheckWidth);
                    Utils.ToLog("AtollInteruptDrviver.PrintString() Discount" + AtollInteruptDrviver.Caption);
                    AtollInteruptDrviver.PrintString();
                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }
                if (FskChk.Charge > 0)
                {
                    /*
                     * AtollInteruptDrviver.Destination = 0;
                     * AtollInteruptDrviver.Summ = FskChk.Charge;
                     * Utils.ToLog("AtollInteruptDrviver.SummCharge()");
                     * AtollInteruptDrviver.SummCharge();
                     * */


                    AtollInteruptDrviver.Department           = 0;
                    AtollInteruptDrviver.AdvancedRegistration = true;
                    AtollInteruptDrviver.Name     = "Надбавка ";
                    AtollInteruptDrviver.Price    = FskChk.Charge;
                    AtollInteruptDrviver.Quantity = 1;

                    Utils.ToLog("AtollInteruptDrviver.Registration() for Charge;");
                    AtollInteruptDrviver.Registration();

                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }


                AtollInteruptDrviver.Caption = new string("-"[0], CheckWidth);
                Utils.ToLog("AtollInteruptDrviver.PrintString()");
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }

                AtollInteruptDrviver.Caption = new string(" "[0], CheckWidth);
                Utils.ToLog("AtollInteruptDrviver.PrintString()");
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }


                foreach (FiskalPayment P in FskChk.Payments)
                {
                    if (P.Summ == 0)
                    {
                        continue;
                    }
                    AtollInteruptDrviver.Caption = P.GetPaymentNameString(CheckWidth);
                    Utils.ToLog("AtollInteruptDrviver.PrintString() Payment " + P.GetPaymentNameString(CheckWidth));
                    AtollInteruptDrviver.PrintString();
                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }

                AtollInteruptDrviver.Caption = new string("-"[0], CheckWidth);
                AtollInteruptDrviver.PrintString();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }

                foreach (FiskalPayment P in FskChk.Payments)
                {
                    AtollInteruptDrviver.Summ      = P.Summ;
                    AtollInteruptDrviver.TypeClose = P.PaymentType;
                    Utils.ToLog("Payment() Type: " + P.PaymentType);
                    AtollInteruptDrviver.Payment();
                    if (!CheckState(true, out ErrorExit))
                    {
                        continue;
                    }
                }
                Utils.ToLog("CloseCheck()");
                AtollInteruptDrviver.CloseCheck();
                if (!CheckState(true, out ErrorExit))
                {
                    continue;
                }
                Sucsecc = true;
            }
            AtollInteruptDrviver.DeviceEnabled = false;
            return(Sucsecc && (!ErrorExit));
        }
Ejemplo n.º 6
0
 public static bool GetColor(FiskalCheck Chk)
 {
     return(Chk.HasNotNalPayment);
 }