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



326
327
328
# File 'lib/br_nfe/product/nota_fiscal.rb', line 326

def autorizados_download_xml
  @autorizados_download_xml
end

#chave_de_acessoObject

Returns the value of attribute chave_de_acesso.



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

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



67
68
69
# File 'lib/br_nfe/product/nota_fiscal.rb', line 67

def codigo_nf
  @codigo_nf
end

#codigo_tipo_emissaoObject

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

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



39
40
41
# File 'lib/br_nfe/product/nota_fiscal.rb', line 39

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



223
224
225
# File 'lib/br_nfe/product/nota_fiscal.rb', line 223

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



148
149
150
# File 'lib/br_nfe/product/nota_fiscal.rb', line 148

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



162
163
164
# File 'lib/br_nfe/product/nota_fiscal.rb', line 162

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.


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

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



312
313
314
# File 'lib/br_nfe/product/nota_fiscal.rb', line 312

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



286
287
288
# File 'lib/br_nfe/product/nota_fiscal.rb', line 286

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



952
953
954
# File 'lib/br_nfe/product/nota_fiscal.rb', line 952

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



940
941
942
# File 'lib/br_nfe/product/nota_fiscal.rb', line 940

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



928
929
930
# File 'lib/br_nfe/product/nota_fiscal.rb', line 928

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



208
209
210
# File 'lib/br_nfe/product/nota_fiscal.rb', line 208

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



125
126
127
# File 'lib/br_nfe/product/nota_fiscal.rb', line 125

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



904
905
906
# File 'lib/br_nfe/product/nota_fiscal.rb', line 904

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



893
894
895
# File 'lib/br_nfe/product/nota_fiscal.rb', line 893

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



138
139
140
# File 'lib/br_nfe/product/nota_fiscal.rb', line 138

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



111
112
113
# File 'lib/br_nfe/product/nota_fiscal.rb', line 111

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



95
96
97
# File 'lib/br_nfe/product/nota_fiscal.rb', line 95

def numero_nf
  @numero_nf
end

#presenca_compradorObject

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

0=N

Required: Yes Default: 9 tag: indPres



242
243
244
# File 'lib/br_nfe/product/nota_fiscal.rb', line 242

def presenca_comprador
  @presenca_comprador
end

#processed_atObject

DATA E HORA DO PROCESSAMENTO DA REQUISIÇÃO



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

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



255
256
257
# File 'lib/br_nfe/product/nota_fiscal.rb', line 255

def processo_emissao
  @processo_emissao
end

#protocolObject

PROTOCOLO / NÚMERO DO RECIBO

N


964
965
966
# File 'lib/br_nfe/product/nota_fiscal.rb', line 964

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

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



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

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

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

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



84
85
86
# File 'lib/br_nfe/product/nota_fiscal.rb', line 84

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



710
711
712
# File 'lib/br_nfe/product/nota_fiscal.rb', line 710

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.



1016
1017
1018
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1016

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)



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

def status_code
  @status_code
end

#status_motiveObject

Returns the value of attribute status_motive.



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

def status_motive
  @status_motive
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

Required: Yes Default: 1 tag: tpEmis



195
196
197
# File 'lib/br_nfe/product/nota_fiscal.rb', line 195

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



178
179
180
# File 'lib/br_nfe/product/nota_fiscal.rb', line 178

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



598
599
600
# File 'lib/br_nfe/product/nota_fiscal.rb', line 598

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



550
551
552
# File 'lib/br_nfe/product/nota_fiscal.rb', line 550

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



526
527
528
# File 'lib/br_nfe/product/nota_fiscal.rb', line 526

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



422
423
424
# File 'lib/br_nfe/product/nota_fiscal.rb', line 422

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



410
411
412
# File 'lib/br_nfe/product/nota_fiscal.rb', line 410

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



490
491
492
# File 'lib/br_nfe/product/nota_fiscal.rb', line 490

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



434
435
436
# File 'lib/br_nfe/product/nota_fiscal.rb', line 434

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 

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



449
450
451
# File 'lib/br_nfe/product/nota_fiscal.rb', line 449

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



