br_danfe 0.11.2 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +3 -1
  3. data/Gemfile.lock +31 -31
  4. data/br_danfe.gemspec +6 -5
  5. data/config/locales/pt-BR.yml +8 -0
  6. data/lib/br_danfe/danfe.rb +2 -2
  7. data/lib/br_danfe/danfe_lib/det_body.rb +1 -1
  8. data/lib/br_danfe/danfe_lib/document.rb +1 -1
  9. data/lib/br_danfe/danfe_lib/emit_header.rb +2 -2
  10. data/lib/br_danfe/danfe_lib/helper.rb +1 -27
  11. data/lib/br_danfe/danfe_lib/infadic.rb +1 -1
  12. data/lib/br_danfe/danfe_lib/xprod.rb +15 -15
  13. data/lib/br_danfe/danfe_nfce.rb +43 -0
  14. data/lib/br_danfe/danfe_nfce_lib/document.rb +35 -0
  15. data/lib/br_danfe/danfe_nfce_lib/footer.rb +15 -0
  16. data/lib/br_danfe/danfe_nfce_lib/header.rb +67 -0
  17. data/lib/br_danfe/danfe_nfce_lib/helper.rb +9 -0
  18. data/lib/br_danfe/danfe_nfce_lib/key.rb +18 -0
  19. data/lib/br_danfe/danfe_nfce_lib/nfce_identification.rb +20 -0
  20. data/lib/br_danfe/danfe_nfce_lib/product_list.rb +100 -0
  21. data/lib/br_danfe/danfe_nfce_lib/qr_code.rb +23 -0
  22. data/lib/br_danfe/danfe_nfce_lib/recipient.rb +72 -0
  23. data/lib/br_danfe/danfe_nfce_lib/total_list.rb +78 -0
  24. data/lib/br_danfe/helper.rb +29 -0
  25. data/lib/br_danfe/{danfe_lib/options.rb → logo_config.rb} +2 -2
  26. data/lib/br_danfe/{danfe_lib/logo_options.rb → logo_options.rb} +2 -2
  27. data/lib/br_danfe/version.rb +1 -1
  28. data/lib/br_danfe/xml.rb +36 -0
  29. data/spec/features/danfe_nfce_spec.rb +31 -0
  30. data/spec/fixtures/nfce/lib/document#render.pdf +99 -0
  31. data/spec/fixtures/nfce/lib/footer#render.pdf +74 -0
  32. data/spec/fixtures/nfce/lib/header#render-homologation.pdf +0 -0
  33. data/spec/fixtures/nfce/lib/header#render-long_name_with_logo.pdf +0 -0
  34. data/spec/fixtures/nfce/lib/header#render-long_name_without_logo.pdf +118 -0
  35. data/spec/fixtures/nfce/lib/header#render-short_name_with_logo.pdf +0 -0
  36. data/spec/fixtures/nfce/lib/header#render-short_name_without_logo.pdf +118 -0
  37. data/spec/fixtures/nfce/lib/key#render.pdf +104 -0
  38. data/spec/fixtures/nfce/lib/nfce_identification#render.pdf +118 -0
  39. data/spec/fixtures/nfce/lib/product_list#render-with_many_products.pdf +307 -0
  40. data/spec/fixtures/nfce/lib/product_list#render-with_many_products_and_long_names.pdf +335 -0
  41. data/spec/fixtures/nfce/lib/product_list#render-with_single_product.pdf +181 -0
  42. data/spec/fixtures/nfce/lib/product_list#render-with_single_product_and_long_name.pdf +195 -0
  43. data/spec/fixtures/nfce/lib/product_list_with_many_products.xml +367 -0
  44. data/spec/fixtures/nfce/lib/product_list_with_many_products_and_long_names.xml +367 -0
  45. data/spec/fixtures/nfce/lib/product_list_with_single_product.xml +238 -0
  46. data/spec/fixtures/nfce/lib/product_list_with_single_product_and_long_name.xml +238 -0
  47. data/spec/fixtures/nfce/lib/qr_code#render.pdf +0 -0
  48. data/spec/fixtures/nfce/lib/recipient#render-company.pdf +95 -0
  49. data/spec/fixtures/nfce/lib/recipient#render-consumer_without_document.pdf +88 -0
  50. data/spec/fixtures/nfce/lib/recipient#render-foreign.pdf +95 -0
  51. data/spec/fixtures/nfce/lib/recipient#render-individual.pdf +95 -0
  52. data/spec/fixtures/nfce/lib/recipient#render-unidentified_consumer.pdf +81 -0
  53. data/spec/fixtures/nfce/lib/total_list#does_not_render-payment_methods.pdf +139 -0
  54. data/spec/fixtures/nfce/lib/total_list#render-grouped_payment_methods.pdf +188 -0
  55. data/spec/fixtures/nfce/lib/total_list#render-totals.pdf +139 -0
  56. data/spec/fixtures/nfce/lib/total_list#render-without_payment.pdf +202 -0
  57. data/spec/fixtures/nfce/lib/total_list#render.pdf +202 -0
  58. data/spec/fixtures/nfce/v4.00/nfce.xml +367 -0
  59. data/spec/fixtures/nfce/v4.00/rendered_nfce.fixture.pdf +0 -0
  60. data/spec/fixtures/nfce/v4.00/saved_nfce.fixture.pdf +0 -0
  61. data/spec/lib/danfe_lib/dest_spec.rb +1 -1
  62. data/spec/lib/danfe_lib/det_body_spec.rb +1 -1
  63. data/spec/lib/danfe_lib/document_spec.rb +1 -1
  64. data/spec/lib/danfe_lib/dup_spec.rb +1 -1
  65. data/spec/lib/danfe_lib/emit_header_spec.rb +1 -1
  66. data/spec/lib/danfe_lib/helper_spec.rb +0 -54
  67. data/spec/lib/danfe_lib/icmstot_spec.rb +1 -1
  68. data/spec/lib/danfe_lib/infadic_spec.rb +1 -1
  69. data/spec/lib/danfe_lib/infadic_vol_spec.rb +1 -1
  70. data/spec/lib/danfe_lib/issqn_spec.rb +1 -1
  71. data/spec/lib/danfe_lib/ticket_spec.rb +1 -1
  72. data/spec/lib/danfe_lib/transp_spec.rb +1 -1
  73. data/spec/lib/danfe_lib/vol_spec.rb +1 -1
  74. data/spec/lib/danfe_nfce_lib/document_spec.rb +19 -0
  75. data/spec/lib/danfe_nfce_lib/footer_spec.rb +42 -0
  76. data/spec/lib/danfe_nfce_lib/header_spec.rb +117 -0
  77. data/spec/lib/danfe_nfce_lib/helper_spec.rb +28 -0
  78. data/spec/lib/danfe_nfce_lib/key_spec.rb +45 -0
  79. data/spec/lib/danfe_nfce_lib/nfce_identification_spec.rb +48 -0
  80. data/spec/lib/danfe_nfce_lib/product_list_spec.rb +66 -0
  81. data/spec/lib/danfe_nfce_lib/qr_code_spec.rb +35 -0
  82. data/spec/lib/danfe_nfce_lib/recipient_spec.rb +163 -0
  83. data/spec/lib/danfe_nfce_lib/total_list_spec.rb +188 -0
  84. data/spec/lib/helper_spec.rb +102 -0
  85. data/spec/lib/logo_config_spec.rb +21 -0
  86. data/spec/lib/{danfe_lib/logo_options_spec.rb → logo_options_spec.rb} +8 -22
  87. data/spec/lib/{danfe_lib/xml_spec.rb → xml_spec.rb} +2 -2
  88. metadata +87 -18
  89. data/lib/br_danfe/danfe_lib/xml.rb +0 -38
  90. data/spec/lib/danfe_lib/options_spec.rb +0 -17
