Class: BrNfe::Product::NotaFiscal

Inherits:
ActiveModelBase show all
Defined in:
lib/br_nfe/product/nota_fiscal.rb

Instance Attribute Summary collapse

Attributes inherited from ActiveModelBase

#reference

Instance Method Summary collapse

Methods inherited from ActiveModelBase

#assign_attributes, #initialize

Constructor Details

This class inherits a constructor from BrNfe::ActiveModelBase

Instance Attribute Details

#autorizados_download_xmlObject

CPF ou CNPJ das pessoas que estão autorizadas a fazer o download do XML da NF-e. Deve ser um Array com os CPF’s e CNPJ’s válidos.

Type: Array Required: No Default: [] tag: autXML



345
346
347
# File 'lib/br_nfe/product/nota_fiscal.rb', line 345

def autorizados_download_xml
  @autorizados_download_xml
end

#chave_de_acessoObject

Returns the value of attribute chave_de_acesso.



47
48
49
# File 'lib/br_nfe/product/nota_fiscal.rb', line 47

def chave_de_acesso
  @chave_de_acesso
end

#codigo_nfObject

Código numérico que compõe a Chave de Acesso. Número aleatório gerado pelo emitente para cada NF-e para evitar acessos indevidos da NF-e. Resumo: É um código controlado pelo sistema. Pode por exemplo ser

utilizado o ID da tabela da nota fiscal.

Type: Number Required: Yes Default: nil Length: _max: 8_ tag: cNF



71
72
73
# File 'lib/br_nfe/product/nota_fiscal.rb', line 71

def codigo_nf
  @codigo_nf
end

#codigo_tipo_emissaoObject

Código do Tipo de Emissão da NF-e

✓ 1=Emissão normal (não em contingência);
✓ 6=Contingência SVC-AN (SEFAZ Virtual de Contingência do AN);
✓ 7=Contingência SVC-RS (SEFAZ Virtual de Contingência do RS);
✓ 9=Contingência off-line da NFC-e (as demais opções de contingência são válidas
    também para a NFC-e).
Para a NFC-e somente estão disponíveis e são válidas as opções de contingência 5 e 9.

Type: Number Required: Yes Default: 1 Length: 1 tag: tpEmis



43
44
45
# File 'lib/br_nfe/product/nota_fiscal.rb', line 43

def codigo_tipo_emissao
  @codigo_tipo_emissao
end

#consumidor_finalObject

Indica operação com Consumidor final false=Normal; true=Consumidor final;

Preencher esse campo com true ou false

Type: Boolean Required: Yes Default: false tag: indFinal



227
228
229
# File 'lib/br_nfe/product/nota_fiscal.rb', line 227

def consumidor_final
  @consumidor_final
end

#data_hora_emissaoObject

Data e hora de emissão do Documento Fiscal

Type: Time Required: Yes Default: Time.current tag: dhEmi



152
153
154
# File 'lib/br_nfe/product/nota_fiscal.rb', line 152

def data_hora_emissao
  @data_hora_emissao
end

#data_hora_expedicaoObject

Data e hora de Saída ou da Entrada da Mercadoria/Produto Campo não considerado para a NFC-e.

Type: Time Required: Yes (apenas para modelo 55) Default: Time.current tag: dhSaiEnt



166
167
168
# File 'lib/br_nfe/product/nota_fiscal.rb', line 166

def data_hora_expedicao
  @data_hora_expedicao
end

#digest_valueObject

VALOR DIGEST DO RETORNO

Digest Value da NF-e processada
Utilizado para conferir a integridade da NFe
original.


996
997
998
# File 'lib/br_nfe/product/nota_fiscal.rb', line 996

def digest_value
  @digest_value
end

#endereco_entrega_cpf_cnpjObject

CPF ou CNPJ do local de entrega da mercadoria. Só é obrigatório se o endereco_entrega for preenchido

Type: String Required: No (Yes if endereco_entrega is present) Default: nil tag: entrega/CPF ou entrega/CNPJ



331
332
333
# File 'lib/br_nfe/product/nota_fiscal.rb', line 331

def endereco_entrega_cpf_cnpj
  @endereco_entrega_cpf_cnpj
end

#endereco_retirada_cpf_cnpjObject

CPF ou CNPJ do local de retirada da mercadoria. Só é obrigatório se o endereco_retirada for preenchido

