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



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

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.


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

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



316
317
318
# File 'lib/br_nfe/product/nota_fiscal.rb', line 316

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



290
291
292
# File 'lib/br_nfe/product/nota_fiscal.rb', line 290

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



956
957
958
# File 'lib/br_nfe/product/nota_fiscal.rb', line 956

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



944
945
946
# File 'lib/br_nfe/product/nota_fiscal.rb', line 944

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



932
933
934
# File 'lib/br_nfe/product/nota_fiscal.rb', line 932

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



908
909
910
# File 'lib/br_nfe/product/nota_fiscal.rb', line 908

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



897
898
899
# File 'lib/br_nfe/product/nota_fiscal.rb', line 897

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

#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



986
987
988
# File 'lib/br_nfe/product/nota_fiscal.rb', line 986

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


973
974
975
# File 'lib/br_nfe/product/nota_fiscal.rb', line 973

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



796
797
798
# File 'lib/br_nfe/product/nota_fiscal.rb', line 796

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



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

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.



1025
1026
1027
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1025

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)



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

def status_code
  @status_code
end

#status_motiveObject

Returns the value of attribute status_motive.



998
999
1000
# File 'lib/br_nfe/product/nota_fiscal.rb', line 998

def status_motive
  @status_motive
end

#tipo_ambienteObject

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



1047
1048
1049
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1047

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



602
603
604
# File 'lib/br_nfe/product/nota_fiscal.rb', line 602

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



554
555
556
# File 'lib/br_nfe/product/nota_fiscal.rb', line 554

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



530
531
532
# File 'lib/br_nfe/product/nota_fiscal.rb', line 530

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



426
427
428
# File 'lib/br_nfe/product/nota_fiscal.rb', line 426

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



414
415
416
# File 'lib/br_nfe/product/nota_fiscal.rb', line 414

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



494
495
496
# File 'lib/br_nfe/product/nota_fiscal.rb', line 494

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



438
439
440
# File 'lib/br_nfe/product/nota_fiscal.rb', line 438

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



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

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



506
507
508
# File 'lib/br_nfe/product/nota_fiscal.rb', line 506

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



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

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



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

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



566
567
568
# File 'lib/br_nfe/product/nota_fiscal.rb', line 566

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



578
579
580
# File 'lib/br_nfe/product/nota_fiscal.rb', line 578

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



626
627
628
# File 'lib/br_nfe/product/nota_fiscal.rb', line 626

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



614
615
616
# File 'lib/br_nfe/product/nota_fiscal.rb', line 614

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



590
591
592
# File 'lib/br_nfe/product/nota_fiscal.rb', line 590

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



518
519
520
# File 'lib/br_nfe/product/nota_fiscal.rb', line 518

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



848
849
850
# File 'lib/br_nfe/product/nota_fiscal.rb', line 848

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



872
873
874
# File 'lib/br_nfe/product/nota_fiscal.rb', line 872

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



824
825
826
# File 'lib/br_nfe/product/nota_fiscal.rb', line 824

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



836
837
838
# File 'lib/br_nfe/product/nota_fiscal.rb', line 836

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



860
861
862
# File 'lib/br_nfe/product/nota_fiscal.rb', line 860

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



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

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



884
885
886
# File 'lib/br_nfe/product/nota_fiscal.rb', line 884

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



542
543
544
# File 'lib/br_nfe/product/nota_fiscal.rb', line 542

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



652
653
654
# File 'lib/br_nfe/product/nota_fiscal.rb', line 652

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



664
665
666
# File 'lib/br_nfe/product/nota_fiscal.rb', line 664

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



700
701
702
# File 'lib/br_nfe/product/nota_fiscal.rb', line 700

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



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

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



765
766
767
# File 'lib/br_nfe/product/nota_fiscal.rb', line 765

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



753
754
755
# File 'lib/br_nfe/product/nota_fiscal.rb', line 753

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



676
677
678
# File 'lib/br_nfe/product/nota_fiscal.rb', line 676

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



777
778
779
# File 'lib/br_nfe/product/nota_fiscal.rb', line 777

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



741
742
743
# File 'lib/br_nfe/product/nota_fiscal.rb', line 741

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



688
689
690
# File 'lib/br_nfe/product/nota_fiscal.rb', line 688

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



639
640
641
# File 'lib/br_nfe/product/nota_fiscal.rb', line 639

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



962
963
964
# File 'lib/br_nfe/product/nota_fiscal.rb', line 962

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.



967
968
969
# File 'lib/br_nfe/product/nota_fiscal.rb', line 967

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



1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1050

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



1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1029

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)


1149
1150
1151
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1149

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

#has_any_service?Boolean

Returns:

  • (Boolean)


1145
1146
1147
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1145

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)


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

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)


1141
1142
1143
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1141

def nfce?
	modelo_nf.to_i == 65
end

#nfe?Boolean

Returns:

  • (Boolean)


1137
1138
1139
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1137

def nfe?
	modelo_nf.to_i == 55
end

#statusObject



999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
# File 'lib/br_nfe/product/nota_fiscal.rb', line 999

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