private void toolStripButton6_Click(object sender, EventArgs e)
        {
            //计算开票余额

            FormCopySettleInvoiceAdddet fca = new FormCopySettleInvoiceAdddet();

            fca.JSD_sysids = this.s_ids.Text;  //多个结算单的sysid
            fca.JSLX       = this.s_lx.Text.Trim();
            //fca.Imoney = Get_Money_Remain().ToString("N2");

            if (fca.ShowDialog() == DialogResult.OK)
            {
                DataRow dr = dtcom.NewRow();
                if (fca.t_kpcorp.Text.Trim() != "--请选择--")
                {
                    dr["kpcorp"] = fca.t_kpcorp.Text.Trim();
                }
                else
                {
                    dr["kpcorp"] = "";
                }

                if (fca.t_Itype.Text.Trim() != "--请选择--")
                {
                    dr["Itype"] = fca.t_Itype.Text.Trim();
                }
                else
                {
                    dr["Itype"] = "";
                }

                dr["Ititle"]   = fca.s_Ititle.Text.Trim();
                dr["Icontent"] = fca.s_Icontent.Text.Trim();
                dr["Iprice"]   = fca.n_Iprice.Text.Trim();
                dr["Inum"]     = fca.n_Inum.Text.Trim();
                dr["Imoney"]   = fca.n_Imoney.Text.Trim();
                dr["Techuser"] = fca.s_Techuser.Text.Trim();
                dr["SaleUser"] = fca.s_SaleUser.Text.Trim();
                dr["Memo"]     = fca.s_Memo.Text.Trim();
                dr["groups"]   = fca.s_groups.Text.Trim();
                dtcom.Rows.Add(dr);
            }
        }
        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            if (this.dgv_tmp.SelectedRows.Count<=0) return;

            int index_ = this.dgv_tmp.SelectedRows[0].Index;
            if ((index_==-1)||(index_==this.dgv_tmp.Rows.Count)) return;

            FormCopySettleInvoiceAdddet fca = new FormCopySettleInvoiceAdddet();
            fca.JSD_sysids = this.s_ids.Text;  //多个结算单的sysid
            fca.JSLX = this.s_lx.Text.Trim();

            fca.kpcorp = dtcom.Rows[index_]["kpcorp"].ToString().Trim();  //所属公司
            fca.Itype = dtcom.Rows[index_]["Itype"].ToString().Trim();    //发票类型
            fca.Ititle= dtcom.Rows[index_]["Ititle"].ToString().Trim();
            fca.Icontent = dtcom.Rows[index_]["Icontent"].ToString().Trim();
            fca.Iprice = dtcom.Rows[index_]["Iprice"].ToString().Trim();
            fca.Inum = dtcom.Rows[index_]["Inum"].ToString().Trim();
            fca.Imoney= dtcom.Rows[index_]["Imoney"].ToString().Trim();
            fca.Itech = dtcom.Rows[index_]["Techuser"].ToString().Trim();
            fca.IsaleUser= dtcom.Rows[index_]["SaleUser"].ToString().Trim();
            fca.Imemo= dtcom.Rows[index_]["Memo"].ToString().Trim();
            fca.Igroup= dtcom.Rows[index_]["groups"].ToString().Trim();

            if (fca.ShowDialog() == DialogResult.OK)
            {

                if (fca.t_kpcorp.Text.Trim() != "--请选择--")
                    dtcom.Rows[index_]["kpcorp"]= fca.t_kpcorp.Text.Trim();
                else
                    dtcom.Rows[index_]["kpcorp"] = "";

                if (fca.t_Itype.Text.Trim() != "--请选择--")
                    dtcom.Rows[index_]["Itype"]= fca.t_Itype.Text.Trim();
                else
                    dtcom.Rows[index_]["Itype"]="";

                dtcom.Rows[index_]["Ititle"] = fca.s_Ititle.Text.Trim();
                dtcom.Rows[index_]["Icontent"] = fca.s_Icontent.Text.Trim();
                dtcom.Rows[index_]["Iprice"] = fca.n_Iprice.Text.Trim();
                dtcom.Rows[index_]["Inum"] = fca.n_Inum.Text.Trim();
                dtcom.Rows[index_]["Imoney"] = fca.n_Imoney.Text.Trim();
                dtcom.Rows[index_]["Techuser"] = fca.s_Techuser.Text.Trim();
                dtcom.Rows[index_]["SaleUser"] = fca.s_SaleUser.Text.Trim();
                dtcom.Rows[index_]["Memo"] = fca.s_Memo.Text.Trim();
                dtcom.Rows[index_]["Groups"] = fca.s_groups.Text.Trim();
            }
        }
        private void toolStripButton6_Click(object sender, EventArgs e)
        {
            //计算开票余额

            FormCopySettleInvoiceAdddet fca = new FormCopySettleInvoiceAdddet();
            fca.JSD_sysids = this.s_ids.Text;  //多个结算单的sysid
            fca.JSLX = this.s_lx.Text.Trim();
            //fca.Imoney = Get_Money_Remain().ToString("N2");

            if (fca.ShowDialog() == DialogResult.OK)
            {
                DataRow dr = dtcom.NewRow();
                if (fca.t_kpcorp.Text.Trim() != "--请选择--")
                    dr["kpcorp"] = fca.t_kpcorp.Text.Trim();
                else
                    dr["kpcorp"] = "";

                if (fca.t_Itype.Text.Trim() != "--请选择--")
                    dr["Itype"] = fca.t_Itype.Text.Trim();
                else
                    dr["Itype"] = "";

                dr["Ititle"] = fca.s_Ititle.Text.Trim();
                dr["Icontent"] = fca.s_Icontent.Text.Trim();
                dr["Iprice"] = fca.n_Iprice.Text.Trim();
                dr["Inum"] = fca.n_Inum.Text.Trim();
                dr["Imoney"] = fca.n_Imoney.Text.Trim();
                dr["Techuser"] = fca.s_Techuser.Text.Trim();
                dr["SaleUser"] = fca.s_SaleUser.Text.Trim();
                dr["Memo"] = fca.s_Memo.Text.Trim();
                dr["groups"] = fca.s_groups.Text.Trim();
                dtcom.Rows.Add(dr);
            }
        }
        private void toolStripButton7_Click(object sender, EventArgs e)
        {
            if (this.dgv_tmp.SelectedRows.Count <= 0)
            {
                return;
            }

            int index_ = this.dgv_tmp.SelectedRows[0].Index;

            if ((index_ == -1) || (index_ == this.dgv_tmp.Rows.Count))
            {
                return;
            }

            FormCopySettleInvoiceAdddet fca = new FormCopySettleInvoiceAdddet();

            fca.JSD_sysids = this.s_ids.Text;  //多个结算单的sysid
            fca.JSLX       = this.s_lx.Text.Trim();

            fca.kpcorp    = dtcom.Rows[index_]["kpcorp"].ToString().Trim(); //所属公司
            fca.Itype     = dtcom.Rows[index_]["Itype"].ToString().Trim();  //发票类型
            fca.Ititle    = dtcom.Rows[index_]["Ititle"].ToString().Trim();
            fca.Icontent  = dtcom.Rows[index_]["Icontent"].ToString().Trim();
            fca.Iprice    = dtcom.Rows[index_]["Iprice"].ToString().Trim();
            fca.Inum      = dtcom.Rows[index_]["Inum"].ToString().Trim();
            fca.Imoney    = dtcom.Rows[index_]["Imoney"].ToString().Trim();
            fca.Itech     = dtcom.Rows[index_]["Techuser"].ToString().Trim();
            fca.IsaleUser = dtcom.Rows[index_]["SaleUser"].ToString().Trim();
            fca.Imemo     = dtcom.Rows[index_]["Memo"].ToString().Trim();
            fca.Igroup    = dtcom.Rows[index_]["groups"].ToString().Trim();

            if (fca.ShowDialog() == DialogResult.OK)
            {
                if (fca.t_kpcorp.Text.Trim() != "--请选择--")
                {
                    dtcom.Rows[index_]["kpcorp"] = fca.t_kpcorp.Text.Trim();
                }
                else
                {
                    dtcom.Rows[index_]["kpcorp"] = "";
                }

                if (fca.t_Itype.Text.Trim() != "--请选择--")
                {
                    dtcom.Rows[index_]["Itype"] = fca.t_Itype.Text.Trim();
                }
                else
                {
                    dtcom.Rows[index_]["Itype"] = "";
                }

                dtcom.Rows[index_]["Ititle"]   = fca.s_Ititle.Text.Trim();
                dtcom.Rows[index_]["Icontent"] = fca.s_Icontent.Text.Trim();
                dtcom.Rows[index_]["Iprice"]   = fca.n_Iprice.Text.Trim();
                dtcom.Rows[index_]["Inum"]     = fca.n_Inum.Text.Trim();
                dtcom.Rows[index_]["Imoney"]   = fca.n_Imoney.Text.Trim();
                dtcom.Rows[index_]["Techuser"] = fca.s_Techuser.Text.Trim();
                dtcom.Rows[index_]["SaleUser"] = fca.s_SaleUser.Text.Trim();
                dtcom.Rows[index_]["Memo"]     = fca.s_Memo.Text.Trim();
                dtcom.Rows[index_]["Groups"]   = fca.s_groups.Text.Trim();
            }
        }