Exemplo n.º 1
0
        List <NTLoteBE> CarregaDados(NTLoteBE obj)
        {
            List <NTLoteBE> result = new List <NTLoteBE>();
            SqlDataReader   dr     = new BaseDados().RetornaDataReader(this.procedure, Globais.Helper.TipoSql.Select.ToString(), obj);

            if (dr.HasRows)
            {
                while (dr.Read())
                {
                    NTLoteBE item = new NTLoteBE();

                    item.lote_id = DBNull.Value.Equals(dr["lote_id "]) ? 0 : Convert.ToInt32(dr["lote_id "]);

                    item.log_id        = DBNull.Value.Equals(dr["log_id"]) ? 0 : Convert.ToInt32(dr["log_id"]);
                    item.user_id       = DBNull.Value.Equals(dr["user_id"]) ? 0 : Convert.ToInt32(dr["user_id"]);
                    item.log_cadastro  = Convert.ToDateTime(dr["log_cadastro"]);
                    item.log_alteracao = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_alteracao"]);
                    item.log_exclusao  = DBNull.Value.Equals(dr["user_id"]) ? default(DateTime) : Convert.ToDateTime(dr["log_exclusao"]);
                    item.log_ativo     = DBNull.Value.Equals(dr["log_ativo"]) ? false : Convert.ToBoolean(dr["log_exclusao"]);

                    item.conf_id      = DBNull.Value.Equals(dr["conf_id "]) ? 0 : Convert.ToInt32(dr["conf_id "]);
                    item.lote_serie   = dr["lote_serie"].ToString();
                    item.lote_modulo  = dr["lote_modulo"].ToString();
                    item.lote_emissao = DBNull.Value.Equals(dr["lote_emissao"]) ? default(DateTime) : Convert.ToDateTime(dr["lote_emissao"]);

                    result.Add(item);
                }
                dr.Close();
            }
            return(result);
        }
Exemplo n.º 2
0
 public string GerarArquivoXML(NTLoteBE obj)
 {
     this.CarregaXMCabecalho(obj.Notas.Count);
     this.CarregaXMLRPSServico(obj);
     //this.CarregaXML();
     this.SalvarXML();
     return(fileXml);;
 }
Exemplo n.º 3
0
        public bool UpdateXmlConsulta(NTLoteBE obj)
        {
            var retorno = ExecutaItem("altUrlCons", obj);

            if (retorno != null)
            {
                return(Convert.ToBoolean(retorno));
            }
            else
            {
                return(false);
            }
        }
Exemplo n.º 4
0
        public bool UpdateProtocolo(NTLoteBE obj)
        {
            var retorno = ExecutaItem("altProto", obj);

            if (retorno != null)
            {
                return(Convert.ToBoolean(retorno));
            }
            else
            {
                return(false);
            }
        }
        /// <summary>
        /// Cria novo lote para enviar a receita
        /// </summary>
        void CriarLoteNotaFiscal()
        {
            NTLoteBLL _lote = new NTLoteBLL();

            loteNota = new NTLoteBE
            {
                conf_id      = this.conf_id,
                lote_serie   = GlobaisSCM.NFeSerie,
                lote_modulo  = GlobaisSCM.Modulo,
                lote_emissao = DateTime.Now,
                lote_status  = StatusNotaNFe.LoteNovo.GetDescription()
            };
            loteNota = _lote.Insert(loteNota);
        }
Exemplo n.º 6
0
 public NFEEnviarNota(NTLoteBE _lote, GlobaisEmpresaBE _empresa)
 {
     this.lote    = _lote;
     this.empresa = _empresa;
 }
