示例#1
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            if (!gridView1.PostEditor())
            {
                return;
            }
            if (!gridView1.UpdateCurrentRow())
            {
                return;
            }
            if (!SaveCheck())
            {
                return;                            //数据合法性校验!!!
            }
            if (source == "1")
            {
                ac001 = Tools.GetEntityPK("RC01");                                    //逝者编号
            }
            string s_fa001 = source == "0"? string.Empty : Tools.GetEntityPK("FA01"); //结算流水号
            string s_rc109 = RegisterAction.GenRegisterNo("0");                       //正常登记寄存证号
            string s_rc002 = rg_rc002.EditValue.ToString();                           //性别
            string s_rc202 = rg_rc202.EditValue.ToString();                           //性别2
            string s_rc003 = txtEdit_rc003.Text;                                      //逝者姓名
            string s_rc303 = txtEdit_rc303.Text;                                      //逝者姓名2
            int    rc004   = int.Parse(txtEdit_rc004.Text);                           //年龄
            int    rc404;

            if (!string.IsNullOrEmpty(txtEdit_rc404.Text))
            {
                rc404 = int.Parse(txtEdit_rc404.Text);
            }
            else
            {
                rc404 = 0;
            }

            string   s_rc014     = txtedit_rc014.Text;                        //身份证号
            string   s_rc050     = txtEdit_rc050.Text;                        //联系人
            string   s_rc051     = txtEdit_rc051.Text;                        //联系电话
            string   s_rc052     = lookUp_rc052.EditValue.ToString();         //与逝者关系
            string   s_rc055     = txtEdit_ac055.Text;                        //联系地址
            string   s_rc099     = mem_rc099.Text;                            //备注
            DateTime d_rc140     = DateTime.Now;                              //寄存日期
            decimal  nums        = decimal.Parse(comboBox1.Text);             //缴费年限
            decimal  dec_tax_sum = new decimal(0);

            //输入交款人信息
            string s_cuname = s_rc003;

            List <string>  itemId_List    = new List <string>();
            List <decimal> itemPrice_List = new List <decimal>();
            List <int>     itemNums_List  = new List <int>();

            if (fpfee > 0)
            {
                foreach (DataRow r in register_ds.Sa01.Rows)
                {
                    itemId_List.Add(r["SA004"].ToString());
                    itemPrice_List.Add(Convert.ToDecimal(r["PRICE"]));
                    itemNums_List.Add(Convert.ToInt32(r["NUMS"]));
                    //计算税票项目金额
                    if (MiscAction.GetItemInvoiceType(r["SA004"].ToString()) == "T")
                    {
                        dec_tax_sum += Convert.ToDecimal(r["SA007"]);
                    }
                }
            }
            string s_tip = string.Empty;

            if (dec_tax_sum > 0)
            {
                s_tip = "本次结算共需要一张财政发票和一张税务发票,是否继续?";
            }
            else
            {
                s_tip = "本次结算共需要一张财政发票,是否继续?";
            }


            if (source == "1")             //外来寄存
            {
                if (XtraMessageBox.Show(s_tip, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
                if (dec_tax_sum > 0 && !TaxInvoice.ClientIsOnline())
                {
                    if (XtraMessageBox.Show("【税神通】客户端不在线!是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                    {
                        return;
                    }
                }
            }

            int re = 0;

            if (fpfee > 0)
            {
                re = RegisterAction.RegisterEnroll(ac001,
                                                   s_rc109,
                                                   s_fa001,
                                                   s_rc002,
                                                   s_rc202,
                                                   s_rc003,
                                                   s_rc303,
                                                   rc004,
                                                   rc404,
                                                   s_rc014,
                                                   s_rc050,
                                                   s_rc051,
                                                   s_rc052,
                                                   s_rc055,
                                                   s_rc099,
                                                   bitId,
                                                   bitPrice,
                                                   d_rc140,
                                                   d_rc140,
                                                   nums,
                                                   regfee,
                                                   source,
                                                   itemId_List.ToArray(),
                                                   itemPrice_List.ToArray(),
                                                   itemNums_List.ToArray(),
                                                   Envior.cur_userId
                                                   );
            }
            else
            {
                re = RegisterAction.RegisterEnroll(ac001,
                                                   s_rc109,
                                                   s_fa001,
                                                   s_rc002,
                                                   s_rc202,
                                                   s_rc003,
                                                   s_rc303,
                                                   rc004,
                                                   rc404,
                                                   s_rc014,
                                                   s_rc050,
                                                   s_rc051,
                                                   s_rc052,
                                                   s_rc055,
                                                   s_rc099,
                                                   bitId,
                                                   bitPrice,
                                                   d_rc140,
                                                   d_rc140,
                                                   nums,
                                                   regfee,
                                                   source,
                                                   Envior.cur_userId
                                                   );
            }

            if (IDC_FLAG)
            {
                ic01.ac001 = ac001;
                ic01_dao.Insert(ic01);

                ///更新身份证照片
                FileStream file    = new FileStream("zp.bmp", FileMode.Open, FileAccess.Read);
                Byte[]     imgByte = new Byte[file.Length];           //把图片转成 Byte型 二进制流
                file.Read(imgByte, 0, imgByte.Length);                //把二进制流读入缓冲区
                file.Close();
                MiscAction.Update_IDC_Photo(ic01.ic001, imgByte);
            }

            if (re > 0 && source == "0")
            {
                XtraMessageBox.Show("寄存办理成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                DialogResult = DialogResult.OK;
                this.Close();
            }
            else if (re > 0 && source == "1" /* 外来寄存 */)
            {
                if (XtraMessageBox.Show("现在打印【骨灰寄存证】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    PrtServAction.PrtRegisterCert(ac001, s_fa001, Envior.mform.Handle.ToInt32());
                }
                //if (XtraMessageBox.Show("现在打印【寄存标签】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                //{
                //	PrtServAction.PrtRegisterLabel(ac001,this.Handle.ToInt32());
                //}

                txtEdit_rc001.EditValue = ac001;
                txtEdit_rc109.EditValue = s_rc109;
                XtraMessageBox.Show("寄存登记成功!现在开始开具发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

                ///开财政票
                if (FinInvoice.GetCurrentPh() > 0)
                {
                    if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        FinInvoice.Invoice(s_fa001);
                    }
                }

                //// 开税票
                if (dec_tax_sum > 0)
                {
                    //获取税务客户信息
                    Frm_TaxClientInfo frm_taxClient = new Frm_TaxClientInfo(s_rc003);
                    if (frm_taxClient.ShowDialog() == DialogResult.OK)
                    {
                        TaxClientInfo clientInfo = frm_taxClient.swapdata["taxclientinfo"] as TaxClientInfo;
                        if (TaxInvoice.GetNextInvoiceNo(s_fa001) > 0)
                        {
                            if (XtraMessageBox.Show("下一张税票代码:" + Envior.NEXT_BILL_CODE + "\r\n" + "票号:" + Envior.NEXT_BILL_NUM + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                TaxInvoice.Invoice(s_fa001, clientInfo);
                            }
                        }
                    }
                }


                DialogResult = DialogResult.OK;
                this.Close();
            }
        }
示例#2
0
        /// <summary>
        /// 结算
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void barButtonItem18_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (!SaveCheck())
            {
                return;
            }
            string s_tip = string.Empty;

            if (dec_fin > 0 && dec_tax > 0)
            {
                s_tip = "本次结算共需要一张财政发票和一张税务发票,是否继续?";
            }
            else if (dec_fin > 0)
            {
                s_tip = "本次结算共需要一张财政发票,是否继续?";
            }
            else if (dec_tax > 0)
            {
                s_tip = "本次结算共需要一张税务发票,是否继续?";
            }
            else
            {
                return;
            }

            if (XtraMessageBox.Show(s_tip, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            if (dec_tax > 0 && !TaxInvoice.ClientIsOnline())
            {
                if (XtraMessageBox.Show("【税神通】客户端不在线!是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
            }



            string        s_cuname = be_cuname.EditValue.ToString();        //交款人(或单位)
            StringBuilder sb_memo  = new StringBuilder(50);

            List <string>  itemId_List   = new List <string>();
            List <string>  itemType_List = new List <string>();
            List <decimal> prict_List    = new List <decimal>();
            List <decimal> nums_List     = new List <decimal>();

            for (int i = 0; i < gridView1.RowCount; i++)
            {
                itemId_List.Add(gridView1.GetRowCellValue(i, "SA004").ToString());
                itemType_List.Add(gridView1.GetRowCellValue(i, "SA002").ToString());
                prict_List.Add(decimal.Parse(gridView1.GetRowCellValue(i, "PRICE").ToString()));
                nums_List.Add(decimal.Parse(gridView1.GetRowCellValue(i, "NUMS").ToString()));
            }
            string s_fa001 = Tools.GetEntityPK("FA01");
            int    re      = FireAction.TempSalesSettle(
                s_cuname, s_fa001, itemId_List.ToArray(), itemType_List.ToArray(), prict_List.ToArray(), nums_List.ToArray(), Envior.cur_userId, sb_memo.ToString());

            //如果保存失败,则退出处理
            if (re < 0)
            {
                return;
            }

            //清理数据
            business_ds.Sa01.Rows.Clear();
            be_cuname.Text  = "";
            te_fin_sum.Text = "";
            te_tax_sum.Text = "";


            XtraMessageBox.Show("结算成功!现在开始开具发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);

            ////开财政票!
            if (dec_fin > 0)
            {
                if (FinInvoice.GetCurrentPh() > 0)
                {
                    if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                    {
                        FinInvoice.Invoice(s_fa001);
                    }
                }
            }

            //// 开税票
            if (dec_tax > 0)
            {
                //获取税务客户信息
                Frm_TaxClientInfo frm_taxClient = null;
                if (tu01 == null)
                {
                    frm_taxClient = new Frm_TaxClientInfo(s_cuname);
                }
                else
                {
                    frm_taxClient = new Frm_TaxClientInfo(tu01);
                }

                if (frm_taxClient.ShowDialog() != DialogResult.OK)
                {
                    tu01 = null;
                    return;
                }

                TaxClientInfo clientInfo = frm_taxClient.swapdata["taxclientinfo"] as TaxClientInfo;

                if (TaxInvoice.GetNextInvoiceNo(s_fa001) < 0)
                {
                    tu01 = null;
                    return;                      //获取票据号失败,则退出!!!
                }

                if (XtraMessageBox.Show("下一张税票代码:" + Envior.NEXT_BILL_CODE + "\r\n" + "票号:" + Envior.NEXT_BILL_NUM + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    TaxInvoice.Invoice(s_fa001, clientInfo);
                }

                //////////// 保存客户信息 ///////////////
                Tu01_dao tu01_dao = new Tu01_dao();
                if (tu01 != null)
                {
                    tu01.tu003 = clientInfo.InfoClientName;
                    tu01.tu005 = clientInfo.InfoClientTaxCode;
                    tu01.tu006 = clientInfo.infoclientaddressphone;
                    tu01.tu007 = clientInfo.infoclientbankaccount;
                    tu01_dao.Update(tu01);
                }
                else if (clientInfo.InfoClientName.Length >= 5)
                {
                    tu01       = new Tu01();
                    tu01.tu001 = Tools.GetEntityPK("TU01");
                    tu01.tu003 = clientInfo.InfoClientName;
                    tu01.tu005 = clientInfo.InfoClientTaxCode;
                    tu01.tu006 = clientInfo.infoclientaddressphone;
                    tu01.tu007 = clientInfo.infoclientbankaccount;
                    tu01_dao.Insert(tu01);
                }
                tu01 = null;
            }
        }
示例#3
0
文件: TaxDemo.cs 项目: anrk0451/White
 private void simpleButton17_Click(object sender, EventArgs e)
 {
     TaxInvoice.ClientIsOnline();
 }
示例#4
0
        /// <summary>
        /// 缴费 过程
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void b_ok_Click(object sender, EventArgs e)
        {
            decimal nums;
            decimal dec_tax_sum = decimal.Zero;

            if (!decimal.TryParse(comboBox1.Text, out nums))
            {
                XtraMessageBox.Show("请输入正确的缴费期限!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            if (!(bitprice > 0))
            {
                XtraMessageBox.Show("参数传递错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            string cuname = txtEdit_rc003.Text;
            string fa001  = Tools.GetEntityPK("FA01");
            int    re     = 0;


            List <string>  itemId_List    = new List <string>();
            List <decimal> itemPrice_List = new List <decimal>();
            List <int>     itemNums_List  = new List <int>();

            if (fpfee > 0)
            {
                foreach (DataRow r in dt_sa01.Rows)
                {
                    itemId_List.Add(r["SA004"].ToString());
                    itemPrice_List.Add(Convert.ToDecimal(r["PRICE"]));
                    itemNums_List.Add(Convert.ToInt32(r["NUMS"]));
                    //计算税票项目金额
                    if (MiscAction.GetItemInvoiceType(r["SA004"].ToString()) == "T")
                    {
                        dec_tax_sum += Convert.ToDecimal(r["SA007"]);
                    }
                }
            }

            if (dec_tax_sum > 0 && !TaxInvoice.ClientIsOnline())
            {
                if (XtraMessageBox.Show("【税神通】客户端不在线!是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
            }


            if (fpfee > 0)
            {
                re = RegisterAction.RegisterPay(rc001, fa001, bitprice, nums, new_regfee + old_regfee,
                                                itemId_List.ToArray(), itemPrice_List.ToArray(), itemNums_List.ToArray(), Envior.cur_userId);
            }
            else
            {
                re = RegisterAction.RegisterPay(rc001, fa001, bitprice, nums, new_regfee + old_regfee, Envior.cur_userId);
            }


            //if (!checkEdit1.Checked)
            //	re = RegisterAction.RegisterPay(rc001, fa001, bitprice, nums, new_regfee + old_regfee,Envior.cur_userId);
            //else
            //	re = RegisterAction.RegisterPay(rc001, fa001, oldprice, bitprice, oldnums, newnums, old_regfee, new_regfee, Envior.cur_userId);

            if (re > 0)
            {
                dt_rc04.Rows.Clear();
                rc04Adapter.Fill(dt_rc04);

                if (XtraMessageBox.Show("缴费成功!现在打印财政【发票】吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    if (FinInvoice.GetCurrentPh() > 0)
                    {
                        if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            FinInvoice.Invoice(fa001);
                        }
                    }
                }

                //// 开税票
                if (dec_tax_sum > 0)
                {
                    //获取税务客户信息
                    Frm_TaxClientInfo frm_taxClient = new Frm_TaxClientInfo(txtEdit_rc003.Text);
                    if (frm_taxClient.ShowDialog() == DialogResult.OK)
                    {
                        TaxClientInfo clientInfo = frm_taxClient.swapdata["taxclientinfo"] as TaxClientInfo;
                        if (TaxInvoice.GetNextInvoiceNo(fa001) > 0)
                        {
                            if (XtraMessageBox.Show("下一张税票代码:" + Envior.NEXT_BILL_CODE + "\r\n" + "票号:" + Envior.NEXT_BILL_NUM + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                TaxInvoice.Invoice(fa001, clientInfo);
                            }
                        }
                    }
                }


                if (XtraMessageBox.Show("现在打印缴费记录吗?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                {
                    //打印缴费记录
                    PrtServAction.PrtRegisterPayRecord(fa001, this.Handle.ToInt32());
                }
                DialogResult = DialogResult.OK;
                this.Close();
            }
        }
示例#5
0
        private void b_ok_Click(object sender, EventArgs e)
        {
            decimal dec_fin = new decimal(0);
            decimal dec_tax = new decimal(0);
            string  s_tip   = string.Empty;

            foreach (DataRow dr in dt_source.Rows)
            {
                if (dr["SA020"].ToString() == "F")
                {
                    dec_fin += Convert.ToDecimal(dr["SA007"]);
                }
                else if (dr["SA020"].ToString() == "T")
                {
                    dec_tax += Convert.ToDecimal(dr["SA007"]);
                }
            }

            if (dec_fin > 0 && dec_tax > 0)
            {
                s_tip = "本次结算共需要一张财政发票和一张税务发票,是否继续?";
            }
            else if (dec_fin > 0)
            {
                s_tip = "本次结算共需要一张财政发票,是否继续?";
            }
            else if (dec_tax > 0)
            {
                s_tip = "本次结算共需要一张税务发票,是否继续?";
            }
            else
            {
                return;
            }

            if (XtraMessageBox.Show(s_tip, "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
            {
                return;
            }
            if (dec_tax > 0 && !TaxInvoice.ClientIsOnline())
            {
                if (XtraMessageBox.Show("【税神通】客户端不在线!是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
                {
                    return;
                }
            }

            string        s_fa001    = Tools.GetEntityPK("FA01");
            string        s_cuname   = FireAction.GetGuyNameById(AC001);
            List <string> sa001_list = new List <string>();

            foreach (DataRow r in dt_source.Rows)
            {
                sa001_list.Add(r["SA001"].ToString());
            }

            int result = FireAction.FireBusinessSettle(s_fa001,
                                                       AC001,
                                                       s_cuname,
                                                       sa001_list.ToArray(),
                                                       Envior.cur_userId
                                                       );

            if (result > 0)
            {
                b_ok.Enabled = false;

                int fire_row = gridView1.LocateByValue("SA002", "06");
                //如果有火化,打印火化证明
                if (fire_row >= 0)
                {   //打印火化证明
                    if (XtraMessageBox.Show("现在打印火化证明?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
                    {
                        PrtServAction.Print_HHZM(AC001, 0);
                    }
                }

                XtraMessageBox.Show("结算成功!现在开始打印发票!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ////开财政票!
                if (dec_fin > 0)
                {
                    if (FinInvoice.GetCurrentPh() > 0)
                    {
                        if (XtraMessageBox.Show("下一张财政发票号码:" + Envior.FIN_NEXT_BILL_NO + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            FinInvoice.Invoice(s_fa001);
                        }
                    }
                }

                //// 开税票
                if (dec_tax > 0)
                {
                    //获取税务客户信息
                    string            s_ac003       = SqlAssist.ExecuteScalar("select ac003 from ac01 where ac001='" + AC001 + "'").ToString();
                    Frm_TaxClientInfo frm_taxClient = new Frm_TaxClientInfo(s_ac003);
                    if (frm_taxClient.ShowDialog() != DialogResult.OK)
                    {
                        return;
                    }
                    TaxClientInfo clientInfo = frm_taxClient.swapdata["taxclientinfo"] as TaxClientInfo;

                    if (TaxInvoice.GetNextInvoiceNo(s_fa001) > 0)
                    {
                        if (XtraMessageBox.Show("下一张税票代码:" + Envior.NEXT_BILL_CODE + "\r\n" + "票号:" + Envior.NEXT_BILL_NUM + ",是否继续?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                        {
                            TaxInvoice.Invoice(s_fa001, clientInfo);
                        }
                    }
                }
                this.DialogResult = DialogResult.OK;
                this.Close();
            }
        }