br_nfe 2.3.2 → 3.0.0.beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +2 -2
  3. data/README.markdown +1 -1
  4. data/br_nfe.gemspec +0 -0
  5. data/lib/br_nfe/constants.rb +2 -2
  6. data/lib/br_nfe/product/nf_xml_value.rb +6 -11
  7. data/lib/br_nfe/product/nfe/cobranca/pagamento.rb +39 -12
  8. data/lib/br_nfe/product/nfe/item.rb +83 -36
  9. data/lib/br_nfe/product/nfe/item_tax/icms.rb +182 -46
  10. data/lib/br_nfe/product/nfe/item_tax/icms_uf_destino.rb +33 -22
  11. data/lib/br_nfe/product/nfe/item_tax/ipi.rb +18 -18
  12. data/lib/br_nfe/product/nfe/transporte/base.rb +17 -15
  13. data/lib/br_nfe/product/nota_fiscal.rb +72 -6
  14. data/lib/br_nfe/product/operation/base.rb +14 -13
  15. data/lib/br_nfe/product/reader/item.rb +19 -2
  16. data/lib/br_nfe/product/reader/nfe.rb +28 -9
  17. data/lib/br_nfe/product/xml/v3_10/infNFe/det/_tc_prod.xml.slim +2 -2
  18. data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/_tc_ICMSUFDest.xml.slim +1 -1
  19. data/lib/br_nfe/product/xml/v4_00/_tc_infNFe.xml.slim +45 -0
  20. data/lib/br_nfe/product/xml/v4_00/infNFe/_tc_ide.xml.slim +30 -0
  21. data/lib/br_nfe/product/xml/v4_00/infNFe/_tc_total.xml.slim +84 -0
  22. data/lib/br_nfe/product/xml/v4_00/infNFe/det/_tc_prod.xml.slim +62 -0
  23. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS00.xml.slim +11 -0
  24. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS10.xml.slim +28 -0
  25. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim +18 -0
  26. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS201.xml.slim +21 -0
  27. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS202.xml.slim +20 -0
  28. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim +23 -0
  29. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS500.xml.slim +13 -0
  30. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim +25 -0
  31. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS60.xml.slim +12 -0
  32. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim +35 -0
  33. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim +38 -0
  34. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS900.xml.slim +31 -0
  35. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/_tc_ICMSUFDest.xml.slim +15 -0
  36. data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/_tc_IPI.xml.slim +27 -0
  37. data/lib/br_nfe/product/xml/v4_00/infNFe/pag/_tc_detPag.xml.slim +17 -0
  38. data/lib/br_nfe/version.rb +4 -4
  39. data/lib/config/settings/nfe/reader_xml_paths.yml +40 -9
  40. data/lib/config/settings/nfe/v4_00/operation.yml +843 -0
  41. data/lib/config/settings/nfe/v4_00/soap_client.yml +807 -0
  42. data/lib/config/settings/nfe/v4_00/xml_paths.yml +577 -0
  43. data/test/br_nfe/product/nfe/item_tax/icms_uf_destino_test.rb +9 -8
  44. data/test/br_nfe/product/nota_fiscal_test.rb +28 -36
  45. data/test/br_nfe/product/reader/nfe_test.rb +31 -31
  46. data/test/factories/product/nfe/item_tax/icms_uf_destino.rb +1 -1
  47. data/test/factories/product/operation/nfe_autorizacao.rb +3 -3
  48. metadata +26 -4
@@ -2,8 +2,8 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Product::NotaFiscal do
4
4
  subject { FactoryGirl.build(:product_nota_fiscal, emitente: emitente) }
5
- let(:endereco) { FactoryGirl.build(:endereco) }
6
- let(:emitente) { FactoryGirl.build(:product_emitente, endereco: endereco) }
5
+ let(:endereco) { FactoryGirl.build(:endereco) }
6
+ let(:emitente) { FactoryGirl.build(:product_emitente, endereco: endereco) }
7
7
 
8
8
  let(:pagamento) { FactoryGirl.build(:product_cobranca_pagamento) }
9
9
 
@@ -12,7 +12,6 @@ describe BrNfe::Product::NotaFiscal do
12
12
  it { must_have_alias_attribute :cNF, :codigo_nf }
