Пример #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 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);
            }
        }