Beispiel #1
0
        protected override bool SetValid()
        {
            bool      flag    = RegisterManager.CheckRegFile("DKST");
            FpManager manager = new FpManager();

            return((((int)TaxCardFactory.CreateTaxCard().TaxMode == 2) && manager.IsSWDK()) & flag);
        }
 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);
 }
Beispiel #3
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);
        }
 public SqdInfoSelect()
 {
     this.Initialize();
     this.panel3.Visible      = false;
     this.NextBtn.Enabled     = false;
     this.BuyerRB.Checked     = true;
     this.YDKRB.Checked       = true;
     this.InvCodeEdit.Enabled = false;
     this.InvNoEdt.Enabled    = false;
     if (!TaxCardFactory.CreateTaxCard().QYLX.ISZYFP)
     {
         this.SellerRB.Checked   = false;
         this.KpErRefRB.Checked  = false;
         this.KpErSendRB.Checked = false;
         this.SellerRB.Enabled   = false;
         this.KpErRefRB.Enabled  = false;
         this.KpErSendRB.Enabled = false;
     }
     this.InvCodeEdit.RegexText = "^[0-9]{0,10}$";
     this.InvNoEdt.RegexText    = "^[0-9]{0,8}$";
     if (this.VersionName == "税务代开")
     {
         this.InvKindCombo.DataSource = new string[] { "增值税专用发票" };
     }
     else
     {
         this.InvKindCombo.DataSource = new string[] { "增值税专用发票" };
     }
     this.InvKindCombo.DropDownStyle = ComboBoxStyle.DropDownList;
 }
Beispiel #5
0
        public string[] GetCurrent(FPLX fplx)
        {
            string str = "";

            try
            {
                TaxCard    card           = TaxCardFactory.CreateTaxCard();
                int        num            = int.Parse(Enum.Format(typeof(FPLX), fplx, "d"));
                InvCodeNum currentInvCode = card.GetCurrentInvCode(fplx);
                if ((currentInvCode.InvTypeCode == null) || (currentInvCode.InvNum == null))
                {
                    str = card.get_ErrCode();
                    if (str.StartsWith("TCD_768") || str.StartsWith("TCD_769"))
                    {
                        FormMain.CallUpload();
                    }
                    return(null);
                }
                if (currentInvCode.InvTypeCode.Equals("0000000000"))
                {
                    str = "INP-242104";
                    return(null);
                }
                str = "000000";
                return(new string[] { currentInvCode.InvTypeCode, currentInvCode.InvNum });
            }
            catch (Exception exception)
            {
                this.log.Error("读取当前发票代码号码时异常:" + exception.ToString());
                str = "9999";
                return(null);
            }
        }
 protected override void RunCommand()
 {
     try
     {
         bMainExit = false;
         if ((fpcx != null) && fpcx.HasShow())
         {
             fpcx.Dispose();
             fpcx.Close();
             fpcx = null;
         }
         SelectMonth.IsChaxun = true;
         DateTime cardClock = TaxCardFactory.CreateTaxCard().GetCardClock();
         fpcx         = base.ShowForm <FaPiaoChaXunShow>() as FaPiaoChaXunShow;
         fpcx.TabText = "选择发票号码查询";
         fpcx.Text    = "选择发票号码查询";
         fpcx.Month   = cardClock.Month;
         fpcx.Year    = cardClock.Year;
         fpcx.Edit(Aisino.Fwkp.Fpkj.Form.FPCX.FaPiaoChaXun.EditFPCX.ChaXun);
     }
     catch (Exception exception)
     {
         this.loger.Error(exception.ToString());
     }
 }
Beispiel #7
0
 private void SelectFPJRow()
 {
     if (this.FPJ.SelectedRows.Count > 0)
     {
         DataGridViewRow row = this.FPJ.SelectedRows[0];
         fpdmhm[0] = row.Cells["LBDM"].Value.ToString();
         fpdmhm[1] = row.Cells["QSHM"].Value.ToString();
         TaxCard card = TaxCardFactory.CreateTaxCard();
         string  str  = string.Empty;
         if (this.mfplx == 0x29)
         {
             str = card.SetInvVols(0x29, fpdmhm[0], fpdmhm[1]);
         }
         else if (this.mfplx == 2)
         {
             str = card.SetInvVols(2, fpdmhm[0], fpdmhm[1]);
         }
         if (ToolUtil.GetReturnErrCode(str) != 0)
         {
             MessageManager.ShowMsgBox(str);
         }
         base.DialogResult = DialogResult.OK;
     }
     else
     {
         MessageManager.ShowMsgBox("至少选择一卷发票");
     }
 }
 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);
 }
 protected override void RunCommand()
 {
     if (TaxCardFactory.CreateTaxCard().get_ECardType() == 3)
     {
         ChaoshuiForm form = new ChaoshuiForm {
             StartPosition = FormStartPosition.CenterScreen,
             ShowInTaskbar = true
         };
         if (form.ShowTips())
         {
             form.ShowDialog();
         }
     }
     else
     {
         ChaoshuiForm form2 = new ChaoshuiForm {
             StartPosition = FormStartPosition.CenterScreen,
             ShowInTaskbar = true
         };
         if (form2.ShowTips())
         {
             form2.ShowDialog();
         }
     }
 }
