Beispiel #1
0
        protected override void RunCommand()
        {
            TaxCard taxCard = TaxCardFactory.CreateTaxCard();

            new InvSplitPara().GetInvSplitPara(InvType.Special);
            SPFLService service = new SPFLService();

            if (CommonTool.isSPBMVersion() && (service.GetMaxBMBBBH() == "0.0"))
            {
                MessageBox.Show("商品和服务税收分类编码表为空,请先更新商品和服务税收分类编码表后,再开具发票!");
            }
            else
            {
                GenerateFP efp  = new GenerateFP(InvType.Special);
                string     code = "";
                if (!efp.CanInvoice(0, out code))
                {
                    MessageManager.ShowMsgBox(code);
                }
                else if (!this.CanXTInv(taxCard))
                {
                    MessageManager.ShowMsgBox("INP-242132");
                }
                else
                {
                    efp.ShowDialog();
                }
            }
        }
        protected override void RunCommand()
        {
            SPFLService  service;
            TaxCard      taxCard = TaxCardFactory.CreateTaxCard();
            InvSplitPara para    = new InvSplitPara();

            para.GetInvSplitPara(InvType.Common);
            bool flag = taxCard.get_StateInfo().CompanyType != 0;

            if (para.ShowSetForm && flag)
            {
                service = new SPFLService();
                if (CommonTool.isSPBMVersion() && (service.GetMaxBMBBBH() == "0.0"))
                {
                    MessageBox.Show("商品和服务税收分类编码表为空,请先更新商品和服务税收分类编码表后,再开具发票!");
                }
                else
                {
                    GenerateInvSetForm form2 = new GenerateInvSetForm(InvType.Common)
                    {
                        NCPBZ = 2
                    };
                    form2.ShowDialog();
                }
            }
            else
            {
                service = new SPFLService();
                if (CommonTool.isSPBMVersion() && (service.GetMaxBMBBBH() == "0.0"))
                {
                    MessageBox.Show("商品和服务税收分类编码表为空,请先更新商品和服务税收分类编码表后,再开具发票!");
                }
                else
                {
                    GenerateFP efp  = new GenerateFP(InvType.Common, 2);
                    string     code = "";
                    if (!efp.CanInvoice(2, out code))
                    {
                        MessageManager.ShowMsgBox(code);
                    }
                    else if (!this.CanXTInv(taxCard))
                    {
                        MessageManager.ShowMsgBox("INP-242132");
                    }
                    else
                    {
                        JSFPJSelect select = new JSFPJSelect(2);
                        if (select.ShowDialog() == DialogResult.OK)
                        {
                            if (efp.GetCurrent(0x29) != null)
                            {
                            }
                            efp.ShowDialog();
                        }
                    }
                }
            }
        }
Beispiel #3
0
        public string ExportData(string pathFile, string separator, DataTable khTable = null)
        {
            string path = pathFile.Remove(pathFile.LastIndexOf(@"\"));

            if (!Directory.Exists(path))
            {
                Directory.CreateDirectory(path);
            }
            DataTable exportData = this.bmfyxmDAL.GetExportData();

            if (exportData.Rows.Count == 0)
            {
                return("没有费用项目");
            }
            StringBuilder builder = new StringBuilder();

            using (StreamWriter writer = new StreamWriter(pathFile, false, ToolUtil.GetEncoding()))
            {
                writer.WriteLine("{费用项目编码}[分隔符]\"" + separator + "\"");
                writer.WriteLine("// 每行格式 :");
                string str2 = "";
                if (Flbm.IsYM())
                {
                    str2 = "// 编码~~名称~~简码~~商品分类~~是否享受优惠政策~~税收分类名称~~优惠政策类型~~编码版本号";
                }
                else
                {
                    str2 = "// 编码~~名称~~简码";
                }
                writer.WriteLine(str2.Replace(",", separator));
                string maxBMBBBH = new SPFLService().GetMaxBMBBBH();
                for (int i = 0; i < exportData.Rows.Count; i++)
                {
                    builder.Remove(0, builder.Length);
                    builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["BM"].ToString(), separator));
                    builder.Append(separator);
                    builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["MC"].ToString(), separator));
                    builder.Append(separator);
                    builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["JM"].ToString(), separator));
                    if (Flbm.IsYM())
                    {
                        builder.Append(separator);
                        builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["SPFL"].ToString(), separator));
                        builder.Append(separator);
                        builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["YHZC"].ToString(), separator));
                        builder.Append(separator);
                        builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["SPFLMC"].ToString(), separator));
                        builder.Append(separator);
                        builder.Append(GetSafeData.ExportItem(exportData.Rows[i]["YHZCMC"].ToString(), separator));
                        builder.Append(separator);
                        builder.Append(GetSafeData.ExportItem(maxBMBBBH, separator));
                    }
                    builder.Replace(",,", ",\"\",");
                    writer.WriteLine(builder.ToString());
                }
            }
            return("0");
        }
