예제 #1
0
        public int InvoiceBillDetail()
        {
            MyTax.ClearInvList();

            if (dtInvocieDetail.Rows.Count > 0)
            {
                for (int i = 0; i < dtInvocieDetail.Rows.Count; i++)
                {
                    MyTax.InvListInit();
                    //商品名称
                    MyTax.ListGoodsName = dtInvocieDetail.Rows[i]["NAME"].ToString();

                    //BacthUpLoad
                    string sTaxItem = dtInvocieDetail.Rows[i]["TAXITEM"].ToString();
                    string sTaxRate = dtInvocieDetail.Rows[i]["TAXRATE"].ToString();
                    string sZeroTax = "";
                    if (sTaxRate == "0")
                    {
                        sZeroTax = "3";
                    }
                    sBatchUpXml = getDataXml("30.0", sTaxItem, "0", sZeroTax, dtInvocieDetail.Rows[i]["ARTID"].ToString());
                    sBatchUpXml = BatchUpLoad(sBatchUpXml);
                    string sRetXml = MyTax.BatchUpload(sBatchUpXml);
                    if (fVaildBatchUp(sRetXml) == 1)
                    {
                        return(1);
                    }

                    //其他信息
                    MyTax.ListTaxItem   = dtInvocieDetail.Rows[i]["ListTaxItem"].ToString();
                    MyTax.ListStandard  = dtInvocieDetail.Rows[i]["ListStandard"].ToString();
                    MyTax.ListUnit      = dtInvocieDetail.Rows[i]["ListUnit"].ToString();
                    MyTax.ListNumber    = double.Parse(dtInvocieDetail.Rows[i]["ListNumber"].ToString());
                    MyTax.ListPrice     = double.Parse(dtInvocieDetail.Rows[i]["ListPrice"].ToString());
                    MyTax.ListAmount    = double.Parse(dtInvocieDetail.Rows[i]["ListAmount"].ToString());;    //金额
                    MyTax.ListPriceKind = short.Parse(dtInvocieDetail.Rows[i]["ListPriceKind"].ToString());;  //含税价标志
                    MyTax.ListTaxAmount = short.Parse(dtInvocieDetail.Rows[i]["ListTaxAmount"].ToString());;  //税额

                    MyTax.AddInvList();
                }
                return(0);
            }
            else
            {
                sRetMsg = "无可开的发票明细。";
                return(1);
            }
        }
