Beispiel #1
0
 /// <summary>
 /// 设置Lable按钮的相关信息
 /// </summary>
 public void SetPrice()
 {
     this.txtRequire.Text = decimal.Round(Info.totalPrice, dataAccur).ToString();
     this.txtPay.Text     = decimal.Round(btnInputNumber, dataAccur).ToString();
     if (btnInputNumber < (decimal)0.01)
     {
         PoleDisplayer.Clear();
         PoleDisplayer.Sum(decimal.Round(Info.totalPrice, 2).ToString());
     }
     else
     {
         PoleDisplayer.Clear();
         //显示给顾客看
         PoleDisplayer.Get(this.txtPay.Text);
     }
     if (0 <= (Convert.ToDecimal(this.txtPay.Text) - Info.totalPrice))
     {
         this.txtGiveBack.Text = decimal.Round((Convert.ToDecimal(this.txtPay.Text) - Info.totalPrice), dataAccur).ToString();
     }
     else
     {
         this.txtGiveBack.Text = "0.0";
     }
     //PoleDisplayer.Change(this.txtGiveBack.Text);
 }
Beispiel #2
0
 /// <summary>
 /// 取消按钮消息处理事件
 /// </summary>
 /// <param name="sender">sender</param>
 /// <param name="e">e</param>
 private void btnCancle_Click(object sender, EventArgs e)
 {
     btnClear.Visible = true;
     btnClear.Enabled = true;
     btnPrint.Enabled = true;
     btnPrint.Visible = true;
     index            = 0;
     PoleDisplayer.Clear();
     this.MainForm.Number.TextBoxText = "";
     Info.inputNumber = 0;
     this.mainForm.OperPara.WriteIniInfo("inputNumber", "0");
     this.txtPay.Text      = "";
     this.txtRequire.Text  = "";
     this.txtGiveBack.Text = "";
     this.labstate.Text    = "";
     if (checkOutType.Equals("结账"))
     {
         ClearcheckOutMoney();
         RecoverDate();
     }
     else
     {
         btnClear.Enabled = true;
         btnInputNumber   = 0;
         checkOutType     = "结账";
     }
     //结账取消按钮
     Info.StatusEnd("结账取消", "");
     //结束结账状态
     sale_sno = 1;
     this.mainForm.ReturnTlpMain.Controls.Remove(this);
     this.mainForm.ReturnTlpMain.Controls.Add(this.mainForm.TlpRight, 1, 0);
     this.mainForm.TlpRight.Dock = DockStyle.Fill;
 }
Beispiel #3
0
 /// <summary>
 /// 还原为正常 结账状态
 /// </summary>
 /// <param name="type">结账类型</param>
 private void RecoverType(string type)
 {
     if (type.Equals("招待") || type.Equals("员工餐"))
     {
         btnClear.Enabled = true;
         btnClear.Visible = true;
         btnPrint.Enabled = true;
         btnPrint.Visible = true;
     }
     else
     {
         //如果没有找零不用弹出提示界面
         if (btnInputNumber != Info.totalPrice)
         {
             CheckForm checkForm = new CheckForm();
             checkForm.StartPosition = FormStartPosition.CenterScreen;
             checkForm.SetStatus(this.txtRequire.Text, this.txtPay.Text, this.txtGiveBack.Text);
             checkForm.ShowDialog();
         }
         //关闭找零窗体后客显显示欢迎信息
         PoleDisplayer.Clear();
         PoleDisplayer.Display(Info.printmsg, PoleDisplayType.Dark);
     }
 }
        /// <summary>
        /// 给点单控件加载信息
        /// </summary>
        /// <param name="orderMenu">点单控件对象</param>
        private void OrderMenu_GetInfo(OrderMenu orderMenu)
        {
            //OrderDinner的集合
            List <OrderDinner> listOrderDinner = new List <OrderDinner>();

            GetSaleTemp01 getSale01 = new GetSaleTemp01();

            //选择的商品的总价格
            Info.totalPrice = 0;

            DataSet dataSet = getSale01.GetOrderInfo(Info.sale_id);


            //根据记录个数创建index_groupId数组
            orderMenu.Init_Index_Group_Array(dataSet);
            OrderDinner orderDinner;

            if (dataSet.Tables[0].Rows.Count > 0)
            {
                int xuhao = 1;
                for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
                {
                    string a = getSale01.Price_type(i);
                    //单餐
                    if (getSale01.Comb_type(i).Equals("0"))
                    {
                        orderDinner          = new OrderDinner();
                        orderDinner.ProdName = getSale01.Pos_disp(i);
                        orderDinner.Number   = getSale01.ProdNumber(i);
                        orderDinner.Discount = Convert.ToDecimal(dataSet.Tables[0].Rows[i]["ITEM_DISC"]);
                        orderDinner.Price    = getSale01.ProdPrice(i);
                        Info.totalPrice     += orderDinner.Price * orderDinner.Number + Convert.ToDecimal(dataSet.Tables[0].Rows[i]["ITEM_DISC"]);
                        orderDinner.Xu       = xuhao++;

                        orderDinner.Discount = decimal.Round(orderDinner.Discount, 1);
                        orderDinner.Total    = getSale01.Act_price(i) * orderDinner.Number;
                        //保留一位小数
                        orderDinner.Price = decimal.Round(orderDinner.Price, 1);
                        orderDinner.Total = decimal.Round(orderDinner.Total, 1);

                        listOrderDinner.Add(orderDinner);
                        if (orderDinner.Number == 1)
                        {
                            PoleDisplayer.Port = Info.cusShowPort;
                            PoleDisplayer.Clear();
                        }
                    }
                }

                this.operPara1.WriteIniInfo("totalPrice", Info.totalPrice.ToString());
                orderMenu.TotalPrice = (Info.totalPrice).ToString();
                //使价格最小精确到角
                orderMenu.TotalPrice = decimal.Round(Convert.ToDecimal(orderMenu.TotalPrice), 1) + "元";
                orderMenu.DgvOrderMenu.DataSource = null;
                orderMenu.DgvOrderMenu.DataSource = listOrderDinner;
            }
            else
            {
                orderMenu.TotalPrice = "0.0元";
                orderMenu.DgvOrderMenu.DataSource = null;
            }
            if (this.orderMenu.DgvOrderMenu.Rows.Count == 0)
            {
                Info.isDistinct  = false;
                Info.isAllowance = false;
            }
        }