Type: String Required: No (Yes if endereco_retirada is present) Default: nil tag: retirada/CPF ou retirada/CNPJ



305
306
307
# File 'lib/br_nfe/product/nota_fiscal.rb', line 305

def endereco_retirada_cpf_cnpj
  @endereco_retirada_cpf_cnpj
end

#exportacao_local_despachoObject

DESCRIÇÃO DO LOCAL DE DESPACHO Informação do Recinto Alfandegado

Type: String Required: No Default: nil Length: _max: 60_ tag: exporta/xLocDespacho



971
972
973
# File 'lib/br_nfe/product/nota_fiscal.rb', line 971

def exportacao_local_despacho
  @exportacao_local_despacho
end

#exportacao_local_embarqueObject

DESCRIÇÃO DO LOCAL DE EMBARQUE OU DE TRANSPOSIÇÃO DE FRONTEIRA

Type: String Required: No Default: nil Length: _max: 60_ tag: exporta/xLocExporta



959
960
961
# File 'lib/br_nfe/product/nota_fiscal.rb', line 959

def exportacao_local_embarque
  @exportacao_local_embarque
end

#exportacao_uf_saidaObject

SIGLA DA UF DE EMBARQUE OU DE TRANSPOSIÇÃO DE FRONTEIRA Não aceita o valor “EX”

Type: String Required: No Default: nil Length: 2 tag: exporta/UFSaidaPais



947
948
949
# File 'lib/br_nfe/product/nota_fiscal.rb', line 947

def exportacao_uf_saida
  @exportacao_uf_saida
end

#finalidade_emissaoObject

Finalidade de emissão da NF-e 1=NF-e normal; (Default) 2=NF-e complementar; 3=NF-e de ajuste; 4=Devolução de mercadoria.

Required: Yes Default: 1 tag: finNFe



212
213
214
# File 'lib/br_nfe/product/nota_fiscal.rb', line 212

def finalidade_emissao
  @finalidade_emissao
end

#forma_pagamentoObject

Indicador da forma de pagamento 0=Pagamento à vista; (Default) 1=Pagamento a prazo; 2=Outros.

Type: Number OR String Required: Yes Default: 0 Length: 1 tag: indPag



129
130
131
# File 'lib/br_nfe/product/nota_fiscal.rb', line 129

def forma_pagamento
  @forma_pagamento
end

#informacoes_contribuinteObject

INFORMAÇÕES COMPLEMENTARES DE INTERESSE DO CONTRIBUINTE

Type: String Required: No Default: nil Length: _max: 5000_ tag: infAdic/infCpl



923
924
925
# File 'lib/br_nfe/product/nota_fiscal.rb', line 923

def informacoes_contribuinte
  @informacoes_contribuinte
end

#informacoes_fiscoObject

INFORMAÇÕES ADICIONAIS DE INTERESSE DO FISCO

Type: String Required: No Default: nil Length: _max: 2000_ tag: infAdic/infAdFisco



912
913
914
# File 'lib/br_nfe/product/nota_fiscal.rb', line 912

def informacoes_fisco
  @informacoes_fisco
end

#modelo_nfObject

Código do Modelo do Documento Fiscal 55=NF-e emitida em substituição ao modelo 1 ou 1A; (Default) 65=NFC-e, utilizada nas operações de venda no varejo (a critério da UF aceitar este modelo de documento).

Type: Number OR String Required: Yes Default: 55 Length: 2 tag: mod



142
143
144
# File 'lib/br_nfe/product/nota_fiscal.rb', line 142

def modelo_nf
  @modelo_nf
end

#natureza_operacaoObject

Descrição da Natureza da Operação Informar a natureza da operação de que decorrer a saída ou a entrada, tais como: venda, compra, transferência, devolução, importação, consignação, remessa (para fins de demonstração, de industrialização ou outra), conforme previsto na alínea ‘i’, inciso I, art. 19 do CONVÊNIO S/No, de 15 de dezembro de 1970.

Type: String Required: Yes Default: _’Venda’_ tag: natOp



115
116
117
# File 'lib/br_nfe/product/nota_fiscal.rb', line 115

def natureza_operacao
  @natureza_operacao
end

#notas_referenciadasObject

Chave de acesso de notas referenciadas. (por enquanto aceita apenas a chave de acesso)

Type: Array Required: No Default: [] tag: NFref > refNFe



