/// <summary>
        /// Contrutor que já carrega as notas no RPS e gera o XML de Envio
        /// </summary>
        /// <param name="lNotas"></param>
        public belCarregaDadosRPS(List<belPesquisaNotas> lNotas, string sNumeroLote = "")
        {
            this.lNotas = lNotas;

            if (sNumeroLote != "")
            {
                bBuscaRetonro = true;
            }
            objLoteEnvio = new ReqEnvioLoteRPS();
            objLoteEnvio.cabec = CarregaCabecalho();
            objLoteEnvio.cabec.NumeroLote = sNumeroLote;
            objLoteEnvio.lote = new Lote();
            daoUtil objdaoUtil = new daoUtil();
            objLoteEnvio.lote.Id = "Lote:" + objdaoUtil.RetornaProximoValorGenerator("GEN_LOTE_NFES", 7);
            objLoteEnvio.lote.RPS = new List<LoteRPS>();
            Principal principal = new Principal("http://issdigital.campinas.sp.gov.br/WsNFe2/LoteRps.jws");
            //int inumero = 0;//Ultima nota enviada.
            //principal.dllConsultarSequencial(Convert.ToInt32(objLoteEnvio.cabec.CodCidade), objLoteEnvio.cabec.CPFCNPJRemetente, base.GetInscricaoMunicipal(), "99", ref inumero);
            foreach (belPesquisaNotas nota in lNotas)
            {
                objLoteEnvio.lote.RPS.Add(CarregaLote(nota.sCD_NFSEQ));
            }

            objLoteEnvio.cabec.QtdRPS = objLoteEnvio.lote.RPS.Count();
            objLoteEnvio.cabec.ValorTotalDeducoes = objLoteEnvio.lote.RPS.Sum(c => c.Deducoes.Deducao.Sum(x => x.ValorDeduzir));
            objLoteEnvio.cabec.ValorTotalServicos = objLoteEnvio.lote.RPS.Sum(c => c.Itens.Item.Sum(x => x.ValorTotal));
        }
 private void frmGerarNumeroCte_Load(object sender, EventArgs e)
 {
     try
     {               
         string sGenerator = "MANIFESTO_MDFE" + Acesso.CD_EMPRESA;
         daoUtil util = new daoUtil();
         if (!daoUtil.VerificaExistenciaGenerator(sGenerator))
         {
             daoUtil.CreateGenerator(sGenerator, 0);
         }
         txtNumeroUltNF.Text = objNumeroManifesto.BuscaUltimoNumeroConhecimento().PadLeft(9, '0');
         txtNumeroASerEmi.Text = (Convert.ToInt32(txtNumeroUltNF.Text) + 1).ToString().PadLeft(9, '0');
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 private void frmGerarNumeroCte_Load(object sender, EventArgs e)
 {
     try
     {
         daoNumeroCte objdaoGeraNumero = new daoNumeroCte();
         if (Acesso.NM_EMPRESA.ToUpper().Equals("SICUPIRA") || Acesso.NM_EMPRESA.ToUpper().Equals("TRANSLILO") || Acesso.NM_EMPRESA.ToUpper().Equals("GCA"))
         {
             string sGenerator = "CONHECIM_CTE" + Acesso.CD_EMPRESA;
             daoUtil util = new daoUtil();
             if (!daoUtil.VerificaExistenciaGenerator(sGenerator))
             {
                 daoUtil.CreateGenerator(sGenerator, 0);
             }
         }
         txtNumeroUltNF.Text = objdaoGeraNumero.BuscaUltimoNumeroConhecimento().PadLeft(6, '0');
         txtNumeroASerEmi.Text = (Convert.ToInt32(txtNumeroUltNF.Text) + 1).ToString().PadLeft(6, '0');
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
        private static dsNFSeCampinas CarregaDataSet(string sCD_NFSEQ, daoUtil dadosEmpresa, string sEnderPrestador, LoteRPS nota)
        {
            dsNFSeCampinas ds = new dsNFSeCampinas();
            dsNFSeCampinas.NotaRow row = ds.Nota.NewNotaRow();

            row.RazaoSocialPrestador = nota.RazaoSocialPrestador;
            row.NumeroRPS = nota.NumeroRPS;
            row.DataEmissaoRPS = nota.DataEmissaoRPS;
            row.CPFCNPJTomador = nota.CPFCNPJTomador;
            row.RazaoSocialTomador = nota.RazaoSocialTomador;
            row.TipoLogradouroTomador = nota.TipoLogradouroTomador.ToUpper();
            row.LogradouroTomador = nota.LogradouroTomador;
            row.NumeroEnderecoTomador = nota.NumeroEnderecoTomador;
            row.TipoBairroTomador = nota.TipoBairroTomador;
            row.CEPTomador = nota.CEPTomador;
            row.EmailTomador = nota.EmailTomador;
            row.CodigoAtividade = nota.CodigoAtividade;
            row.AliquotaAtividade = nota.AliquotaAtividade.ToString();

            switch (nota.TipoRecolhimento)
            {
                case "A": row.TipoRecolhimento = "A Recolher";
                    break;
                case "R": row.TipoRecolhimento = "Retido na fonte";
                    break;
            }
            row.MunicipioPrestacaoDescricao = nota.MunicipioPrestacaoDescricao;
            switch (nota.Tributacao)
            {
                case "C": row.Tributacao = "Isenta de ISS";
                    break;
                case "E": row.Tributacao = "Não Incidência no Município";
                    break;
                case "F": row.Tributacao = "Imune";
                    break;
                case "K": row.Tributacao = "Exigibilidd Susp.Dec.J/Proc.A";
                    break;
                case "N": row.Tributacao = "Não Tributável";
                    break;
                case "T": row.Tributacao = "Tributável";
                    break;
                case "G": row.Tributacao = "Tributável Fixo";
                    break;
                case "H": row.Tributacao = "Tributável S.N.";
                    break;
                case "M": row.Tributacao = "Micro Empreendedor Individual (MEI)";
                    break;
            }
            row.AliquotaPIS = nota.AliquotaPIS;
            row.AliquotaCOFINS = nota.AliquotaCOFINS;
            row.AliquotaINSS = nota.AliquotaINSS;
            row.AliquotaIR = nota.AliquotaIR;
            row.AliquotaCSLL = nota.AliquotaCSLL;

            row.ValorCOFINS = Convert.ToDecimal(nota.ValorCOFINS.ToString().Replace(".", ","));
            row.ValorCSLL = Convert.ToDecimal(nota.ValorCSLL.ToString().Replace(".", ","));
            row.ValorINSS = Convert.ToDecimal(nota.ValorINSS.ToString().Replace(".", ","));
            row.ValorIR = Convert.ToDecimal(nota.ValorIR.ToString().Replace(".", ","));
            row.ValorPIS = Convert.ToDecimal(nota.ValorPIS.ToString().Replace(".", ","));

            row.DescricaoRPS = nota.DescricaoRPS;
            row.F_ENDER_TOMADOR =
            row.F_RECOLHIMENTO =
            row.F_TRIBUTACAO =
            row.F_CD_VERIFICACAO = daoUtil.GetCodVerificacaoByCD_NFSEQ(sCD_NFSEQ);
            row.F_CNPJ_PRESTADOR = Acesso.CNPJ_EMPRESA;
            row.F_ENDERECO_PRESTADOR = sEnderPrestador;
            row.F_MUNICIPIO_PRESTADOR = Acesso.CIDADE_EMPRESA;
            row.F_UF_PRESTADOR = daoUtil.GetUfByNome(nota.CidadeTomadorDescricao);
            row.F_EMAIL_PRESTADOR = dadosEmpresa.EmailEmpresa;
            //row.F_UF_TOMADOR = daoUtil.GetUfByNome(nota.CidadeTomadorDescricao);
            row.F_UF_TOMADOR = daoUtil.GetUfTomador(nota.CD_NFSEQ);
            row.F_MES_RECOLHIMENTO = nota.DataEmissaoRPS.ToString("MM/yyyy");
            if (nota.Deducoes.Deducao.Count() > 0)
            {
                row.F_VALOR_DECUCAO = nota.Deducoes.Deducao.Sum(c => c.ValorDeduzir);
            }
            else
            {
                row.F_VALOR_DECUCAO = 0;
            }
            row.CidadeTomadorDescricao = nota.CidadeTomadorDescricao;
            row.InscricaoPrestador = nota.InscricaoMunicipalPrestador;

            row.Duplicatas = daoCobr.BuscaFatToImpressaoNFSE_DSF(nota.CD_NFSEQ);

            ds.Nota.AddNotaRow(row);

            dsNFSeCampinas.ItensRow rowItem;
            foreach (LoteRPSItensItem item in nota.Itens.Item)
            {
                rowItem = ds.Itens.NewItensRow();
                rowItem.DiscriminacaoServico = item.DiscriminacaoServico;
                rowItem.Quantidade = item.Quantidade;
                rowItem.ValorTotal = item.ValorTotal;
                rowItem.ValorUnitario = item.ValorUnitario;
                rowItem.NumeroRPS = nota.NumeroRPS;
                ds.Itens.AddItensRow(rowItem);
            }



            return ds;
        }
        private void btnVisualizar_Click(object sender, EventArgs e)
        {
            try
            {
                if (belPesq.lResultPesquisa != null)
                {
                    List<belimpressao> sListImpressao = new List<belimpressao>();
                    belimpressao obj;

                    List<belPesquisaNotas> objSelecionadas = belPesq.lResultPesquisa.Where(c => c.bSeleciona).ToList<belPesquisaNotas>();
                    List<belPesquisaNotas> objSelect = objSelecionadas.Where(c =>
                                                                       c.bEnviado == true ||
                                                                       c.bCancelado == true).ToList<belPesquisaNotas>();
                    foreach (belPesquisaNotas item in objSelect)
                    {
                        obj = new belimpressao();
                        obj.sNfSeq = item.sCD_NFSEQ;
                        obj.sNota = item.scd_numero_nfse;
                        obj.bCanc = item.bCancelado;
                        obj.dtEnvio = item.dDT_EMI;
                        sListImpressao.Add(obj);
                    }

                    if (sListImpressao.Count > 0)
                    {
                        if (Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.DSF)
                        {
                            if (sListImpressao.Count > 1)
                            {
                                throw new Exception("Imprima uma nota de cada vez !");
                            }
                            else
                            {

                                daoUtil dadosEmpresa = new daoUtil();
                                dadosEmpresa.SetDadosEmpresa();

                                string sEnderPrestador = string.Format("{0}, - BAIRRO: {1} ",
                                    dadosEmpresa.RuaEmpresa, dadosEmpresa.BairroEmpresa);
                                string sRPS = daoUtil.GetNumRPSbyCD_NFSEQ(sListImpressao.FirstOrDefault().sNfSeq);

                                string sPathXml = "";

                                if (sListImpressao.FirstOrDefault().bCanc)
                                {
                                    sPathXml = belCancelamentoDSF.GetFilePathMonthServico(false, sListImpressao.FirstOrDefault().sNota, sListImpressao.FirstOrDefault().dtEnvio);
                                }
                                else
                                {
                                    sPathXml = belCancelamentoDSF.GetFilePathMonthServico(true, sListImpressao.FirstOrDefault().sNota, sListImpressao.FirstOrDefault().dtEnvio);
                                }
                                if (!Directory.Exists(Pastas.ENVIADOS + "PDF\\"))
                                {
                                    Directory.CreateDirectory(Pastas.ENVIADOS + "PDF\\");
                                }

                                string sPathPDFdsf = "";
                                if (sListImpressao.FirstOrDefault().bCanc)
                                {
                                    sPathPDFdsf = Pastas.ENVIADOS + "PDF\\" + sListImpressao.FirstOrDefault().sNota + "_canc.pdf"; //belCancelamentoDSF
                                }
                                else
                                {
                                    sPathPDFdsf = Pastas.ENVIADOS + "PDF\\" + sListImpressao.FirstOrDefault().sNota + ".pdf";
                                }

                                LoteRPS nota = SerializeClassToXml.DeserializeClasse<LoteRPS>(sPathXml);
                                nota.CD_NFSEQ = sListImpressao.FirstOrDefault().sNfSeq;

                                nota.NumeroRPS = sListImpressao.FirstOrDefault().sNota;
                                foreach (LoteRPSItensItem item in nota.Itens.Item)
                                {
                                    item.NumeroRPS = nota.NumeroRPS;
                                }
                                List<LoteRPS> lNotas = new List<LoteRPS>();
                                lNotas.Add(nota);

                                ReportDocument rpt = new ReportDocument();
                                rpt.Load(Util.GetPathRelatorio("rptNFSeCamp.rpt"));


                                dsNFSeCampinas ds = CarregaDataSet(sListImpressao.FirstOrDefault().sNfSeq, dadosEmpresa, sEnderPrestador, nota);
                                rpt.SetDataSource(ds);
                                rpt.DataDefinition.FormulaFields["F_BAIRRO_TOMADOR"].Text = "\"" + nota.BairroTomador + "\"";
                                decimal vl_iss = Math.Round(nota.Itens.Item.Sum(c => c.ValorTotal) * (Convert.ToDecimal(nota.AliquotaAtividade.Replace('.', ',')) / 100), 2);
                                rpt.DataDefinition.FormulaFields["F_VALOR_ISS"].Text = "\"" + "R$    " + vl_iss.ToString().Replace('.', ',') + "\"";





                                //try { rpt.SetParameterValue("PathImage", Acesso.LOGOTIPO); }
                                //catch (System.Exception ex) { };

                                if (objSelect.FirstOrDefault().bCancelado)
                                {
                                    string sMotivoCanc = daoUtil.GetMOTIVO_CANC(sListImpressao.FirstOrDefault().sNfSeq);
                                    rpt.DataDefinition.FormulaFields["F_MOTIVO_CANC"].Text = "\"" + sMotivoCanc + "\"";
                                }


                                rpt.Refresh();


                                if (Convert.ToBoolean(Acesso.EMAIL_AUTOMATICO))
                                {
                                    if (KryptonMessageBox.Show("Deseja enviar email da Nota para o Tomador ?", Mensagens.MSG_Confirmacao, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                                    {
                                        if (Acesso.VerificaDadosEmail())
                                        {
                                            List<belEmail> objlbelEmail = new List<belEmail>();
                                            if (File.Exists(sPathPDFdsf))
                                            {
                                                try
                                                {
                                                    File.Delete(sPathPDFdsf);
                                                }
                                                catch (Exception) { }
                                            }

                                            if (!File.Exists(sPathPDFdsf))
                                            {
                                                Util.ExportPDF(rpt, sPathPDFdsf);
                                            }
                                            for (int i = 0; i < sListImpressao.Count; i++)
                                            {
                                                belEmail objemail = new belEmail(sPathXml, sPathPDFdsf, sListImpressao.FirstOrDefault().sNfSeq, "", "", sListImpressao[i].sVerificacao);
                                                objlbelEmail.Add(objemail);
                                            }
                                            if (objlbelEmail.Count > 0)
                                            {
                                                frmEmail objfrmEmail = new frmEmail(objlbelEmail, belEmail.TipoEmail.NF_ServicoDSF);
                                                objfrmEmail.ShowDialog();
                                            }
                                        }
                                        else
                                        {
                                            KryptonMessageBox.Show("Campos para o envio de e-mail automático não estão preenchidos corretamente!", Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                        }
                                    }
                                }



                                frmRelatorio frm = new frmRelatorio(rpt, "Impressão de Relatório de Nota Fiscal Eletrônica de Serviço");
                                frm.Show();
                            }
                        }
                        else if (Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.SUSESU)
                        {
                            bel.NFes.Susesu.belNFesSusesu objNfe;

                            List<belNFesSusesu> lNfe = new List<belNFesSusesu>();
                            foreach (belPesquisaNotas nota in objSelect)
                            {
                                objNfe = new belNFesSusesu();
                                string sCHAVE = nota.sCHAVENFE;
                                objNfe.DATA_EMISSAO = objSelect.FirstOrDefault().dDT_EMI.ToString();
                                objNfe.NUMERO_NOTA = Convert.ToInt32(nota.sCD_NOTAFIS);
                                objNfe = belSerializeToXml.DeserializeClasse<belNFesSusesu>(objNfe.GetsFilePathServico(true));
                                objNfe.sCHAVE = sCHAVE;
                                lNfe.Add(objNfe);
                            }

                            ReportDocument rpt = new ReportDocument();
                            rpt.Load(Util.GetPathRelatorio("rptNfesSusesu.rpt"));

                            rpt.SetDataSource(lNfe);

                            daoUtil dadosEmpresa = new daoUtil();
                            dadosEmpresa.SetDadosEmpresa();
                            string sNomeCidade = lNfe.FirstOrDefault().BuscaNomeCidade(Util.TiraSimbolo(lNfe.FirstOrDefault().TOMADOR_MUNICIPIO.ToString()));

                            rpt.DataDefinition.FormulaFields["NM_MUNICIPIO_TOMADOR"].Text = "\"" + sNomeCidade + "\"";
                            rpt.DataDefinition.FormulaFields["NomeEmpresa"].Text = "\"" + Acesso.NM_RAZAOSOCIAL + "\"";
                            rpt.DataDefinition.FormulaFields["DocEmpresa"].Text = "\"" + Acesso.CNPJ_EMPRESA + "\"";
                            rpt.DataDefinition.FormulaFields["IMEmpresa"].Text = "\"" + dadosEmpresa.ImEmpresa + "\"";
                            rpt.DataDefinition.FormulaFields["IEEmpresa"].Text = "\"" + dadosEmpresa.IeEmpresa + "\"";
                            rpt.DataDefinition.FormulaFields["FoneEmpresa"].Text = "\"" + dadosEmpresa.FoneEmpresa + "\"";
                            rpt.DataDefinition.FormulaFields["EnderecoEmpresa"].Text = "\"" + dadosEmpresa.RuaEmpresa + "\"";
                            rpt.DataDefinition.FormulaFields["BairroEmpresa"].Text = "\"" + dadosEmpresa.BairroEmpresa + "\"";
                            rpt.DataDefinition.FormulaFields["CidadeEmpresa"].Text = "\"" + Acesso.CIDADE_EMPRESA + " - " + Acesso.xUF + "\"";
                            rpt.DataDefinition.FormulaFields["EmailEmpresa"].Text = "\"" + dadosEmpresa.EmailEmpresa + "\"";

                            rpt.Refresh();
                            try { rpt.SetParameterValue("PathImage", Acesso.LOGOTIPO); }
                            catch (System.Exception) { };

                            frmRelatorio frm = new frmRelatorio(rpt, "Impressão de Relatório de Nota Fiscal Eletrônica de Serviço");
                            frm.Show();

                        }
                        else
                        {
                            belimpressao objbelimpressao = new belimpressao();
                            sListImpressao = objbelimpressao.BuscaDadosParaImpressao(sListImpressao);


                            if (KryptonMessageBox.Show("Deseja enviar email da Nota para o Tomador ?", Mensagens.MSG_Confirmacao, MessageBoxButtons.YesNo, MessageBoxIcon.Question) == System.Windows.Forms.DialogResult.Yes)
                            {
                                if (Convert.ToBoolean(Acesso.EMAIL_AUTOMATICO))
                                {
                                    if (Acesso.VerificaDadosEmail())
                                    {
                                        List<belEmail> objlbelEmail = new List<belEmail>();
                                        for (int i = 0; i < sListImpressao.Count; i++)
                                        {
                                            belEmail objemail = new belEmail("", "", sListImpressao[i].sNfSeq, sListImpressao[i].sNota, "", sListImpressao[i].sVerificacao);
                                            objlbelEmail.Add(objemail);
                                        }
                                        if (objlbelEmail.Count > 0)
                                        {
                                            frmEmail objfrmEmail = new frmEmail(objlbelEmail, belEmail.TipoEmail.NF_Servico);
                                            objfrmEmail.ShowDialog();
                                        }
                                    }
                                    else
                                    {
                                        KryptonMessageBox.Show("Campos para o envio de e-mail automático não estão preenchidos corretamente!", Mensagens.CHeader, MessageBoxButtons.OK, MessageBoxIcon.Information);
                                    }
                                }
                            }

                            if (Acesso.tipoWsNfse == Acesso.TP_WS_NFSE.GINFES)
                            {

                                for (int i = 0; i < sListImpressao.Count; i++)
                                {
                                    System.Diagnostics.Process.Start("iexplore", "visualizar.ginfes" + (Acesso.TP_AMB_SERV == 2 ? "h" : "") + ".com.br/report/consultarNota?__report=nfs_ver4&cdVerificacao=" + sListImpressao[i].sVerificacao + "&numNota=" + sListImpressao[i].sNota);
                                }
                            }
                            else
                            {
                                //https://spe.riodasostras.rj.gov.br/nfse/nfse.aspx?ccm=99999999&nf=999999999&cod=XXXXXXXX

                                for (int i = 0; i < sListImpressao.Count; i++)
                                {
                                    System.Diagnostics.Process.Start("iexplore", string.Format("https://spe.riodasostras.rj.gov.br/nfse/nfse.aspx?ccm=2747&nf={0}&cod={1}", sListImpressao[i].sNota, sListImpressao[i].sVerificacao.Replace("-", "")));
                                }
                            }
                        }
                    }
                    else
                    {
                        KryptonMessageBox.Show("Nenhuma nota Válida foi Selecionada", Mensagens.MSG_Aviso, MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception ex)
            {
                new HLPexception(ex);
            }
        }
Example #6
0
        public tcLoteRps BuscaDadosNFes(List<belPesquisaNotas> objListaNotas)
        {

            try
            {
                tcLoteRps objLoteRps = new tcLoteRps();

                objLoteRps.Rps = new List<TcRps>();
                foreach (belPesquisaNotas Nota in objListaNotas)
                {
                    TcRps objTcRps = new TcRps();

                    #region IdentificacaoRps - TcIdentificacaoRps

                    beltcIdentificacaoRps objbeltcIdentificacaoRps = new beltcIdentificacaoRps();
                    objTcRps.InfRps = new TcInfRps();

                    objTcRps.InfRps.DataEmissao = daoUtil.GetDateServidor();
                    objTcRps.InfRps.Status = 1;//Normal;

                    DataTable dt = BuscaDadosNota(Nota.sCD_NFSEQ);
                    foreach (DataRow dr in dt.Rows)
                    {
                        objTcRps.InfRps.NaturezaOperacao = Convert.ToInt16(dr["cd_natureza_oper_nfse"].ToString());
                        objTcRps.InfRps.OptanteSimplesNacional = (dr["st_simples"].ToString().Equals("S") ? 1 : 2);
                        objTcRps.InfRps.IncentivadorCultural = (dr["st_insentivador_cultural"].ToString().Equals("S") ? 1 : 2);
                        if (objTcRps.InfRps.OptanteSimplesNacional == 1)
                        {
                            objTcRps.InfRps.RegimeEspecialTributacao = Convert.ToInt16(dr["RegimeEspecialTributacao"].ToString());
                        }
                        else
                        {
                            objTcRps.InfRps.RegimeEspecialTributacao = 0;
                        }
                    }

                    objTcRps.InfRps.IdentificacaoRps = objbeltcIdentificacaoRps.BuscatcIdentificacaoRps(Nota.sCD_NFSEQ);

                    #endregion

                    #region   Servico - TcDadosServico

                    belServico objbelServico = new belServico();
                    objTcRps.InfRps.Servico = objbelServico.RetornaDadosServico(Nota.sCD_NFSEQ, objTcRps.InfRps.NaturezaOperacao);

                    #endregion

                    #region   Prestador - tcIdentificacaoPrestador

                    belPrestador objbelPrestador = new belPrestador();
                    objTcRps.InfRps.Prestador = objbelPrestador.RettcIdentificacaoPrestador(Nota.sCD_NFSEQ);
                    objLoteRps.Cnpj = objTcRps.InfRps.Prestador.Cnpj;
                    objLoteRps.InscricaoMunicipal = objTcRps.InfRps.Prestador.InscricaoMunicipal;

                    #endregion

                    #region Tomador - TcDadosTomador

                    belTomador objbelTomador = new belTomador();
                    objTcRps.InfRps.Tomador = objbelTomador.RettcDadosTomador(Nota.sCD_NFSEQ);

                    #endregion

                    #region  ConstrucaoCivil - TcDadosContrucaoCivil - Tratado na Visualização da Nota

                    if (Acesso.NM_EMPRESA.Equals("AENGE"))
                    {
                        belConstrucaoCivil objbelConstrucaoCivil = new belConstrucaoCivil();
                        objTcRps.InfRps.ConstrucaoCivil = objbelConstrucaoCivil.RettcDadosConstrucaoCivil(Nota.sCD_NFSEQ);
                    }
                    #endregion

                    objLoteRps.Rps.Add(objTcRps);
                }
                daoUtil objdaoUtil = new daoUtil();
                objLoteRps.NumeroLote = objdaoUtil.RetornaProximoValorGenerator("GEN_LOTE_NFES", 15);
                objLoteRps.QuantidadeRps = objLoteRps.Rps.Count;

                return objLoteRps;
            }
            catch (Exception ex)
            {
                throw ex;
            }


        }