13
13
  it { must_have_alias_attribute :nNF, :numero_nf }
14
14
  it { must_have_alias_attribute :natOp, :natureza_operacao }
15
- it { must_have_alias_attribute :indPag, :forma_pagamento }
16
15
  it { must_have_alias_attribute :mod, :modelo_nf }
17
16
  it { must_have_alias_attribute :dhEmi, :data_hora_emissao, Time.current.in_time_zone }
18
17
  it { must_have_alias_attribute :dhSaiEnt, :data_hora_expedicao, Time.current.in_time_zone }
@@ -30,7 +29,7 @@ describe BrNfe::Product::NotaFiscal do
30
29
  it { must_have_alias_attribute :cobranca, :fatura, BrNfe.fatura_product_class.new }
31
30
  it { must_have_alias_attribute :cobr, :fatura, BrNfe.fatura_product_class.new }
32
31
  it { must_have_alias_attribute :pag, :pagamentos, [BrNfe.pagamento_product_class.new] }
33
-
32
+
34
33
  it { must_have_alias_attribute :ICMSTot_vBC, :total_icms_base_calculo }
35
34
  it { must_have_alias_attribute :ICMSTot_vICMS, :total_icms }
36
35
  it { must_have_alias_attribute :ICMSTot_vICMSDeson, :total_icms_desonerado }
@@ -80,9 +79,6 @@ describe BrNfe::Product::NotaFiscal do
80
79
  it '#natureza_operacao deve ter o padrão Venda' do
81
80
  subject.class.new.natureza_operacao.must_equal 'Venda'
82
81
  end
83
- it '#forma_pagamento deve ter o padrão 0' do
84
- subject.class.new.forma_pagamento.must_equal 0
85
- end
86
82
  it '#modelo_nf deve ter o padrão 55' do
87
83
  subject.class.new.modelo_nf.must_equal 55
88
84
  end
@@ -113,10 +109,10 @@ describe BrNfe::Product::NotaFiscal do
113
109
  end
114
110
 
115
111
  describe "Validations" do
116
- before do
112
+ before do
117
113
  MiniTest::Spec.string_for_validation_length = '1'
118
114
  end
119
- after do
115
+ after do
120
116
  MiniTest::Spec.string_for_validation_length = 'x'
121
117
  end
122
118
 
@@ -139,10 +135,6 @@ describe BrNfe::Product::NotaFiscal do
139
135
  context '#natureza_operacao' do
140
136
  it { must validate_presence_of(:natureza_operacao) }
141
137
  end
142
- context '#forma_pagamento' do
143
- it { must validate_presence_of(:forma_pagamento) }
144
- it { must validate_inclusion_of(:forma_pagamento).in_array([0, 1, 2, '0', '1', '2']) }
145
- end
146
138
  context '#modelo_nf' do
147
139
  it { must validate_presence_of(:modelo_nf) }
148
140
  it { must validate_inclusion_of(:modelo_nf).in_array([55, 65, '55', '65']) }
@@ -153,11 +145,11 @@ describe BrNfe::Product::NotaFiscal do
153
145
  context '#data_hora_expedicao' do
154
146
  it "deve ser obrigatório se for uma NF-e" do
155
147
  subject.modelo_nf = 55
156
- must validate_presence_of(:data_hora_expedicao)
148
+ must validate_presence_of(:data_hora_expedicao)
157
149
  end
158
150
  it "não deve ser obrigatório se for uma NFC-e" do
159
151
  subject.modelo_nf = 65
160
- wont validate_presence_of(:data_hora_expedicao)
152
+ wont validate_presence_of(:data_hora_expedicao)
161
153
  end
162
154
  end
163
155
  context '#tipo_operacao' do
@@ -170,7 +162,7 @@ describe BrNfe::Product::NotaFiscal do
170
162
  end
171
163
  context '#presenca_comprador' do
172
164
  it { must validate_presence_of(:presenca_comprador) }
173
- it { must validate_inclusion_of(:presenca_comprador).in_array([0, 1, 2, 3, 4, 9, '0', '1', '2', '3', '4', '9']) }
165
+ it { must validate_inclusion_of(:presenca_comprador).in_array([0, 1, 2, 3, 4, 5, 9, '0', '1', '2', '3', '4', '5', '9']) }
174
166
  end