Beispiel #5
0
        /// <summary>
        ///  打印发票
        /// </summary>
        /// <param name="saleid">销售单号</param>
        /// <param name="shopid">分店编号</param>
        /// <param name="posid">pos机号</param>
        /// <param name="empid">收银员编号</param>
        /// <param name="totalPrice">应付金额</param>
        /// <param name="btnInput">已付金额</param>
        /// <param name="type">结账类型</param>
        /// <param name="datetime">当前时间</param>
        public void PrintInvoice(string saleid, string shopid, string posid, string empid, decimal totalPrice, decimal btnInput, string type, DateTime datetime)
        {
            //实例GetSale对象用来返回销售id号
            GetSaleTmp01 getSale01  = new GetSaleTmp01(saleid, shopid);
            int          counttotle = getSale01.ReturenRecordNumber;

            //先清空账单
            listPrint.Clear();
            //listPrint.Add(this.mainForm.OperPara.TicketHead);//外界设置
            this.mainForm.AddExtraInfo(listPrint, this.mainForm.OperPara.TicketHead);
            listPrint.Add("日期: " + datetime.ToShortDateString() + "   时间: " + datetime.ToString("HH:mm:ss"));
            listPrint.Add("款台:" + posid + "   收银员:" + empid);
            listPrint.Add("编号:" + saleid);
            if (type.Equals("员工餐") || type.Equals("招待"))
            {
                listPrint.Add("结账类型:" + type);
            }
            listPrint.Add("品名        数量        小计 ");
            listPrint.Add("----------------------------");
            decimal totqunt = 0;

            for (int i = 0; i < counttotle; i++)
            {
                try
                {
                    //组合餐的子产品不打印
                    if (getSale01.ReturnComb_Type(i) != "2")
                    {
                        decimal qty = decimal.Round(getSale01.ReturnQty(i), 0);
                        totqunt += qty;
                        //小计
                        string price     = (decimal.Round(Convert.ToDecimal(getSale01.ReturnSale_Price(i)) * qty + Convert.ToDecimal(getSale01.ReturnItem_Disc_Tot(i)), 2)).ToString();
                        string prod_name = getSale01.ReturnProd_Name1(getSale01.ReturnProdID(i));
                        string Prod_id   = getSale01.ReturnProdID(i);
                        //设置打印内容
                        listPrint.Add(prod_name.PadRight(10, ' ') + qty.ToString() + "      " + price.ToString());
                    }
                    //总金额实现
                }
                catch { }
            }

            // decimal totqunt = decimal.Round(GetSaleTmp00.InitGetSaleTmp00(shopid, saleid).SaleTmp00TotQuan(), 0);
            listPrint.Add("      ");
            listPrint.Add("数量合计:" + "      " + decimal.Round(totqunt, 0).ToString());
            listPrint.Add("合计:" + "      " + decimal.Round(totalPrice, 2).ToString());
            listPrint.Add("现金" + "       " + decimal.Round(btnInput, 2).ToString());
            listPrint.Add("找回" + "       " + decimal.Round((btnInput - totalPrice), 2).ToString());
            this.mainForm.AddExtraInfo(listPrint, this.mainForm.OperPara.TicketTail);



            LPTControl.Port = Info.printPort;
            //如果选择打印按钮则打印小票
            if (enablePrint || type.Equals("员工餐") || type.Equals("招待"))
            {
                //LPTControl.NewRow(2);
                foreach (string s in listPrint)
                {
                    LPTControl.WriteLine(s);
                }
                LPTControl.NewRow(1);
                LPTControl.CutPaper();
            }
            PoleDisplayer.Clear();
            PoleDisplayer.Change(this.txtGiveBack.Text);
            LPTControl.OpenBox();
            LPTControl.Close();
        }