br_danfe 0.11.2 → 0.12.0

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 (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,139 @@
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 562
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 144.5669 129.4543 Td
28
+ /F1.0 6 Tf
29
+ <537562746f74616c205224> Tj
30
+ ET
31
+
32
+
33
+ BT
34
+ 196.6677 129.4543 Td
35
+ /F1.0 6 Tf
36
+ <3130342c3030> Tj
37
+ ET
38
+
39
+
40
+ BT
41
+ 8.5039 123.7851 Td
42
+ /F1.0 6 Tf
43
+ <> Tj
44
+ ET
45
+
46
+
47
+ BT
48
+ 8.5039 116.8261 Td
49
+ /F1.0 7 Tf
50
+ <517464652e20746f74616c206465206974656e73> Tj
51
+ ET
52
+
53
+
54
+ BT
55
+ 214.0677 116.8261 Td
56
+ /F1.0 7 Tf
57
+ <34> Tj
58
+ ET
59
+
60
+
61
+ BT
62
+ 8.5039 109.7394 Td
63
+ /F1.0 7 Tf
64
+ <446573636f6e746f205224> Tj
65
+ ET
66
+
67
+
68
+ BT
69
+ 197.2677 109.7394 Td
70
+ /F1.0 7 Tf
71
+ <31322c3030> Tj
72
+ ET
73
+
74
+
75
+ BT
76
+ 8.5039 102.6528 Td
77
+ /F2.0 7 Tf
78
+ <56616c6f7220546f74616c205224> Tj
79
+ ET
80
+
81
+
82
+ BT
83
+ 197.2677 102.6528 Td
84
+ /F2.0 7 Tf
85
+ <39322c3030> Tj
86
+ ET
87
+
88
+ Q
89
+
90
+ endstream
91
+ endobj
92
+ 5 0 obj
93
+ << /Type /Page
94
+ /Parent 3 0 R
95
+ /MediaBox [0 0 226.7717 141.7323]
96
+ /CropBox [0 0 226.7717 141.7323]
97
+ /BleedBox [0 0 226.7717 141.7323]
98
+ /TrimBox [0 0 226.7717 141.7323]
99
+ /ArtBox [0 0 226.7717 141.7323]
100
+ /Contents 4 0 R
101
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
102
+ /Font << /F1.0 6 0 R
103
+ /F2.0 7 0 R
104
+ >>
105
+ >>
106
+ >>
107
+ endobj
108
+ 6 0 obj
109
+ << /Type /Font
110
+ /Subtype /Type1
111
+ /BaseFont /Courier
112
+ /Encoding /WinAnsiEncoding
113
+ >>
114
+ endobj
115
+ 7 0 obj
116
+ << /Type /Font
117
+ /Subtype /Type1
118
+ /BaseFont /Courier-Bold
119
+ /Encoding /WinAnsiEncoding
120
+ >>
121
+ endobj
122
+ xref
123
+ 0 8
124
+ 0000000000 65535 f
125
+ 0000000015 00000 n
126
+ 0000000109 00000 n
127
+ 0000000158 00000 n
128
+ 0000000215 00000 n
129
+ 0000000828 00000 n
130
+ 0000001156 00000 n
131
+ 0000001251 00000 n
132
+ trailer
133
+ << /Size 8
134
+ /Root 2 0 R
135
+ /Info 1 0 R
136
+ >>
137
+ startxref
138
+ 1351
139
+ %%EOF
@@ -0,0 +1,202 @@
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 1099
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 144.5669 129.4543 Td
28
+ /F1.0 6 Tf
29
+ <537562746f74616c205224> Tj
30
+ ET
31
+
32
+
33
+ BT
34
+ 196.6677 129.4543 Td
35
+ /F1.0 6 Tf
36
+ <3130342c3030> Tj
37
+ ET
38
+
39
+
40
+ BT
41
+ 8.5039 123.7851 Td
42
+ /F1.0 6 Tf
43
+ <> Tj
44
+ ET
45
+
46
+
47
+ BT
48
+ 8.5039 116.8261 Td
49
+ /F1.0 7 Tf
50
+ <517464652e20746f74616c206465206974656e73> Tj
51
+ ET
52
+
53
+
54
+ BT
55
+ 214.0677 116.8261 Td
56
+ /F1.0 7 Tf
57
+ <34> Tj
58
+ ET
59
+
60
+
61
+ BT
62
+ 8.5039 109.7394 Td
63
+ /F1.0 7 Tf
64
+ <446573636f6e746f205224> Tj
65
+ ET
66
+
67
+
68
+ BT
69
+ 197.2677 109.7394 Td
70
+ /F1.0 7 Tf
71
+ <31322c3030> Tj
72
+ ET
73
+
74
+
75
+ BT
76
+ 8.5039 102.6528 Td
77
+ /F2.0 7 Tf
78
+ <56616c6f7220546f74616c205224> Tj
79
+ ET
80
+
81
+
82
+ BT
83
+ 197.2677 102.6528 Td
84
+ /F2.0 7 Tf
85
+ <39322c3030> Tj
86
+ ET
87
+
88
+
89
+ BT
90
+ 8.5039 96.1952 Td
91
+ /F1.0 6 Tf
92
+ <> Tj
93
+ ET
94
+
95
+
96
+ BT
97
+ 8.5039 89.2362 Td
98
+ /F2.0 7 Tf
99
+ <466f726d6120646520706167616d656e746f> Tj
100
+ ET
101
+
102
+
103
+ BT
104
+ 163.6677 89.2362 Td
105
+ /F2.0 7 Tf
106
+ <56616c6f72207061676f205224> Tj
107
+ ET
108
+
109
+
110
+ BT
111
+ 8.5039 82.1496 Td
112
+ /F1.0 7 Tf
113
+ <44696e686569726f> Tj
114
+ ET
115
+
116
+
117
+ BT
118
+ 197.2677 82.1496 Td
119
+ /F1.0 7 Tf
120
+ <31302c3030> Tj
121
+ ET
122
+
123
+
124
+ BT
125
+ 8.5039 75.063 Td
126
+ /F1.0 7 Tf
127
+ <436865717565> Tj
128
+ ET
129
+
130
+
131
+ BT
132
+ 197.2677 75.063 Td
133
+ /F1.0 7 Tf
134
+ <31352c3330> Tj
135
+ ET
136
+
137
+
138
+ BT
139
+ 8.5039 67.9764 Td
140
+ /F1.0 7 Tf
141
+ <4372e96469746f204c6f6a61> Tj
142
+ ET
143
+
144
+
145
+ BT
146
+ 197.2677 67.9764 Td
147
+ /F1.0 7 Tf
148
+ <36362c3730> Tj
149
+ ET
150
+
151
+ Q
152
+
153
+ endstream
154
+ endobj
155
+ 5 0 obj
156
+ << /Type /Page
157
+ /Parent 3 0 R
158
+ /MediaBox [0 0 226.7717 141.7323]
159
+ /CropBox [0 0 226.7717 141.7323]
160
+ /BleedBox [0 0 226.7717 141.7323]
161
+ /TrimBox [0 0 226.7717 141.7323]
162
+ /ArtBox [0 0 226.7717 141.7323]
163
+ /Contents 4 0 R
164
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
165
+ /Font << /F1.0 6 0 R
166
+ /F2.0 7 0 R
167
+ >>
168
+ >>
169
+ >>
170
+ endobj
171
+ 6 0 obj
172
+ << /Type /Font
173
+ /Subtype /Type1
174
+ /BaseFont /Courier
175
+ /Encoding /WinAnsiEncoding
176
+ >>
177
+ endobj
178
+ 7 0 obj
179
+ << /Type /Font
180
+ /Subtype /Type1
181
+ /BaseFont /Courier-Bold
182
+ /Encoding /WinAnsiEncoding
183
+ >>
184
+ endobj
185
+ xref
186
+ 0 8
187
+ 0000000000 65535 f
188
+ 0000000015 00000 n
189
+ 0000000109 00000 n
190
+ 0000000158 00000 n
191
+ 0000000215 00000 n
192
+ 0000001366 00000 n
193
+ 0000001694 00000 n
194
+ 0000001789 00000 n
195
+ trailer
196
+ << /Size 8
197
+ /Root 2 0 R
198
+ /Info 1 0 R
199
+ >>
200
+ startxref
201
+ 1889
202
+ %%EOF
@@ -0,0 +1,202 @@
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 1099
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 144.5669 129.4543 Td
28
+ /F1.0 6 Tf
29
+ <537562746f74616c205224> Tj
30
+ ET
31
+
32
+
33
+ BT
34
+ 196.6677 129.4543 Td
35
+ /F1.0 6 Tf
36
+ <3130342c3030> Tj
37
+ ET
38
+
39
+
40
+ BT
41
+ 8.5039 123.7851 Td
42
+ /F1.0 6 Tf
43
+ <> Tj
44
+ ET
45
+
46
+
47
+ BT
48
+ 8.5039 116.8261 Td
49
+ /F1.0 7 Tf
50
+ <517464652e20746f74616c206465206974656e73> Tj
51
+ ET
52
+
53
+
54
+ BT
55
+ 214.0677 116.8261 Td
56
+ /F1.0 7 Tf
57
+ <34> Tj
58
+ ET
59
+
60
+
61
+ BT
62
+ 8.5039 109.7394 Td
63
+ /F1.0 7 Tf
64
+ <446573636f6e746f205224> Tj
65
+ ET
66
+
67
+
68
+ BT
69
+ 197.2677 109.7394 Td
70
+ /F1.0 7 Tf
71
+ <31322c3030> Tj
72
+ ET
73
+
74
+
75
+ BT
76
+ 8.5039 102.6528 Td
77
+ /F2.0 7 Tf
78
+ <56616c6f7220546f74616c205224> Tj
79
+ ET
80
+
81
+
82
+ BT
83
+ 197.2677 102.6528 Td
84
+ /F2.0 7 Tf
85
+ <39322c3030> Tj
86
+ ET
87
+
88
+
89
+ BT
90
+ 8.5039 96.1952 Td
91
+ /F1.0 6 Tf
92
+ <> Tj
93
+ ET
94
+
95
+
96
+ BT
97
+ 8.5039 89.2362 Td
98
+ /F2.0 7 Tf
99
+ <466f726d6120646520706167616d656e746f> Tj
100
+ ET
101
+
102
+
103
+ BT
104
+ 163.6677 89.2362 Td
105
+ /F2.0 7 Tf
106
+ <56616c6f72207061676f205224> Tj
107
+ ET
108
+
109
+
110
+ BT
111
+ 8.5039 82.1496 Td
112
+ /F1.0 7 Tf
113
+ <44696e686569726f> Tj
114
+ ET
115
+
116
+
117
+ BT
118
+ 197.2677 82.1496 Td
119
+ /F1.0 7 Tf
120
+ <31302c3030> Tj
121
+ ET
122
+
123
+
124
+ BT
125
+ 8.5039 75.063 Td
126
+ /F1.0 7 Tf
127
+ <436865717565> Tj
128
+ ET
129
+
130
+
131
+ BT
132
+ 197.2677 75.063 Td
133
+ /F1.0 7 Tf
134
+ <31352c3330> Tj
135
+ ET
136
+
137
+
138
+ BT
139
+ 8.5039 67.9764 Td
140
+ /F1.0 7 Tf
141
+ <4372e96469746f204c6f6a61> Tj
142
+ ET
143
+
144
+
145
+ BT
146
+ 197.2677 67.9764 Td
147
+ /F1.0 7 Tf
148
+ <36362c3730> Tj
149
+ ET
150
+
151
+ Q
152
+
153
+ endstream
154
+ endobj
155
+ 5 0 obj
156
+ << /Type /Page
157
+ /Parent 3 0 R
158
+ /MediaBox [0 0 226.7717 141.7323]
159
+ /CropBox [0 0 226.7717 141.7323]
160
+ /BleedBox [0 0 226.7717 141.7323]
161
+ /TrimBox [0 0 226.7717 141.7323]
162
+ /ArtBox [0 0 226.7717 141.7323]
163
+ /Contents 4 0 R
164
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
165
+ /Font << /F1.0 6 0 R
166
+ /F2.0 7 0 R
167
+ >>
168
+ >>
169
+ >>
170
+ endobj
171
+ 6 0 obj
172
+ << /Type /Font
173
+ /Subtype /Type1
174
+ /BaseFont /Courier
175
+ /Encoding /WinAnsiEncoding
176
+ >>
177
+ endobj
178
+ 7 0 obj
179
+ << /Type /Font
180
+ /Subtype /Type1
181
+ /BaseFont /Courier-Bold
182
+ /Encoding /WinAnsiEncoding
183
+ >>
184
+ endobj
185
+ xref
186
+ 0 8
187
+ 0000000000 65535 f
188
+ 0000000015 00000 n
189
+ 0000000109 00000 n
190
+ 0000000158 00000 n
191
+ 0000000215 00000 n
192
+ 0000001366 00000 n
193
+ 0000001694 00000 n
194
+ 0000001789 00000 n
195
+ trailer
196
+ << /Size 8
197
+ /Root 2 0 R
198
+ /Info 1 0 R
199
+ >>
200
+ startxref
201
+ 1889
202
+ %%EOF