175
167
  context '#processo_emissao' do
176
168
  it { must validate_presence_of(:processo_emissao) }
@@ -188,7 +180,7 @@ describe BrNfe::Product::NotaFiscal do
188
180
  end
189
181
  context "quando o endereco_entrega não for preenchido" do
190
182
  before { subject.endereco_entrega = nil }
191
- it { wont validate_presence_of(:endereco_entrega_cpf_cnpj) }
183
+ it { wont validate_presence_of(:endereco_entrega_cpf_cnpj) }
192
184
  it { wont validate_length_of(:endereco_entrega_cpf_cnpj).is_at_most(14) }
193
185
  end
194
186
  end
@@ -200,7 +192,7 @@ describe BrNfe::Product::NotaFiscal do
200
192
  end
201
193
  context "quando o endereco_retirada não for preenchido" do
202
194
  before { subject.endereco_retirada = nil }
203
- it { wont validate_presence_of(:endereco_retirada_cpf_cnpj) }
195
+ it { wont validate_presence_of(:endereco_retirada_cpf_cnpj) }
204
196
  it { wont validate_length_of(:endereco_retirada_cpf_cnpj).is_at_most(14) }
205
197
  end
206
198
  end
@@ -400,17 +392,17 @@ describe BrNfe::Product::NotaFiscal do
400
392
  end
401
393
 
402
394
  describe '#endereco_retirada' do
