示例#1
0
        public static void Payment(double Summ, int TypeClose, ref double Remainder, ref double Change)
        {
            ECR.Summ      = Summ;
            ECR.TypeClose = TypeClose;
            ECR.Payment();

            Remainder = ECR.Remainder;
            Change    = ECR.Change;
        }
示例#2
0
        public void RegisterPayment(double sum, byte type = 0)
        {
            if (!driverExists)
            {
                return;
            }

            cmd.Mode = 1;
            cmd.SetMode();
            cmd.TypeClose = type;
            cmd.Summ      = sum;
            cmd.Payment();
        }
示例#3
0
        private bool PayAtol(double cash, double card, string cashier = "Кассир", int numCheck = -1, int numSession = 0, bool vozvrat = false)
        {
            if (!SetDevice())
            {
                return(false);
            }

            ECR.Mode = 1;
            if (ECR.SetMode() != 0)
            {
                MessageBox.Show(ECR.ResultDescription);
                return(false);
            }

            ECR.AttrNumber = 1021;
            ECR.AttrValue  = cashier;
            if (ECR.WriteAttribute() != 0)
            {
                MessageBox.Show(ECR.ResultDescription);
                return(false);
            }

            numCheck   = ECR.CheckNumber;
            numSession = ECR.Session;

            int num = 1;

            foreach (DataGridViewRow item in dataGridViewChecks.Rows)
            {
                ECR.Name     = num.ToString() + ". " + item.Cells["ColumnProduct"].Value.ToString();
                ECR.Quantity = double.Parse(item.Cells["ColumnQty"].Value.ToString());
                //ECR.Department = Отдел;
                ECR.TaxTypeNumber = int.Parse(item.Cells["ColumnNDSValue"].Value.ToString());
                ECR.Price         = double.Parse(item.Cells["ColumnPrice"].Value.ToString());

                ECR.Percents           = double.Parse(item.Cells["ColumnDiscountValue"].Value.ToString());
                ECR.DiscountValue      = double.Parse(item.Cells["ColumnDiscountValue"].Value.ToString());
                ECR.DiscountType       = 1;
                ECR.DiscountTypeNumber = 1;

                if (!vozvrat)
                {
                    if (ECR.Registration() != 0)
                    {
                        MessageBox.Show(ECR.ResultDescription);
                        return(false);
                    }
                }
                else
                {
                    if (ECR.Return() != 0)
                    {
                        MessageBox.Show(ECR.ResultDescription);
                        return(false);
                    }
                }

                num++;
            }

            if (cash > 0)
            {
                ECR.Summ      = cash;
                ECR.TypeClose = 0;
                ECR.Payment();
            }

            if (card > 0)
            {
                ECR.Summ      = card;
                ECR.TypeClose = 3;
                ECR.Payment();
            }

            if (ECR.CloseCheck() != 0)
            {
                MessageBox.Show(ECR.ResultDescription);
                return(false);
            }


            if (ECR.ResetMode() != 0)
            {
                MessageBox.Show(ECR.ResultDescription);
                return(false);
            }

            ECR.DeviceEnabled = false;
            if (ECR.ResultCode != 0)
            {
                MessageBox.Show(ECR.ResultDescription);
                return(false);
            }

            return(true);
        }