Exemplo n.º 7
0
        /// <summary>
        /// Carrega xml com os itens das notas a serem emitidas
        /// </summary>
        /// <param name="obj"></param>
        void CarregaXMLRPSServico(NTLoteBE obj)
        {
            string retorno                = "";
            string Tipo                   = "1";
            string NaturezaOperacao       = "1";
            string OptanteSimplesNacional = "2";
            string IncentivadorCultural   = "2";
            string Status                 = "1";

            string ItemListaServico          = "108";
            string CodigoTributacaoMunicipio = "2706";
            string Discriminacao             = "CONTRATO PRESTACAO DE SERVICOS DE CLOUD COMPUTING DE SERVIDOR VIRTUAL PARA O SISTEMA DE RECADASTRAMENTO VALOR REFERENTE USO NO MES R$ 1.976,00 - VALOR APROXIMADO DOS TRIBUTOS: R$ 358,84(18, 16 %)  FONTE: IBPT";
            string CodigoMunicipio           = "3548708";

            foreach (var item in obj.Notas)
            {
                var iss = Math.Round(((item.not_totalbruto * GlobaisSCM.TaxaISS) / 100), 2);

                retorno += "         <tipos:Rps>";
                retorno += "            <tipos:InfRps>";
                retorno += "               <tipos:IdentificacaoRps>";
                retorno += "                  <tipos:Numero>" + item.not_id + "</tipos:Numero>";
                retorno += "                  <tipos:Serie>" + obj.lote_serie + "</tipos:Serie>";
                retorno += "                  <tipos:Tipo>" + Tipo + "</tipos:Tipo>";
                retorno += "               </tipos:IdentificacaoRps>";
                retorno += "               <tipos:DataEmissao>" + obj.lote_emissao.ToString("yyyy-MM-dd") + "T08:00:00</tipos:DataEmissao>";//Removida a hora de envio para teste, se der erro alterar
                retorno += "               <tipos:NaturezaOperacao>" + NaturezaOperacao + "</tipos:NaturezaOperacao>";
                retorno += "               <tipos:OptanteSimplesNacional>" + OptanteSimplesNacional + "</tipos:OptanteSimplesNacional>";
                retorno += "               <tipos:IncentivadorCultural>" + IncentivadorCultural + "</tipos:IncentivadorCultural>";
                retorno += "               <tipos:Status>" + Status + "</tipos:Status>";
                retorno += "               <tipos:Servico>";
                retorno += "                  <tipos:Valores>";
                retorno += "                     <tipos:ValorServicos>" + item.not_totalbruto.ToString("n2").Replace(",", "") + "</tipos:ValorServicos>";
                retorno += "                     <tipos:ValorDeducoes>0.00</tipos:ValorDeducoes>";
                retorno += "                     <tipos:ValorPis>" + item.not_pis.ToString("n2").Replace(",", "") + "</tipos:ValorPis>";
                retorno += "                     <tipos:ValorCofins>" + item.not_confins.ToString("n2").Replace(",", "") + "</tipos:ValorCofins>";
                retorno += "                     <tipos:ValorIr>" + item.not_irrf.ToString("n2").Replace(",", "") + "</tipos:ValorIr>";
                retorno += "                     <tipos:ValorCsll>" + item.not_cssl.ToString("n2").Replace(",", "") + "</tipos:ValorCsll>";
                retorno += "                     <tipos:IssRetido>2</tipos:IssRetido>";
                retorno += "                     <tipos:ValorIss>" + iss.ToString("n2").Replace(",", "") + "</tipos:ValorIss>";
                retorno += "                     <tipos:ValorIssRetido>0.00</tipos:ValorIssRetido>";
                retorno += "                     <tipos:BaseCalculo>" + item.not_totalbruto.ToString("n2").Replace(",", "") + "</tipos:BaseCalculo>";
                retorno += "                     <tipos:Aliquota>0.0300</tipos:Aliquota>";
                retorno += "                     <tipos:ValorLiquidoNfse>" + item.not_totalliquido.ToString("n2").Replace(",", "") + "</tipos:ValorLiquidoNfse>";
                retorno += "                  </tipos:Valores>";
                retorno += "                  <tipos:ItemListaServico>" + ItemListaServico + "</tipos:ItemListaServico>";
                retorno += "                  <tipos:CodigoTributacaoMunicipio>" + CodigoTributacaoMunicipio + "</tipos:CodigoTributacaoMunicipio>"; //Deixar Fixo
                retorno += "                  <tipos:Discriminacao>" + Common.RemoveCaracter(Discriminacao.ToUpper()) + "</tipos:Discriminacao>";
                retorno += "                  <tipos:CodigoMunicipio>" + CodigoMunicipio + "</tipos:CodigoMunicipio>";                               //Deixar Fixo
                retorno += "               </tipos:Servico>";
                retorno += "               <tipos:Prestador>";
                retorno += "                  <tipos:Cnpj>" + this.cnpj + "</tipos:Cnpj>";
                retorno += "                  <tipos:InscricaoMunicipal>" + this.incricaoMunicipal + "</tipos:InscricaoMunicipal>";
                retorno += "               </tipos:Prestador>";
                retorno += "               <tipos:Tomador>";
                retorno += "                  <tipos:IdentificacaoTomador>";
                retorno += "                     <tipos:CpfCnpj>";
                if (item.Contrato.Cliente.cli_tipoInscricao == "2")
                {
                    retorno += "                        <tipos:Cpf>" + Common.RemoveCaracter(item.Contrato.Cliente.cli_CPF) + "</tipos:Cpf>";
                }
                else
                {
                    retorno += "                        <tipos:Cnpj>" + Common.RemoveCaracter(item.Contrato.Cliente.cli_CPF) + "</tipos:Cnpj>";
                }
                retorno += "                     </tipos:CpfCnpj>";
                retorno += "                  </tipos:IdentificacaoTomador>";
                retorno += "                  <tipos:RazaoSocial>" + Common.RemoveCaracter(item.Contrato.Cliente.cli_razaoSocial.ToUpper()) + "</tipos:RazaoSocial>";
                retorno += "                  <tipos:Endereco>";
                retorno += "                     <tipos:Endereco>" + Common.RemoveCaracter(item.Contrato.Cliente.Endereco[0].end_logradouro.ToUpper()) + "</tipos:Endereco>";
                retorno += "                     <tipos:Numero>" + Common.RemoveCaracter(item.Contrato.Cliente.Endereco[0].end_numero) + "</tipos:Numero>";
                retorno += "                     <tipos:Bairro>" + Common.RemoveCaracter(item.Contrato.Cliente.Endereco[0].end_bairro.ToUpper()) + "</tipos:Bairro>";
                retorno += "                     <tipos:CodigoMunicipio>3550308</tipos:CodigoMunicipio>";
                retorno += "                     <tipos:Uf>" + Common.RemoveCaracter(item.Contrato.Cliente.Endereco[0].end_estado.ToUpper()) + "</tipos:Uf>";
                retorno += "                     <tipos:Cep>" + Common.RemoveCaracter(item.Contrato.Cliente.Endereco[0].end_cep) + "</tipos:Cep>";
                retorno += "                  </tipos:Endereco>";
                retorno += "               </tipos:Tomador>";
                retorno += "            </tipos:InfRps>";
                retorno += "         </tipos:Rps>";
            }
            xml = xml.Replace("@DadosClientes", retorno);
        }