403
- it { must_have_one(:endereco_retirada,
404
- BrNfe.endereco_class,
395
+ it { must_have_one(:endereco_retirada,
396
+ BrNfe.endereco_class,
405
397
  {logradouro: 'LOG', numero: 'NR', bairro: "BRR"}
406
398
  )}
407
399
  it { must_validate_have_one(:endereco_retirada, BrNfe.endereco_class, :invalid_endereco_retirada) }
408
400
  end
409
401
 
410
402
  describe '#endereco_entrega' do
411
- it '316' do
412
- must_have_one(:endereco_entrega,
413
- BrNfe.endereco_class,
403
+ it '316' do
404
+ must_have_one(:endereco_entrega,
405
+ BrNfe.endereco_class,
414
406
  {logradouro: 'LOG', numero: 'NR', bairro: "BRR"}
415
407
  )
416
408
  end
@@ -441,7 +433,7 @@ describe BrNfe::Product::NotaFiscal do
441
433
  end
442
434
 
443
435
  describe '#emitente' do
444
- it 'have one' do
436
+ it 'have one' do
445
437
  must_have_one(:emitente,
446
438
  BrNfe.emitente_product_class,
447
439
  {nome_fantasia: 'FANTASIA', razao_social: 'RAZAO'},
@@ -452,7 +444,7 @@ describe BrNfe::Product::NotaFiscal do
452
444
  end
453
445
 
454
446
  describe '#destinatario' do
455
- it 'have one' do
447
+ it 'have one' do
456
448
  must_have_one(:destinatario,
457
449
  BrNfe.destinatario_product_class,
458
450
  {nome_fantasia: 'FANTASIA', razao_social: 'RAZAO'},
@@ -463,16 +455,16 @@ describe BrNfe::Product::NotaFiscal do
463
455
  end
464
456
 
465
457
  describe '#transporte' do
466
- it { must_have_one(:transporte,
467
- BrNfe.transporte_product_class,
458
+ it { must_have_one(:transporte,
459
+ BrNfe.transporte_product_class,
468
460
  {retencao_cfop: 'LOG', retencao_valor_sevico: 50.55}
469
461
  )}
470
462
  it { must_validate_have_one(:transporte, BrNfe.transporte_product_class, :invalid_transporte) }
471
463
  end
472
464
 
473
465
  describe '#fatura' do
474
- it { must_have_one(:fatura,
475
- BrNfe.fatura_product_class,
466
+ it { must_have_one(:fatura,
467
+ BrNfe.fatura_product_class,
476
468
  {numero_fatura: 'LOG', valor_original: 50.55}
477
469
  )}
478
470
  it { must_validate_have_one(:fatura, BrNfe.fatura_product_class, :invalid_fatura) }
@@ -480,13 +472,13 @@ describe BrNfe::Product::NotaFiscal do
480
472
 
481
473
  describe '#pagamentos' do
482
474
  it { must_have_many(:pagamentos, BrNfe.pagamento_product_class, {forma_pagamento: '1', total: 350.00}) }
483
- it { must_validate_length_has_many(:pagamentos,
484
- BrNfe.pagamento_product_class,
475
+ it { must_validate_length_has_many(:pagamentos,
476
+ BrNfe.pagamento_product_class,
485
477
  condition: :nfce?
486
478
  )}
487
-
488
- it { must_validates_has_many(:pagamentos,
489
- BrNfe.pagamento_product_class,
479
+
480
+ it { must_validates_has_many(:pagamentos,
481
+ BrNfe.pagamento_product_class,
490
482
  :invalid_pagamento,
491
483
  condition: :nfce?
492
484
  )}
@@ -494,8 +486,8 @@ describe BrNfe::Product::NotaFiscal do
494
486
 
495
487
  describe '#itens' do
496
488
  it { must_have_many(:itens, BrNfe.item_product_class, {codigo_produto: 'P123', codigo_ean: '123456'}) }
497
- it { must_validate_length_has_many(:itens,
498
- BrNfe.item_product_class,
489
+ it { must_validate_length_has_many(:itens,
490
+ BrNfe.item_product_class,
499
491
  minimum: 1
500
492
  )}
501
493
  it { must_validates_has_many(:itens, BrNfe.item_product_class, :invalid_item) }
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  describe BrNfe::Product::Reader::Nfe do
4
4
  describe "XML Version 3.10" do
5
- let(:nfe_completa) { read_fixture('product/nfe/v3_10/completa.xml') }
5
+ let(:nfe_completa) { read_fixture('product/nfe/v3_10/completa.xml') }
6
6
  let(:nfe_without_proc) { read_fixture('product/nfe/v3_10/without_proc.xml') }
7
7
  describe "Valores da nota fiscal" do
8
8
  it "Deve carregar os totais da nota fiscal" do
@@ -167,7 +167,7 @@ describe BrNfe::Product::Reader::Nfe do
167
167
  dest.endereco_nome_pais.must_equal 'BRASIL'
168
168
  dest.telefone.must_equal '49991471446'
169
169
  dest.indicador_ie.must_equal 9
170
- dest.email.must_equal 'felipe_lucca@live.ie'
170
+ dest.email.must_equal 'felipe_lucca@live.ie'
171
171
  dest.inscricao_estadual.must_equal '99999999'
172
172
  dest.suframa.must_equal '66547'
173
173
  dest.inscricao_municipal.must_equal '4654564'
@@ -227,7 +227,7 @@ describe BrNfe::Product::Reader::Nfe do
227
227
  transporte.reboques[1].uf.must_equal 'RS'
228
228
  transporte.reboques[1].rntc.must_equal '654899'
229
229
  # Volumes
230
- transporte.volumes.size.must_equal 2
230
+ transporte.volumes.size.must_equal 2
231
231
  transporte.volumes[0].quantidade.must_equal '5'
232
232
  transporte.volumes[0].especie.must_equal 'CAIXA'
233
233
  transporte.volumes[0].marca.must_equal 'DUO'
@@ -358,7 +358,7 @@ describe BrNfe::Product::Reader::Nfe do
358
358
  end
359
359
  end
360
360
  describe '#Itens da nota fiscal' do
361
- let(:invoice) { BrNfe::Product::Reader::Nfe.new(nfe_completa).invoice }
361
+ let(:invoice) { BrNfe::Product::Reader::Nfe.new(nfe_completa).invoice }
362
362
  it "Deve ler o Item 1 - ICMS-00" do
363
363
  item = invoice.itens[0]
364
364
  # Atributos
@@ -461,7 +461,7 @@ describe BrNfe::Product::Reader::Nfe do
461
461
  # ICMS UF DESTINO
462
462
  icms_uf_destino = item.icms_uf_destino
463
463
  icms_uf_destino.total_base_calculo.must_equal 0.0
464
- icms_uf_destino.percentual_fcp.must_equal 0.0
464
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
465
465
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
466
466
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
467
467
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -571,7 +571,7 @@ describe BrNfe::Product::Reader::Nfe do
571
571
  # ICMS UF DESTINO
572
572
  icms_uf_destino = item.icms_uf_destino
573
573
  icms_uf_destino.total_base_calculo.must_equal 0.0
574
- icms_uf_destino.percentual_fcp.must_equal 0.0
574
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
575
575
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
576
576
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
577
577
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -670,7 +670,7 @@ describe BrNfe::Product::Reader::Nfe do
670
670
  # ICMS UF DESTINO
671
671
  icms_uf_destino = item.icms_uf_destino
672
672
  icms_uf_destino.total_base_calculo.must_equal 0.0
673
- icms_uf_destino.percentual_fcp.must_equal 0.0
673
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
674
674
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
675
675
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
676
676
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -725,7 +725,7 @@ describe BrNfe::Product::Reader::Nfe do
725
725
  icms.total_base_calculo.must_equal 0.0
726
726
  icms.aliquota.must_equal 0.0
727
727
  icms.total.must_equal 0.0
728
-
728
+
729
729
  icms.modalidade_base_calculo_st.must_equal 4
730
730
  icms.mva_st.must_equal 40.0
731
731
  icms.reducao_base_calculo_st.must_equal 5.0
@@ -770,7 +770,7 @@ describe BrNfe::Product::Reader::Nfe do
770
770
  # ICMS UF DESTINO
771
771
  icms_uf_destino = item.icms_uf_destino
772
772
  icms_uf_destino.total_base_calculo.must_equal 0.0
773
- icms_uf_destino.percentual_fcp.must_equal 0.0
773
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
774
774
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
775
775
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
776
776
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -880,7 +880,7 @@ describe BrNfe::Product::Reader::Nfe do
880
880
  # ICMS UF DESTINO
881
881
  icms_uf_destino = item.icms_uf_destino
882
882
  icms_uf_destino.total_base_calculo.must_equal 0.0
883
- icms_uf_destino.percentual_fcp.must_equal 0.0
883
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
884
884
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
885
885
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
886
886
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -979,7 +979,7 @@ describe BrNfe::Product::Reader::Nfe do
979
979
  # ICMS UF DESTINO
980
980
  icms_uf_destino = item.icms_uf_destino
981
981
  icms_uf_destino.total_base_calculo.must_equal 0.0
982
- icms_uf_destino.percentual_fcp.must_equal 0.0
982
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
983
983
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
984
984
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
985
985
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1078,7 +1078,7 @@ describe BrNfe::Product::Reader::Nfe do
1078
1078
  # ICMS UF DESTINO
1079
1079
  icms_uf_destino = item.icms_uf_destino
1080
1080
  icms_uf_destino.total_base_calculo.must_equal 0.0
1081
- icms_uf_destino.percentual_fcp.must_equal 0.0
1081
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1082
1082
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1083
1083
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1084
1084
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1133,7 +1133,7 @@ describe BrNfe::Product::Reader::Nfe do
1133
1133
  icms.total_base_calculo.must_equal 598.9
1134
1134
  icms.aliquota.must_equal 3.33
1135
1135
  icms.total.must_equal 19.94
1136
-
1136
+
1137
1137
  icms.modalidade_base_calculo_st.must_be_nil
1138
1138
  icms.mva_st.must_equal 0.0
1139
1139
  icms.reducao_base_calculo_st.must_equal 0.0
@@ -1178,7 +1178,7 @@ describe BrNfe::Product::Reader::Nfe do
1178
1178
  # ICMS UF DESTINO
1179
1179
  icms_uf_destino = item.icms_uf_destino
1180
1180
  icms_uf_destino.total_base_calculo.must_equal 0.0
1181
- icms_uf_destino.percentual_fcp.must_equal 0.0
1181
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1182
1182
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1183
1183
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1184
1184
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1288,7 +1288,7 @@ describe BrNfe::Product::Reader::Nfe do
1288
1288
  # ICMS UF DESTINO
1289
1289
  icms_uf_destino = item.icms_uf_destino
1290
1290
  icms_uf_destino.total_base_calculo.must_equal 0.0
1291
- icms_uf_destino.percentual_fcp.must_equal 0.0
1291
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1292
1292
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1293
1293
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1294
1294
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1388,7 +1388,7 @@ describe BrNfe::Product::Reader::Nfe do
1388
1388
  # ICMS UF DESTINO
1389
1389
  icms_uf_destino = item.icms_uf_destino
1390
1390
  icms_uf_destino.total_base_calculo.must_equal 0.0
1391
- icms_uf_destino.percentual_fcp.must_equal 0.0
1391
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1392
1392
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1393
1393
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1394
1394
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1488,7 +1488,7 @@ describe BrNfe::Product::Reader::Nfe do
1488
1488
  # ICMS UF DESTINO
1489
1489
  icms_uf_destino = item.icms_uf_destino
1490
1490
  icms_uf_destino.total_base_calculo.must_equal 0.0
1491
- icms_uf_destino.percentual_fcp.must_equal 0.0
1491
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1492
1492
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1493
1493
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1494
1494
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1588,7 +1588,7 @@ describe BrNfe::Product::Reader::Nfe do
1588
1588
  # ICMS UF DESTINO
1589
1589
  icms_uf_destino = item.icms_uf_destino
1590
1590
  icms_uf_destino.total_base_calculo.must_equal 0.0
1591
- icms_uf_destino.percentual_fcp.must_equal 0.0
1591
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1592
1592
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1593
1593
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1594
1594
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1688,7 +1688,7 @@ describe BrNfe::Product::Reader::Nfe do
1688
1688
  # ICMS UF DESTINO
1689
1689
  icms_uf_destino = item.icms_uf_destino
1690
1690
  icms_uf_destino.total_base_calculo.must_equal 0.0
1691
- icms_uf_destino.percentual_fcp.must_equal 0.0
1691
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1692
1692
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1693
1693
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1694
1694
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1788,7 +1788,7 @@ describe BrNfe::Product::Reader::Nfe do
1788
1788
  # ICMS UF DESTINO
1789
1789
  icms_uf_destino = item.icms_uf_destino
1790
1790
  icms_uf_destino.total_base_calculo.must_equal 0.0
1791
- icms_uf_destino.percentual_fcp.must_equal 0.0
1791
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1792
1792
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1793
1793
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1794
1794
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1888,7 +1888,7 @@ describe BrNfe::Product::Reader::Nfe do
1888
1888
  # ICMS UF DESTINO
1889
1889
  icms_uf_destino = item.icms_uf_destino
1890
1890
  icms_uf_destino.total_base_calculo.must_equal 0.0
1891
- icms_uf_destino.percentual_fcp.must_equal 0.0
1891
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
1892
1892
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
1893
1893
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
1894
1894
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -1988,7 +1988,7 @@ describe BrNfe::Product::Reader::Nfe do
1988
1988
  # ICMS UF DESTINO
1989
1989
  icms_uf_destino = item.icms_uf_destino
1990
1990
  icms_uf_destino.total_base_calculo.must_equal 0.0
1991
- icms_uf_destino.percentual_fcp.must_equal 1.11
1991
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 1.11
1992
1992
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 18.00
1993
1993
  icms_uf_destino.aliquota_interestadual.must_equal 12.00
1994
1994
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -2088,7 +2088,7 @@ describe BrNfe::Product::Reader::Nfe do
2088
2088
  # ICMS UF DESTINO
2089
2089
  icms_uf_destino = item.icms_uf_destino
2090
2090
  icms_uf_destino.total_base_calculo.must_equal 0.0
2091
- icms_uf_destino.percentual_fcp.must_equal 2.0
2091
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 2.0
2092
2092
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 12.00
2093
2093
  icms_uf_destino.aliquota_interestadual.must_equal 17.00
2094
2094
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -2188,7 +2188,7 @@ describe BrNfe::Product::Reader::Nfe do
2188
2188
  # ICMS UF DESTINO
2189
2189
  icms_uf_destino = item.icms_uf_destino
2190
2190
  icms_uf_destino.total_base_calculo.must_equal 0.0
2191
- icms_uf_destino.percentual_fcp.must_equal 0.0
2191
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
2192
2192
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
2193
2193
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
2194
2194
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -2203,7 +2203,7 @@ describe BrNfe::Product::Reader::Nfe do
2203
2203
  item.codigo_produto.must_equal 'CM080P'
2204
2204
  item.codigo_ean.must_equal ''
2205
2205
  item.descricao_produto.must_equal 'AERTECNICA - CENTRAL DE ASPIRACAO PERFETTO P80'
2206
-
2206
+
2207
2207
  ###################### Associações HasMany ######################
2208
2208
  item.declaracoes_importacao.must_be_empty
2209
2209
  item.detalhes_exportacao.must_be_empty
@@ -2230,7 +2230,7 @@ describe BrNfe::Product::Reader::Nfe do
2230
2230
  # ICMS UF DESTINO
2231
2231
  icms_uf_destino = item.icms_uf_destino
2232
2232
  icms_uf_destino.total_base_calculo.must_equal 0.0
2233
- icms_uf_destino.percentual_fcp.must_equal 0.0
2233
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
2234
2234
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
2235
2235
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
2236
2236
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -2245,7 +2245,7 @@ describe BrNfe::Product::Reader::Nfe do
2245
2245
  item.codigo_produto.must_equal '164125'
2246
2246
  item.codigo_ean.must_equal ''
2247
2247
  item.descricao_produto.must_equal 'BELKIN - CAPA PARA IPHONE HALO TRANSPARENTE'
2248
-
2248
+
2249
2249
  ###################### Associações HasMany ######################
2250
2250
  item.declaracoes_importacao.must_be_empty
2251
2251
  item.detalhes_exportacao.must_be_empty
@@ -2280,7 +2280,7 @@ describe BrNfe::Product::Reader::Nfe do
2280
2280
  # ICMS UF DESTINO
2281
2281
  icms_uf_destino = item.icms_uf_destino
2282
2282
  icms_uf_destino.total_base_calculo.must_equal 0.0
2283
- icms_uf_destino.percentual_fcp.must_equal 0.0
2283
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 0.0
2284
2284
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 0.0
2285
2285
  icms_uf_destino.aliquota_interestadual.must_equal 0.0
2286
2286
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -2295,7 +2295,7 @@ describe BrNfe::Product::Reader::Nfe do
2295
2295
  item.codigo_produto.must_equal 'TQF110039'
2296
2296
  item.codigo_ean.must_equal ''
2297
2297
  item.descricao_produto.must_equal '7BALL - TAQUEIRA DE CHAO BUENOS AIRES PRETA'
2298
-
2298
+
2299
2299
  ###################### Associações HasMany ######################
2300
2300
  item.declaracoes_importacao.must_be_empty
2301
2301
  item.detalhes_exportacao.must_be_empty
@@ -2343,7 +2343,7 @@ describe BrNfe::Product::Reader::Nfe do
2343
2343
  # ICMS UF DESTINO
2344
2344
  icms_uf_destino = item.icms_uf_destino
2345
2345
  icms_uf_destino.total_base_calculo.must_equal 411.80
2346
- icms_uf_destino.percentual_fcp.must_equal 1.50
2346
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 1.50
2347
2347
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 17.00
2348
2348
  icms_uf_destino.aliquota_interestadual.must_equal 12.00
2349
2349
  icms_uf_destino.percentual_partilha_destino.must_equal 60.0
@@ -2475,7 +2475,7 @@ describe BrNfe::Product::Reader::Nfe do
2475
2475
  # ICMS UF DESTINO
2476
2476
  icms_uf_destino = item.icms_uf_destino
2477
2477
  icms_uf_destino.total_base_calculo.must_equal 1400.50
2478
- icms_uf_destino.percentual_fcp.must_equal 1.50
2478
+ icms_uf_destino.percentual_fcp_uf_destino.must_equal 1.50
2479
2479
  icms_uf_destino.aliquota_interna_uf_destino.must_equal 12.00
2480
2480
  icms_uf_destino.aliquota_interestadual.must_equal 17.00
2481
2481
  icms_uf_destino.percentual_partilha_destino.must_equal 80.00
@@ -1,7 +1,7 @@
1
1
  FactoryGirl.define do
2
2
  factory :product_item_tax_icms_uf_destino, class: BrNfe::Product::Nfe::ItemTax::IcmsUfDestino do
3
3
  total_base_calculo 345.64
4
- percentual_fcp 1.0
4
+ percentual_fcp_uf_destino 1.0
5
5
  aliquota_interna_uf_destino 17.0
6
6
  aliquota_interestadual 12.0
7
7
  total_fcp_destino 3.46
@@ -41,7 +41,7 @@ FactoryGirl.define do
41
41
  natureza_operacao: 'Venda', #Default
42
42
  forma_pagamento: 0, # Pagamento à vista; (Default)
43
43
  modelo_nf: 55, # Default
44
- data_hora_emissao: Time.current,
44
+ data_hora_emissao: Time.current,
45
45
  data_hora_expedicao: Time.current,
46
46
  tipo_operacao: 1, # Saída - Default
47
47
  tipo_impressao: 1, # DANFE normal, Retrato; (Default)
@@ -284,7 +284,7 @@ FactoryGirl.define do
284
284
  },
285
285
  icms_uf_destino: {
286
286
  total_base_calculo: 1400.50,
287
- percentual_fcp: 1.5,
287
+ percentual_fcp_uf_destino: 1.5,
288
288
  aliquota_interna_uf_destino: 12.0,
289
289
  aliquota_interestadual: 12.0,
290
290
  percentual_partilha_destino: 80.0,
@@ -430,7 +430,7 @@ FactoryGirl.define do
430
430
  natureza_operacao: 'Venda', #Default
431
431
  forma_pagamento: 0, # Pagamento à vista; (Default)
432
432
  modelo_nf: 55, # Default
433
- data_hora_emissao: Time.parse('25/12/2016 12:00:00 -0300'),
433
+ data_hora_emissao: Time.parse('25/12/2016 12:00:00 -0300'),
434
434
  data_hora_expedicao: Time.parse('25/12/2016 12:00:00 -0300'),
435
435
  tipo_operacao: 1, # Saída - Default
436
436
  tipo_impressao: 1, # DANFE normal, Retrato; (Default)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_nfe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 3.0.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno M. Mergen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-06 00:00:00.000000000 Z
11
+ date: 2018-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -305,6 +305,25 @@ files:
305
305
  - lib/br_nfe/product/xml/v3_10/infNFe/det/prod/_tc_det_export.xml.slim
306
306
  - lib/br_nfe/product/xml/v3_10/infNFe/det/prod/_tc_di.xml.slim
307
307
  - lib/br_nfe/product/xml/v3_10/root/NfeAutorizacao.xml.slim
308
+ - lib/br_nfe/product/xml/v4_00/_tc_infNFe.xml.slim
309
+ - lib/br_nfe/product/xml/v4_00/infNFe/_tc_ide.xml.slim
310
+ - lib/br_nfe/product/xml/v4_00/infNFe/_tc_total.xml.slim
311
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/_tc_prod.xml.slim
312
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS00.xml.slim
313
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS10.xml.slim
314
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim
315
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS201.xml.slim
316
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS202.xml.slim
317
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim
318
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS500.xml.slim
319
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim
320
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS60.xml.slim
321
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim
322
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim
323
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS900.xml.slim
324
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/_tc_ICMSUFDest.xml.slim
325
+ - lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/_tc_IPI.xml.slim
326
+ - lib/br_nfe/product/xml/v4_00/infNFe/pag/_tc_detPag.xml.slim
308
327
  - lib/br_nfe/service/association/have_intermediario.rb
309
328
  - lib/br_nfe/service/association/have_rps.rb
310
329
  - lib/br_nfe/service/base.rb
@@ -426,6 +445,9 @@ files:
426
445
  - lib/config/settings/nfe/v3_10/operation.yml
427
446
  - lib/config/settings/nfe/v3_10/soap_client.yml
428
447
  - lib/config/settings/nfe/v3_10/xml_paths.yml
448
+ - lib/config/settings/nfe/v4_00/operation.yml
449
+ - lib/config/settings/nfe/v4_00/soap_client.yml
450
+ - lib/config/settings/nfe/v4_00/xml_paths.yml
429
451
  - lib/config/settings/nfse.yml
430
452
  - test/br_nfe/association/have_address_test.rb
431
453
  - test/br_nfe/association/have_condicao_pagamento_test.rb
@@ -884,9 +906,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
884
906
  version: 2.3.6
885
907
  required_rubygems_version: !ruby/object:Gem::Requirement
886
908
  requirements:
887
- - - ">="
909
+ - - ">"
888
910
  - !ruby/object:Gem::Version
889
- version: '0'
911
+ version: 1.3.1
890
912
  requirements: []
891
913
  rubyforge_project:
892
914
  rubygems_version: 2.5.1