Class: BrNfe::Service::Rps

Inherits:
ActiveModelBase show all
Includes:
Association::HaveCondicaoPagamento, Association::HaveDestinatario, Association::HaveIntermediario
Defined in:
lib/br_nfe/service/rps.rb

Instance Attribute Summary collapse

Attributes inherited from ActiveModelBase

#reference

Instance Method Summary collapse

Methods included from Association::HaveCondicaoPagamento

#condicao_pagamento, #condicao_pagamento=

Methods included from Association::HaveIntermediario

#intermediario, #intermediario=

Methods included from Association::HaveDestinatario

#destinatario, #destinatario=

Methods inherited from ActiveModelBase

#assign_attributes

Constructor Details

#initialize(attributes = {}) ⇒ Rps

Returns a new instance of Rps.



37
38
39
40
# File 'lib/br_nfe/service/rps.rb', line 37

def initialize(attributes = {})
	self.items = [] # Para poder utilizar o << para adicionar itens
	super
end

Instance Attribute Details

#base_calculoObject

Valor da base de cálculo Caso não definido irá somar o total dos serviços e subtrair com o valor das deduções

Tipo: Float



103
104
105
# File 'lib/br_nfe/service/rps.rb', line 103

def base_calculo
  @base_calculo
end

#cnae_codeObject

Código CNAE (Classificação Nacional de Atividades Econômicas) Pode ser encontrado em www.cnae.ibge.gov.br/ Tamanho de 8 caracteres

  • Para as cidades que não trabalham com multiplos serviços na nota, se não for definido um código CNAE será pega o código do 1° item de serviço (se houver algum)

Tipo: String



187
188
189
# File 'lib/br_nfe/service/rps.rb', line 187

def cnae_code
  @cnae_code
end

#codigo_artObject

Returns the value of attribute codigo_art.



86
87
88
# File 'lib/br_nfe/service/rps.rb', line 86

def codigo_art
  @codigo_art
end

#codigo_municipioObject

Returns the value of attribute codigo_municipio.



174
175
176
# File 'lib/br_nfe/service/rps.rb', line 174

def codigo_municipio
  @codigo_municipio
end

#codigo_obraObject

Para construção civil



85
86
87
# File 'lib/br_nfe/service/rps.rb', line 85

def codigo_obra
  @codigo_obra
end

#codigo_paisObject

Returns the value of attribute codigo_pais.



176
177
178
# File 'lib/br_nfe/service/rps.rb', line 176

def codigo_pais
  @codigo_pais
end

#codigo_tributacao_municipioObject

Returns the value of attribute codigo_tributacao_municipio.



172
173
174
# File 'lib/br_nfe/service/rps.rb', line 172

def codigo_tributacao_municipio
  @codigo_tributacao_municipio
end

#competenciaObject

Returns the value of attribute competencia.



78
79
80
# File 'lib/br_nfe/service/rps.rb', line 78

def competencia
  @competencia
end

#data_emissaoObject

Returns the value of attribute data_emissao.



76
77
78
# File 'lib/br_nfe/service/rps.rb', line 76

def data_emissao
  @data_emissao
end

#deducoesObject

Valor das deduções de impostos

Tipo: Float



111
112
113
# File 'lib/br_nfe/service/rps.rb', line 111

def deducoes
  @deducoes
end

#desconto_condicionadoObject

Returns the value of attribute desconto_condicionado.



168
169
170
# File 'lib/br_nfe/service/rps.rb', line 168

def desconto_condicionado
  @desconto_condicionado
end

#desconto_incondicionadoObject

Returns the value of attribute desconto_incondicionado.



167
168
169
# File 'lib/br_nfe/service/rps.rb', line 167

def desconto_incondicionado
  @desconto_incondicionado
end

#descriptionObject

Descrição dos serviços prestados Algumas cidades permitem adicionar os serviços com itens e a maioria é necessário identificar cada serviço dentro da discriminação.