Beispiel #10
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);
 }
Beispiel #11
0
        public static bool IsDK()
        {
            string taxCode     = TaxCardFactory.CreateTaxCard().TaxCode;
            ushort companyType = TaxCardFactory.CreateTaxCard().StateInfo.CompanyType;

            return((!string.IsNullOrEmpty(taxCode) && (taxCode.Length == 15)) && (taxCode.Substring(8, 2) == "DK"));
        }
 protected override object[] doService(object[] param)
 {
     object[] objArray = new object[] { false };
     if (param.Length == 1)
     {
         FPLX        fplx = Invoice.ParseFPLX(param[0].ToString());
         InvoiceType type = (InvoiceType)2;
         TaxCard     card = TaxCardFactory.CreateTaxCard();
         if (((int)fplx != 0x29) && ((int)fplx != 2))
         {
             return(objArray);
         }
         if ((int)fplx == 0x29)
         {
             type = (InvoiceType)0x29;
         }
         card.GetCurrentInvCode(type);
         if (card.RetCode != 0)
         {
             MessageManager.ShowMsgBox(card.ErrCode);
             objArray[0] = false;
             return(objArray);
         }
         if (new JSFPJSelect(fplx).ShowDialog() == DialogResult.OK)
         {
             objArray[0] = true;
         }
     }
     return(objArray);
 }
Beispiel #13
0
 private void btnOK2_Click(object sender, EventArgs e)
 {
     try
     {
         PropValue.IsJiaoYan = this.checkBox_JiaoYan.Checked;
         int    result = 0;
         int    num2   = 0;
         string s      = "0";
         string str2   = "";
         string str3   = this.comboBoxYF.Text.Trim();
         if (str3 != "0")
         {
             string[] strArray = str3.Split(new char[] { '-' });
             if (strArray.Length == 2)
             {
                 str2 = strArray[0].Trim();
                 s    = strArray[1].Trim();
             }
         }
         bool   flag    = int.TryParse(s, out result);
         bool   flag2   = int.TryParse(str2, out num2);
         string dJmonth = result.ToString();
         string dJYear  = "";
         if (num2 != 0)
         {
             dJYear = num2.ToString();
         }
         string dJtype = this.comboBoxDJZL.SelectedValue.ToString();
         switch (dJtype)
         {
         case "a":
         case "c":
         case "s":
         {
             TaxCard taxCard = TaxCardFactory.CreateTaxCard();
             if (!this.CanXTInv(taxCard))
             {
                 MessageManager.ShowMsgBox("INP-242132");
                 return;
             }
             break;
         }
         }
         AisinoDataSet set = new DJXGdal().QueryXSDJ(dJYear, dJmonth, dJtype);
         if ((dJmonth != "0") && (set.get_Data().Rows.Count == 0))
         {
             MessageManager.ShowMsgBox("没有符合条件的数据");
         }
         else
         {
             this.billBL.XGDJZL = dJtype;
             new DJXG(dJYear, dJmonth, dJtype, this.checkBox_JiaoYan.Checked).ShowDialog();
             base.Close();
         }
     }
     catch (Exception exception)
     {
         HandleException.HandleError(exception);
     }
 }
 public HySqdInfoSelect()
 {
     this.Initialize();
     this.panel3.Visible      = false;
     this.BtnNext.Enabled     = false;
     this.DraweeRB.Checked    = true;
     this.YDKRB.Checked       = true;
     this.InvCodeEdit.Enabled = false;
     this.InvNumEdit.Enabled  = false;
     if (!TaxCardFactory.CreateTaxCard().QYLX.ISHY)
     {
         this.CarrierRB.Checked = false;
         this.Carrier_MistakeRejectRB.Checked     = false;
         this.Carrier_MistakeNonDeliverRB.Checked = false;
         this.CarrierRB.Enabled = false;
         this.Carrier_MistakeRejectRB.Enabled     = false;
         this.Carrier_MistakeNonDeliverRB.Enabled = false;
     }
     this.InvCodeEdit.RegexText = ("^[0-9]{0,10}$");
     this.InvNumEdit.RegexText  = ("^[0-9]{0,8}$");
     if (this.VersionName == "税务代开")
     {
         this.InvKindCombo.DataSource = new string[] { "货物运输业增值税专用发票" };
     }
     else
     {
         this.InvKindCombo.DataSource = new string[] { "货物运输业增值税专用发票" };
     }
     this.InvKindCombo.DropDownStyle = ComboBoxStyle.DropDownList;
 }