279
280
281
# File 'lib/br_nfe/product/nota_fiscal.rb', line 279

def notas_referenciadas
  @notas_referenciadas
end

#numero_nfObject

Número do Documento Fiscal. Número da nota fiscal De fato

Type: Number Required: Yes Default: nil Length: _max: 9_ tag: nNF



99
100
101
# File 'lib/br_nfe/product/nota_fiscal.rb', line 99

def numero_nf
  @numero_nf
end

#presenca_compradorObject

Indicador de presença do comprador no estabelecimento comercial no momento da operação:

0=Não se aplica (por exemplo, Nota Fiscal complementar ou de ajuste);
1=Operação presencial;
2=Operação não presencial, pela Internet;
3=Operação não presencial, Teleatendimento;
4=NFC-e em operação com entrega a domicílio;
9=Operação não presencial, outros. (Default)

Required: Yes Default: 9 tag: indPres



246
247
248
# File 'lib/br_nfe/product/nota_fiscal.rb', line 246

def presenca_comprador
  @presenca_comprador
end

#processed_atObject

DATA E HORA DO PROCESSAMENTO DA REQUISIÇÃO



1001
1002
1003
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1001

def processed_at
  @processed_at
end

#processo_emissaoObject

Processo de emissão da NF-e 0=Emissão de NF-e com aplicativo do contribuinte; (Default) 1=Emissão de NF-e avulsa pelo Fisco; 2=Emissão de NF-e avulsa, pelo contribuinte com seu certificado digital, através do site do Fisco; 3=Emissão NF-e pelo contribuinte com aplicativo fornecido pelo Fisco.

Required: Yes Default: 0 tag: procEmi



259
260
261
# File 'lib/br_nfe/product/nota_fiscal.rb', line 259

def processo_emissao
  @processo_emissao
end

#protocolObject

PROTOCOLO / NÚMERO DO RECIBO

Número do Recibo gerado pelo Portal da
Secretaria de Fazenda Estadual


988
989
990
# File 'lib/br_nfe/product/nota_fiscal.rb', line 988

def protocol
  @protocol
end

#regime_tributario_servicoObject

CÓDIGO DO REGIME ESPECIAL DE TRIBUTAÇÃO

1 = Microempresa Municipal;
2 = Estimativa;
3 = Sociedade de Profissionais;
4 = Cooperativa;
5 = Microempresário Individual (MEI);
6 = Microempresário e Empresa de Pequeno Porte (ME/EPP)

Type: Number Required: No Example: 2 Default: 1 Length: 1 tag: total/ISSQNtot/cRegTrib



811
812
813
# File 'lib/br_nfe/product/nota_fiscal.rb', line 811

def regime_tributario_servico
  @regime_tributario_servico
end

#serieObject

Série do Documento Fiscal, preencher com zeros na hipótese de a NF-e não possuir série. (v2.0) Série 890-899: uso exclusivo para emissão de NF-e avulsa, pelo

contribuinte com seu certificado digital, através do site do Fisco
(procEmi=2). (v2.0)

Serie 900-999: uso exclusivo de NF-e emitidas no SCAN. (v2.0)

Type: Number Required: Yes Default: nil Length: _max: 3_ tag: serie



88
89
90
# File 'lib/br_nfe/product/nota_fiscal.rb', line 88

def serie
  @serie
end

#servicos_data_prestacaoObject

DATA DA PRESTAÇÃO DO SERVIÇO

Type: Date Required: Yes apenas se tiver algum serviço nos itens Default: Date.current Example: Date.current Length: 8 YYYYMMDD tag: total/ISSQNtot/dCompet



729
730
731
# File 'lib/br_nfe/product/nota_fiscal.rb', line 729

def servicos_data_prestacao
  @servicos_data_prestacao
end

#situationObject

SITUAÇÃO DA NOTA FISCAL Informa o status atual da nota fiscal. Retorna se a nota fiscal está autorizada, cancelada, denegada, rejeitada, ajustada. Exemplo:

  • :authorized - Quando a nota fiscal está autorizada para uso

  • :adjusted - Quando a nota fiscal está autorizada para o uso e foi realizado algum

    evento posterior que a mesma foi ajustada
    
  • :draft - Quando a nota fiscal ainda não tem validade fiscal.

  • :canceled - Quando a nota fiscal foi cancelada.

  • :denied - Quando a nota fiscal foi denegada e o XML deve ser guardado.

  • :rejected - Quando a nota fiscal foi rejeitada e pode ser enviada novamente com as correções.



