Ejemplo n.º 1
0
        //挂账/预付单据
        private void CreditPayOrder()
        {
            if (this.lines.Count <= 0)
            {
                new MsgForm("无商品明细").ShowDialog();
                return;
            }
            IBLL.ISaleData bll = new BLL.SaleData();
            if (supcus_no == "")
            {
                new MsgForm("未选择客户").ShowDialog();
                return;
            }

            if (new YesNoForm("确认挂账/预付?").ShowDialog() == System.Windows.Forms.DialogResult.Yes)
            {
                try
                {
                    insertTHRK("", 0);
                    bll.SubmitOrder(lblsheet_no.Text, 1, Program.oper_id);
                    new MsgForm("单据提交成功!").ShowDialog();
                    clear_data();
                    newOrder("销售退货");
                }
                catch (Exception ex)
                {
                    new MsgForm("操作异常:" + ex.GetMessage()).ShowDialog();
                    return;
                }
            }
        }
Ejemplo n.º 2
0
        //现结单据
        private void CashPayOrder()
        {
            if (this.lines.Count <= 0)
            {
                new MsgForm("无商品明细").ShowDialog();
                return;
            }
            IBLL.ISaleData bll = new BLL.SaleData();

            if (supcus_no == "")
            {
                new MsgForm("未选择客户").ShowDialog();
                return;
            }
            frmPay frm2 = new frmPay("2");
            //应付
            decimal yf = lines.Sum(d => d.qty * d.price);
            //实付
            decimal sf       = 0;
            string  pay_way2 = "";
            var     res2     = frm2.Cash(yf, out sf, out pay_way2);

            if (res2)
            {
                try
                {
                    var item = new Model.ot_pay_flow();
                    item.sheet_no    = lblsheet_no.Text;
                    item.cus_no      = supcus_no;
                    item.oper_id     = Program.oper_id;
                    item.oper_date   = DateTime.Now;
                    item.pay_way     = pay_way2;
                    item.sale_amount = yf;
                    item.pay_amount  = sf;
                    item.old_amount  = yf;
                    item.jh          = Program.jh;
                    item.ml          = 0;
                    int flow_id = 0;
                    bll.InsertPayFlow(item, out flow_id);

                    insertTHRK(pay_way2, sf);
                    bll.SubmitOrder(lblsheet_no.Text, 1, Program.oper_id);
                    new MsgForm("单据提交成功!").ShowDialog();
                    clear_data();
                    newOrder("销售退货");
                }
                catch (Exception ex)
                {
                    new MsgForm("操作异常:" + ex.GetMessage()).ShowDialog();
                    return;
                }
            }
        }