Exemplo n.º 8
0
 public bool UpdateXmlConsulta(NTLoteBE obj)
 {
     return(new NTLoteDao().UpdateXmlConsulta(obj));
 }
Exemplo n.º 9
0
 public bool Delete(NTLoteBE obj)
 {
     return(new NTLoteDao().Delete(obj).Value);
 }
Exemplo n.º 10
0
 public bool UpdateProtocolo(NTLoteBE obj)
 {
     return(new NTLoteDao().UpdateProtocolo(obj));
 }
Exemplo n.º 11
0
 public bool UpdateXmlEnvio(NTLoteBE obj)
 {
     return(new NTLoteDao().UpdateXmlEnvio(obj));
 }
Exemplo n.º 12
0
 public bool UpdateStatus(NTLoteBE obj)
 {
     return(new NTLoteDao().UpdateStatus(obj));
 }
Exemplo n.º 13
0
 public bool Update(NTLoteBE obj)
 {
     return(new NTLoteDao().Update(obj).Value);
 }
Exemplo n.º 14
0
 public NTLoteBE Insert(NTLoteBE obj)
 {
     obj.lote_id = new NTLoteDao().Insert(obj);
     return(obj);
 }
Exemplo n.º 15
0
 public NTLoteBE SelectId(NTLoteBE obj)
 {
     return(new NTLoteDao().SelectId <NTLoteBE>(obj));
 }
Exemplo n.º 16
0
 public List <NTLoteBE> Select(NTLoteBE obj)
 {
     return(new NTLoteDao().Select <NTLoteBE>(obj).ToList());
 }