1040
1041
1042
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1040

def situation
  @situation
end

#status_codeObject

STATUS DA OPERAÇÃO Esse é o status final da operação com anota fiscal. A partir do status é possível identificar se obteve sucesso no processamento da nota (para qualquer operação)



1012
1013
1014
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1012

def status_code
  @status_code
end

#status_motiveObject

Returns the value of attribute status_motive.



1013
1014
1015
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1013

def status_motive
  @status_motive
end

#tipo_ambienteObject

DADOS SETADOS NA LEITURA DO XML #######################



1062
1063
1064
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1062

def tipo_ambiente
  @tipo_ambiente
end

#tipo_impressaoObject

Formato de Impressão do DANFE 0=Sem geração de DANFE; 1=DANFE normal, Retrato; (Default) 2=DANFE normal, Paisagem; 3=DANFE Simplificado; 4=DANFE NFC-e; 5=DANFE NFC-e em mensagem eletrônica (o envio de mensagem eletrônica pode

ser feita de forma simultânea com a impressão do DANFE; usar o tpImp=5
quando esta for a única forma de disponibilização do DANFE).

Required: Yes Default: 1 tag: tpEmis



199
200
201
# File 'lib/br_nfe/product/nota_fiscal.rb', line 199

def tipo_impressao
  @tipo_impressao
end

#tipo_operacaoObject

Tipo de Operação 0=Entrada; 1=Saída (Default)

Type: Number OR String Required: Yes Default: 1 Length: 1 tag: tpNF



182
183
184
# File 'lib/br_nfe/product/nota_fiscal.rb', line 182

def tipo_operacao
  @tipo_operacao
end

#total_cofinsObject

VALOR TOTAL DO COFINS

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vCOFINS



617
618
619
# File 'lib/br_nfe/product/nota_fiscal.rb', line 617

def total_cofins
  @total_cofins
end

#total_descontoObject

VALOR TOTAL DO DESCONTO

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vDesc



569
570
571
# File 'lib/br_nfe/product/nota_fiscal.rb', line 569

def total_desconto
  @total_desconto
end

#total_freteObject

VALOR TOTAL DO FRETE

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vFrete



545
546
547
# File 'lib/br_nfe/product/nota_fiscal.rb', line 545

def total_frete
  @total_frete
end

#total_icmsObject

VALOR TOTAL DO ICMS

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vICMS



441
442
443
# File 'lib/br_nfe/product/nota_fiscal.rb', line 441

def total_icms
  @total_icms
end

#total_icms_base_calculoObject

BASE DE CÁLCULO DO ICMS

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vBC



429
430
431
# File 'lib/br_nfe/product/nota_fiscal.rb', line 429

def total_icms_base_calculo
  @total_icms_base_calculo
end

#total_icms_base_calculo_stObject

BASE DE CÁLCULO DO ICMS ST

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vBCST



509
510
511
# File 'lib/br_nfe/product/nota_fiscal.rb', line 509

def total_icms_base_calculo_st
  @total_icms_base_calculo_st
end

#total_icms_desoneradoObject

VALOR TOTAL DO ICMS DESONERADO

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vICMSDeson



453
454
455
# File 'lib/br_nfe/product/nota_fiscal.rb', line 453

def total_icms_desonerado
  @total_icms_desonerado
end

#total_icms_fcp_uf_destinoObject

VALOR TOTAL DO ICMS RELATIVO FUNDO DE COMBATE À POBREZA(FCP) DA UF DE DESTINO

Valor total do ICMS relativo ao Fundo de Combate à Pobreza
(FCP) para a UF de destino.

Type: Float Required: No Example: 108.46 Length: 13v2 tag: total/ICMSTot/vFCPUFDest



468
469
470
# File 'lib/br_nfe/product/nota_fiscal.rb', line 468

def total_icms_fcp_uf_destino
  @total_icms_fcp_uf_destino
end

#total_icms_stObject

VALOR TOTAL DO ICMS ST

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vST



521
522
523
# File 'lib/br_nfe/product/nota_fiscal.rb', line 521

def total_icms_st
  @total_icms_st
end

#total_icms_uf_destinoObject

VALOR TOTAL DO ICMS INTERESTADUAL PARA A UF DE DESTINO

