Class: BrNfe::Service::Rps
- Inherits:
-
ActiveModelBase
- Object
- ActiveModelBase
- BrNfe::Service::Rps
- Includes:
- Association::HaveCondicaoPagamento, Association::HaveDestinatario, Association::HaveIntermediario
- Defined in:
- lib/br_nfe/service/rps.rb
Instance Attribute Summary collapse
-
#base_calculo ⇒ Object
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.
-
#cnae_code ⇒ Object
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).
-
#codigo_art ⇒ Object
Returns the value of attribute codigo_art.
-
#codigo_municipio ⇒ Object
Returns the value of attribute codigo_municipio.
-
#codigo_obra ⇒ Object
Para construção civil.
-
#codigo_pais ⇒ Object
Returns the value of attribute codigo_pais.
-
#codigo_tributacao_municipio ⇒ Object
Returns the value of attribute codigo_tributacao_municipio.
-
#competencia ⇒ Object
Returns the value of attribute competencia.
-
#data_emissao ⇒ Object
Returns the value of attribute data_emissao.
-
#deducoes ⇒ Object
Valor das deduções de impostos .
-
#desconto_condicionado ⇒ Object
Returns the value of attribute desconto_condicionado.
-
#desconto_incondicionado ⇒ Object
Returns the value of attribute desconto_incondicionado.
-
#description ⇒ Object
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.
-
#exigibilidade_iss ⇒ Object
Returns the value of attribute exigibilidade_iss.
-
#iss_aliquota ⇒ Object
% de Aliquota do ISS Utilizado para as cidades que não possuem multiplos itens de serviço na nota.
-
#iss_retido ⇒ Object
Iss retido? Identifica se o ISS foi retido .
-
#item_lista_servico ⇒ Object
Returns the value of attribute item_lista_servico.
-
#items ⇒ Object
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.
-
#municipio_incidencia ⇒ Object
Returns the value of attribute municipio_incidencia.
-
#numero ⇒ Object
Returns the value of attribute numero.
-
#numero_processo ⇒ Object
Returns the value of attribute numero_processo.
-
#numero_substituicao ⇒ Object
Returns the value of attribute numero_substituicao.
-
#outras_informacoes ⇒ Object
Returns the value of attribute outras_informacoes.
-
#outras_retencoes ⇒ Object
Returns the value of attribute outras_retencoes.
-
#responsavel_retencao ⇒ Object
Returns the value of attribute responsavel_retencao.
-
#serie ⇒ Object
Returns the value of attribute serie.
-
#serie_substituicao ⇒ Object
Returns the value of attribute serie_substituicao.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tipo ⇒ Object
Returns the value of attribute tipo.
-
#tipo_substituicao ⇒ Object
Returns the value of attribute tipo_substituicao.
-
#total_base_calculo_st ⇒ Object
Valor da base de cálculo da substituição tributária.
-
#total_iss ⇒ Object
Valor total do ISS (R$) Valor utilizado para identificar o valor total do ISS.
-
#total_iss_retido ⇒ Object
Valor do Iss retido Total de iss retido da nota.
-
#total_issqn_st ⇒ Object
Valor total do ISS de substituição tributária.
-
#validar_recepcao_rps ⇒ Object
Returns the value of attribute validar_recepcao_rps.
-
#valor_cofins ⇒ Object
Returns the value of attribute valor_cofins.
-
#valor_csll ⇒ Object
Returns the value of attribute valor_csll.
-
#valor_inss ⇒ Object
Returns the value of attribute valor_inss.
-
#valor_ir ⇒ Object
Returns the value of attribute valor_ir.
-
#valor_liquido ⇒ Object
Valor líquido da NF (R$) Caso não seja setado um valor manualmente irá calcular o valor .
-
#valor_pis ⇒ Object
Returns the value of attribute valor_pis.
-
#valor_total_servicos ⇒ Object
Valor total dos serviços Pode ser definido diretamente ou então será a soma do valor de todos os itens.
Attributes inherited from ActiveModelBase
Instance Method Summary collapse
- #default_values ⇒ Object
-
#initialize(attributes = {}) ⇒ Rps
constructor
A new instance of Rps.
- #iss_retido? ⇒ Boolean
-
#replace_invoice? ⇒ Boolean
Verifica se a NF atual está sendo substituida por outra.
-
#validate_rps? ⇒ Boolean
Método utilizado para saberse o modelo deve validar as informações obrigatórias do RPS.
Methods included from Association::HaveCondicaoPagamento
#condicao_pagamento, #condicao_pagamento=
Methods included from Association::HaveIntermediario
#intermediario, #intermediario=
Methods included from Association::HaveDestinatario
Methods inherited from ActiveModelBase
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_calculo ⇒ Object
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_code ⇒ Object
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_art ⇒ Object
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_municipio ⇒ Object
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_obra ⇒ Object
Para construção civil
85 86 87 |
# File 'lib/br_nfe/service/rps.rb', line 85 def codigo_obra @codigo_obra end |
#codigo_pais ⇒ Object
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_municipio ⇒ Object
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 |
#competencia ⇒ Object
Returns the value of attribute competencia.
78 79 80 |
# File 'lib/br_nfe/service/rps.rb', line 78 def competencia @competencia end |
#data_emissao ⇒ Object
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 |
#deducoes ⇒ Object
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_condicionado ⇒ Object
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_incondicionado ⇒ Object
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 |
#description ⇒ Object
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_iss ⇒ Object
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_aliquota ⇒ Object
% 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_retido ⇒ Object
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_servico ⇒ Object
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 |
#items ⇒ Object
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_incidencia ⇒ Object
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 |
#numero ⇒ Object
Returns the value of attribute numero.
72 73 74 |
# File 'lib/br_nfe/service/rps.rb', line 72 def numero @numero end |
#numero_processo ⇒ Object
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_substituicao ⇒ Object
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_informacoes ⇒ Object
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_retencoes ⇒ Object
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_retencao ⇒ Object
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 |
#serie ⇒ Object
Returns the value of attribute serie.
73 74 75 |
# File 'lib/br_nfe/service/rps.rb', line 73 def serie @serie end |
#serie_substituicao ⇒ Object
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 |
#status ⇒ Object
Returns the value of attribute status.
77 78 79 |
# File 'lib/br_nfe/service/rps.rb', line 77 def status @status end |
#tipo ⇒ Object
Returns the value of attribute tipo.
74 75 76 |
# File 'lib/br_nfe/service/rps.rb', line 74 def tipo @tipo end |
#tipo_substituicao ⇒ Object
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_st ⇒ Object
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_iss ⇒ Object
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_retido ⇒ Object
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_st ⇒ Object
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_rps ⇒ Object
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_cofins ⇒ Object
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_csll ⇒ Object
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_inss ⇒ Object
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_ir ⇒ Object
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_liquido ⇒ Object
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_pis ⇒ Object
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_servicos ⇒ Object
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_values ⇒ Object
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
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
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
14 15 16 |
# File 'lib/br_nfe/service/rps.rb', line 14 def validate_rps? true end |