コード例 #1
0
 protected override bool SetValid()
 {
     try
     {
         bool    flag3;
         bool    iSPTFP;
         TaxCard card = TaxCardFactory.CreateTaxCard();
         if (card.get_StateInfo().CompanyType == 0)
         {
             flag3  = (WbjkEntry.RegFlag_JT || WbjkEntry.RegFlag_ST) || WbjkEntry.RegFlag_KT;
             iSPTFP = card.get_QYLX().ISPTFP;
             return(flag3 && iSPTFP);
         }
         flag3  = (WbjkEntry.RegFlag_JT || WbjkEntry.RegFlag_ST) || WbjkEntry.RegFlag_KT;
         iSPTFP = card.get_QYLX().ISPTFP;
         return(flag3 && iSPTFP);
     }
     catch (BaseException exception)
     {
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         ExceptionHandler.HandleError(exception2);
     }
     return(true);
 }
コード例 #2
0
        public static bool HasHxAuthorization()
        {
            TaxCard card = TaxCardFactory.CreateTaxCard();

            if (!card.get_QYLX().ISZYFP)
            {
                return(card.get_QYLX().ISPTFP);
            }
            return(true);
        }
コード例 #3
0
        protected override bool SetValid()
        {
            TaxCard card = TaxCardFactory.CreateTaxCard();

            if (!card.get_QYLX().ISZYFP)
            {
                bool iSZYFP = card.get_QYLX().ISZYFP;
            }
            return(card.get_TaxMode() == 2);
        }
コード例 #4
0
        public static bool HasZcAuthorization()
        {
            TaxCard card = TaxCardFactory.CreateTaxCard();

            if ((!card.get_QYLX().ISJDC&& !card.get_QYLX().ISHY) && !card.get_QYLX().ISPTFPDZ)
            {
                return(card.get_QYLX().ISPTFPJSP);
            }
            return(true);
        }
コード例 #5
0
 protected override bool SetValid()
 {
     try
     {
         TaxCard card   = TaxCardFactory.CreateTaxCard();
         bool    iSPTFP = card.get_QYLX().ISPTFP;
         bool    flag2  = card.get_StateInfo().CompanyType != 0;
         bool    flag3  = false;
         if (!flag2)
         {
             flag3 = false;
         }
         else if (true)
         {
             if (WbjkEntry.RegFlag_JS)
             {
                 flag3 = false;
             }
             if ((WbjkEntry.RegFlag_JT || WbjkEntry.RegFlag_KT) || WbjkEntry.RegFlag_ST)
             {
                 flag3 = true;
             }
         }
         return(flag3 && iSPTFP);
     }
     catch (BaseException exception)
     {
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         ExceptionHandler.HandleError(exception2);
     }
     return(true);
 }
コード例 #6
0
 protected override bool SetValid()
 {
     try
     {
         bool    flag   = false;
         TaxCard card   = TaxCardFactory.CreateTaxCard();
         bool    iSZYFP = card.get_QYLX().ISZYFP;
         if (card.get_StateInfo().CompanyType == 0)
         {
             flag = false;
         }
         else
         {
             flag = false;
         }
         return(false);
     }
     catch (BaseException exception)
     {
         ExceptionHandler.HandleError(exception);
     }
     catch (Exception exception2)
     {
         ExceptionHandler.HandleError(exception2);
     }
     return(true);
 }
コード例 #7
0
        public static bool HasAuthorizationWithCode(string typeCode)
        {
            TaxCard card = TaxCardFactory.CreateTaxCard();

            switch (typeCode)
            {
            case "0":
                return(card.get_QYLX().ISZYFP);

            case "2":
                return(card.get_QYLX().ISPTFP);

            case "005":
                return(card.get_QYLX().ISJDC);

            case "009":
                return(card.get_QYLX().ISHY);

            case "025":
                return(card.get_QYLX().ISPTFPJSP);

            case "026":
                return(card.get_QYLX().ISPTFPDZ);
            }
            return(false);
        }
コード例 #8
0
        private static bool IsCanSQ(string PZ)
        {
            TaxCard card = TaxCardFactory.CreateTaxCard();

            if (PZ.CompareTo("f") == 0)
            {
                if (card.get_QYLX().ISHY)
                {
                    return(true);
                }
            }
            else if (PZ.CompareTo("j") == 0)
            {
                if (card.get_QYLX().ISJDC)
                {
                    return(true);
                }
            }
            else if (PZ.CompareTo("c") == 0)
            {
                if (card.get_QYLX().ISPTFP)
                {
                    return(true);
                }
            }
            else if (PZ.CompareTo("s") == 0)
            {
                if (card.get_QYLX().ISZYFP)
                {
                    return(true);
                }
            }
            else if (PZ.CompareTo("a") == 0)
            {
                if (card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP)
                {
                    return(true);
                }
            }
            else
            {
                return(false);
            }
            return(false);
        }
コード例 #9
0
 private bool CanXTInv(TaxCard taxCard)
 {
     try
     {
         object[] objArray = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.BMIsNeedImportXTSP", null);
         if ((((objArray != null) && (objArray.Length > 0)) && (objArray[0] != null)) && Convert.ToBoolean(objArray[0]))
         {
             ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.BMImportXTSP", null);
         }
         if (taxCard.get_QYLX().ISXT)
         {
             object[] objArray2 = ServiceFactory.InvokePubService("Aisino.Fwkp.Bmgl.BMCheckXTSP", null);
             if (!(((objArray2 != null) && (objArray2[0] is bool)) && Convert.ToBoolean(objArray2[0])))
             {
                 return(false);
             }
         }
     }
     catch (Exception)
     {
         return(false);
     }
     return(true);
 }
コード例 #10
0
ファイル: FPCX.cs プロジェクト: SoL-Alucard-Git/HX-Base
 private void FPCX_Load(object sender, EventArgs e)
 {
     try
     {
         TaxCard card = TaxCardFactory.CreateTaxCard();
         Dictionary <string, string> item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "销售单据编号");
         item.Add("Property", "XSDJBH");
         item.Add("Type", "Text");
         item.Add("Width", "120");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleCenter");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "发票种类");
         item.Add("Property", "FPZL");
         item.Add("Type", "Text");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "发票代码");
         item.Add("Property", "FPDM");
         item.Add("Type", "Text");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "发票号码");
         item.Add("Property", "FPHM");
         item.Add("Type", "Text");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "开票机号");
         item.Add("Property", "KPJH");
         item.Add("Type", "Text");
         item.Add("Align", "MiddleCenter");
         item.Add("Width", "80");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "购方名称");
         item.Add("Property", "GFMC");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "购方税号");
         item.Add("Property", "GFSH");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "购方地址电话");
         item.Add("Property", "GFDZDH");
         item.Add("Type", "Text");
         item.Add("Width", "120");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "购方银行账号");
         item.Add("Property", "GFYHZH");
         item.Add("Type", "Text");
         item.Add("Width", "120");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "身份证号码/组织机构代码");
         item.Add("Property", "XSBM");
         item.Add("Type", "Text");
         item.Add("Width", "120");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "开票日期");
         item.Add("Property", "KPRQ");
         item.Add("Type", "Text");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "合计金额");
         item.Add("Property", "HJJE");
         item.Add("Type", "Text");
         item.Add("Width", "60");
         item.Add("Align", "MiddleRight");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "税率");
         item.Add("Property", "SLV");
         item.Add("Type", "Text");
         item.Add("Width", "60");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "合计税额");
         item.Add("Property", "HJSE");
         item.Add("Type", "Text");
         item.Add("Width", "60");
         item.Add("Align", "MiddleRight");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "主要商品名称");
         item.Add("Property", "ZYSPMC");
         item.Add("Type", "Text");
         item.Add("Width", "160");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "商品税目");
         item.Add("Property", "SPSM");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "备注");
         item.Add("Property", "BZ");
         item.Add("Type", "Text");
         item.Add("Visible", "False");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "开票人");
         item.Add("Property", "KPR");
         item.Add("Type", "Text");
         item.Add("Width", "80");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "收款人");
         item.Add("Property", "SKR");
         item.Add("Type", "Text");
         item.Add("Width", "80");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "复核人");
         item.Add("Property", "FHR");
         item.Add("Type", "Text");
         item.Add("Width", "80");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "作废标志");
         item.Add("Property", "ZFBZ");
         item.Add("Type", "Text");
         item.Add("Width", "80");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "清单标志");
         item.Add("Property", "QDBZ");
         item.Add("Type", "Text");
         item.Add("Width", "80");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "分页序号");
         item.Add("Property", "ROWNUMBER");
         item.Add("Type", "Text");
         item.Add("Visible", "False");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "销方名称");
         item.Add("Property", "XFMC");
         item.Add("Type", "Text");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "销方税号");
         item.Add("Property", "XFSH");
         item.Add("Type", "Text");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "销方地址电话");
         item.Add("Property", "XFDZDH");
         item.Add("Type", "Text");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "销方银行账号");
         item.Add("Property", "XFYHZH");
         item.Add("Type", "Text");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "报送状态");
         item.Add("Property", "BSZT");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         if (card.get_QYLX().ISTDQY)
         {
             item.Add("Visible", "False");
         }
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "作废日期");
         item.Add("Property", "ZFRQ");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         this.list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "营业税标志");
         item.Add("Property", "YYSBZ");
         item.Add("Type", "Text");
         item.Add("Visible", "False");
         this.list.Add(item);
         this.aisinoDataGrid1.set_ColumeHead(this.list);
         this.aisinoDataGrid1.get_Columns()["KPRQ"].DefaultCellStyle.Format = "yyyy-MM-dd";
         this.aisinoDataGrid1.get_Columns()["HJJE"].DefaultCellStyle.Format = "0.00";
         this.aisinoDataGrid1.get_Columns()["HJSE"].DefaultCellStyle.Format = "0.00";
         this.aisinoDataGrid1.get_Columns()["FPHM"].DefaultCellStyle.Format = new string('0', 8);
         this.aisinoDataGrid1.set_DataSource(new AisinoDataSet());
         this.comboBoxFPZL.DropDownStyle = ComboBoxStyle.DropDownList;
         this.comboBoxFPZL.DataSource    = CbbXmlBind.ReadXmlNode("InvType_1", true);
         this.comboBoxFPZL.DisplayMember = "Value";
         this.comboBoxFPZL.ValueMember   = "Key";
         if (RegisterManager.CheckRegFile("JIJS"))
         {
             this.comboBoxFPZL.SelectedIndex = 2;
             this.comboBoxFPZL.Enabled       = false;
         }
         DataTable table = new DataTable();
         table.Columns.Add("Display");
         table.Columns.Add("Value");
         table.Rows.Add(new object[] { "否", "0" });
         table.Rows.Add(new object[] { "是", "1" });
         table.Rows.Add(new object[] { "全部", "both" });
         this.comboBoxZFBZ.DropDownStyle = ComboBoxStyle.DropDownList;
         this.comboBoxZFBZ.DataSource    = table;
         this.comboBoxZFBZ.DisplayMember = "Display";
         this.comboBoxZFBZ.ValueMember   = "Value";
         this.ckbAllDate.Checked         = PropValue.AllDate;
         this.ckbContainTadayS.Checked   = PropValue.ContainStartDay;
         this.ckbContainTadayE.Checked   = PropValue.ContainEndDay;
         this.dTPStart.Value             = this.dTPStart.Value.Date.AddDays((double)((-1 * this.dTPStart.Value.Day) + 1));
         this.dTPEnd.Value = this.dTPEnd.Value.Date;
         if (!RegisterManager.CheckRegFile("JIJT"))
         {
             this.toolStripButtonExcel.Visible = false;
             this.toolStripButtonXML.Visible   = false;
         }
     }
     catch (Exception exception)
     {
         ExceptionHandler.HandleError(exception);
     }
 }