Beispiel #15
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();
                }
            }
        }
Beispiel #16
0
 private void SelectFPJRow()
 {
     if (this.FPJ.SelectedRows.Count > 0)
     {
         DataGridViewRow row = this.FPJ.SelectedRows[0];
         fpdmhm[0] = row.Cells["LBDM"].Value.ToString();
         fpdmhm[1] = row.Cells["QSHM"].Value.ToString();
         int num = int.Parse(row.Cells["FPZS"].Value.ToString());
         endnum = (int.Parse(fpdmhm[1]) + num) - 1;
         TaxCard card = TaxCardFactory.CreateTaxCard();
         string  str  = string.Empty;
         if ((int)this.mfplx == 0x29)
         {
             str = card.SetInvVols((InvoiceType)0x29, fpdmhm[0], fpdmhm[1]);
         }
         else if ((int)this.mfplx == 2)
         {
             str = card.SetInvVols((InvoiceType)2, fpdmhm[0], fpdmhm[1]);
         }
         //逻辑修改
         if (!InternetWare.Config.Constants.IsTest)
         {
             if (ToolUtil.GetReturnErrCode(str) != 0)
             {
                 MessageManager.ShowMsgBox(str);
             }
         }
         base.DialogResult = DialogResult.OK;
     }
     else
     {
         MessageManager.ShowMsgBox("至少选择一卷发票");
     }
 }
Beispiel #17
0
        public DataTable AppendByKey(string KeyWord, int TopNo, bool isSPBMSel)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

            dictionary.Add("key", "%" + KeyWord + "%");
            dictionary.Add("TopNo", TopNo);
            TaxCard card = TaxCardFactory.CreateTaxCard();

            if (card.QYLX.ISDXQY && isSPBMSel)
            {
                dictionary.Add("DXQY", "true");
            }
            else
            {
                dictionary.Add("DXQY", "false");
            }
            if (card.QYLX.ISXT)
            {
                dictionary.Add("XTQY", "true");
            }
            else
            {
                dictionary.Add("XTQY", "false");
            }
            DataTable table = this.baseDAO.querySQLDataTable("aisino.Fwkp.Bmgl.BMSPFL.SPFLqueryKeyAppend", dictionary);

            if (KeyWord.Trim().Length == 0)
            {
                table.Rows.Clear();
            }
            return(table);
        }
Beispiel #18
0
        public bool CanUseThisSPFLBM(string bm, bool isSPBMSel, bool isXTSP)
        {
            Dictionary <string, object> dictionary = new Dictionary <string, object>();

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

            if (card.QYLX.ISDXQY && isSPBMSel)
            {
                dictionary.Add("DXQY", 1);
            }
            else
            {
                dictionary.Add("DXQY", 0);
            }
            if (card.QYLX.ISXT)
            {
                dictionary.Add("XTQY", 1);
            }
            else
            {
                dictionary.Add("XTQY", 0);
            }
            dictionary.Add("XTSP", isXTSP ? 1 : 0);
            return(this.baseDAO.querySQLDataTable("aisino.Fwkp.Bmgl.BMSPFL.CanUseThisSPFLBM", dictionary).Rows.Count >= 1);
        }
Beispiel #19
0
        protected override void RunCommand()
        {
            TaxCard      taxCard = TaxCardFactory.CreateTaxCard();
            InvSplitPara para    = new InvSplitPara();

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

            if (para.ShowSetForm && flag)
            {
                GenerateInvSetForm form2 = new GenerateInvSetForm(InvType.Common)
                {
                    NCPBZ = 1
                };
                form2.ShowDialog();
            }
            else
            {
                GenerateFP efp  = new GenerateFP(InvType.Common, 1);
                string     code = "";
                if (!efp.CanInvoice(2, out code))
                {
                    MessageManager.ShowMsgBox(code);
                }
                else if (!this.CanXTInv(taxCard))
                {
                    MessageManager.ShowMsgBox("INP-242132");
                }
                else
                {
                    efp.ShowDialog();
                }
            }
        }
