示例#1
0
        //取重、输入数量
        private void inputQty(string text)
        {
            if (supcus_no == "")
            {
                new MsgForm("未选择客户").ShowDialog();
                return;
            }
            if (currGoods != null)
            {
                if (Program.is_continue_weight == "1" && total_weight == Weight)
                {
                    new MsgForm("请先放商品,再取重").ShowDialog();
                    return;
                }
                IBLL.ISaleData       bll      = new BLL.SaleData();
                IBLL.IGoods          goodsBLL = new BLL.Goods();
                Model.bi_t_item_info gd       = currGoods;
                Model.t_order_detail item     = new Model.t_order_detail();
                item.item_no = gd.item_no;
                switch (text)
                {
                case "取重":
                    if (Program.is_continue_weight == "1" && total_weight != 0)
                    {
                        item.qty = Weight - total_weight;
                    }
                    else
                    {
                        item.qty = Weight;
                    }
                    break;

                case "手输数量":
                    if (Program.can_input_qty == "1" && currGoods.item_flag == "1")
                    {
                        new MsgForm("称重商品不可手输数量").ShowDialog();
                        return;
                    }
                    InputNumerForm frm = new InputNumerForm("数量", 3);
                    decimal        qty = 0;
                    if (frm.Input(out qty) == true)
                    {
                        if (qty <= 0)
                        {
                            new MsgForm("数量不正确").ShowDialog();
                            return;
                        }
                        item.qty = qty;
                    }
                    else
                    {
                        return;
                    }

                    break;
                }
                if (bll.CheckCusIsRetail(supcus_no))
                {
                    item.price = currGoods.base_price;//一级批发价
                }
                else
                {
                    IBLL.IClientBLL bll2 = new BLL.ClientBLL();
                    item.price = bll2.GetCusItemPrice(supcus_no, item.item_no); //在线取客户零批价
                }
                total_weight = Weight;

                item.item_subno   = gd.item_subno;
                item.item_name    = gd.item_name;
                item.unit_no      = gd.unit_no;
                item.amt          = item.qty * item.price;
                item.sheet_no     = lblsheet_no.Text;
                item.oper_id      = Program.oper_id;
                item.oper_date    = DateTime.Now;
                item.jh           = Program.jh;
                item.cost_price   = goodsBLL.GetCost(gd.item_no, Program.branch_no);
                item.branch_no    = Program.branch_no;
                item.cus_no       = supcus_no;
                item.sup_no       = supcus_no;
                item.is_give      = "0";
                item.source_price = item.price;
                item.discount     = 1;

                int flow_id = 0;
                bll.Insert(item, out flow_id);
                item.flow_id = flow_id;
                this.lines.Add(item);
                this.ShowLine();
            }
        }