br_nfe 3.0.0.beta.1 → 3.0.0.beta.2
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.
- checksums.yaml +4 -4
- data/lib/br_nfe/constants.rb +0 -0
- data/lib/br_nfe/product/nf_xml_value.rb +7 -4
- data/lib/br_nfe/product/nfe/cobranca/pagamento.rb +0 -0
- data/lib/br_nfe/product/nfe/item.rb +0 -6
- data/lib/br_nfe/product/nfe/item_tax/icms.rb +0 -0
- data/lib/br_nfe/product/nfe/item_tax/icms_uf_destino.rb +0 -0
- data/lib/br_nfe/product/nfe/item_tax/ipi.rb +0 -0
- data/lib/br_nfe/product/nfe/transporte/base.rb +0 -0
- data/lib/br_nfe/product/operation/base.rb +0 -0
- data/lib/br_nfe/product/reader/item.rb +0 -0
- data/lib/br_nfe/product/reader/nfe.rb +0 -0
- data/lib/br_nfe/product/xml/v3_10/infNFe/det/imposto/_tc_ICMSUFDest.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/_tc_infNFe.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/_tc_cobr.xml.slim +15 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/_tc_total.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS00.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS10.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS20.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS201.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS202.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS30.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS500.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS51.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS60.xml.slim +1 -1
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS70.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS90.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/ICMS/_tc_ICMS900.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/_tc_ICMSUFDest.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/det/imposto/_tc_IPI.xml.slim +0 -0
- data/lib/br_nfe/product/xml/v4_00/infNFe/pag/_tc_detPag.xml.slim +0 -0
- data/lib/br_nfe/version.rb +1 -1
- data/lib/config/settings/nfe/reader_xml_paths.yml +0 -0
- data/lib/config/settings/nfe/v4_00/operation.yml +0 -0
- data/lib/config/settings/nfe/v4_00/xml_paths.yml +0 -0
- data/test/br_nfe/product/nfe/item_tax/icms_uf_destino_test.rb +0 -0
- data/test/br_nfe/product/nfe/item_test.rb +6 -17
- data/test/br_nfe/product/nota_fiscal_test.rb +0 -0
- data/test/br_nfe/product/reader/nfe_test.rb +43 -43
- data/test/factories/product/nfe/item_tax/icms_uf_destino.rb +0 -0
- data/test/factories/product/operation/nfe_autorizacao.rb +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 67be1594124aaa1ed825c0ce8a479d8954279a78
|
|
4
|
+
data.tar.gz: 27c2d0ea3a43e8f364532d4603ea957b7b218921
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 606af3f407cab3d88f9840af6ba32c9e3a277e274fe79251c8341a7787f32303d66fffc4a17fb0e2ab6aee1e41c71c908152d5cec254138627128c1288b1d520
|
|
7
|
+
data.tar.gz: 4ca04076d16bc986e240ceb7887c3cf7bb0b91170812685a5ef2380aaa00640865699116df7117012e2744328e328717ac44adbe3c625ed5e47b330cb4933066
|
data/lib/br_nfe/constants.rb
CHANGED
|
File without changes
|
|
@@ -188,11 +188,14 @@ module BrNfe
|
|
|
188
188
|
end
|
|
189
189
|
|
|
190
190
|
def nf_xml_value_EAN ean, xml_version=:v3_10
|
|
191
|
-
if ean.
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
if ean.present?
|
|
192
|
+
ean_str = "#{ean}".strip.upcase
|
|
193
|
+
if ean_str == 'SEM GTIN'
|
|
194
|
+
ean_str
|
|
195
|
+
elsif ean_str.size > 8
|
|
196
|
+
ean_str.gsub(/[^\d]/,'').rjust(12, '0')
|
|
194
197
|
else
|
|
195
|
-
|
|
198
|
+
ean_str.gsub(/[^\d]/,'').rjust(8, '0')
|
|
196
199
|
end
|
|
197
200
|
end
|
|
198
201
|
end
|
|
File without changes
|
|
@@ -53,9 +53,6 @@ module BrNfe
|
|
|
53
53
|
attr_accessor :codigo_ean
|
|
54
54
|
alias_attribute :codigo_gtin, :codigo_ean
|
|
55
55
|
alias_attribute :cEAN, :codigo_ean
|
|
56
|
-
def codigo_ean
|
|
57
|
-
"#{@codigo_ean}".gsub(/[^\d]/,'')
|
|
58
|
-
end
|
|
59
56
|
|
|
60
57
|
# Descrição do produto ou serviço
|
|
61
58
|
#
|
|
@@ -214,9 +211,6 @@ module BrNfe
|
|
|
214
211
|
#
|
|
215
212
|
attr_accessor :codigo_ean_tributavel
|
|
216
213
|
alias_attribute :codigo_gtin_tributavel, :codigo_ean_tributavel
|
|
217
|
-
def codigo_ean_tributavel
|
|
218
|
-
"#{@codigo_ean_tributavel}".gsub(/[^\d]/,'')
|
|
219
|
-
end
|
|
220
214
|
alias_attribute :cEANTrib, :codigo_ean_tributavel
|
|
221
215
|
|
|
222
216
|
# Unidade Tributável
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
- fatura = nfe.fatura
|
|
2
|
+
- if fatura.numero_fatura.present?
|
|
3
|
+
fat
|
|
4
|
+
nFat = nf_xml_value_text( fatura.numero_fatura, 60 )
|
|
5
|
+
vOrig = nf_xml_value_monetary( fatura.valor_original )
|
|
6
|
+
vDesc = nf_xml_value_monetary( fatura.valor_desconto )
|
|
7
|
+
vLiq = nf_xml_value_monetary( fatura.valor_liquido )
|
|
8
|
+
|
|
9
|
+
- fatura.duplicatas.each do |duplicata|
|
|
10
|
+
dup
|
|
11
|
+
- if duplicata.numero_duplicata.present?
|
|
12
|
+
nDup = nf_xml_value_text( duplicata.numero_duplicata, 60 )
|
|
13
|
+
- if duplicata.vencimento.present?
|
|
14
|
+
dVenc = nf_xml_value_date( duplicata.vencimento )
|
|
15
|
+
vDup = nf_xml_value_monetary( duplicata.total )
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
orig = icms.origem
|
|
2
2
|
CST = icms.codigo_cst
|
|
3
3
|
- if icms.total_base_calculo_st_retido.to_f > 0.0
|
|
4
|
-
|
|
4
|
+
vBCSTRet = nf_xml_value_monetary icms.total_base_calculo_st_retido
|
|
5
5
|
pST = nf_xml_value_percent( icms.aliquota_consumidor_final )
|
|
6
6
|
vICMSSTRet = nf_xml_value_monetary icms.total_st_retido
|
|
7
7
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
data/lib/br_nfe/version.rb
CHANGED
|
@@ -3,6 +3,6 @@ module BrNfe
|
|
|
3
3
|
MAJOR = 3 #inclui alterações de API e pode quebrar compatibilidade com versões anteriores
|
|
4
4
|
MINOR = 0 #inclui novas funcionalidades, sem quebrar APIs existentes
|
|
5
5
|
PATCH = 0 #corrige bugs ou traz melhorias em implementações já existentes
|
|
6
|
-
CURRENT = "#{MAJOR}.#{MINOR}.#{PATCH}.beta.
|
|
6
|
+
CURRENT = "#{MAJOR}.#{MINOR}.#{PATCH}.beta.2"
|
|
7
7
|
end
|
|
8
8
|
end
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -44,7 +44,7 @@ describe BrNfe::Product::Nfe::Item do
|
|
|
44
44
|
it { must_have_alias_attribute :ICMSUFDest, :icms_uf_destino, BrNfe.icms_uf_destino_item_tax_product_class.new }
|
|
45
45
|
it { must_have_alias_attribute :infAdProd, :informacoes_adicionais }
|
|
46
46
|
end
|
|
47
|
-
|
|
47
|
+
|
|
48
48
|
describe 'Default values' do
|
|
49
49
|
it "for tipo_produto" do
|
|
50
50
|
subject.class.new.tipo_produto.must_equal :product
|
|
@@ -55,10 +55,10 @@ describe BrNfe::Product::Nfe::Item do
|
|
|
55
55
|
end
|
|
56
56
|
|
|
57
57
|
describe 'Validations' do
|
|
58
|
-
before do
|
|
58
|
+
before do
|
|
59
59
|
MiniTest::Spec.string_for_validation_length = '1'
|
|
60
60
|
end
|
|
61
|
-
after do
|
|
61
|
+
after do
|
|
62
62
|
MiniTest::Spec.string_for_validation_length = 'x'
|
|
63
63
|
end
|
|
64
64
|
it { must validate_numericality_of(:total_frete).allow_nil }
|
|
@@ -66,13 +66,13 @@ describe BrNfe::Product::Nfe::Item do
|
|
|
66
66
|
it { must validate_numericality_of(:total_desconto).allow_nil }
|
|
67
67
|
it { must validate_numericality_of(:total_outros).allow_nil }
|
|
68
68
|
it { must validate_length_of(:codigo_cest).is_at_most(7) }
|
|
69
|
-
|
|
69
|
+
|
|
70
70
|
it { must validate_length_of(:numero_pedido_compra).is_at_most(15) }
|
|
71
71
|
it { must allow_value('').for(:numero_pedido_compra) }
|
|
72
72
|
|
|
73
73
|
it { must validate_length_of(:item_pedido_compra).is_at_most(6) }
|
|
74
74
|
it { must allow_value('').for(:item_pedido_compra) }
|
|
75
|
-
|
|
75
|
+
|
|
76
76
|
it { must validate_length_of(:informacoes_adicionais).is_at_most(500) }
|
|
77
77
|
|
|
78
78
|
describe "numero_fci" do
|
|
@@ -181,12 +181,6 @@ describe BrNfe::Product::Nfe::Item do
|
|
|
181
181
|
end
|
|
182
182
|
end
|
|
183
183
|
|
|
184
|
-
describe 'codigo_ean' do
|
|
185
|
-
it "Só aceita números" do
|
|
186
|
-
must_accept_only_numbers :codigo_ean
|
|
187
|
-
end
|
|
188
|
-
end
|
|
189
|
-
|
|
190
184
|
describe '#codigo_produto' do
|
|
191
185
|
it "deve retornar o valor da CFOP se não preenchero valor e tiver cfop" do
|
|
192
186
|
subject.cfop = 7896
|
|
@@ -228,11 +222,6 @@ describe BrNfe::Product::Nfe::Item do
|
|
|
228
222
|
it { must_returns_an_array :codigos_nve }
|
|
229
223
|
end
|
|
230
224
|
|
|
231
|
-
describe 'codigo_ean_tributavel' do
|
|
232
|
-
it "Só aceita números" do
|
|
233
|
-
must_accept_only_numbers :codigo_ean_tributavel
|
|
234
|
-
end
|
|
235
|
-
end
|
|
236
225
|
|
|
237
226
|
describe '#quantidade_tributavel' do
|
|
238
227
|
it "se a quantidade_tributavel for nil, deve considerar o valor de quantidade_comercial" do
|
|
@@ -319,7 +308,7 @@ describe BrNfe::Product::Nfe::Item do
|
|
|
319
308
|
end
|
|
320
309
|
describe '#icms' do
|
|
321
310
|
it { must_have_one :icms, BrNfe.icms_item_tax_product_class, {origem: 0, codigo_cst: '10'}, null: false }
|
|
322
|
-
|
|
311
|
+
|
|
323
312
|
it 'Se o item for um produto deve validar o ICMS' do
|
|
324
313
|
subject.tipo_produto = :product
|
|
325
314
|
must_validate_have_one :icms, BrNfe.icms_item_tax_product_class, :invalid_icms
|
|
File without changes
|
|
@@ -364,7 +364,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
364
364
|
# Atributos
|
|
365
365
|
item.tipo_produto.must_equal :product
|
|
366
366
|
item.codigo_produto.must_equal '018-1520'
|
|
367
|
-
item.codigo_ean.must_equal ''
|
|
367
|
+
item.codigo_ean.strip.must_equal ''
|
|
368
368
|
item.descricao_produto.must_equal 'PIX - CABO HDMI 15m 2.0 4K ULTRAHD'
|
|
369
369
|
item.codigo_ncm.must_equal '85444200'
|
|
370
370
|
item.codigos_nve.must_equal ['55556','66548']
|
|
@@ -374,7 +374,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
374
374
|
item.quantidade_comercial.must_equal 1.0
|
|
375
375
|
item.valor_unitario_comercial.must_equal 261.25
|
|
376
376
|
item.valor_total_produto.must_equal 261.25
|
|
377
|
-
item.codigo_ean_tributavel.must_equal '33546896546321'
|
|
377
|
+
item.codigo_ean_tributavel.strip.must_equal '33546896546321'
|
|
378
378
|
item.unidade_tributavel.must_equal 'PC'
|
|
379
379
|
item.quantidade_tributavel.must_equal 1.0
|
|
380
380
|
item.valor_unitario_tributavel.must_equal 261.25
|
|
@@ -474,7 +474,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
474
474
|
# Atributos
|
|
475
475
|
item.tipo_produto.must_equal :product
|
|
476
476
|
item.codigo_produto.must_equal '6450'
|
|
477
|
-
item.codigo_ean.must_equal ''
|
|
477
|
+
item.codigo_ean.strip.must_equal ''
|
|
478
478
|
item.descricao_produto.must_equal 'DISCABOS - PARALELO SPEAKER 2x1,50mm2 PT'
|
|
479
479
|
item.codigo_ncm.must_equal '85444900'
|
|
480
480
|
item.codigo_cest.must_equal ''
|
|
@@ -485,7 +485,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
485
485
|
item.quantidade_comercial.must_equal 70.0
|
|
486
486
|
item.valor_unitario_comercial.must_equal 4.62
|
|
487
487
|
item.valor_total_produto.must_equal 313.40
|
|
488
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
488
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
489
489
|
item.unidade_tributavel.must_equal 'MT'
|
|
490
490
|
item.quantidade_tributavel.must_equal 70.0
|
|
491
491
|
item.valor_unitario_tributavel.must_equal 4.62
|
|
@@ -584,7 +584,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
584
584
|
# Atributos
|
|
585
585
|
item.tipo_produto.must_equal :product
|
|
586
586
|
item.codigo_produto.must_equal '11114'
|
|
587
|
-
item.codigo_ean.must_equal ''
|
|
587
|
+
item.codigo_ean.strip.must_equal ''
|
|
588
588
|
item.descricao_produto.must_equal 'CONTROLLER - FIO PP 3X1,00MM2 750V PT'
|
|
589
589
|
item.codigo_ncm.must_equal '85444900'
|
|
590
590
|
item.codigo_cest.must_equal ''
|
|
@@ -595,7 +595,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
595
595
|
item.quantidade_comercial.must_equal 30.0
|
|
596
596
|
item.valor_unitario_comercial.must_equal 5.28
|
|
597
597
|
item.valor_total_produto.must_equal 158.4
|
|
598
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
598
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
599
599
|
item.unidade_tributavel.must_equal 'MT'
|
|
600
600
|
item.quantidade_tributavel.must_equal 30.0
|
|
601
601
|
item.valor_unitario_tributavel.must_equal 5.28
|
|
@@ -683,7 +683,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
683
683
|
# Atributos
|
|
684
684
|
item.tipo_produto.must_equal :product
|
|
685
685
|
item.codigo_produto.must_equal 'CM640'
|
|
686
|
-
item.codigo_ean.must_equal ''
|
|
686
|
+
item.codigo_ean.strip.must_equal ''
|
|
687
687
|
item.descricao_produto.must_equal 'AERTECNICA - ACOPLADOR PARA RESPIRO MOD CENTR'
|
|
688
688
|
item.codigo_ncm.must_equal '85087000'
|
|
689
689
|
item.codigo_cest.must_equal ''
|
|
@@ -694,7 +694,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
694
694
|
item.quantidade_comercial.must_equal 6.0
|
|
695
695
|
item.valor_unitario_comercial.must_equal 95.44
|
|
696
696
|
item.valor_total_produto.must_equal 572.64
|
|
697
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
697
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
698
698
|
item.unidade_tributavel.must_equal 'PC'
|
|
699
699
|
item.quantidade_tributavel.must_equal 6.0
|
|
700
700
|
item.valor_unitario_tributavel.must_equal 95.44
|
|
@@ -783,7 +783,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
783
783
|
# Atributos
|
|
784
784
|
item.tipo_produto.must_equal :product
|
|
785
785
|
item.codigo_produto.must_equal '241088'
|
|
786
|
-
item.codigo_ean.must_equal ''
|
|
786
|
+
item.codigo_ean.strip.must_equal ''
|
|
787
787
|
item.descricao_produto.must_equal 'BELKIN - BRACADEIRA SMARTPHONE PTO/AMAR'
|
|
788
788
|
item.codigo_ncm.must_equal '42023200'
|
|
789
789
|
item.codigo_cest.must_equal ''
|
|
@@ -794,7 +794,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
794
794
|
item.quantidade_comercial.must_equal 70.0
|
|
795
795
|
item.valor_unitario_comercial.must_equal 56.99
|
|
796
796
|
item.valor_total_produto.must_equal 3_989.30
|
|
797
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
797
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
798
798
|
item.unidade_tributavel.must_equal 'PC'
|
|
799
799
|
item.quantidade_tributavel.must_equal 70.0
|
|
800
800
|
item.valor_unitario_tributavel.must_equal 56.99
|
|
@@ -893,7 +893,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
893
893
|
# Atributos
|
|
894
894
|
item.tipo_produto.must_equal :product
|
|
895
895
|
item.codigo_produto.must_equal '0000936'
|
|
896
|
-
item.codigo_ean.must_equal ''
|
|
896
|
+
item.codigo_ean.strip.must_equal ''
|
|
897
897
|
item.descricao_produto.must_equal 'MIL EMBALAGENS - BOBINA PLASTICO BOLHA'
|
|
898
898
|
item.codigo_ncm.must_equal '39211900'
|
|
899
899
|
item.codigo_cest.must_equal ''
|
|
@@ -904,7 +904,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
904
904
|
item.quantidade_comercial.must_equal 2.0
|
|
905
905
|
item.valor_unitario_comercial.must_equal 100.0
|
|
906
906
|
item.valor_total_produto.must_equal 200.0
|
|
907
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
907
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
908
908
|
item.unidade_tributavel.must_equal 'PC'
|
|
909
909
|
item.quantidade_tributavel.must_equal 2.0
|
|
910
910
|
item.valor_unitario_tributavel.must_equal 100.0
|
|
@@ -992,7 +992,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
992
992
|
# Atributos
|
|
993
993
|
item.tipo_produto.must_equal :product
|
|
994
994
|
item.codigo_produto.must_equal 'P15009'
|
|
995
|
-
item.codigo_ean.must_equal '1232132132133123'
|
|
995
|
+
item.codigo_ean.strip.must_equal '1232132132133123'
|
|
996
996
|
item.descricao_produto.must_equal '7BALL - CAPA MESA HOME COURISSIMO PRETO'
|
|
997
997
|
item.codigo_ncm.must_equal '95042000'
|
|
998
998
|
item.codigo_cest.must_equal ''
|
|
@@ -1003,7 +1003,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1003
1003
|
item.quantidade_comercial.must_equal 1.0
|
|
1004
1004
|
item.valor_unitario_comercial.must_equal 511.81
|
|
1005
1005
|
item.valor_total_produto.must_equal 511.81
|
|
1006
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1006
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1007
1007
|
item.unidade_tributavel.must_equal 'PC'
|
|
1008
1008
|
item.quantidade_tributavel.must_equal 1.0
|
|
1009
1009
|
item.valor_unitario_tributavel.must_equal 511.81
|
|
@@ -1091,7 +1091,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1091
1091
|
# Atributos
|
|
1092
1092
|
item.tipo_produto.must_equal :product
|
|
1093
1093
|
item.codigo_produto.must_equal '1654'
|
|
1094
|
-
item.codigo_ean.must_equal '3333333333333333'
|
|
1094
|
+
item.codigo_ean.strip.must_equal '3333333333333333'
|
|
1095
1095
|
item.descricao_produto.must_equal 'ABSOLUTE - HDA4 - CAIXA ACUSTICA 100 WATTS'
|
|
1096
1096
|
item.codigo_ncm.must_equal '85182100'
|
|
1097
1097
|
item.codigo_cest.must_equal ''
|
|
@@ -1102,7 +1102,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1102
1102
|
item.quantidade_comercial.must_equal 1.0
|
|
1103
1103
|
item.valor_unitario_comercial.must_equal 603.9
|
|
1104
1104
|
item.valor_total_produto.must_equal 602.67
|
|
1105
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1105
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1106
1106
|
item.unidade_tributavel.must_equal 'PC'
|
|
1107
1107
|
item.quantidade_tributavel.must_equal 1.0
|
|
1108
1108
|
item.valor_unitario_tributavel.must_equal 603.9
|
|
@@ -1191,7 +1191,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1191
1191
|
# Atributos
|
|
1192
1192
|
item.tipo_produto.must_equal :product
|
|
1193
1193
|
item.codigo_produto.must_equal '1300'
|
|
1194
|
-
item.codigo_ean.must_equal ''
|
|
1194
|
+
item.codigo_ean.strip.must_equal ''
|
|
1195
1195
|
item.descricao_produto.must_equal 'PURE ACOUSTICS - CAIXA DE SOM PX255'
|
|
1196
1196
|
item.codigo_ncm.must_equal '85182200'
|
|
1197
1197
|
item.codigo_cest.must_equal ''
|
|
@@ -1202,7 +1202,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1202
1202
|
item.quantidade_comercial.must_equal 1.0
|
|
1203
1203
|
item.valor_unitario_comercial.must_equal 834.91
|
|
1204
1204
|
item.valor_total_produto.must_equal 834.91
|
|
1205
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1205
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1206
1206
|
item.unidade_tributavel.must_equal 'PC'
|
|
1207
1207
|
item.quantidade_tributavel.must_equal 1.0
|
|
1208
1208
|
item.valor_unitario_tributavel.must_equal 834.91
|
|
@@ -1301,7 +1301,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1301
1301
|
# Atributos
|
|
1302
1302
|
item.tipo_produto.must_equal :product
|
|
1303
1303
|
item.codigo_produto.must_equal 'SU-07'
|
|
1304
|
-
item.codigo_ean.must_equal ''
|
|
1304
|
+
item.codigo_ean.strip.must_equal ''
|
|
1305
1305
|
item.descricao_produto.must_equal 'AIRON - SUPORTE CAIXA PAREDE SU-07'
|
|
1306
1306
|
item.codigo_ncm.must_equal '85189090'
|
|
1307
1307
|
item.codigo_cest.must_equal ''
|
|
@@ -1312,7 +1312,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1312
1312
|
item.quantidade_comercial.must_equal 1.0
|
|
1313
1313
|
item.valor_unitario_comercial.must_equal 90.85
|
|
1314
1314
|
item.valor_total_produto.must_equal 90.85
|
|
1315
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1315
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1316
1316
|
item.unidade_tributavel.must_equal 'PAR'
|
|
1317
1317
|
item.quantidade_tributavel.must_equal 1.0
|
|
1318
1318
|
item.valor_unitario_tributavel.must_equal 90.85
|
|
@@ -1401,7 +1401,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1401
1401
|
# Atributos
|
|
1402
1402
|
item.tipo_produto.must_equal :product
|
|
1403
1403
|
item.codigo_produto.must_equal '1514'
|
|
1404
|
-
item.codigo_ean.must_equal ''
|
|
1404
|
+
item.codigo_ean.strip.must_equal ''
|
|
1405
1405
|
item.descricao_produto.must_equal 'GAIA - SUPORTE DE TETO PARA TV COM GIRO MANUAL ATE 300? GSP - 251'
|
|
1406
1406
|
item.codigo_ncm.must_equal '38151900'
|
|
1407
1407
|
item.codigo_cest.must_equal '2804200'
|
|
@@ -1412,7 +1412,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1412
1412
|
item.quantidade_comercial.must_equal 1.0
|
|
1413
1413
|
item.valor_unitario_comercial.must_equal 1190.00
|
|
1414
1414
|
item.valor_total_produto.must_equal 1190.00
|
|
1415
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1415
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1416
1416
|
item.unidade_tributavel.must_equal 'PC'
|
|
1417
1417
|
item.quantidade_tributavel.must_equal 1.0
|
|
1418
1418
|
item.valor_unitario_tributavel.must_equal 1190.00
|
|
@@ -1501,7 +1501,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1501
1501
|
# Atributos
|
|
1502
1502
|
item.tipo_produto.must_equal :product
|
|
1503
1503
|
item.codigo_produto.must_equal '250705022'
|
|
1504
|
-
item.codigo_ean.must_equal ''
|
|
1504
|
+
item.codigo_ean.strip.must_equal ''
|
|
1505
1505
|
item.descricao_produto.must_equal 'AIRON - BASE GIRATORIA DE TV PLASMA / LCD'
|
|
1506
1506
|
item.codigo_ncm.must_equal '94032000'
|
|
1507
1507
|
item.codigo_cest.must_equal ''
|
|
@@ -1512,7 +1512,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1512
1512
|
item.quantidade_comercial.must_equal 1.0
|
|
1513
1513
|
item.valor_unitario_comercial.must_equal 776.44
|
|
1514
1514
|
item.valor_total_produto.must_equal 776.44
|
|
1515
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1515
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1516
1516
|
item.unidade_tributavel.must_equal 'PC'
|
|
1517
1517
|
item.quantidade_tributavel.must_equal 1.0
|
|
1518
1518
|
item.valor_unitario_tributavel.must_equal 776.44
|
|
@@ -1601,7 +1601,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1601
1601
|
# Atributos
|
|
1602
1602
|
item.tipo_produto.must_equal :product
|
|
1603
1603
|
item.codigo_produto.must_equal 'CM080P'
|
|
1604
|
-
item.codigo_ean.must_equal ''
|
|
1604
|
+
item.codigo_ean.strip.must_equal ''
|
|
1605
1605
|
item.descricao_produto.must_equal 'AERTECNICA - CENTRAL DE ASPIRACAO PERFETTO P80'
|
|
1606
1606
|
item.codigo_ncm.must_equal '85087000'
|
|
1607
1607
|
item.codigo_cest.must_equal ''
|
|
@@ -1612,7 +1612,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1612
1612
|
item.quantidade_comercial.must_equal 1.0
|
|
1613
1613
|
item.valor_unitario_comercial.must_equal 3959.00
|
|
1614
1614
|
item.valor_total_produto.must_equal 3909.00
|
|
1615
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1615
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1616
1616
|
item.unidade_tributavel.must_equal 'PC'
|
|
1617
1617
|
item.quantidade_tributavel.must_equal 1.0
|
|
1618
1618
|
item.valor_unitario_tributavel.must_equal 3959.00
|
|
@@ -1701,7 +1701,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1701
1701
|
# Atributos
|
|
1702
1702
|
item.tipo_produto.must_equal :product
|
|
1703
1703
|
item.codigo_produto.must_equal '348'
|
|
1704
|
-
item.codigo_ean.must_equal ''
|
|
1704
|
+
item.codigo_ean.strip.must_equal ''
|
|
1705
1705
|
item.descricao_produto.must_equal 'KEF - CONJUNTO DE CAIXA DE SOM T105'
|
|
1706
1706
|
item.codigo_ncm.must_equal '85182100'
|
|
1707
1707
|
item.codigo_cest.must_equal ''
|
|
@@ -1712,7 +1712,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1712
1712
|
item.quantidade_comercial.must_equal 1.0
|
|
1713
1713
|
item.valor_unitario_comercial.must_equal 14734.37
|
|
1714
1714
|
item.valor_total_produto.must_equal 14734.37
|
|
1715
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1715
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1716
1716
|
item.unidade_tributavel.must_equal 'PC'
|
|
1717
1717
|
item.quantidade_tributavel.must_equal 1.0
|
|
1718
1718
|
item.valor_unitario_tributavel.must_equal 14734.37
|
|
@@ -1801,7 +1801,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1801
1801
|
# Atributos
|
|
1802
1802
|
item.tipo_produto.must_equal :product
|
|
1803
1803
|
item.codigo_produto.must_equal '139'
|
|
1804
|
-
item.codigo_ean.must_equal ''
|
|
1804
|
+
item.codigo_ean.strip.must_equal ''
|
|
1805
1805
|
item.descricao_produto.must_equal 'CONECTOR FEMEA GIGALAN CAT6'
|
|
1806
1806
|
item.codigo_ncm.must_equal '85369010'
|
|
1807
1807
|
item.codigo_cest.must_equal ''
|
|
@@ -1812,7 +1812,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1812
1812
|
item.quantidade_comercial.must_equal 1.0
|
|
1813
1813
|
item.valor_unitario_comercial.must_equal 66.00
|
|
1814
1814
|
item.valor_total_produto.must_equal 66.00
|
|
1815
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1815
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1816
1816
|
item.unidade_tributavel.must_equal 'PC'
|
|
1817
1817
|
item.quantidade_tributavel.must_equal 1.0
|
|
1818
1818
|
item.valor_unitario_tributavel.must_equal 66.00
|
|
@@ -1901,7 +1901,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1901
1901
|
# Atributos
|
|
1902
1902
|
item.tipo_produto.must_equal :product
|
|
1903
1903
|
item.codigo_produto.must_equal '44'
|
|
1904
|
-
item.codigo_ean.must_equal ''
|
|
1904
|
+
item.codigo_ean.strip.must_equal ''
|
|
1905
1905
|
item.descricao_produto.must_equal 'ROYAL - VIDRO TEMPERADO INCOLOR'
|
|
1906
1906
|
item.codigo_ncm.must_equal '70071900'
|
|
1907
1907
|
item.codigo_cest.must_equal ''
|
|
@@ -1912,7 +1912,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
1912
1912
|
item.quantidade_comercial.must_equal 1.0
|
|
1913
1913
|
item.valor_unitario_comercial.must_equal 50.00
|
|
1914
1914
|
item.valor_total_produto.must_equal 50.00
|
|
1915
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
1915
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
1916
1916
|
item.unidade_tributavel.must_equal 'PC'
|
|
1917
1917
|
item.quantidade_tributavel.must_equal 1.0
|
|
1918
1918
|
item.valor_unitario_tributavel.must_equal 50.00
|
|
@@ -2001,7 +2001,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2001
2001
|
# Atributos
|
|
2002
2002
|
item.tipo_produto.must_equal :product
|
|
2003
2003
|
item.codigo_produto.must_equal 'MEXXF17014S'
|
|
2004
|
-
item.codigo_ean.must_equal ''
|
|
2004
|
+
item.codigo_ean.strip.must_equal ''
|
|
2005
2005
|
item.descricao_produto.must_equal '7BALL - PEBOLIN BUENOS AIRES FREIJO'
|
|
2006
2006
|
item.codigo_ncm.must_equal '95042000'
|
|
2007
2007
|
item.codigo_cest.must_equal ''
|
|
@@ -2012,7 +2012,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2012
2012
|
item.quantidade_comercial.must_equal 1.0
|
|
2013
2013
|
item.valor_unitario_comercial.must_equal 2228.00
|
|
2014
2014
|
item.valor_total_produto.must_equal 2228.00
|
|
2015
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
2015
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
2016
2016
|
item.unidade_tributavel.must_equal 'PC'
|
|
2017
2017
|
item.quantidade_tributavel.must_equal 1.0
|
|
2018
2018
|
item.valor_unitario_tributavel.must_equal 2228.00
|
|
@@ -2101,7 +2101,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2101
2101
|
# Atributos
|
|
2102
2102
|
item.tipo_produto.must_equal :product
|
|
2103
2103
|
item.codigo_produto.must_equal 'FINUS72000ZV'
|
|
2104
|
-
item.codigo_ean.must_equal ''
|
|
2104
|
+
item.codigo_ean.strip.must_equal ''
|
|
2105
2105
|
item.descricao_produto.must_equal 'FLEX - CONFIGURADOR USB Z-FLEX'
|
|
2106
2106
|
item.codigo_ncm.must_equal '85176294'
|
|
2107
2107
|
item.codigo_cest.must_equal ''
|
|
@@ -2112,7 +2112,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2112
2112
|
item.quantidade_comercial.must_equal 1.0
|
|
2113
2113
|
item.valor_unitario_comercial.must_equal 174.92
|
|
2114
2114
|
item.valor_total_produto.must_equal 174.92
|
|
2115
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
2115
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
2116
2116
|
item.unidade_tributavel.must_equal 'PC'
|
|
2117
2117
|
item.quantidade_tributavel.must_equal 1.0
|
|
2118
2118
|
item.valor_unitario_tributavel.must_equal 174.92
|
|
@@ -2201,7 +2201,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2201
2201
|
# Atributos
|
|
2202
2202
|
item.tipo_produto.must_equal :product
|
|
2203
2203
|
item.codigo_produto.must_equal 'CM080P'
|
|
2204
|
-
item.codigo_ean.must_equal ''
|
|
2204
|
+
item.codigo_ean.strip.must_equal ''
|
|
2205
2205
|
item.descricao_produto.must_equal 'AERTECNICA - CENTRAL DE ASPIRACAO PERFETTO P80'
|
|
2206
2206
|
|
|
2207
2207
|
###################### Associações HasMany ######################
|
|
@@ -2243,7 +2243,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2243
2243
|
# Atributos
|
|
2244
2244
|
item.tipo_produto.must_equal :product
|
|
2245
2245
|
item.codigo_produto.must_equal '164125'
|
|
2246
|
-
item.codigo_ean.must_equal ''
|
|
2246
|
+
item.codigo_ean.strip.must_equal ''
|
|
2247
2247
|
item.descricao_produto.must_equal 'BELKIN - CAPA PARA IPHONE HALO TRANSPARENTE'
|
|
2248
2248
|
|
|
2249
2249
|
###################### Associações HasMany ######################
|
|
@@ -2293,7 +2293,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2293
2293
|
# Atributos
|
|
2294
2294
|
item.tipo_produto.must_equal :product
|
|
2295
2295
|
item.codigo_produto.must_equal 'TQF110039'
|
|
2296
|
-
item.codigo_ean.must_equal ''
|
|
2296
|
+
item.codigo_ean.strip.must_equal ''
|
|
2297
2297
|
item.descricao_produto.must_equal '7BALL - TAQUEIRA DE CHAO BUENOS AIRES PRETA'
|
|
2298
2298
|
|
|
2299
2299
|
###################### Associações HasMany ######################
|
|
@@ -2356,7 +2356,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2356
2356
|
# Atributos
|
|
2357
2357
|
item.tipo_produto.must_equal :product
|
|
2358
2358
|
item.codigo_produto.must_equal 'PD854KL'
|
|
2359
|
-
item.codigo_ean.must_equal ''
|
|
2359
|
+
item.codigo_ean.strip.must_equal ''
|
|
2360
2360
|
item.descricao_produto.must_equal 'MICROCOMPUTADOR DELL ALL IN ONE INSPIRON 20 3059'
|
|
2361
2361
|
item.codigo_ncm.must_equal '84715010'
|
|
2362
2362
|
item.codigo_cest.must_equal ''
|
|
@@ -2367,7 +2367,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2367
2367
|
item.quantidade_comercial.must_equal 1.0
|
|
2368
2368
|
item.valor_unitario_comercial.must_equal 1400.50
|
|
2369
2369
|
item.valor_total_produto.must_equal 1400.50
|
|
2370
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
2370
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
2371
2371
|
item.unidade_tributavel.must_equal 'UN'
|
|
2372
2372
|
item.quantidade_tributavel.must_equal 1.0
|
|
2373
2373
|
item.valor_unitario_tributavel.must_equal 1400.50
|
|
@@ -2488,7 +2488,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2488
2488
|
# Atributos
|
|
2489
2489
|
item.tipo_produto.must_equal :service
|
|
2490
2490
|
item.codigo_produto.must_equal '123457'
|
|
2491
|
-
item.codigo_ean.must_equal ''
|
|
2491
|
+
item.codigo_ean.strip.must_equal ''
|
|
2492
2492
|
item.descricao_produto.must_equal 'DESCRICAO DO SERVICO'
|
|
2493
2493
|
item.codigo_ncm.must_equal '99'
|
|
2494
2494
|
item.codigo_cest.must_equal ''
|
|
@@ -2499,7 +2499,7 @@ describe BrNfe::Product::Reader::Nfe do
|
|
|
2499
2499
|
item.quantidade_comercial.must_equal 1.0
|
|
2500
2500
|
item.valor_unitario_comercial.must_equal 100.0
|
|
2501
2501
|
item.valor_total_produto.must_equal 100.0
|
|
2502
|
-
item.codigo_ean_tributavel.must_equal ''
|
|
2502
|
+
item.codigo_ean_tributavel.strip.must_equal ''
|
|
2503
2503
|
item.unidade_tributavel.must_equal 'UN'
|
|
2504
2504
|
item.quantidade_tributavel.must_equal 1.0
|
|
2505
2505
|
item.valor_unitario_tributavel.must_equal 100.0
|
|
File without changes
|
|
File without changes
|
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: 3.0.0.beta.
|
|
4
|
+
version: 3.0.0.beta.2
|
|
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-
|
|
11
|
+
date: 2018-08-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|
|
@@ -306,6 +306,7 @@ files:
|
|
|
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
308
|
- lib/br_nfe/product/xml/v4_00/_tc_infNFe.xml.slim
|
|
309
|
+
- lib/br_nfe/product/xml/v4_00/infNFe/_tc_cobr.xml.slim
|
|
309
310
|
- lib/br_nfe/product/xml/v4_00/infNFe/_tc_ide.xml.slim
|
|
310
311
|
- lib/br_nfe/product/xml/v4_00/infNFe/_tc_total.xml.slim
|
|
311
312
|
- lib/br_nfe/product/xml/v4_00/infNFe/det/_tc_prod.xml.slim
|