Beispiel #20
0
 protected override void RunCommand()
 {
     try
     {
         GC.Collect();
         if ((fpzf == null) || !fpzf.HasShow())
         {
             FaPiaoZuoFei_YiKai.CardClock = TaxCardFactory.CreateTaxCard().GetCardClock();
             Dictionary <string, object> condition = new Dictionary <string, object>();
             string data = FaPiaoZuoFei_YiKai.CardClock.ToString("yyyyMM");
             condition.Add("Date", Tool.ObjectToInt(data));
             if (this.xxfpChaXunBll.SelectYiKaiZuoFeiFpCount(condition) == 0)
             {
                 MessageManager.ShowMsgBox("FPCX-000021");
             }
             else
             {
                 DockForm form = base.ShowForm <FaPiaoZuoFei_YiKai>();
                 if (form != null)
                 {
                     fpzf         = form as FaPiaoZuoFei_YiKai;
                     fpzf.Visible = false;
                     fpzf.TabText = "选择发票号码作废";
                     fpzf.Text    = "选择发票号码作废";
                     fpzf.Edit(Aisino.Fwkp.Fpkj.Form.FPCX.FaPiaoChaXun.EditFPCX.ZuoFei);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.loger.Error(exception.Message);
     }
 }
Beispiel #21
0
 private static bool CreateXML()
 {
     try
     {
         XmlDocument document = new XmlDocument();
         string      path     = m_strConfigPath.Remove(m_strConfigPath.LastIndexOf(@"\"));
         if (!Directory.Exists(path))
         {
             Directory.CreateDirectory(path);
         }
         XmlDeclaration newChild = document.CreateXmlDeclaration("1.0", "utf-8", null);
         document.AppendChild(newChild);
         XmlElement element = document.CreateElement("root");
         document.AppendChild(element);
         XmlNode node = document.CreateNode("element", "kzyf", "");
         node.InnerText = TaxCardFactory.CreateTaxCard().get_CardEffectDate();
         element.AppendChild(node);
         document.Save(m_strConfigPath);
         return(true);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Beispiel #22
0
        protected override bool SetValid()
        {
            TaxCard card = TaxCardFactory.CreateTaxCard();
            string  str  = PropertyUtil.GetValue("HandMade", "0");

            return((((int)card.TaxMode == 2) && card.QYLX.ISZYFP) && (str == "0"));
        }
Beispiel #23
0
 static RegisterManager()
 {
     FilterTaxCode = null;
     taxCard_0     = TaxCardFactory.CreateTaxCard();
     ilog_0        = LogUtil.GetLogger <RegisterManager>();
     dictionary_0  = new Dictionary <string, RegFileInfo>();
     errCode       = "0000";
 }
Beispiel #24
0
 public static bool IsYM()
 {
     if (TaxCardFactory.CreateTaxCard().GetExtandParams("FLBMFlag") != "FLBM")
     {
         return(false);
     }
     return(true);
 }
Beispiel #25
0
 public DJCF()
 {
     this.Initialize();
     if (TaxCardFactory.CreateTaxCard().get_StateInfo().CompanyType == 0)
     {
         this.checkBox2.Visible = false;
     }
 }
        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 #27
0
        protected override bool SetValid()
        {
            TaxCard   card1   = TaxCardFactory.CreateTaxCard();
            bool      iSJDC   = card1.QYLX.ISJDC;
            FpManager manager = new FpManager();
            string    str     = PropertyUtil.GetValue("HandMade", "0");

            return(((((int)card1.TaxMode == 2) & iSJDC) && !manager.IsSWDK()) && (str == "0"));
        }
        protected override bool SetValid()
        {
            TaxCard   card    = TaxCardFactory.CreateTaxCard();
            bool      flag    = card.QYLX.ISPTFP && card.QYLX.ISNCPSG;
            FpManager manager = new FpManager();
            string    str     = PropertyUtil.GetValue("HandMade", "0");

            return(((((int)card.TaxMode == 2) & flag) && !manager.IsSWDK()) && (str == "0"));
        }
Beispiel #29
0
 private bool _Check(GenerateFP generateFP)
 {
     TaxCard taxCard = TaxCardFactory.CreateTaxCard();
     if (!this.CanXTInv(taxCard))
     {
         MessageManager.ShowMsgBox("INP-242132");
         return false;
     }
     return true;
 }
Beispiel #30
0
        public static bool isSPBMVersion()
        {
            bool flag = false;

            if (TaxCardFactory.CreateTaxCard().GetExtandParams("FLBMFlag") == "FLBM")
            {
                flag = true;
            }
            return(flag);
        }