/// <summary> /// 用于结账为员工餐和招待相应表的更新工作 /// </summary> /// <param name="type">结账类型</param> /// <param name="saleid">销售单号</param> /// <param name="shopid">分店编号</param> /// <param name="empid">收银员号</param> /// <returns>bool</returns> private bool TypeUpdateTable(string type, string saleid, string shopid, string empid) { try { InsertSaleAll.InitInsertSaleAll().UpdateSaleTmp00(saleid, shopid, type); InsertSaleAll.InitInsertSaleAll().UpdateSaleTmp01(saleid, shopid, empid, type); return(true); } catch { return(false); } }
/// <summary> /// 完成对结账确定按钮的对数据插入工作 /// </summary> /// <param name="sale_id">销售单号</param> /// <param name="shop_id">分店号</param> /// <param name="btninputmumber">已付金额</param> /// <param name="totalPrice">应付金额</param> /// <param name="method_id">销售方法</param> /// <param name="btnMoneyclick">现金按钮是否选中</param> /// <param name="sale_Sno">销售单序号</param> /// <param name="indexPayment">处于第几条记录</param> /// <param name="datetime">当前时间</param> /// <param name="btnmoney">现金输入</param> private void BtnConfirm(string sale_id, string shop_id, decimal btninputmumber, decimal totalPrice, int method_id, bool btnMoneyclick, int sale_Sno, int indexPayment, DateTime datetime, decimal btnmoney) { string pay_id = "01"; decimal Face_Value = 0; UInt16 methodid = 1; try { methodid = Convert.ToUInt16(method_id); } catch { methodid = 1; } decimal amount = -(btninputmumber - totalPrice); char trans = getPayment.ReturnTransferStatus(indexPayment); //对saletmp00表的最后更新 InsertSaleAll.InitInsertSaleAll().UpdateSaleTmp00(sale_id, shop_id, (btninputmumber - totalPrice), methodid, totalPrice); if (0 > amount)//有找零 { if (!btnMoneyclick) { pay_id = getPayment.ReturnPay_ID(indexPayment); Face_Value = getPayment.ReturnFace_Value(indexPayment); this.InsertSaleTemp02(shop_id, sale_id, sale_Sno, pay_id, amount, trans, datetime, Face_Value); } else { pay_id = getPayment.ReturnPay_ID(indexPayment); Face_Value = getPayment.ReturnFace_Value(indexPayment); this.InsertSaleTemp02(shop_id, sale_id, sale_sno, pay_id, btnmoney, trans, datetime, Face_Value); this.InsertSaleTemp02(shop_id, sale_id, sale_Sno + 1, pay_id, amount, trans, datetime, Face_Value); } } else { if (btnMoneyclick) { amount = btnmoney; pay_id = getPayment.ReturnPay_ID(indexPayment); Face_Value = getPayment.ReturnFace_Value(indexPayment);//index 为现金按钮的面值记录 this.InsertSaleTemp02(shop_id, sale_id, sale_Sno, pay_id, amount, trans, datetime, Face_Value); } else { return; } } btnmoneyclick = false; }
/// <summary> /// 完成对SaleTmp表对应的Sale表的插入 /// </summary> /// <returns>bool</returns> private bool InsertSallData(string sale_Id, string shop_Id, string types) { try { try { InsertSaleAll.InitInsertSaleAll().InSertSale00Data(sale_Id, shop_Id); InsertSaleAll.InitInsertSaleAll().InSertSale01Data(sale_Id, shop_Id); } catch { } try { if (types.Equals("结账")) { InsertSaleAll.InitInsertSaleAll().InSertSale02Data(sale_Id, shop_Id); } } catch { } //try //{ // InsertSaleAll.InitInsertSaleAll().InSertSale03Data(sale_Id, shop_Id); //} //catch { } try { //调用向后台传输数据的方法 //读取配置文件中传输间隔单数 int i; try { i = Convert.ToInt32(this.mainForm.OperPara.GetIniConfig("nudIntervalBill")); } catch { i = 10; } } catch { } return(true); } catch { return(false); } }