예제 #2
0
        public void invok(string msg)
        {
            String GS = GT.RetCode.ToString();

            if (GS.Equals("1011"))
            {
                GT.InvInfoInit();    //初始化
                GT.InfoKind      = 2;
                GT.SellerAddress = "2";
                // GT.InfoTypeCode = "6500143320"; //发票类别
                GT.GetInfo();


                //textBox2.Text = GT.InfoTypeCode;

                //textBox1.Text = GT.InfoNumber.ToString();

                GT.InfoClientName         = "开票企业名称";          //购方名称
                GT.InfoClientTaxCode      = "650105999990003"; //购方税号
                GT.InfoClientBankAccount  = "246234524";       //购方开户账号
                GT.InfoClientAddressPhone = "新疆";              //购方地址
                //GT.InfoSellerBankAccount = ""; //销方开户行
                GT.InfoSellerAddressPhone = "";                //销方地址
                GT.InfoTaxRate            = 3;                 //税率
                GT.InfoNotes    = "新A79972";                   //备注
                GT.InfoInvoicer = "admin";                     //开票人
                GT.InfoChecker  = "崔杰";                        //复核人
                GT.InfoCashier  = "崔浩";                        //收款人
                //GT.InfoListName = "详见销货清单";
                //明细数据\
                GT.ClearInvList();

                GT.InvListInit();    //初始化明细

                //if ("是否含税" == "含税")
                //    {
                //        GT.ListPriceKind = 1;
                //    }
                //    else
                //    {
                //        GT.ListPriceKind = 0;
                //    }
                GT.ListPriceKind = 1;

                GT.ListGoodsName = "细绒棉";  //名称
                GT.ListStandard  = "3128"; //规格
                GT.ListUnit      = "KG";   //规格

                GT.ListNumber = 2;         //数量
                GT.ListPrice  = 100;       //单价
                GT.ListAmount = 200;       //金额


                GT.AddInvList();

                GT.Invoice();    //发票开具

                //textBox3.Text = GT.InfoNumber.ToString();

                if (GT.RetCode.ToString() == "4001")    // 传入发票数据不合法
                {
                    //"传入发票数据不合法", "信息提示";
                }
                else if (GT.RetCode.ToString() == "4002")    //开票前金税卡状态错误
                {
                    // MessageBox.Show("开票前金税卡状态错误", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    //保存发票ToolStripMenuItem.Enabled = false;
                }
                else if (GT.RetCode.ToString() == "4003")    //金税卡开票调用错误
                {
                    //  MessageBox.Show("金税卡开票调用错误,请确认组件版本号!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    //保存发票ToolStripMenuItem.Enabled = false;
                }
                else if (GT.RetCode.ToString() == "4004")    //开票后金税卡状态错误
                {
                    // MessageBox.Show("开票后金税卡状态错误", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    //保存发票ToolStripMenuItem.Enabled = false;
                }
                else if (GT.RetCode.ToString() == "4011")    //开票成功
                {
                    GT.GoodsListFlag = 0;
                    GT.PrintInv();

                    if (GT.RetCode == 5001)
                    {
                        //  MessageBox.Show("发票打印失败,失败原因:未找到发票,请先保存发票", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else if (GT.RetCode == 5011)
                    {
                        //  MessageBox.Show("发票打印成功!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                        //if (GetFPStyle == "发票")
                        //{
                        //    toolStripButton2_Click(null, null);
                        //}
                    }
                    else if (GT.RetCode == 5012)
                    {
                        // MessageBox.Show("发票打印失败,失败原因:未打印", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                    else if (GT.RetCode == 5013)
                    {
                        // MessageBox.Show("发票打印失败!", "信息提示", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
            }
        }
예제 #3
0
        public int InvoiceBillDetail(int iItemId)
        {
            MyTax.ClearInvList();
            DataRow   row     = gridView1.GetDataRow(iItemId);
            string    sBseqId = row["BSEQID"].ToString();
            DataTable myDt    = new DataTable();

            string spName = "NEIIP_FINANCE.sp_get_pending_invDetail";

            string[] sParameters = new string[2] {
                "anFinseqId", "aors"
            };

            string[] sParametersValue = new string[2] {
                sBseqId, ""
            };
            string[] sParametersType = new string[2] {
                "Varchar2", "RefCursor"
            };
            string[] sParametersDirection = new string[2] {
                "Input", "Output"
            };

            myDt            = GetDataTableBySp(spName, sParameters, sParametersValue, sParametersType, sParametersDirection);
            iTaxDetailCount = myDt.Rows.Count;

            if (iTaxDetailCount > 0)
            {
                for (int i = 0; i < myDt.Rows.Count; i++)
                {
                    MyTax.InvListInit();
                    //商品名称
                    MyTax.ListGoodsName = myDt.Rows[i]["NAME"].ToString();

                    //BacthUpLoad
                    string sTaxItem = myDt.Rows[i]["TAXITEM"].ToString();
                    string sTaxRate = myDt.Rows[i]["TAXRATE"].ToString();
                    string sZeroTax = "";
                    if (sTaxRate == "0")
                    {
                        sZeroTax = "3";
                    }
                    sBatchUpXml = getDataXml("30.0", sTaxItem, "0", sZeroTax, myDt.Rows[i]["ARTID"].ToString());
                    sBatchUpXml = BatchUpLoad(sBatchUpXml);
                    string sRetXml = MyTax.BatchUpload(sBatchUpXml);
                    if (fVaildBatchUp(sRetXml) == 1)
                    {
                        return(1);
                    }

                    //其他信息
                    MyTax.ListTaxItem   = myDt.Rows[i]["TAXITEM"].ToString();
                    MyTax.ListStandard  = myDt.Rows[i]["SPEC"].ToString();
                    MyTax.ListUnit      = myDt.Rows[i]["UNIT"].ToString();
                    MyTax.ListNumber    = double.Parse(myDt.Rows[i]["BILLTOTAL"].ToString());
                    MyTax.ListPrice     = double.Parse(myDt.Rows[i]["BILLPRICE"].ToString());
                    MyTax.ListAmount    = double.Parse(myDt.Rows[i]["BILLAMOUNT"].ToString());; //金额
                    MyTax.ListPriceKind = 1;                                                    //含税价标志
                    MyTax.ListTaxAmount = 0;                                                    //税额

                    MyTax.AddInvList();
                }
                return(0);
            }
            else
            {
                sRetMsg = "发票开具失败,无可开的发票明细。";
                return(1);
            }
        }