module Rnfse::XMLBuilder::IssNet10

Private Instance Methods

add_cidade(hash) click to toggle source

troca a tag Endereco/CodigoMunicipio por Cidade

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 34
def add_cidade(hash)
  Rnfse::Hash.replace_key_values(hash, 'tc:Endereco/tc:CodigoMunicipio') do |key, value|
    { 'tc:Cidade' => value }
  end
end
add_estado(hash) click to toggle source

troca a tag Uf pela tag Estado

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 41
def add_estado(hash)
  Rnfse::Hash.replace_key_values(hash, 'tc:Uf') do |key, value|
    { :'tc:Estado' => value } 
  end
end
add_municipio_prestacao_servico(hash) click to toggle source

troca a tag CodigoMunicipio para MunicipioPrestacaoServico na tag Servico

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 49
def add_municipio_prestacao_servico(hash)
  Rnfse::Hash.replace_key_values(hash, 'tc:Servico/tc:CodigoMunicipio') do |key, value|
    { :'tc:MunicipioPrestacaoServico' => value }
  end
end
alter_aliquota(hash) click to toggle source

alterar o formato da aliquota de 0 a 1 para 0 a 100

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 27
def alter_aliquota(hash)
  Rnfse::Hash.transform_values(hash, 'tc:Aliquota') do |val|
    "%.2f" % (val * 100)
  end
end
build_cancelar_nfse_xmlns() click to toggle source

namespaces do xml cancelar_nfse

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 119
def build_cancelar_nfse_xmlns
  {
    'xmlns' => 'http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_cancelar_nfse_envio.xsd',
    'xmlns:tc' => xmlns_tc
  }
end
build_consultar_lote_rps_xmlns() click to toggle source

namespaces do xml consultar_lote_rps

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 93
def build_consultar_lote_rps_xmlns
  {
    'xmlns' => 'http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_consultar_lote_rps_envio.xsd',
    'xmlns:tc' => xmlns_tc,
    'xmlns:ts' => xmlns_ts
  }
end
build_consultar_nfse_por_rps_xmlns() click to toggle source

namespaces do xml consultar_nfse_por_xml

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 102
def build_consultar_nfse_por_rps_xmlns
  {
    'xmlns' => 'http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_consultar_nfse_rps_envio.xsd',
    'xmlns:tc' => xmlns_tc,
    'xmlns:ts' => xmlns_ts
  }
end
build_consultar_nfse_xmlns() click to toggle source

namespaces do xml consultar_nfse

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 111
def build_consultar_nfse_xmlns
  {
    'xmlns' => 'http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_consultar_nfse_envio.xsd',
    'xmlns:tc' => xmlns_tc
  }
end
build_consultar_situacao_lote_rps_xmlns() click to toggle source

namespaces do xml consultar_situacao_lote_rps

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 85
def build_consultar_situacao_lote_rps_xmlns
  {
    'xmlns' => 'http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_consultar_situacao_lote_rps_envio.xsd',
    'xmlns:tc' => xmlns_tc
  }
end
build_recepcionar_lote_rps_xmlns() click to toggle source

namespaces do xml recepcionar_lote_rps

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 77
def build_recepcionar_lote_rps_xmlns
  {
    'xmlns' => 'http://www.issnetonline.com.br/webserviceabrasf/vsd/servico_enviar_lote_rps_envio.xsd',
    'xmlns:tc' => xmlns_tc
  }
end
prepare_hash(hash) click to toggle source

prepara um hash para ser convertido a xml com o Gyoku

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 8
def prepare_hash(hash)
  hash = camelize_hash(hash)
  hash = wrap_rps(hash)
  hash = wrap_periodo_emissao(hash)
  hash = wrap_identificacao_nfse(hash)
  hash = add_tc_namespace(hash)
  hash = clean_numerics(hash)
  hash = date_to_utc(hash)
  hash = fix_booleans(hash)
  hash = wrap_cpf_cnpj(hash)
  hash = add_municipio_prestacao_servico(hash)
  hash = add_estado(hash)
  hash = add_cidade(hash)
  hash = alter_aliquota(hash)

  hash
end
wrap_cpf_cnpj(hash) click to toggle source

encapsula as tags cpf ou cnpj em uma tag cpfcnpj

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 56
def wrap_cpf_cnpj(hash)
  if hash[:Pedido].nil?
    Rnfse::Hash.replace_key_values(hash, /tc:(Cpf|Cnpj)/) do |key, value|
      { :'tc:CpfCnpj' => { key => value } }
    end
  else
    hash
  end
end
xmlns_tc() click to toggle source

namespace dos tipos complexos

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 67
def xmlns_tc
  'http://www.issnetonline.com.br/webserviceabrasf/vsd/tipos_complexos.xsd'
end
xmlns_ts() click to toggle source

namespace dos tipos simples

# File lib/rnfse/xml_builder/iss_net_1_0.rb, line 72
def xmlns_ts
  'http://www.issnetonline.com.br/webserviceabrasf/vsd/tipos_simples.xsd'
end