Valor total do ICMS Interestadual para a UF de destino, já
considerando o valor do ICMS relativo ao Fundo de Combate à
Pobreza naquela UF

Type: Float Required: No Example: 108.46 Length: 13v2 tag: total/ICMSTot/vICMSUFDest



483
484
485
# File 'lib/br_nfe/product/nota_fiscal.rb', line 483

def total_icms_uf_destino
  @total_icms_uf_destino
end

#total_icms_uf_origemObject

VALOR TOTAL DO ICMS INTERESTADUAL PARA A UF DO REMETENTE

Valor total do ICMS Interestadual para a UF do remetente.
Nota: A partir de 2019, este valor será zero.

Type: Float Required: No Example: 108.46 Length: 13v2 tag: total/ICMSTot/vICMSUFRemet



497
498
499
# File 'lib/br_nfe/product/nota_fiscal.rb', line 497

def total_icms_uf_origem
  @total_icms_uf_origem
end

#total_imposto_importacaoObject

VALOR TOTAL DO II

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vII



581
582
583
# File 'lib/br_nfe/product/nota_fiscal.rb', line 581

def total_imposto_importacao
  @total_imposto_importacao
end

#total_ipiObject

VALOR TOTAL DO IPI

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vIPI



593
594
595
# File 'lib/br_nfe/product/nota_fiscal.rb', line 593

def total_ipi
  @total_ipi
end

#total_nfObject

VALOR TOTAL DA NF-E

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vNF



641
642
643
# File 'lib/br_nfe/product/nota_fiscal.rb', line 641

def total_nf
  @total_nf
end

#total_outras_despesasObject

OUTRAS DESPESAS ACESSÓRIAS

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vOutro



629
630
631
# File 'lib/br_nfe/product/nota_fiscal.rb', line 629

def total_outras_despesas
  @total_outras_despesas
end

#total_pisObject

VALOR TOTAL DO PIS

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vPIS



605
606
607
# File 'lib/br_nfe/product/nota_fiscal.rb', line 605

def total_pis
  @total_pis
end

#total_produtosObject

VALOR TOTAL DOS PRODUTOS E SERVIÇOS

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vProd



533
534
535
# File 'lib/br_nfe/product/nota_fiscal.rb', line 533

def total_produtos
  @total_produtos
end

#total_retencao_base_calculo_irrfObject

BASE DE CÁLCULO DO IRRF

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/retTrib/vBCIRRF



863
864
865
# File 'lib/br_nfe/product/nota_fiscal.rb', line 863

def total_retencao_base_calculo_irrf
  @total_retencao_base_calculo_irrf
end

#total_retencao_base_calculo_previdenciaObject

BASE DE CÁLCULO DA RETENÇÃO DA PREVIDÊNCIA SOCIAL

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/retTrib/vBCRetPrev



887
888
889
# File 'lib/br_nfe/product/nota_fiscal.rb', line 887

def total_retencao_base_calculo_previdencia
  @total_retencao_base_calculo_previdencia
end

#total_retencao_cofinsObject

VALOR RETIDO DE COFINS

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/retTrib/vRetCOFINS



839
840
841
# File 'lib/br_nfe/product/nota_fiscal.rb', line 839

def total_retencao_cofins
  @total_retencao_cofins
end

#total_retencao_csllObject

VALOR RETIDO DE CSLL

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/retTrib/vRetCSLL



851
852
853
# File 'lib/br_nfe/product/nota_fiscal.rb', line 851

def total_retencao_csll
  @total_retencao_csll
end

#total_retencao_irrfObject

VALOR RETIDO DO IRRF

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/retTrib/vIRRF



875
876
877
# File 'lib/br_nfe/product/nota_fiscal.rb', line 875

def total_retencao_irrf
  @total_retencao_irrf
end

#total_retencao_pisObject

VALOR RETIDO DE PIS

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/retTrib/vRetPIS



827
828
829
# File 'lib/br_nfe/product/nota_fiscal.rb', line 827

def total_retencao_pis
  @total_retencao_pis
end

#total_retencao_previdenciaObject

VALOR DA RETENÇÃO DA PREVIDÊNCIA SOCIAL

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/retTrib/vRetPrev



899
900
901
# File 'lib/br_nfe/product/nota_fiscal.rb', line 899