@@ -0,0 +1,99 @@
1
+ %PDF-1.3
2
+ %����
3
+ 1 0 obj
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Catalog
10
+ /Pages 3 0 R
11
+ >>
12
+ endobj
13
+ 3 0 obj
14
+ << /Type /Pages
15
+ /Count 2
16
+ /Kids [5 0 R 8 0 R]
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 53
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 8.5039 38.7457 Td
28
+ /F1.0 6 Tf
29
+ <> Tj
30
+ ET
31
+
32
+ Q
33
+
34
+ endstream
35
+ endobj
36
+ 5 0 obj
37
+ << /Type /Page
38
+ /Parent 3 0 R
39
+ /MediaBox [0 0 226.7717 51.0236]
40
+ /CropBox [0 0 226.7717 51.0236]
41
+ /BleedBox [0 0 226.7717 51.0236]
42
+ /TrimBox [0 0 226.7717 51.0236]
43
+ /ArtBox [0 0 226.7717 51.0236]
44
+ /Contents 4 0 R
45
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
46
+ /Font << /F1.0 6 0 R
47
+ >>
48
+ >>
49
+ >>
50
+ endobj
51
+ 6 0 obj
52
+ << /Type /Font
53
+ /Subtype /Type1
54
+ /BaseFont /Courier
55
+ /Encoding /WinAnsiEncoding
56
+ >>
57
+ endobj
58
+ 7 0 obj
59
+ << /Length 10
60
+ >>
61
+ stream
62
+ q
63
+ 0.3 w
64
+ Q
65
+
66
+ endstream
67
+ endobj
68
+ 8 0 obj
69
+ << /Type /Page
70
+ /Parent 3 0 R
71
+ /MediaBox [0 0 226.7717 51.0236]
72
+ /CropBox [0 0 226.7717 51.0236]
73
+ /BleedBox [0 0 226.7717 51.0236]
74
+ /TrimBox [0 0 226.7717 51.0236]
75
+ /ArtBox [0 0 226.7717 51.0236]
76
+ /Contents 7 0 R
77
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
78
+ >>
79
+ >>
80
+ endobj
81
+ xref
82
+ 0 9
83
+ 0000000000 65535 f
84
+ 0000000015 00000 n
85
+ 0000000109 00000 n
86
+ 0000000158 00000 n
87
+ 0000000221 00000 n
88
+ 0000000324 00000 n
89
+ 0000000635 00000 n
90
+ 0000000730 00000 n
91
+ 0000000790 00000 n
92
+ trailer
93
+ << /Size 9
94
+ /Root 2 0 R
95
+ /Info 1 0 R
96
+ >>
97
+ startxref
98
+ 1077
99
+ %%EOF
@@ -0,0 +1,74 @@
1
+ %PDF-1.3
2
+ %����
3
+ 1 0 obj
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Catalog
10
+ /Pages 3 0 R
11
+ >>
12
+ endobj
13
+ 3 0 obj
14
+ << /Type /Pages
15
+ /Count 1
16
+ /Kids [5 0 R]
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 177
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 21.8858 130.0833 Td
28
+ /F1.0 5 Tf
29
+ <5472696275746f7320546f7461697320496e636964656e74657320284c6569204665646572616c2031322e3734312f32303132293a20522420372c3530> Tj
30
+ ET
31
+
32
+ Q
33
+
34
+ endstream
35
+ endobj
36
+ 5 0 obj
37
+ << /Type /Page
38
+ /Parent 3 0 R
39
+ /MediaBox [0 0 226.7717 141.7323]
40
+ /CropBox [0 0 226.7717 141.7323]
41
+ /BleedBox [0 0 226.7717 141.7323]
42
+ /TrimBox [0 0 226.7717 141.7323]
43
+ /ArtBox [0 0 226.7717 141.7323]
44
+ /Contents 4 0 R
45
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
46
+ /Font << /F1.0 6 0 R
47
+ >>
48
+ >>
49
+ >>
50
+ endobj
51
+ 6 0 obj
52
+ << /Type /Font
53
+ /Subtype /Type1
54
+ /BaseFont /Courier
55
+ /Encoding /WinAnsiEncoding
56
+ >>
57
+ endobj
58
+ xref
59
+ 0 7
60
+ 0000000000 65535 f
61
+ 0000000015 00000 n
62
+ 0000000109 00000 n
63
+ 0000000158 00000 n
64
+ 0000000215 00000 n
65
+ 0000000443 00000 n
66
+ 0000000759 00000 n
67
+ trailer
68
+ << /Size 7
69
+ /Root 2 0 R
70
+ /Info 1 0 R
71
+ >>
72
+ startxref
73
+ 854
74
+ %%EOF
@@ -0,0 +1,118 @@
1
+ %PDF-1.3
2
+ %����
3
+ 1 0 obj
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Catalog
10
+ /Pages 3 0 R
11
+ >>
12
+ endobj
13
+ 3 0 obj
14
+ << /Type /Pages
15
+ /Count 1
16
+ /Kids [5 0 R]
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 675
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 8.5039 128.8253 Td
28
+ /F2.0 7 Tf
29
+ <5465737420636f6d70616e79207769746820736f6d652076657279206c6f6e67206e616d6520746f20646f2061> Tj
30
+ ET
31
+
32
+
33
+ BT
34
+ 8.5039 121.4683 Td
35
+ /F2.0 7 Tf
36
+ <6c696e6520627265616b> Tj
37
+ ET
38
+
39
+
40
+ BT
41
+ 8.5039 114.7403 Td
42
+ /F1.0 6 Tf
43
+ <434e504a3a2031302e3834352e3138302f303030312d3636> Tj
44
+ ET
45
+
46
+
47
+ BT
48
+ 8.5039 108.4103 Td
49
+ /F1.0 6 Tf
50
+ <5220474552454d49415320455547454e494f2044412053494c56412c2038352c2053455252415249412c20425241434f20444f> Tj
51
+ ET
52
+
53
+
54
+ BT
55
+ 8.5039 102.0803 Td
56
+ /F1.0 6 Tf
57
+ <54524f4d4255444f202d205343> Tj
58
+ ET
59
+
60
+
61
+ BT
62
+ 8.5039 95.7503 Td
63
+ /F1.0 6 Tf
64
+ <446f63756d656e746f20417578696c696172206461204e6f74612046697363616c20646520436f6e73756d69646f7220456c657472f46e696361> Tj
65
+ ET
66
+
67
+ Q
68
+
69
+ endstream
70
+ endobj
71
+ 5 0 obj
72
+ << /Type /Page
73
+ /Parent 3 0 R
74
+ /MediaBox [0 0 226.7717 141.7323]
75
+ /CropBox [0 0 226.7717 141.7323]
76
+ /BleedBox [0 0 226.7717 141.7323]
77
+ /TrimBox [0 0 226.7717 141.7323]
78
+ /ArtBox [0 0 226.7717 141.7323]
79
+ /Contents 4 0 R
80
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
81
+ /Font << /F2.0 6 0 R
82
+ /F1.0 7 0 R
83
+ >>
84
+ >>
85
+ >>
86
+ endobj
87
+ 6 0 obj
88
+ << /Type /Font
89
+ /Subtype /Type1
90
+ /BaseFont /Courier-Bold
91
+ /Encoding /WinAnsiEncoding
92
+ >>
93
+ endobj
94
+ 7 0 obj
95
+ << /Type /Font
96
+ /Subtype /Type1
97
+ /BaseFont /Courier
98
+ /Encoding /WinAnsiEncoding
99
+ >>
100
+ endobj
101
+ xref
102
+ 0 8
103
+ 0000000000 65535 f
104
+ 0000000015 00000 n
105
+ 0000000109 00000 n
106
+ 0000000158 00000 n
107
+ 0000000215 00000 n
108
+ 0000000941 00000 n
109
+ 0000001269 00000 n
110
+ 0000001369 00000 n
111
+ trailer
112
+ << /Size 8
113
+ /Root 2 0 R
114
+ /Info 1 0 R
115
+ >>
116
+ startxref
117
+ 1464
118
+ %%EOF
@@ -0,0 +1,118 @@
1
+ %PDF-1.3
2
+ %����
3
+ 1 0 obj
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Catalog
10
+ /Pages 3 0 R
11
+ >>
12
+ endobj
13
+ 3 0 obj
14
+ << /Type /Pages
15
+ /Count 1
16
+ /Kids [5 0 R]
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 589
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 8.5039 128.8253 Td
28
+ /F2.0 7 Tf
29
+ <5465737420636f6d70616e79> Tj
30
+ ET
31
+
32
+
33
+ BT
34
+ 8.5039 122.0973 Td
35
+ /F1.0 6 Tf
36
+ <434e504a3a2031302e3834352e3138302f303030312d3636> Tj
37
+ ET
38
+
39
+
40
+ BT
41
+ 8.5039 115.7673 Td
42
+ /F1.0 6 Tf
43
+ <5220474552454d49415320455547454e494f2044412053494c56412c2038352c2053455252415249412c20425241434f20444f> Tj
44
+ ET
45
+
46
+
47
+ BT
48
+ 8.5039 109.4373 Td
49
+ /F1.0 6 Tf
50
+ <54524f4d4255444f202d205343> Tj
51
+ ET
52
+
53
+
54
+ BT
55
+ 8.5039 103.1073 Td
56
+ /F1.0 6 Tf
57
+ <> Tj
58
+ ET
59
+
60
+
61
+ BT
62
+ 8.5039 96.7773 Td
63
+ /F1.0 6 Tf
64
+ <446f63756d656e746f20417578696c696172206461204e6f74612046697363616c20646520436f6e73756d69646f7220456c657472f46e696361> Tj
65
+ ET
66
+
67
+ Q
68
+
69
+ endstream
70
+ endobj
71
+ 5 0 obj
72
+ << /Type /Page
73
+ /Parent 3 0 R
74
+ /MediaBox [0 0 226.7717 141.7323]
75
+ /CropBox [0 0 226.7717 141.7323]
76
+ /BleedBox [0 0 226.7717 141.7323]
77
+ /TrimBox [0 0 226.7717 141.7323]
78
+ /ArtBox [0 0 226.7717 141.7323]
79
+ /Contents 4 0 R
80
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
81
+ /Font << /F2.0 6 0 R
82
+ /F1.0 7 0 R
83
+ >>
84
+ >>
85
+ >>
86
+ endobj
87
+ 6 0 obj
88
+ << /Type /Font
89
+ /Subtype /Type1
90
+ /BaseFont /Courier-Bold
91
+ /Encoding /WinAnsiEncoding
92
+ >>
93
+ endobj
94
+ 7 0 obj
95
+ << /Type /Font
96
+ /Subtype /Type1
97
+ /BaseFont /Courier
98
+ /Encoding /WinAnsiEncoding
99
+ >>
100
+ endobj
101
+ xref
102
+ 0 8
103
+ 0000000000 65535 f
104
+ 0000000015 00000 n
105
+ 0000000109 00000 n
106
+ 0000000158 00000 n
107
+ 0000000215 00000 n
108
+ 0000000855 00000 n
109
+ 0000001183 00000 n
110
+ 0000001283 00000 n
111
+ trailer
112
+ << /Size 8
113
+ /Root 2 0 R
114
+ /Info 1 0 R
115
+ >>
116
+ startxref
117
+ 1378
118
+ %%EOF
@@ -0,0 +1,104 @@
1
+ %PDF-1.3
2
+ %����
3
+ 1 0 obj
4
+ << /Creator <feff0050007200610077006e>
5
+ /Producer <feff0050007200610077006e>
6
+ >>
7
+ endobj
8
+ 2 0 obj
9
+ << /Type /Catalog
10
+ /Pages 3 0 R
11
+ >>
12
+ endobj
13
+ 3 0 obj
14
+ << /Type /Pages
15
+ /Count 1
16
+ /Kids [5 0 R]
17
+ >>
18
+ endobj
19
+ 4 0 obj
20
+ << /Length 427
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 8.5039 129.4543 Td
28
+ /F1.0 6 Tf
29
+ <> Tj
30
+ ET
31
+
32
+
33
+ BT
34
+ 46.1858 122.4953 Td
35
+ /F2.0 7 Tf
36
+ <436f6e73756c74652070656c612043686176652064652041636573736f20656d> Tj
37
+ ET
38
+
39
+
40
+ BT
41
+ 44.0858 115.1383 Td
42
+ /F1.0 7 Tf
43
+ <7777772e736566617a2e616d2e676f762e62722f6e6663652f636f6e73756c7461> Tj
44
+ ET
45
+
46
+
47
+ BT
48
+ 16.1858 108.3823 Td
49
+ /F1.0 6 Tf
50
+ <343232302030333130203834353120383030302030313636203535303020313030302030303136203239313120383239312030323332> Tj
51
+ ET
52
+
53
+ Q
54
+
55
+ endstream
56
+ endobj
57
+ 5 0 obj
58
+ << /Type /Page
59
+ /Parent 3 0 R
60
+ /MediaBox [0 0 226.7717 141.7323]
61
+ /CropBox [0 0 226.7717 141.7323]
62
+ /BleedBox [0 0 226.7717 141.7323]
63
+ /TrimBox [0 0 226.7717 141.7323]
64
+ /ArtBox [0 0 226.7717 141.7323]
65
+ /Contents 4 0 R
66
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
67
+ /Font << /F1.0 6 0 R
68
+ /F2.0 7 0 R
69
+ >>
70
+ >>
71
+ >>
72
+ endobj
73
+ 6 0 obj
74
+ << /Type /Font
75
+ /Subtype /Type1
76
+ /BaseFont /Courier
77
+ /Encoding /WinAnsiEncoding
78
+ >>
79
+ endobj
80
+ 7 0 obj
81
+ << /Type /Font
82
+ /Subtype /Type1
83
+ /BaseFont /Courier-Bold
84
+ /Encoding /WinAnsiEncoding
85
+ >>
86
+ endobj
87
+ xref
88
+ 0 8
89
+ 0000000000 65535 f
90
+ 0000000015 00000 n
91
+ 0000000109 00000 n
92
+ 0000000158 00000 n
93
+ 0000000215 00000 n
94
+ 0000000693 00000 n
95
+ 0000001021 00000 n
96
+ 0000001116 00000 n
97
+ trailer
98
+ << /Size 8
99
+ /Root 2 0 R
100
+ /Info 1 0 R
101
+ >>
102
+ startxref
103
+ 1216
104
+ %%EOF