502
503
504
# File 'lib/br_nfe/product/nota_fiscal.rb', line 502

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

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



464
465
466
# File 'lib/br_nfe/product/nota_fiscal.rb', line 464

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

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



478
479
480
# File 'lib/br_nfe/product/nota_fiscal.rb', line 478

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



562
563
564
# File 'lib/br_nfe/product/nota_fiscal.rb', line 562

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



574
575
576
# File 'lib/br_nfe/product/nota_fiscal.rb', line 574

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



622
623
624
# File 'lib/br_nfe/product/nota_fiscal.rb', line 622

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



610
611
612
# File 'lib/br_nfe/product/nota_fiscal.rb', line 610

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



586
587
588
# File 'lib/br_nfe/product/nota_fiscal.rb', line 586

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



514
515
516
# File 'lib/br_nfe/product/nota_fiscal.rb', line 514

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



844
845
846
# File 'lib/br_nfe/product/nota_fiscal.rb', line 844

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



868
869
870
# File 'lib/br_nfe/product/nota_fiscal.rb', line 868

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



820
821
822
# File 'lib/br_nfe/product/nota_fiscal.rb', line 820

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



832
833
834
# File 'lib/br_nfe/product/nota_fiscal.rb', line 832

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



856
857
858
# File 'lib/br_nfe/product/nota_fiscal.rb', line 856

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



808
809
810
# File 'lib/br_nfe/product/nota_fiscal.rb', line 808

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



880
881
882
# File 'lib/br_nfe/product/nota_fiscal.rb', line 880

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



538
539
540
# File 'lib/br_nfe/product/nota_fiscal.rb', line 538

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



648
649
650
# File 'lib/br_nfe/product/nota_fiscal.rb', line 648

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



660
661
662
# File 'lib/br_nfe/product/nota_fiscal.rb', line 660

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



696
697
698
# File 'lib/br_nfe/product/nota_fiscal.rb', line 696

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



725
726
727
# File 'lib/br_nfe/product/nota_fiscal.rb', line 725

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



761
762
763
# File 'lib/br_nfe/product/nota_fiscal.rb', line 761

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



749
750
751
# File 'lib/br_nfe/product/nota_fiscal.rb', line 749

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



672
673
674
# File 'lib/br_nfe/product/nota_fiscal.rb', line 672

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



773
774
775
# File 'lib/br_nfe/product/nota_fiscal.rb', line 773

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



737
738
739
# File 'lib/br_nfe/product/nota_fiscal.rb', line 737

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



684
685
686
# File 'lib/br_nfe/product/nota_fiscal.rb', line 684

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



635
636
637
# File 'lib/br_nfe/product/nota_fiscal.rb', line 635

def total_tributos
  @total_tributos
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



265
266
267
# File 'lib/br_nfe/product/nota_fiscal.rb', line 265

def versao_aplicativo
  @versao_aplicativo
end

#xmlObject

Utilizado para setar o XML da nfe na resposta



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

def xml
  @xml
end

Instance Method Details

#chave_de_acesso_dvObject



45
46
47
# File 'lib/br_nfe/product/nota_fiscal.rb', line 45

def chave_de_acesso_dv
  chave_de_acesso[-1]
end

#chave_de_acesso_sem_dvObject



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

def chave_de_acesso_sem_dv
  chave_de_acesso[0..-2]
end

#default_valuesObject



1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1036

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



1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1020

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)


1135
1136
1137
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1135

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

#has_any_service?Boolean

Returns:

  • (Boolean)


1131
1132
1133
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1131

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)


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

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)


1127
1128
1129
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1127

def nfce?
  modelo_nf.to_i == 65
end

#nfe?Boolean

Returns:

  • (Boolean)


1123
1124
1125
# File 'lib/br_nfe/product/nota_fiscal.rb', line 1123

def nfe?
  modelo_nf.to_i == 55
end

#statusObject



990
991
992
993
994
995
996
997
998
999
1000
1001
1002
# File 'lib/br_nfe/product/nota_fiscal.rb', line 990

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