def total_retencao_previdencia
  @total_retencao_previdencia
end

#total_seguroObject

VALOR TOTAL DO SEGURO

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vSeg



557
558
559
# File 'lib/br_nfe/product/nota_fiscal.rb', line 557

def total_seguro
  @total_seguro
end

#total_servicosObject

VALOR TOTAL DOS SERVIÇOS SOB NÃO-INCIDÊNCIA OU NÃO TRIBUTADOS PELO ICMS

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vServ



667
668
669
# File 'lib/br_nfe/product/nota_fiscal.rb', line 667

def total_servicos
  @total_servicos
end

#total_servicos_base_calculoObject

VALOR TOTAL BASE DE CÁLCULO DO ISS

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vBC



679
680
681
# File 'lib/br_nfe/product/nota_fiscal.rb', line 679

def total_servicos_base_calculo
  @total_servicos_base_calculo
end

#total_servicos_cofinsObject

VALOR TOTAL DA COFINS SOBRE SERVIÇOS

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vCOFINS



715
716
717
# File 'lib/br_nfe/product/nota_fiscal.rb', line 715

def total_servicos_cofins
  @total_servicos_cofins
end

#total_servicos_deducaoObject

VALOR TOTAL DEDUÇÃO PARA REDUÇÃO DA BASE DE CÁLCULO

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vDeducao



744
745
746
# File 'lib/br_nfe/product/nota_fiscal.rb', line 744

def total_servicos_deducao
  @total_servicos_deducao
end

#total_servicos_desconto_condicionadoObject

VALOR TOTAL DESCONTO CONDICIONADO

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vDescCond



780
781
782
# File 'lib/br_nfe/product/nota_fiscal.rb', line 780

def total_servicos_desconto_condicionado
  @total_servicos_desconto_condicionado
end

#total_servicos_desconto_incondicionadoObject

VALOR TOTAL DESCONTO INCONDICIONADO

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vDescIncond



768
769
770
# File 'lib/br_nfe/product/nota_fiscal.rb', line 768

def total_servicos_desconto_incondicionado
  @total_servicos_desconto_incondicionado
end

#total_servicos_issObject

VALOR TOTAL DO ISS

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vISS



691
692
693
# File 'lib/br_nfe/product/nota_fiscal.rb', line 691

def total_servicos_iss
  @total_servicos_iss
end

#total_servicos_iss_retidoObject

VALOR TOTAL RETENÇÃO ISS

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vISSRet



792
793
794
# File 'lib/br_nfe/product/nota_fiscal.rb', line 792

def total_servicos_iss_retido
  @total_servicos_iss_retido
end

#total_servicos_outras_retencoesObject

VALOR TOTAL OUTRAS RETENÇÕES DO ISSQN

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vOutro



756
757
758
# File 'lib/br_nfe/product/nota_fiscal.rb', line 756

def total_servicos_outras_retencoes
  @total_servicos_outras_retencoes
end

#total_servicos_pisObject

VALOR TOTAL DO PIS SOBRE SERVIÇOS

Type: Float Required: No Example: 178.46 Length: 13v2 tag: total/ISSQNtot/vPIS



703
704
705
# File 'lib/br_nfe/product/nota_fiscal.rb', line 703

def total_servicos_pis
  @total_servicos_pis
end

#total_tributosObject

VALOR APROXIMADO TOTAL DE TRIBUTOS FEDERAIS, ESTADUAIS E MUNICIPAIS. (NT 2013/003)

Type: Float Required: Yes Example: 178.46 Length: 13v2 tag: total/ICMSTot/vTotTrib



654
655
656
# File 'lib/br_nfe/product/nota_fiscal.rb', line 654

def total_tributos
  @total_tributos
end

#versaoObject

Identificação do emitente da NF-e Versão do XML



8
9
10
# File 'lib/br_nfe/product/nota_fiscal.rb', line 8

def versao
  @versao
end

#versao_aplicativoObject

Versão do Processo de emissão da NF-e Informar a versão do aplicativo emissor de NF-e.

Required: Yes Default: 0 tag: verProc



269
270
271
# File 'lib/br_nfe/product/nota_fiscal.rb', line 269

def versao_aplicativo
  @versao_aplicativo
end

#xmlObject

Utilizado para setar o XML da nfe na resposta



977
978
979
# File 'lib/br_nfe/product/nota_fiscal.rb', line 977