Beispiel #4
0
 protected override void RunCommand()
 {
     try
     {
         if ((commonIfm == null) || !commonIfm.HasShow())
         {
             SPFLService service = new SPFLService();
             if (FLBM_lock.isFlbm() && (service.GetMaxBMBBBH() == "0.0"))
             {
                 MessageManager.ShowMsgBox("INP-242133");
             }
             else
             {
                 IFpManager manager = new FpManager();
                 if (manager.CanInvoice((FPLX)0x29))
                 {
                     if (manager.GetCurrent((FPLX)0x29) != null)
                     {
                         if (new JSFPJSelect((FPLX)0x29).ShowDialog() == DialogResult.OK)
                         {
                             string[] current = manager.GetCurrent((FPLX)0x29);
                             if (current != null)
                             {
                                 if (new StartConfirmForm((FPLX)0x29, current).ShowDialog() == DialogResult.OK)
                                 {
                                     commonIfm = new InvoiceForm_JS((FPLX)0x29, (ZYFP_LX)0, current[0], current[1]);
                                     if (commonIfm.InitSuccess)
                                     {
                                         commonIfm.ShowDialog();
                                     }
                                 }
                             }
                             else
                             {
                                 MessageManager.ShowMsgBox(manager.Code());
                             }
                         }
                     }
                     else
                     {
                         MessageManager.ShowMsgBox(manager.Code());
                     }
                 }
                 else
                 {
                     MessageManager.ShowMsgBox(manager.Code());
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.log.Error("电子增值税普通发票开具功能加载异常:" + exception.ToString());
         string[] textArray1 = new string[] { exception.ToString() };
         MessageManager.ShowMsgBox("INP-242114", textArray1);
     }
 }
Beispiel #5
0
 protected override void RunCommand()
 {
     try
     {
         if ((commonIfm == null) || !commonIfm.HasShow())
         {
             SPFLService service = new SPFLService();
             if (FLBM_lock.isFlbm() && (service.GetMaxBMBBBH() == "0.0"))
             {
                 MessageManager.ShowMsgBox("INP-242133");
             }
             else if ((NCPXSInvEntry.ncpxsIfm != null) && NCPXSInvEntry.ncpxsIfm.HasShow())
             {
                 string[] textArray1 = new string[] { "农产品销售发票", "一般普通发票" };
                 MessageManager.ShowMsgBox("INP-242165", textArray1);
             }
             else if ((NCPSGInvEntry.ncpsgIfm != null) && NCPSGInvEntry.ncpsgIfm.HasShow())
             {
                 string[] textArray2 = new string[] { "收购发票", "一般普通发票" };
                 MessageManager.ShowMsgBox("INP-242165", textArray2);
             }
             else
             {
                 IFpManager manager = new FpManager();
                 if (manager.CanInvoice((FPLX)0x33))
                 {
                     string[] current = manager.GetCurrent((FPLX)0x33);
                     if (current != null)
                     {
                         if (new StartConfirmForm((FPLX)0x33, current).ShowDialog() == DialogResult.OK)
                         {
                             commonIfm = new InvoiceForm_DZ((FPLX)0x33, 0, current[0], current[1]);
                             if (commonIfm.InitSuccess)
                             {
                                 commonIfm.ShowDialog();
                             }
                         }
                     }
                     else
                     {
                         MessageManager.ShowMsgBox(manager.Code());
                     }
                 }
                 else
                 {
                     MessageManager.ShowMsgBox(manager.Code());
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.log.Error("电子增值税普通发票开具功能加载异常:" + exception.ToString());
         string[] textArray3 = new string[] { exception.ToString() };
         MessageManager.ShowMsgBox("INP-242114", textArray3);
     }
 }
Beispiel #6
0
 protected override void RunCommand()
 {
     try
     {
         if ((zyfpIfm == null) || !zyfpIfm.HasShow())
         {
             SPFLService service = new SPFLService();
             if (FLBM_lock.isFlbm() && (service.GetMaxBMBBBH() == "0.0"))
             {
                 MessageManager.ShowMsgBox("INP-242133");
             }
             else if ((SNYInvEntry.snyIfm != null) && SNYInvEntry.snyIfm.HasShow())
             {
                 MessageManager.ShowMsgBox("INP-242163");
             }
             else
             {
                 IFpManager manager = new FpManager();
                 if (manager.CanInvoice(0))
                 {
                     string[] current = manager.GetCurrent(0);
                     if (current != null)
                     {
                         if (new StartConfirmForm(0, current).ShowDialog() == DialogResult.OK)
                         {
                             zyfpIfm = new InvoiceForm_ZZS(0, 0, current[0], current[1]);
                             if (zyfpIfm.InitSuccess)
                             {
                                 zyfpIfm.ShowDialog();
                             }
                         }
                     }
                     else
                     {
                         MessageManager.ShowMsgBox(manager.Code());
                     }
                 }
                 else
                 {
                     MessageManager.ShowMsgBox(manager.Code());
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.log.Error("专用发票开具功能加载异常:" + exception.ToString());
         string[] textArray1 = new string[] { exception.ToString() };
         MessageManager.ShowMsgBox("INP-242115", textArray1);
     }
 }
Beispiel #7
0
        protected override void RunCommand()
        {
            SPFLService service = new SPFLService();

            if (CommonTool.isSPBMVersion() && (service.GetMaxBMBBBH() == "0.0"))
            {
                MessageBox.Show("商品和服务税收分类编码表为空,请先更新商品和服务税收分类编码表后,再开具发票!");
            }
            else
            {
                GenerateFP efp  = new GenerateFP(InvType.transportation);
                string     code = "";
                if (!efp.CanInvoice(11, out code))
                {
                    MessageManager.ShowMsgBox(code);
                }
                else
                {
                    efp.ShowDialog();
                }
            }
        }
Beispiel #8
0
        protected override void RunCommand()
        {
            try
            {
                if (((oldJdcfpfm == null) || !oldJdcfpfm.HasShow()) && ((newJdcfpfm == null) || !newJdcfpfm.HasShow()))
                {
                    SPFLService service = new SPFLService();
                    if (FLBM_lock.isFlbm() && (service.GetMaxBMBBBH() == "0.0"))
                    {
                        MessageManager.ShowMsgBox("INP-242133");
                    }
                    else
                    {
                        IFpManager manager = new FpManager();
                        if (manager.CanInvoice((FPLX)12))
                        {
                            string[] current = manager.GetCurrent((FPLX)12);
                            if (current != null)
                            {
                                if (new StartConfirmForm((FPLX)12, current).ShowDialog() == DialogResult.OK)
                                {
                                    string jdcVerSelect = this.GetJdcVerSelect();
                                    switch ("1")
                                    {
                                    case "":
                                        new JDCVersionSet(current[0], current[1], JDCVersion.NULL).ShowDialog();
                                        return;

                                    case "0":
                                        oldJdcfpfm = new JDCInvoiceForm_old((FPLX)12, current[0], current[1]);
                                        if (oldJdcfpfm.InitSuccess)
                                        {
                                            oldJdcfpfm.ShowDialog();
                                        }
                                        break;

                                    case "1":
                                        newJdcfpfm = new JDCInvoiceForm_new((FPLX)12, current[0], current[1]);
                                        if (newJdcfpfm.InitSuccess)
                                        {
                                            newJdcfpfm.ShowDialog();
                                        }
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                MessageManager.ShowMsgBox(manager.Code());
                            }
                        }
                        else
                        {
                            MessageManager.ShowMsgBox(manager.Code());
                        }
                    }
                }
            }
            catch (Exception exception)
            {
                this.log.Error("机动车销售统一发票开具功能加载异常:" + exception.ToString());
                string[] textArray1 = new string[] { exception.ToString() };
                MessageManager.ShowMsgBox("INP-242156", textArray1);
            }
        }