Tipo: Text



197
198
199
# File 'lib/br_nfe/service/rps.rb', line 197

def description
  @description
end

#exigibilidade_issObject

Returns the value of attribute exigibilidade_iss.



173
174
175
# File 'lib/br_nfe/service/rps.rb', line 173

def exigibilidade_iss
  @exigibilidade_iss
end

#iss_aliquotaObject

% de Aliquota do ISS Utilizado para as cidades que não possuem multiplos itens de serviço na nota. Caso não seja definido então irá pegar a aliquota do 1º item que encontrar

O Valor informado deve ser o percentual real do ISS EXEMPLO: 2% = 2.0 3.5% = 3.5

Tipo: Float



142
143
144
# File 'lib/br_nfe/service/rps.rb', line 142

def iss_aliquota
  @iss_aliquota
end

#iss_retidoObject

Iss retido? Identifica se o ISS foi retido

Tipo: Integer



117
118
119
# File 'lib/br_nfe/service/rps.rb', line 117

def iss_retido
  @iss_retido
end

#item_lista_servicoObject

Returns the value of attribute item_lista_servico.



171
172
173
# File 'lib/br_nfe/service/rps.rb', line 171

def item_lista_servico
  @item_lista_servico
end

#itemsObject

Itens do RPS Contém um vetor com todos os serviços prestados Para a maioria das cidades os itens são informados junto à discriminação porém para outras poucas cidades é possível inserir vários itens de serviços na NF.

Mesmo para as cidades que não permitem enviar os itens de serviço será necessário informar pelo menos 1 item.

Tipo: Array



52
53
54
# File 'lib/br_nfe/service/rps.rb', line 52

def items
  @items
end

#municipio_incidenciaObject

Returns the value of attribute municipio_incidencia.



175
176
177
# File 'lib/br_nfe/service/rps.rb', line 175

def municipio_incidencia
  @municipio_incidencia
end

#numeroObject

Returns the value of attribute numero.



72
73
74
# File 'lib/br_nfe/service/rps.rb', line 72

def numero
  @numero
end

#numero_processoObject

Returns the value of attribute numero_processo.



177
178
179
# File 'lib/br_nfe/service/rps.rb', line 177

def numero_processo
  @numero_processo
end

#numero_substituicaoObject

Returns the value of attribute numero_substituicao.



80
81
82
# File 'lib/br_nfe/service/rps.rb', line 80

def numero_substituicao
  @numero_substituicao
end

#outras_informacoesObject

Returns the value of attribute outras_informacoes.



178
179
180
# File 'lib/br_nfe/service/rps.rb', line 178

def outras_informacoes
  @outras_informacoes
end

#outras_retencoesObject

Returns the value of attribute outras_retencoes.



166
167
168
# File 'lib/br_nfe/service/rps.rb', line 166

def outras_retencoes
  @outras_retencoes
end

#responsavel_retencaoObject

Returns the value of attribute responsavel_retencao.



170
171
172
# File 'lib/br_nfe/service/rps.rb', line 170

def responsavel_retencao
  @responsavel_retencao
end

#serieObject

Returns the value of attribute serie.



73
74
75
# File 'lib/br_nfe/service/rps.rb', line 73

def serie
  @serie
end

#serie_substituicaoObject

Returns the value of attribute serie_substituicao.



81
82
83
# File 'lib/br_nfe/service/rps.rb', line 81

def serie_substituicao
  @serie_substituicao
end

#statusObject

Returns the value of attribute status.



77
78
79
# File 'lib/br_nfe/service/rps.rb', line 77

def status
  @status
end

#tipoObject

Returns the value of attribute tipo.



74
75
76
# File 'lib/br_nfe/service/rps.rb', line 74

def tipo
  @tipo
end

#tipo_substituicaoObject

Returns the value of attribute tipo_substituicao.