def xml
  @xml
end

#xml_inf_nfeObject

Utilizado para setar o XML da tag <infNFe> Serve apenas se deseja pegar apenas a informação da NF-e sem a assinatura.



982
983
984
# File 'lib/br_nfe/product/nota_fiscal.rb', line 982

def xml_inf_nfe
  @xml_inf_nfe
end

Instance Method Details

#chave_de_acesso_dvObject



49
50
51
# File 'lib/br_nfe/product/nota_fiscal.rb', line 49

def chave_de_acesso_dv
	chave_de_acesso[-1]
end

#chave_de_acesso_sem_dvObject



52
53
54
# File 'lib/br_nfe/product/nota_fiscal.rb', line 52

def chave_de_acesso_sem_dv
	chave_de_acesso[0..-2]
end

#default_valuesObject



1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1065

def default_values
	{
		versao_aplicativo:   0,
		natureza_operacao:   'Venda',
		forma_pagamento:     0, # 0=À vista
		modelo_nf:           55, #NF-e
		data_hora_emissao:   Time.current.in_time_zone,
		data_hora_expedicao: Time.current.in_time_zone,
		tipo_operacao:       1, # 1=Saída
		tipo_impressao:      1, # 1=DANFE normal, Retrato;
		finalidade_emissao:  1, # 1=NF-e normal;
		presenca_comprador:  9, # 9=Operação não presencial, outros.
		processo_emissao:    0, # 0=Emissão de NF-e com aplicativo do contribuinte;
		codigo_tipo_emissao: 1, # 1=Normal
		servicos_data_prestacao:   Date.current,
		regime_tributario_servico: 1, # 1=Microempresa Municipal;
	}
end

#get_situation_by_status_codeObject



1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1044

def get_situation_by_status_code
	if "#{status_code}".strip.in?(    BrNfe::Constants::NFE_SITUATION_AUTORIZED )
		:authorized
	elsif "#{status_code}".strip.in?( BrNfe::Constants::NFE_SITUATION_ADJUSTED )
		:adjusted
	elsif "#{status_code}".strip.in?( BrNfe::Constants::NFE_SITUATION_CANCELED )
		:canceled
	elsif "#{status_code}".strip.in?( BrNfe::Constants::NFE_SITUATION_DENIED )
		:denied
	elsif status_code.blank? || "#{status_code}".strip.in?( BrNfe::Constants::NFE_SITUATION_DRAFT )
		:draft
	else
		:rejected
	end
end

#has_any_product?Boolean

Returns:

  • (Boolean)


1164
1165
1166
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1164

def has_any_product?
	itens.select(&:is_product?).any?
end

#has_any_service?Boolean

Returns:

  • (Boolean)


1160
1161
1162
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1160

def has_any_service?
	itens.select(&:is_service?).any?
end

#has_taxes_retention?Boolean

MÉTODO PARA SABER SE EXISTE ALGUM VALOR NO TOTALIZADOR DE RETENÇÃO DE IMPOSTOS. Utilizado para saber se deve ou não colocar a tag de totalizador de retenções no XML.

Tipo: Boolean

Returns:

  • (Boolean)


1174
1175
1176
1177
1178
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1174

def has_taxes_retention?
	total_retencao_pis.to_f  > 0.0 || total_retencao_cofins.to_f > 0.0 ||
	total_retencao_csll.to_f > 0.0 || total_retencao_irrf.to_f > 0.0   ||
	total_retencao_previdencia.to_f > 0.0
end

#nfce?Boolean

Returns:

  • (Boolean)


1156
1157
1158
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1156

def nfce?
	modelo_nf.to_i == 65
end

#nfe?Boolean

Returns:

  • (Boolean)


1152
1153
1154
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1152

def nfe?
	modelo_nf.to_i == 55
end

#statusObject



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1014

def status
	if "#{status_code}   ".strip.in?( BrNfe::Constants::NFE_STATUS_SUCCESS )
		:success
	elsif "#{status_code}".strip.in?( BrNfe::Constants::NFE_STATUS_PROCESSING )
		:processing
	elsif "#{status_code}".strip.in?( BrNfe::Constants::NFE_STATUS_OFFLINE )
		:offline
	elsif "#{status_code}".strip.in?( BrNfe::Constants::NFE_STATUS_DENIED )
		:denied
	elsif status_code.present?
		:error
	end
end