コード例 #11
0
ファイル: DJCF.cs プロジェクト: SoL-Alucard-Git/HX-Base
        private void toolBtnZDCF_Click(object sender, EventArgs e)
        {
            try
            {
                if (this.aisinoDataGrid1.get_SelectedRows().Count != 0)
                {
                    if (this.aisinoDataGrid1.get_SelectedRows().Count == 1)
                    {
                        string   bH     = this.aisinoDataGrid1.get_SelectedRows()[0].Cells["BH"].Value.ToString();
                        SaleBill bill   = this.billBL.Find(bH);
                        InvType  common = InvType.Common;
                        TaxCard  card   = TaxCardFactory.CreateTaxCard();
                        if (bill.DJZL == "c")
                        {
                            if (!card.get_QYLX().ISPTFP)
                            {
                                MessageManager.ShowMsgBox("无法取得普通发票开票限额,不能拆分!");
                                return;
                            }
                            common = InvType.Common;
                        }
                        else if (bill.DJZL == "s")
                        {
                            if (!card.get_QYLX().ISZYFP)
                            {
                                MessageManager.ShowMsgBox("无法取得专用发票开票限额,不能拆分!");
                                return;
                            }
                            common = InvType.Special;
                        }
                        double invAmountLimit = 0.0;
                        int    count          = card.get_SQInfo().PZSQType.Count;
                        for (int i = 0; i < count; i++)
                        {
                            if (card.get_SQInfo().PZSQType[i].invType == 2)
                            {
                                invAmountLimit = card.get_SQInfo().PZSQType[i].InvAmountLimit;
                            }
                            if (card.get_SQInfo().PZSQType[i].invType == 0)
                            {
                                invAmountLimit = card.get_SQInfo().PZSQType[i].InvAmountLimit;
                            }
                        }
                        bool hzfw           = card.get_StateInfo().CompanyType > 0;
                        bool exEWMInfoSplit = false;
                        if (this.checkBox2.Checked)
                        {
                            if ((bill.DJZL == "c") && (bill.QDHSPMC.Length > 0))
                            {
                                exEWMInfoSplit = false;
                            }
                            else
                            {
                                exEWMInfoSplit = true;
                            }
                        }
                        else if (bill.DJZL == "s")
                        {
                            exEWMInfoSplit = true;
                        }
                        if (!hzfw)
                        {
                            exEWMInfoSplit = true;
                        }
                        int[]  slvjeseIndex = GenerateInvoice.Instance.SetInvoiceTimes();
                        string reason       = "";
                        string str3         = this.billBL.CheckBillRecordCF(bill, "AT", exEWMInfoSplit, ref reason, slvjeseIndex, hzfw, false);
                        if (str3 == "Needless")
                        {
                            if (reason.Equals("差额税单据不允许拆分"))
                            {
                                MessageManager.ShowMsgBox(reason);
                            }
                            else
                            {
                                MessageManager.ShowMsgBox("INP-272204");
                            }
                        }
                        else if (str3 != "Need")
                        {
                            str3 = "该单据不能进行自动拆分!" + str3.Replace("HasWrong", "");
                            MessageBoxHelper.Show(reason, "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                        }
                        else
                        {
                            SeparateType keepMaxJE;
                            bool         mergeSmallJE = false;
                            if (this.radioButton1.Checked)
                            {
                                keepMaxJE = SeparateType.KeepMaxJE;
                            }
                            else
                            {
                                keepMaxJE = SeparateType.KeepMaxSL;
                            }
                            if (this.checkBox1.Checked)
                            {
                                mergeSmallJE = true;
                            }
                            string str4 = this.billBL.AutoSeparate(bill, keepMaxJE, mergeSmallJE, exEWMInfoSplit, slvjeseIndex, hzfw);
                            if (str4 == "0")
                            {
                                DJCFAuto auto = new DJCFAuto(bill, this.djcfBLL);
                                if (auto.ShowDialog() == DialogResult.OK)
                                {
                                    if (this.JYrule == "s")
                                    {
                                        this.aisinoDataGrid1.remove_DataGridRowSelectionChanged(new EventHandler <DataGridRowEventArgs>(this.aisinoDataGrid1_DataGridRowSelectionChanged));
                                        this.CheckAdd(this.djcfBLL.Pagesize, this.djcfBLL.CurrentPage);
                                        this.aisinoDataGrid1.add_DataGridRowSelectionChanged(new EventHandler <DataGridRowEventArgs>(this.aisinoDataGrid1_DataGridRowSelectionChanged));
                                    }
                                    else
                                    {
                                        this.dataSet = this.djcfBLL.QueryXSDJ(this.KeyWords, this.DJmonth, this.DJtype, this.JYrule, this.djcfBLL.Pagesize, this.djcfBLL.CurrentPage);
                                        this.aisinoDataGrid1.set_DataSource(this.dataSet);
                                    }
                                }
                                if (this.aisinoDataGrid1.get_Rows().Count == 0)
                                {
                                    this.aisinoDataGrid2.set_DataSource(this.djcfBLL.QueryXSDJMX("noexist", this.djcfBLL.Pagesize, 1));
                                }
                            }
                            else
                            {
                                string str6;
                                string str5 = "该单据不能进行自动拆分!";
                                switch (str4)
                                {
                                case "-1":
                                    MessageManager.ShowMsgBox("折扣组超过拆分限制,不允许拆分!");
                                    return;

                                case "-2":
                                    MessageManager.ShowMsgBox("非清单发票商品名称中含有“清单”字样,不允许拆分!");
                                    return;

                                case "-3":
                                    MessageManager.ShowMsgBox(str5);
                                    return;

                                case "-4":
                                    MessageManager.ShowMsgBox(str5);
                                    return;

                                case "-5":
                                    MessageManager.ShowMsgBox(str5);
                                    return;

                                case "-6":
                                    MessageManager.ShowMsgBox("INP-272204");
                                    return;

                                case "-7":
                                    MessageManager.ShowMsgBox("商品金额乘以税率的值与税额的误差超过限制,不允许拆分!");
                                    return;

                                case "-8":
                                    MessageManager.ShowMsgBox("商品单价乘以数量与金额误差超过限制,不允许拆分!");
                                    return;

                                case "-9":
                                    MessageManager.ShowMsgBox("拆分后单据号长度超过50,不允许拆分!");
                                    return;

                                case "-10":
                                    MessageManager.ShowMsgBox(str5);
                                    return;

                                case "-11":
                                    MessageManager.ShowMsgBox(str5);
                                    return;
                                }
                                if (str4.StartsWith("[-1]"))
                                {
                                    str6 = str4.Substring(4, str4.Length - 4);
                                    if (str6.Equals("A612"))
                                    {
                                        MessageManager.ShowMsgBox("作为汉字防伪用户 该单据存在单行商品的商品名称超出范围,不允许拆分!");
                                    }
                                    else if (str6.Equals("A613"))
                                    {
                                        MessageManager.ShowMsgBox("作为汉字防伪用户 该单据存在单行商品的计量单位超出范围,不允许拆分!");
                                    }
                                    else if ((str6.Equals("A017") || str6.Equals("A018")) || str6.Equals("A128"))
                                    {
                                        MessageManager.ShowMsgBox("税率非法,不允许拆分!");
                                    }
                                    else if (str6.Equals("A052"))
                                    {
                                        MessageManager.ShowMsgBox("稀土商品单价和数量为空,不允许拆分!");
                                    }
                                    else if (str6.Equals("A024"))
                                    {
                                        MessageManager.ShowMsgBox("增值税专用发票的购方税号为空,不允许拆分!");
                                    }
                                    else if ((((str6.Equals("A631") || str6.Equals("A632")) || (str6.Equals("A633") || str6.Equals("A634"))) || (str6.Equals("A635") || str6.Equals("A636"))) || str6.Equals("A637"))
                                    {
                                        MessageManager.ShowMsgBox("该单据中购方税号不符合校验规则,系统不允许拆分!");
                                    }
                                    else
                                    {
                                        MessageManager.ShowMsgBox(str6);
                                    }
                                }
                                else if (str4.StartsWith("group"))
                                {
                                    str6 = str4.Substring(5, str4.Length - 5);
                                    MessageManager.ShowMsgBox("第" + str6 + "组折扣商品开票金额超出金税设备允许范围¥" + invAmountLimit.ToString());
                                }
                                else if (str4.StartsWith("[sql]"))
                                {
                                    MessageManager.ShowMsgBox(str4.Substring(5, str4.Length - 5));
                                }
                                else if (str4.StartsWith("[error]"))
                                {
                                    str6 = str4.Substring(7, str4.Length - 7);
                                    MessageManager.ShowMsgBox("第" + str6 + "行,金额为0!");
                                }
                                else if (str4.StartsWith("[error_1_hs]"))
                                {
                                    str6 = str4.Substring(12, str4.Length - 12);
                                    MessageManager.ShowMsgBox("第" + str6 + "行,单价乘以数量不等于含税金额!");
                                }
                                else if (str4.StartsWith("[error_1_bhs]"))
                                {
                                    str6 = str4.Substring(13, str4.Length - 13);
                                    MessageManager.ShowMsgBox("第" + str6 + "行,单价乘以数量不等于金额!");
                                }
                                else if (str4.StartsWith("[error_2]"))
                                {
                                    MessageManager.ShowMsgBox("第" + str4.Substring(9, str4.Length - 9) + "行,商品数据非法!");
                                }
                            }
                        }
                    }
                    else
                    {
                        MessageManager.ShowMsgBox("INP-272202");
                    }
                }
            }
            catch (CustomException exception)
            {
                MessageBoxHelper.Show(exception.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            }
            catch (Exception exception2)
            {
                HandleException.HandleError(exception2);
            }
        }
コード例 #12
0
ファイル: DJCF.cs プロジェクト: SoL-Alucard-Git/HX-Base
 private void toolBtnSDCF_Click(object sender, EventArgs e)
 {
     try
     {
         if ((this.aisinoDataGrid1.get_SelectedRows().Count != 0) && (this.aisinoDataGrid1.get_SelectedRows().Count == 1))
         {
             string   bH   = this.aisinoDataGrid1.get_SelectedRows()[0].Cells["BH"].Value.ToString();
             SaleBill bill = this.billBL.Find(bH);
             TaxCard  card = TaxCardFactory.CreateTaxCard();
             if (bill.DJZL == "c")
             {
                 if (!card.get_QYLX().ISPTFP)
                 {
                     MessageManager.ShowMsgBox("无法取得普通发票开票限额,不能拆分!");
                     return;
                 }
             }
             else if ((bill.DJZL == "s") && !card.get_QYLX().ISZYFP)
             {
                 MessageManager.ShowMsgBox("无法取得专用发票开票限额,不能拆分!");
                 return;
             }
             string reason = "";
             if (this.billBL.CheckBillRecordCF(bill, "MT", true, ref reason) != "Need")
             {
                 MessageBoxHelper.Show(reason, "提示", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
             else
             {
                 string str4 = this.billBL.CheckBeforeCF(bill);
                 if (str4 != "0")
                 {
                     string str5;
                     if (str4.StartsWith("[error_hs]"))
                     {
                         str5 = str4.Substring(10, str4.Length - 10);
                         MessageManager.ShowMsgBox("第" + str5 + "行,单价乘以数量不等于含税金额!");
                     }
                     else if (str4.StartsWith("[error_bhs]"))
                     {
                         str5 = str4.Substring(11, str4.Length - 11);
                         MessageManager.ShowMsgBox("第" + str5 + "行,单价乘以数量不等于金额!");
                     }
                     else if (str4.StartsWith("[error_1]"))
                     {
                         MessageManager.ShowMsgBox("第" + str4.Substring(9, str4.Length - 9) + "行,商品数据非法!");
                     }
                 }
                 else
                 {
                     MannualSplit split = new MannualSplit(bill);
                     if (split.ShowDialog() == DialogResult.OK)
                     {
                         if (this.JYrule == "s")
                         {
                             this.aisinoDataGrid1.remove_DataGridRowSelectionChanged(new EventHandler <DataGridRowEventArgs>(this.aisinoDataGrid1_DataGridRowSelectionChanged));
                             this.CheckAdd(this.djcfBLL.Pagesize, this.djcfBLL.CurrentPage);
                             this.aisinoDataGrid1.add_DataGridRowSelectionChanged(new EventHandler <DataGridRowEventArgs>(this.aisinoDataGrid1_DataGridRowSelectionChanged));
                         }
                         else
                         {
                             this.aisinoDataGrid1.set_DataSource(this.djcfBLL.QueryXSDJ(this.KeyWords, this.DJmonth, this.DJtype, this.JYrule, this.djcfBLL.Pagesize, this.djcfBLL.CurrentPage));
                         }
                         if (this.aisinoDataGrid1.get_Rows().Count == 0)
                         {
                             this.aisinoDataGrid2.set_DataSource(this.djcfBLL.QueryXSDJMX("noexist", this.djcfBLL.Pagesize, 1));
                         }
                     }
                 }
             }
         }
     }
     catch (Exception exception)
     {
         HandleException.HandleError(exception);
     }
 }
コード例 #13
0
ファイル: YCCBByAuto.cs プロジェクト: SoL-Alucard-Git/HX-Base
        protected override bool SetValid()
        {
            TaxCard card = TaxCardFactory.CreateTaxCard();

            return((card.get_TaxMode() == 2) && !card.get_QYLX().ISTDQY);
        }
コード例 #14
0
        private void DanJuExcelCR_Load(object sender, EventArgs e)
        {
            try
            {
                TaxCard card = TaxCardFactory.CreateTaxCard();
                this.fileControl1.set_FileFilter(FatchSaleBill.FileFilterExcel);
                this.fileControl2.set_FileFilter(FatchSaleBill.FileFilterExcel);
                bool flag = false;
                if (PropValue.ExcelInvType == "Special")
                {
                    if (card.get_QYLX().ISZYFP)
                    {
                        IniRead.type = "s";
                    }
                    else
                    {
                        flag = true;
                    }
                }
                else if (PropValue.ExcelInvType == "Common")
                {
                    if (card.get_QYLX().ISPTFP)
                    {
                        IniRead.type = "c";
                    }
                    else
                    {
                        flag = true;
                    }
                }
                else if (PropValue.ExcelInvType == "transportation")
                {
                    if (card.get_QYLX().ISHY)
                    {
                        IniRead.type = "f";
                    }
                    else
                    {
                        flag = true;
                    }
                }
                else if (PropValue.ExcelInvType == "vehiclesales")
                {
                    if (card.get_QYLX().ISJDC)
                    {
                        IniRead.type = "j";
                    }
                    else
                    {
                        flag = true;
                    }
                }
                if (flag)
                {
                    if (card.get_QYLX().ISPTFP)
                    {
                        IniRead.type           = "c";
                        PropValue.ExcelInvType = "Common";
                    }
                    else if (card.get_QYLX().ISZYFP)
                    {
                        IniRead.type           = "s";
                        PropValue.ExcelInvType = "Special";
                    }
                    else if (card.get_QYLX().ISHY)
                    {
                        IniRead.type           = "f";
                        PropValue.ExcelInvType = "transportation";
                    }
                    else if (card.get_QYLX().ISJDC)
                    {
                        IniRead.type           = "v";
                        PropValue.ExcelInvType = "vehiclesales";
                    }
                }
                this.fileControl1.get_TextBoxFile().Text = PropValue.ExcelFile1Path;
                this.fileControl2.get_TextBoxFile().Text = PropValue.ExcelFile2Path;
                this.comboBoxJESM.SelectedValue          = PropValue.ExcelAmountType;
                this.radioBtnZYFP.Checked  = PropValue.ExcelInvType == "Special";
                this.radioBtnPTFP.Checked  = PropValue.ExcelInvType == "Common";
                this.radioBtnHYFP.Checked  = PropValue.ExcelInvType == "transportation";
                this.radioBtnJDCFP.Checked = PropValue.ExcelInvType == "vehiclesales";
                if (PropValue.SingleDoubleTable == "1")
                {
                    this.label2.Visible       = false;
                    this.fileControl2.Visible = false;
                    this.label1.Text          = "传入路径";
                }
                else if (PropValue.SingleDoubleTable == "2")
                {
                    this.label2.Visible       = true;
                    this.fileControl2.Visible = true;
                    this.label1.Text          = "主表路径";
                }
                this.radioBtnPTFP.Visible  = false;
                this.radioBtnZYFP.Visible  = false;
                this.radioBtnHYFP.Visible  = false;
                this.radioBtnJDCFP.Visible = false;
                int num = 0;
                if (card.get_QYLX().ISZYFP)
                {
                    this.radioBtnZYFP.Visible = true;
                    num++;
                }
                if (card.get_QYLX().ISPTFP)
                {
                    this.radioBtnPTFP.Visible = true;
                    if (num == 0)
                    {
                        this.radioBtnPTFP.Location = new Point(7, 0x15);
                    }
                    num++;
                }
                if (card.get_QYLX().ISHY)
                {
                    this.radioBtnHYFP.Visible = true;
                    if (num == 0)
                    {
                        this.radioBtnHYFP.Location = new Point(7, 0x15);
                    }
                    else if (num == 1)
                    {
                        this.radioBtnHYFP.Location = new Point(7, 50);
                    }
                    num++;
                }
                if (card.get_QYLX().ISJDC)
                {
                    this.radioBtnJDCFP.Visible = true;
                    switch (num)
                    {
                    case 0:
                        this.radioBtnJDCFP.Location = new Point(7, 0x15);
                        break;

                    case 1:
                        this.radioBtnJDCFP.Location = new Point(7, 50);
                        break;

                    case 2:
                        this.radioBtnJDCFP.Location = new Point(0x7a, 0x15);
                        break;
                    }
                }
                if (this.radioBtnJDCFP.Checked)
                {
                    this.comboBoxJESM.SelectedIndex = 0;
                    this.comboBoxJESM.Enabled       = false;
                }
            }
            catch (Exception exception)
            {
                HandleException.HandleError(exception);
            }
        }
コード例 #15
0
        private void WriteExcel(DataTable table, List <Dictionary <string, string> > listColumnName, string tableTitle)
        {
            int           num;
            int           num6;
            TaxCard       card  = TaxCardFactory.CreateTaxCard();
            List <string> list  = new List <string>();
            List <string> list2 = new List <string>();

            for (num = 0; num < listColumnName.Count; num++)
            {
                if (listColumnName[num].ContainsKey("AisinoLBL") && (!listColumnName[num].ContainsKey("Visible") || ((listColumnName[num]["Visible"].ToUpper() != "FALSE") || (num == 0x10))))
                {
                    list.Add(listColumnName[num]["AisinoLBL"]);
                    if (listColumnName[num].ContainsKey("Align") && (listColumnName[num]["Align"] == "MiddleRight"))
                    {
                        num6 = num + 1;
                        list2.Add(num6.ToString());
                    }
                }
            }
            if (File.Exists(this.FilePath))
            {
                XmlDocument document = new XmlDocument();
                document.Load(this.FilePath);
                XmlNode    node         = document.DocumentElement.ChildNodes.Item(3);
                string     namespaceURI = "urn:schemas-microsoft-com:office:spreadsheet";
                XmlElement firstChild   = (XmlElement)node.FirstChild;
                num6 = table.Columns.Count + 1;
                firstChild.SetAttribute("ExpandedColumnCount", namespaceURI, num6.ToString());
                num6 = table.Rows.Count + 1;
                firstChild.SetAttribute("ExpandedRowCount", namespaceURI, num6.ToString());
                XmlElement newChild = document.CreateElement("Column", namespaceURI);
                newChild.SetAttribute("AutoFitWidth", namespaceURI, "0");
                newChild.SetAttribute("Width", namespaceURI, "50");
                firstChild.AppendChild(newChild);
                if (list2.Count > 0)
                {
                    for (num = 0; num < list2.Count; num++)
                    {
                        XmlElement element3 = document.CreateElement("Column", namespaceURI);
                        element3.SetAttribute("Index", namespaceURI, list2[num]);
                        element3.SetAttribute("StyleID", namespaceURI, "s23");
                        firstChild.AppendChild(element3);
                    }
                }
                if (tableTitle.Length > 0)
                {
                    XmlElement element4 = document.CreateElement("Row", namespaceURI);
                    element4.SetAttribute("Height", namespaceURI, "22");
                    firstChild.AppendChild(element4);
                    XmlElement element5 = document.CreateElement("Cell", namespaceURI);
                    element5.SetAttribute("Index", namespaceURI, (table.Columns.Count / 2).ToString());
                    element5.SetAttribute("StyleID", namespaceURI, "s22");
                    element4.AppendChild(element5);
                    XmlElement element6 = document.CreateElement("Data", namespaceURI);
                    element6.SetAttribute("Type", namespaceURI, "String");
                    element6.InnerText = tableTitle;
                    element5.AppendChild(element6);
                    firstChild.SetAttribute("ExpandedRowCount", namespaceURI, (table.Rows.Count + 2).ToString());
                }
                XmlElement element7 = document.CreateElement("Row", namespaceURI);
                element7.SetAttribute("Height", namespaceURI, "20");
                firstChild.AppendChild(element7);
                int num3 = 0;
                for (num = 0; num < table.Columns.Count; num++)
                {
                    if (((table.Columns[num].ColumnName != "FPMXXH") && (table.Columns[num].ColumnName != "YYSBZ")) && (!card.get_QYLX().ISTDQY || !(table.Columns[num].ColumnName == "BSZT")))
                    {
                        XmlElement element8 = document.CreateElement("Cell", namespaceURI);
                        element8.SetAttribute("StyleID", namespaceURI, "s21");
                        element7.AppendChild(element8);
                        XmlElement element9 = document.CreateElement("Data", namespaceURI);
                        element9.SetAttribute("Type", namespaceURI, "String");
                        element9.InnerText = list[num3];
                        element8.AppendChild(element9);
                        num3++;
                    }
                }
                for (num = 0; num < table.Rows.Count; num++)
                {
                    XmlElement element10 = document.CreateElement("Row", namespaceURI);
                    firstChild.AppendChild(element10);
                    for (int i = 0; i < table.Columns.Count; i++)
                    {
                        if (((table.Columns[i].ColumnName != "FPMXXH") && (table.Columns[i].ColumnName != "YYSBZ")) && (!card.get_QYLX().ISTDQY || (table.Columns[i].ColumnName != "BSZT")))
                        {
                            XmlElement element11 = document.CreateElement("Cell", namespaceURI);
                            element10.AppendChild(element11);
                            XmlElement element12 = document.CreateElement("Data", namespaceURI);
                            element12.SetAttribute("Type", namespaceURI, "String");
                            if (table.Columns[i].DataType == typeof(DateTime))
                            {
                                element12.InnerText = Convert.ToDateTime(table.Rows[num][i]).ToString("yyyy-MM-dd");
                            }
                            else
                            {
                                string str2;
                                if (table.Columns[i].ColumnName == "SLV")
                                {
                                    str2 = table.Rows[num][i].ToString();
                                    if (((str2 == "") || (str2 == null)) || (str2 == "多税率"))
                                    {
                                        element12.InnerText = "多税率";
                                    }
                                    else if (str2 == "中外合作油气田")
                                    {
                                        element12.InnerText = str2;
                                    }
                                    else if (str2 == "0.015")
                                    {
                                        element12.InnerText = Convert.ToSingle(table.Rows[num][i]).ToString("0.0%");
                                    }
                                    else
                                    {
                                        element12.InnerText = Convert.ToSingle(table.Rows[num][i]).ToString("0%");
                                    }
                                }
                                else if (table.Columns[i].ColumnName == "GFSH")
                                {
                                    str2 = table.Rows[num][i].ToString();
                                    if (((str2.Equals("000000000000000") || str2.Equals("00000000000000000")) || str2.Equals("000000000000000000")) || str2.Equals("00000000000000000000"))
                                    {
                                        if ((table.Rows[num][1].ToString() == "普通发票") || (table.Rows[num][1].ToString() == "收购发票"))
                                        {
                                            if (((table.Rows[num][20].ToString() == "是") && (((table.Rows[num][11].ToString() == "0") || (table.Rows[num][11].ToString() == null)) || (table.Rows[num][11].ToString() == ""))) && (((table.Rows[num][13].ToString() == "0") || (table.Rows[num][13].ToString() == null)) || (table.Rows[num][13].ToString() == "")))
                                            {
                                                element12.InnerText = table.Rows[num][i].ToString();
                                            }
                                            else
                                            {
                                                element12.InnerText = "";
                                            }
                                        }
                                        else
                                        {
                                            element12.InnerText = table.Rows[num][i].ToString();
                                        }
                                    }
                                    else
                                    {
                                        element12.InnerText = table.Rows[num][i].ToString();
                                    }
                                }
                                else if (table.Columns[i].ColumnName == "BZ")
                                {
                                    string s = table.Rows[num][i].ToString();
                                    if ((s == "") || (s == null))
                                    {
                                        element12.InnerText = "";
                                    }
                                    else
                                    {
                                        byte[] buffer = Convert.FromBase64String(s);
                                        if ((buffer != null) && (buffer.Length >= 1))
                                        {
                                            s = ToolUtil.GetString(buffer);
                                        }
                                        else
                                        {
                                            s = "";
                                        }
                                        element12.InnerText = s;
                                    }
                                }
                                else if (table.Columns[i].ColumnName == "FPHM")
                                {
                                    element12.InnerText = table.Rows[num][i].ToString().PadLeft(8, '0');
                                }
                                else if ((((table.Columns[i].ColumnName == "JE") || (table.Columns[i].ColumnName == "SE")) || (table.Columns[i].ColumnName == "HJJE")) || (table.Columns[i].ColumnName == "HJSE"))
                                {
                                    double result = 0.0;
                                    if (double.TryParse(table.Rows[num][i].ToString(), out result))
                                    {
                                        element12.InnerText = result.ToString("0.00");
                                    }
                                    else
                                    {
                                        element12.InnerText = "0.00";
                                    }
                                }
                                else
                                {
                                    element12.InnerText = table.Rows[num][i].ToString();
                                }
                            }
                            element11.AppendChild(element12);
                        }
                    }
                }
                document.Save(this.FilePath);
            }
        }
コード例 #16
0
        protected override void RunCommand()
        {
            RemoteReport report = new RemoteReport();
            TaxCard      card   = TaxCardFactory.CreateTaxCard();

            card.get_TaxClock().ToString("yyyyMM");
            if (report.CheckStatus())
            {
                if (report.ISZP)
                {
                    report.ProcessMsg(FPZL.ZP, OPTYPE.ZPCB);
                    if (report.ISCBZP)
                    {
                        PropertyUtil.SetValue(AttributeName.ZPCSDateName, report.dtZPLastCSDate.ToString("yyyyMM"));
                    }
                }
                if (report.ISHY)
                {
                    report.ProcessMsg(FPZL.HY, OPTYPE.HYCB);
                    if (report.ISCBHy)
                    {
                        PropertyUtil.SetValue(AttributeName.HYCSDateName, report.dtHYLastCSDate.ToString("yyyyMM"));
                    }
                }
                if (report.ISJDC)
                {
                    report.ProcessMsg(FPZL.JDC, OPTYPE.JDCCB);
                    if (report.ISCBJDC)
                    {
                        PropertyUtil.SetValue(AttributeName.JDCCSDateName, report.dtJDCLastCSDate.ToString("yyyyMM"));
                    }
                }
                if (report.ISJSP)
                {
                    report.ProcessMsg(FPZL.JSFP, OPTYPE.JSPCB);
                    if (report.ISCBJSFP)
                    {
                        PropertyUtil.SetValue(AttributeName.JSPCSDateName, report.dtJSPLastCSDate.ToString("yyyyMM"));
                    }
                }
                PropertyUtil.Save();
                if ((report.ISCBZP && report.ISCBHy) && (report.ISCBJDC && report.ISCBJSFP))
                {
                    MessageManager.ShowMsgBox("YC0003");
                }
                else if ((card.get_RetCode() == 250) || (card.get_RetCode() == 0x309))
                {
                    MessageManager.ShowMsgBox(card.get_ErrCode());
                }
                else
                {
                    string str = "本次上报汇总情况如下:\r\n";
                    if (card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP)
                    {
                        if (!report.ISCBZP)
                        {
                            if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票及电子增值税普通发票抄报失败原因:";
                            }
                            else if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (!card.get_QYLX().ISPTFPDZ || (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票抄报失败原因:";
                            }
                            else if ((!card.get_QYLX().ISPTFP&& !card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票抄报失败原因:";
                            }
                            str = str + report.CBZPMESS + "\r\n";
                        }
                        else
                        {
                            if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票及电子增值税普通发票抄报成功:";
                            }
                            else if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (!card.get_QYLX().ISPTFPDZ || (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票抄报成功:";
                            }
                            else if ((!card.get_QYLX().ISPTFP&& !card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票抄报成功:";
                            }
                            str = str + report.CBZPMESS + "\r\n";
                        }
                    }
                    if (card.get_QYLX().ISHY)
                    {
                        if (!report.ISCBHy)
                        {
                            str = (str + "(" + report.dtHYLastCSDate.ToString("yyyy年MM月") + "份征期)货物运输业增值税专用发票抄报失败原因:") + report.CBHYMESS + "\r\n";
                        }
                        else if (card.get_QYLX().ISHY)
                        {
                            str = (str + "(" + report.dtHYLastCSDate.ToString("yyyy年MM月") + "份征期)货物运输业增值税专用发票抄报成功:") + report.CBHYMESS + "\r\n";
                        }
                    }
                    if (card.get_QYLX().ISJDC || card.get_QYLX().ISPTFPDZ)
                    {
                        if (card.get_QYLX().ISJDC)
                        {
                            if (!str.Contains("机动车"))
                            {
                                str = str + "(" + report.dtJDCLastCSDate.ToString("yyyy年MM月") + "份征期)机动车销售统一发票";
                            }
                            else
                            {
                                str = str + "及机动车销售统一发票";
                            }
                        }
                        if (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))
                        {
                            if (!str.Contains("机动车"))
                            {
                                str = str + "(" + report.dtJDCLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票";
                            }
                            else
                            {
                                str = str + "及电子增值税普通发票";
                            }
                        }
                        if (!report.ISCBJDC)
                        {
                            str = (str + "抄报失败原因:") + report.CBJDCMESS + "\r\n";
                        }
                        else
                        {
                            str = (str + "抄报成功:") + report.CBJDCMESS + "\r\n";
                        }
                    }
                    if (card.get_QYLX().ISPTFPJSP)
                    {
                        if (!report.ISCBJSFP)
                        {
                            if (card.get_QYLX().ISPTFPJSP)
                            {
                                str = (str + "(" + report.dtJSPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税普通发票(卷票)抄报失败原因:") + report.CBJSPMESS + "\r\n";
                            }
                        }
                        else if (card.get_QYLX().ISPTFPJSP)
                        {
                            str = (str + "(" + report.dtJSPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税普通发票(卷票)抄报成功:") + report.CBJSPMESS + "\r\n";
                        }
                    }
                    MessageManager.ShowMsgBox("YC0004", new string[] { str });
                }
            }
        }
コード例 #17
0
ファイル: CommFun.cs プロジェクト: SoL-Alucard-Git/HX-Base
        public List <InvTypeEntity> GetInvTypeCollect()
        {
            List <InvTypeEntity> list = new List <InvTypeEntity>();
            InvTypeEntity        item = new InvTypeEntity();
            TaxCard card = TaxCardFactory.CreateTaxCard();

            if (card.get_QYLX().ISZYFP)
            {
                item.m_invType    = INV_TYPE.INV_SPECIAL;
                item.m_strInvName = "增值税专用发票";
                list.Add(item);
            }
            if (card.get_QYLX().ISPTFP)
            {
                item = new InvTypeEntity {
                    m_invType    = INV_TYPE.INV_COMMON,
                    m_strInvName = "增值税普通发票"
                };
                list.Add(item);
            }
            if (card.get_QYLX().ISHY)
            {
                item = new InvTypeEntity {
                    m_invType    = INV_TYPE.INV_TRANSPORTATION,
                    m_strInvName = "货物运输业增值税专用发票"
                };
                list.Add(item);
            }
            if (card.get_QYLX().ISJDC)
            {
                item = new InvTypeEntity {
                    m_invType    = INV_TYPE.INV_VEHICLESALES,
                    m_strInvName = "机动车销售统一发票"
                };
                list.Add(item);
            }
            if (card.get_QYLX().ISPTFPDZ)
            {
                item = new InvTypeEntity {
                    m_invType    = INV_TYPE.INV_PTDZ,
                    m_strInvName = "电子增值税普通发票"
                };
                list.Add(item);
            }
            if (card.get_QYLX().ISPTFPJSP)
            {
                item = new InvTypeEntity {
                    m_invType    = INV_TYPE.INV_JSFP,
                    m_strInvName = "增值税普通发票(卷票)"
                };
                list.Add(item);
            }
            if (string.IsNullOrEmpty(card.get_SQInfo().DHYBZ))
            {
                item.m_invType    = INV_TYPE.INV_SPECIAL;
                item.m_strInvName = "增值税专用发票";
                list.Add(item);
                item = new InvTypeEntity {
                    m_invType    = INV_TYPE.INV_COMMON,
                    m_strInvName = "增值税普通发票"
                };
                list.Add(item);
            }
            return(list);
        }
コード例 #18
0
ファイル: XSDJLR.cs プロジェクト: SoL-Alucard-Git/HX-Base
 private void XSDJLR_Load(object sender, EventArgs e)
 {
     try
     {
         if (this.UseYear)
         {
             this.comboBoxDJZL.SelectedIndexChanged -= new EventHandler(this.comboBoxDJZL_SelectedIndexChanged);
         }
         this.comboBoxYF.Items.AddRange(this.billBL.SaleBillMonth());
         this.comboBoxYF.SelectedIndex   = 0;
         this.comboBoxDJZL.DataSource    = CbbXmlBind.ReadXmlNode("InvType", true);
         this.comboBoxDJZL.DisplayMember = "Value";
         this.comboBoxDJZL.ValueMember   = "Key";
         this.checkBox_JiaoYan.Checked   = PropValue.IsJiaoYan;
         if (this.UseYear)
         {
             string str  = "";
             string str2 = "";
             string str3 = this.comboBoxDJZL.SelectedValue.ToString();
             if (str3 == "a")
             {
                 str  = "s";
                 str2 = "c";
             }
             else
             {
                 str = str3;
             }
             this.comboBoxYF.Items.Clear();
             this.comboBoxYF.Items.AddRange(this.billBL.SaleBillYearMonth(str, str2));
         }
         if (RegisterManager.CheckRegFile("JIJS"))
         {
             TaxCard card = TaxCardFactory.CreateTaxCard();
             if (card.get_QYLX().ISPTFP&& card.get_QYLX().ISZYFP)
             {
                 this.comboBoxDJZL.SelectedIndex = 2;
                 this.comboBoxDJZL.Enabled       = false;
             }
             else if (card.get_QYLX().ISPTFP)
             {
                 this.btnOK.Enabled = false;
             }
             else if (card.get_QYLX().ISZYFP)
             {
                 this.comboBoxDJZL.SelectedIndex = 1;
                 this.comboBoxDJZL.Enabled       = false;
             }
             else
             {
                 this.btnOK.Enabled = false;
             }
         }
     }
     catch (Exception exception)
     {
         HandleException.HandleError(exception);
     }
     finally
     {
         if (this.UseYear)
         {
             this.comboBoxDJZL.SelectedIndexChanged += new EventHandler(this.comboBoxDJZL_SelectedIndexChanged);
         }
     }
 }
コード例 #19
0
        private object[] StartYCCB(object[] para)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("CBBZ", "");
            dictionary.Add("Message", "");
            TaxCard card = TaxCardFactory.CreateTaxCard();

            card.get_TaxClock().ToString("yyyyMM");
            try
            {
                RemoteReport report = new RemoteReport {
                    bByAuto = true
                };
                if (report.CheckStatus())
                {
                    if (report.ISZP)
                    {
                        report.ProcessMsg(FPZL.ZP, OPTYPE.ZPCB);
                        if (report.ISCBZP)
                        {
                            PropertyUtil.SetValue(AttributeName.ZPCSDateName, report.dtZPLastCSDate.ToString("yyyyMM"));
                        }
                    }
                    if (report.ISHY)
                    {
                        report.ProcessMsg(FPZL.HY, OPTYPE.HYCB);
                        if (report.ISCBHy)
                        {
                            PropertyUtil.SetValue(AttributeName.HYCSDateName, report.dtHYLastCSDate.ToString("yyyyMM"));
                        }
                    }
                    if (report.ISJDC)
                    {
                        report.ProcessMsg(FPZL.JDC, OPTYPE.JDCCB);
                        if (report.ISCBJDC)
                        {
                            PropertyUtil.SetValue(AttributeName.JDCCSDateName, report.dtJDCLastCSDate.ToString("yyyyMM"));
                        }
                    }
                    if (report.ISJSP)
                    {
                        report.ProcessMsg(FPZL.JSFP, OPTYPE.JSPCB);
                        if (report.ISCBJSFP)
                        {
                            PropertyUtil.SetValue(AttributeName.JSPCSDateName, report.dtJSPLastCSDate.ToString("yyyyMM"));
                        }
                    }
                    PropertyUtil.Save();
                    if ((report.ISCBZP && report.ISCBHy) && (report.ISCBJDC && report.ISCBJSFP))
                    {
                        dictionary["CBBZ"]    = "0";
                        dictionary["Message"] = "上报汇总成功!";
                    }
                    else
                    {
                        dictionary["CBBZ"] = "1";
                        if ((card.get_RetCode() == 250) || (card.get_RetCode() == 0x309))
                        {
                            dictionary["Message"] = "金税盘错误,错误码:" + card.get_RetCode();
                        }
                        else
                        {
                            string str = "本次上报汇总情况如下:\r\n";
                            if (card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP)
                            {
                                if (!report.ISCBZP)
                                {
                                    if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                                    {
                                        str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票及电子增值税普通发票抄报失败原因:";
                                    }
                                    else if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (!card.get_QYLX().ISPTFPDZ || (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))))
                                    {
                                        str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票抄报失败原因:";
                                    }
                                    else if ((!card.get_QYLX().ISPTFP&& !card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                                    {
                                        str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票抄报失败原因:";
                                    }
                                    str = str + report.CBZPMESS + "\r\n";
                                }
                                else
                                {
                                    if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                                    {
                                        str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票及电子增值税普通发票抄报成功:";
                                    }
                                    else if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (!card.get_QYLX().ISPTFPDZ || (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))))
                                    {
                                        str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票抄报成功:";
                                    }
                                    else if ((!card.get_QYLX().ISPTFP&& !card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                                    {
                                        str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票抄报成功:";
                                    }
                                    str = str + report.CBZPMESS + "\r\n";
                                }
                            }
                            if (card.get_QYLX().ISHY)
                            {
                                if (!report.ISCBHy)
                                {
                                    str = (str + "(" + report.dtHYLastCSDate.ToString("yyyy年MM月") + "份征期)货物运输业增值税专用发票抄报失败原因:") + report.CBHYMESS + "\r\n";
                                }
                                else if (card.get_QYLX().ISHY)
                                {
                                    str = (str + "(" + report.dtHYLastCSDate.ToString("yyyy年MM月") + "份征期)货物运输业增值税专用发票抄报成功:") + report.CBHYMESS + "\r\n";
                                }
                            }
                            if (card.get_QYLX().ISJDC || card.get_QYLX().ISPTFPDZ)
                            {
                                if (card.get_QYLX().ISJDC)
                                {
                                    if (!str.Contains("机动车"))
                                    {
                                        str = str + "(" + report.dtJDCLastCSDate.ToString("yyyy年MM月") + "份征期)机动车销售统一发票";
                                    }
                                    else
                                    {
                                        str = str + "及机动车销售统一发票";
                                    }
                                }
                                if (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))
                                {
                                    if (!str.Contains("机动车"))
                                    {
                                        str = str + "(" + report.dtJDCLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票";
                                    }
                                    else
                                    {
                                        str = str + "及电子增值税普通发票";
                                    }
                                }
                                if (!report.ISCBJDC)
                                {
                                    str = (str + "抄报失败原因:") + report.CBJDCMESS + "\r\n";
                                }
                                else
                                {
                                    str = (str + "抄报成功:") + report.CBJDCMESS + "\r\n";
                                }
                            }
                            if (card.get_QYLX().ISPTFPJSP)
                            {
                                if (!report.ISCBJSFP)
                                {
                                    if (card.get_QYLX().ISPTFPJSP)
                                    {
                                        str = (str + "(" + report.dtJSPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税普通发票(卷票)抄报失败原因:") + report.CBJSPMESS + "\r\n";
                                    }
                                }
                                else if (card.get_QYLX().ISPTFPJSP)
                                {
                                    str = (str + "(" + report.dtJSPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税普通发票(卷票)抄报成功:") + report.CBJSPMESS + "\r\n";
                                }
                            }
                            dictionary["Message"] = str;
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                dictionary["CBBZ"]    = "1";
                dictionary["Message"] = exception.Message;
            }
            return(new object[] { dictionary });
        }
コード例 #20
0
ファイル: DanJuTxtCR.cs プロジェクト: SoL-Alucard-Git/HX-Base
        private void DanJuTxtCR_Load(object sender, EventArgs e)
        {
            try
            {
                TaxCard card = TaxCardFactory.CreateTaxCard();
                bool    flag = false;
                if (PropValue.TxtInvType == "Special")
                {
                    if (!card.get_QYLX().ISZYFP)
                    {
                        flag = true;
                    }
                }
                else if (PropValue.TxtInvType == "Common")
                {
                    if (!card.get_QYLX().ISPTFP)
                    {
                        flag = true;
                    }
                }
                else if (PropValue.TxtInvType == "transportation")
                {
                    if (!card.get_QYLX().ISHY)
                    {
                        flag = true;
                    }
                }
                else if ((PropValue.TxtInvType == "vehiclesales") && !card.get_QYLX().ISJDC)
                {
                    flag = true;
                }
                if (flag)
                {
                    if (card.get_QYLX().ISPTFP)
                    {
                        PropValue.TxtInvType = "Common";
                    }
                    else if (card.get_QYLX().ISZYFP)
                    {
                        PropValue.TxtInvType = "Special";
                    }
                    else if (card.get_QYLX().ISHY)
                    {
                        PropValue.TxtInvType = "transportation";
                    }
                    else if (card.get_QYLX().ISJDC)
                    {
                        PropValue.TxtInvType = "vehiclesales";
                    }
                }
                this.fileControl1.set_FileFilter(FatchSaleBill.FileFilterTxt);
                this.fileControl1.get_TextBoxFile().Text = PropValue.TxtPath;
                this.comboBoxJESM.SelectedValue          = PropValue.TxtAmountType;
                this.radioBtnZYFP.Checked  = PropValue.TxtInvType == "Special";
                this.radioBtnPTFP.Checked  = PropValue.TxtInvType == "Common";
                this.radioBtnHYFP.Checked  = PropValue.TxtInvType == "transportation";
                this.radioBtnJDCFP.Checked = PropValue.TxtInvType == "vehiclesales";
                this.radioBtnPTFP.Visible  = false;
                this.radioBtnZYFP.Visible  = false;
                this.radioBtnHYFP.Visible  = false;
                this.radioBtnJDCFP.Visible = false;
                int num = 0;
                if (card.get_QYLX().ISZYFP)
                {
                    this.radioBtnZYFP.Visible = true;
                    num++;
                }
                if (card.get_QYLX().ISPTFP)
                {
                    this.radioBtnPTFP.Visible = true;
                    if (num == 0)
                    {
                        this.radioBtnPTFP.Location = new Point(8, 20);
                    }
                    num++;
                }
                if (card.get_QYLX().ISHY)
                {
                    this.radioBtnHYFP.Visible = true;
                    if (num == 0)
                    {
                        this.radioBtnHYFP.Location = new Point(8, 20);
                    }
                    else if (num == 1)
                    {
                        this.radioBtnHYFP.Location = new Point(8, 50);
                    }
                    num++;
                }
                if (card.get_QYLX().ISJDC)
                {
                    this.radioBtnJDCFP.Visible = true;
                    switch (num)
                    {
                    case 0:
                        this.radioBtnJDCFP.Location = new Point(8, 20);
                        break;

                    case 1:
                        this.radioBtnJDCFP.Location = new Point(8, 50);
                        break;

                    case 2:
                        this.radioBtnJDCFP.Location = new Point(120, 20);
                        break;
                    }
                }
                if (this.radioBtnJDCFP.Checked)
                {
                    this.comboBoxJESM.SelectedIndex = 0;
                    this.comboBoxJESM.Enabled       = false;
                }
                if (RegisterManager.CheckRegFile("JIJS"))
                {
                    this.radioBtnPTFP.Visible  = false;
                    this.radioBtnHYFP.Visible  = false;
                    this.radioBtnJDCFP.Visible = false;
                    this.radioBtnZYFP.Checked  = true;
                }
            }
            catch (Exception exception)
            {
                HandleException.HandleError(exception);
            }
        }
コード例 #21
0
        public static void Ycqk(bool auto)
        {
            TaxCard card = TaxCardFactory.CreateTaxCard();

            card.get_TaxClock().ToString("yyyyMM");
            RemoteReport report = new RemoteReport();

            if (report.CheckStatus())
            {
                if (report.ISZP)
                {
                    report.ProcessMsg(FPZL.ZP, OPTYPE.ZPQK);
                    if (report.ISQKZP)
                    {
                        PropertyUtil.SetValue(AttributeName.ZPQKDateName, report.dtZPLastCSDate.ToString("yyyyMM"));
                    }
                }
                if (report.ISHY)
                {
                    report.ProcessMsg(FPZL.HY, OPTYPE.HYQK);
                    if (report.ISQKHY)
                    {
                        PropertyUtil.SetValue(AttributeName.HYQKDateName, report.dtHYLastCSDate.ToString("yyyyMM"));
                    }
                }
                if (report.ISJDC)
                {
                    report.ProcessMsg(FPZL.JDC, OPTYPE.JDCQK);
                    if (report.ISQKJDC)
                    {
                        PropertyUtil.SetValue(AttributeName.JDCQKDateName, report.dtJDCLastCSDate.ToString("yyyyMM"));
                    }
                }
                if (report.ISJSP)
                {
                    report.ProcessMsg(FPZL.JSFP, OPTYPE.JSPQK);
                    if (report.ISQKJSP)
                    {
                        PropertyUtil.SetValue(AttributeName.JSPQKDateName, report.dtJSPLastCSDate.ToString("yyyyMM"));
                    }
                }
                PropertyUtil.Save();
                if ((report.ISQKZP && report.ISQKHY) && (report.ISQKJDC && report.ISQKJSP))
                {
                    MessageManager.ShowMsgBox("YC0006");
                    FormMain.ResetForm();
                }
                else if (auto)
                {
                    string str = "本次远程清卡情况如下:\r\n";
                    if (card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP)
                    {
                        if (!report.ISQKZP)
                        {
                            if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票及电子增值税普通发票清卡失败,原因:";
                            }
                            else if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (!card.get_QYLX().ISPTFPDZ || (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票清卡失败,原因:";
                            }
                            else if ((!card.get_QYLX().ISPTFP&& !card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票清卡失败,原因:";
                            }
                            str = str + report.QKZPMESS + "\r\n";
                        }
                        else
                        {
                            if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票及电子增值税普通发票清卡成功:";
                            }
                            else if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (!card.get_QYLX().ISPTFPDZ || (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票清卡成功:";
                            }
                            else if ((!card.get_QYLX().ISPTFP&& !card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                            {
                                str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票清卡成功:";
                            }
                            str = str + report.QKZPMESS + "\r\n";
                        }
                    }
                    if (card.get_QYLX().ISHY)
                    {
                        if (!report.ISQKHY)
                        {
                            str = (str + "(" + report.dtHYLastCSDate.ToString("yyyy年MM月") + "份征期)货物运输业增值税专用发票清卡失败,原因:") + report.QKHYMESS + "\r\n";
                        }
                        else if (card.get_QYLX().ISHY)
                        {
                            str = (str + "(" + report.dtHYLastCSDate.ToString("yyyy年MM月") + "份征期)货物运输业增值税专用发票清卡成功:") + report.QKHYMESS + "\r\n";
                        }
                    }
                    if (card.get_QYLX().ISJDC || card.get_QYLX().ISPTFPDZ)
                    {
                        if (card.get_QYLX().ISJDC)
                        {
                            if (!str.Contains("机动车"))
                            {
                                str = str + "(" + report.dtJDCLastCSDate.ToString("yyyy年MM月") + "份征期)机动车销售统一发票";
                            }
                            else
                            {
                                str = str + "及机动车销售统一发票";
                            }
                        }
                        if (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))
                        {
                            if (!str.Contains("机动车"))
                            {
                                str = str + "(" + report.dtJDCLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票";
                            }
                            else
                            {
                                str = str + "及电子增值税普通发票";
                            }
                        }
                        if (!report.ISQKJDC)
                        {
                            str = (str + "清卡失败,原因:") + report.QKJDCMESS + "\r\n";
                        }
                        else if (card.get_QYLX().ISJDC || card.get_QYLX().ISPTFPDZ)
                        {
                            str = (str + "清卡成功:") + report.QKJDCMESS + "\r\n";
                        }
                    }
                    if (card.get_QYLX().ISPTFPJSP)
                    {
                        if (!report.ISQKJSP)
                        {
                            str = (str + "(" + report.dtJSPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税普通发票(卷票)清卡失败,原因:") + report.QKJSFPMESS + "\r\n";
                        }
                        else if (card.get_QYLX().ISPTFPJSP)
                        {
                            str = (str + "(" + report.dtJSPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税普通发票(卷票)清卡成功:") + report.QKJSFPMESS + "\r\n";
                        }
                    }
                    MessageManager.ShowMsgBox("YC0009", new string[] { str });
                }
            }
            FormMain.RefreashStatus();
        }
コード例 #22
0
ファイル: QKService.cs プロジェクト: SoL-Alucard-Git/HX-Base
        private object[] StartQK(object[] param)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("QKBZ", "");
            dictionary.Add("Message", "");
            try
            {
                RemoteReport report = new RemoteReport();
                TaxCard      card   = TaxCardFactory.CreateTaxCard();
                card.get_TaxClock().ToString("yyyyMM");
                if (report.CheckStatus())
                {
                    if (report.ISZP)
                    {
                        report.ProcessMsg(FPZL.ZP, OPTYPE.ZPQK);
                        if (report.ISQKZP)
                        {
                            PropertyUtil.SetValue(AttributeName.ZPQKDateName, report.dtZPLastCSDate.ToString("yyyyMM"));
                        }
                    }
                    if (report.ISHY)
                    {
                        report.ProcessMsg(FPZL.HY, OPTYPE.HYQK);
                        if (report.ISQKHY)
                        {
                            PropertyUtil.SetValue(AttributeName.HYQKDateName, report.dtHYLastCSDate.ToString("yyyyMM"));
                        }
                    }
                    if (report.ISJDC)
                    {
                        report.ProcessMsg(FPZL.JDC, OPTYPE.JDCQK);
                        if (report.ISQKJDC)
                        {
                            PropertyUtil.SetValue(AttributeName.JDCQKDateName, report.dtJDCLastCSDate.ToString("yyyyMM"));
                        }
                    }
                    if (report.ISJSP)
                    {
                        report.ProcessMsg(FPZL.JSFP, OPTYPE.JSPQK);
                        if (report.ISQKJSP)
                        {
                            PropertyUtil.SetValue(AttributeName.JSPQKDateName, report.dtJSPLastCSDate.ToString("yyyyMM"));
                        }
                    }
                    PropertyUtil.Save();
                    if ((report.ISQKZP && report.ISQKHY) && (report.ISQKJDC && report.ISQKJSP))
                    {
                        dictionary["QKBZ"]    = "0";
                        dictionary["Message"] = "已成功执行清卡!";
                    }
                    else
                    {
                        dictionary["QKBZ"] = "1";
                        string str = "本次远程清卡情况如下:\r\n";
                        if (card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP)
                        {
                            if (!report.ISQKZP)
                            {
                                if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                                {
                                    str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票及电子增值税普通发票清卡失败,原因:";
                                }
                                else if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (!card.get_QYLX().ISPTFPDZ || (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))))
                                {
                                    str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票清卡失败,原因:";
                                }
                                else if ((!card.get_QYLX().ISPTFP&& !card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                                {
                                    str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票清卡失败,原因:";
                                }
                                str = str + report.QKZPMESS + "\r\n";
                            }
                            else
                            {
                                if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                                {
                                    str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票及电子增值税普通发票清卡成功:";
                                }
                                else if ((card.get_QYLX().ISPTFP || card.get_QYLX().ISZYFP) && (!card.get_QYLX().ISPTFPDZ || (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))))
                                {
                                    str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税专普票清卡成功:";
                                }
                                else if ((!card.get_QYLX().ISPTFP&& !card.get_QYLX().ISZYFP) && (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x3d)))
                                {
                                    str = str + "(" + report.dtZPLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票清卡成功:";
                                }
                                str = str + report.QKZPMESS + "\r\n";
                            }
                        }
                        if (card.get_QYLX().ISHY)
                        {
                            if (!report.ISQKHY)
                            {
                                str = (str + "(" + report.dtHYLastCSDate.ToString("yyyy年MM月") + "份征期)货物运输业增值税专用发票清卡失败,原因:") + report.QKHYMESS + "\r\n";
                            }
                            else if (card.get_QYLX().ISHY)
                            {
                                str = (str + "(" + report.dtHYLastCSDate.ToString("yyyy年MM月") + "份征期)货物运输业增值税专用发票清卡成功:") + report.QKHYMESS + "\r\n";
                            }
                        }
                        if (card.get_QYLX().ISJDC || card.get_QYLX().ISPTFPDZ)
                        {
                            if (card.get_QYLX().ISJDC)
                            {
                                if (!str.Contains("机动车"))
                                {
                                    str = str + "(" + report.dtJDCLastCSDate.ToString("yyyy年MM月") + "份征期)机动车销售统一发票";
                                }
                                else
                                {
                                    str = str + "及机动车销售统一发票";
                                }
                            }
                            if (card.get_QYLX().ISPTFPDZ&& (card.get_InvEleKindCode() == 0x33))
                            {
                                if (!str.Contains("机动车"))
                                {
                                    str = str + "(" + report.dtJDCLastCSDate.ToString("yyyy年MM月") + "份征期)电子增值税普通发票";
                                }
                                else
                                {
                                    str = str + "及电子增值税普通发票";
                                }
                            }
                            if (!report.ISQKJDC)
                            {
                                str = (str + "清卡失败,原因:") + report.QKJDCMESS + "\r\n";
                            }
                            else if (card.get_QYLX().ISJDC || card.get_QYLX().ISPTFPDZ)
                            {
                                str = (str + "清卡成功:") + report.QKJDCMESS + "\r\n";
                            }
                        }
                        if (card.get_QYLX().ISPTFPJSP)
                        {
                            if (!report.ISQKJSP)
                            {
                                str = (str + "(" + report.dtJSPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税普通发票(卷票)清卡失败,原因:") + report.QKJSFPMESS + "\r\n";
                            }
                            else if (card.get_QYLX().ISPTFPJSP)
                            {
                                str = (str + "(" + report.dtJSPLastCSDate.ToString("yyyy年MM月") + "份征期)增值税普通发票(卷票)清卡成功:") + report.QKJSFPMESS + "\r\n";
                            }
                        }
                        dictionary["Message"] = str;
                    }
                }
            }
            catch (Exception exception)
            {
                dictionary["QKBZ"]    = "1";
                dictionary["Message"] = exception.Message;
            }
            return(new object[] { dictionary });
        }
コード例 #23
0
ファイル: FaPiaoCC.cs プロジェクト: SoL-Alucard-Git/HX-Base
 private void FaPiaoCC_Load(object sender, EventArgs e)
 {
     try
     {
         int num;
         this.fileControl1.set_FileFilter("文本文件(*.txt)|*.txt");
         this.fileControl1.get_TextBoxFile().Text = PropValue.InvExportTxtPath;
         this.fileControl1.set_CheckFileExists(false);
         this.checkBox1.Checked          = PropValue.CheckBoxKqd;
         this.comboBoxDJZL.DataSource    = CbbXmlBind.ReadXmlNode("InvType", true);
         this.comboBoxDJZL.DisplayMember = "Value";
         this.comboBoxDJZL.ValueMember   = "Key";
         if (RegisterManager.CheckRegFile("JIJS"))
         {
             TaxCard card = TaxCardFactory.CreateTaxCard();
             if (card.get_QYLX().ISPTFP&& card.get_QYLX().ISZYFP)
             {
                 this.comboBoxDJZL.SelectedIndex = 2;
                 this.comboBoxDJZL.Enabled       = false;
             }
             else if (card.get_QYLX().ISPTFP)
             {
                 this.btnOK.Enabled = false;
             }
             else if (card.get_QYLX().ISZYFP)
             {
                 this.comboBoxDJZL.SelectedIndex = 1;
                 this.comboBoxDJZL.Enabled       = false;
             }
             else
             {
                 this.btnOK.Enabled = false;
             }
         }
         if ((base.TaxCardInstance.get_QYLX().ISPTFP || base.TaxCardInstance.get_QYLX().ISZYFP) && (this.nMonth != this.m_dtLastRepDate.Month))
         {
             this.nYear  = this.m_dtLastRepDate.Year;
             this.nMonth = this.m_dtLastRepDate.Month;
         }
         this.dateTimePicker1.Text = this.nYear.ToString() + "-" + this.nMonth.ToString() + "-01";
         if (this.nMonth == 12)
         {
             num = this.nYear + 1;
             this.dateTimePicker2.Text = Convert.ToDateTime(num.ToString() + "-01-01").AddDays(-1.0).ToShortDateString();
         }
         else
         {
             num = this.nMonth + 1;
             this.dateTimePicker2.Text = Convert.ToString(Convert.ToDateTime(this.nYear.ToString() + "-" + num.ToString() + "-01").AddDays(-1.0));
         }
         List <Dictionary <string, string> > list = new List <Dictionary <string, string> >();
         Dictionary <string, string>         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "单据编号");
         item.Add("Property", "XSDJBH");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "发票种类");
         item.Add("Property", "FPZL");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "发票代码");
         item.Add("Property", "FPDM");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "发票号码");
         item.Add("Property", "FPHM");
         item.Add("Type", "Text");
         item.Add("Width", "150");
         item.Add("Align", "MiddleRight");
         item.Add("HeadAlign", "MiddleLeft");
         list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "作废标志");
         item.Add("Property", "ZFBZ");
         item.Add("Type", "Text");
         item.Add("Width", "80");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "清单标志");
         item.Add("Property", "QDBZ");
         item.Add("Type", "Text");
         item.Add("Width", "80");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "税率");
         item.Add("Property", "SLV");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "合计金额");
         item.Add("Property", "HJJE");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         item.Add("Align", "MiddleCenter");
         item.Add("HeadAlign", "MiddleCenter");
         list.Add(item);
         item = new Dictionary <string, string>();
         item.Add("AisinoLBL", "开票日期");
         item.Add("Property", "KPRQ");
         item.Add("Type", "Text");
         item.Add("Width", "100");
         item.Add("Align", "MiddleLeft");
         item.Add("HeadAlign", "MiddleLeft");
         list.Add(item);
         this.aisinoDataGrid1.set_ColumeHead(list);
         this.aisinoDataGrid1.get_Columns()["KPRQ"].DefaultCellStyle.Format = "yyyy-MM-dd";
         this.aisinoDataGrid1.get_Columns()["HJJE"].DefaultCellStyle.Format = "0.00";
         DataGridViewColumn column = this.aisinoDataGrid1.get_Columns()["FPHM"];
         if (null != column)
         {
             column.DefaultCellStyle.Format = new string('0', 8);
         }
         this.dateTimePicker1_CloseUp(sender, e);
         this.toolStripButtonPrint.Visible = false;
     }
     catch (Exception exception)
     {
         if (exception.ToString().Contains("超时"))
         {
             this.log.Error(exception.ToString());
         }
         else
         {
             HandleException.HandleError(exception);
         }
     }
 }