82
83
84
# File 'lib/br_nfe/service/rps.rb', line 82

def tipo_substituicao
  @tipo_substituicao
end

#total_base_calculo_stObject

Valor da base de cálculo da substituição tributária

Tipo: Float



63
64
65
# File 'lib/br_nfe/service/rps.rb', line 63

def total_base_calculo_st
  @total_base_calculo_st
end

#total_issObject

Valor total do ISS (R$) Valor utilizado para identificar o valor total do ISS

Tipo: Float



130
131
132
# File 'lib/br_nfe/service/rps.rb', line 130

def total_iss
  @total_iss
end

#total_iss_retidoObject

Valor do Iss retido Total de iss retido da nota

Tipo: float



124
125
126
# File 'lib/br_nfe/service/rps.rb', line 124

def total_iss_retido
  @total_iss_retido
end

#total_issqn_stObject

Valor total do ISS de substituição tributária

Tipo: Float



68
69
70
# File 'lib/br_nfe/service/rps.rb', line 68

def total_issqn_st
  @total_issqn_st
end

#validar_recepcao_rpsObject

Returns the value of attribute validar_recepcao_rps.



70
71
72
# File 'lib/br_nfe/service/rps.rb', line 70

def validar_recepcao_rps
  @validar_recepcao_rps
end

#valor_cofinsObject

Returns the value of attribute valor_cofins.



162
163
164
# File 'lib/br_nfe/service/rps.rb', line 162

def valor_cofins
  @valor_cofins
end

#valor_csllObject

Returns the value of attribute valor_csll.



165
166
167
# File 'lib/br_nfe/service/rps.rb', line 165

def valor_csll
  @valor_csll
end

#valor_inssObject

Returns the value of attribute valor_inss.



163
164
165
# File 'lib/br_nfe/service/rps.rb', line 163

def valor_inss
  @valor_inss
end

#valor_irObject

Returns the value of attribute valor_ir.



164
165
166
# File 'lib/br_nfe/service/rps.rb', line 164

def valor_ir
  @valor_ir
end

#valor_liquidoObject

Valor líquido da NF (R$) Caso não seja setado um valor manualmente irá calcular o valor

Tipo: Float



152
153
154
# File 'lib/br_nfe/service/rps.rb', line 152

def valor_liquido
  @valor_liquido
end

#valor_pisObject

Returns the value of attribute valor_pis.



161
162
163
# File 'lib/br_nfe/service/rps.rb', line 161

def valor_pis
  @valor_pis
end

#valor_total_servicosObject

Valor total dos serviços Pode ser definido diretamente ou então será a soma do valor de todos os itens

Tipo: Float



93
94
95
# File 'lib/br_nfe/service/rps.rb', line 93

def valor_total_servicos
  @valor_total_servicos
end

Instance Method Details

#default_valuesObject



214
215
216
217
218
219
# File 'lib/br_nfe/service/rps.rb', line 214

def default_values
	{
		codigo_pais: '1058',
		validar_recepcao_rps: false
	}
end

#iss_retido?Boolean

Returns:

  • (Boolean)


206
207
208
# File 'lib/br_nfe/service/rps.rb', line 206

def iss_retido?
	BrNfe.true_values.include?(iss_retido)
end

#replace_invoice?Boolean

Verifica se a NF atual está sendo substituida por outra

Tipo: Boolean

Returns:

  • (Boolean)


202
203
204
# File 'lib/br_nfe/service/rps.rb', line 202

def replace_invoice?
	numero_substituicao.present? && serie_substituicao.present? && tipo_substituicao.present?
end

#validate_rps?Boolean

Método utilizado para saberse o modelo deve validar as informações obrigatórias do RPS. Por padrão é setado com true pois a maioria das cidades trabalha com RPS. Para as cidades que não trabalham com RPS esse método deverá ser sobrescrito

Tipo: Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/br_nfe/service/rps.rb', line 14

def validate_rps?
	true
end