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,95 @@
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 351
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
+ 50.3858 122.4953 Td
35
+ /F1.0 7 Tf
36
+ <434f4e53554d49444f52204350463a203337362e3236342e3036302d3238> Tj
37
+ ET
38
+
39
+
40
+ BT
41
+ 96.5858 115.1103 Td
42
+ /F1.0 7 Tf
43
+ <4a6f686e20446f65> Tj
44
+ ET
45
+
46
+
47
+ BT
48
+ 23.0858 107.7253 Td
49
+ /F1.0 7 Tf
50
+ <41762e2042617965722046696c686f2c20313939392c2043656e74726f2c2054696a75636173202d205343> 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
+ >>
69
+ >>
70
+ >>
71
+ endobj
72
+ 6 0 obj
73
+ << /Type /Font
74
+ /Subtype /Type1
75
+ /BaseFont /Courier
76
+ /Encoding /WinAnsiEncoding
77
+ >>
78
+ endobj
79
+ xref
80
+ 0 7
81
+ 0000000000 65535 f
82
+ 0000000015 00000 n
83
+ 0000000109 00000 n
84
+ 0000000158 00000 n
85
+ 0000000215 00000 n
86
+ 0000000617 00000 n
87
+ 0000000933 00000 n
88
+ trailer
89
+ << /Size 7
90
+ /Root 2 0 R
91
+ /Info 1 0 R
92
+ >>
93
+ startxref
94
+ 1028
95
+ %%EOF
@@ -0,0 +1,81 @@
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 153
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
+ 56.6858 122.4953 Td
35
+ /F1.0 7 Tf
36
+ <434f4e53554d49444f52204ec34f204944454e544946494341444f> Tj
37
+ ET
38
+
39
+ Q
40
+
41
+ endstream
42
+ endobj
43
+ 5 0 obj
44
+ << /Type /Page
45
+ /Parent 3 0 R
46
+ /MediaBox [0 0 226.7717 141.7323]
47
+ /CropBox [0 0 226.7717 141.7323]
48
+ /BleedBox [0 0 226.7717 141.7323]
49
+ /TrimBox [0 0 226.7717 141.7323]
50
+ /ArtBox [0 0 226.7717 141.7323]
51
+ /Contents 4 0 R
52
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
53
+ /Font << /F1.0 6 0 R
54
+ >>
55
+ >>
56
+ >>
57
+ endobj
58
+ 6 0 obj
59
+ << /Type /Font
60
+ /Subtype /Type1
61
+ /BaseFont /Courier
62
+ /Encoding /WinAnsiEncoding
63
+ >>
64
+ endobj
65
+ xref
66
+ 0 7
67
+ 0000000000 65535 f
68
+ 0000000015 00000 n
69
+ 0000000109 00000 n
70
+ 0000000158 00000 n
71
+ 0000000215 00000 n
72
+ 0000000419 00000 n
73
+ 0000000735 00000 n
74
+ trailer
75
+ << /Size 7
76
+ /Root 2 0 R
77
+ /Info 1 0 R
78
+ >>
79
+ startxref
80
+ 830
81
+ %%EOF
@@ -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,188 @@
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 977
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
+ <34302c3030> 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
+ <35322c3030> Tj
135
+ ET
136
+
137
+ Q
138
+
139
+ endstream
140
+ endobj
141
+ 5 0 obj
142
+ << /Type /Page
143
+ /Parent 3 0 R
144
+ /MediaBox [0 0 226.7717 141.7323]
145
+ /CropBox [0 0 226.7717 141.7323]
146
+ /BleedBox [0 0 226.7717 141.7323]
147
+ /TrimBox [0 0 226.7717 141.7323]
148
+ /ArtBox [0 0 226.7717 141.7323]
149
+ /Contents 4 0 R
150
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
151
+ /Font << /F1.0 6 0 R
152
+ /F2.0 7 0 R
153
+ >>
154
+ >>
155
+ >>
156
+ endobj
157
+ 6 0 obj
158
+ << /Type /Font
159
+ /Subtype /Type1
160
+ /BaseFont /Courier
161
+ /Encoding /WinAnsiEncoding
162
+ >>
163
+ endobj
164
+ 7 0 obj
165
+ << /Type /Font
166
+ /Subtype /Type1
167
+ /BaseFont /Courier-Bold
168
+ /Encoding /WinAnsiEncoding
169
+ >>
170
+ endobj
171
+ xref
172
+ 0 8
173
+ 0000000000 65535 f
174
+ 0000000015 00000 n
175
+ 0000000109 00000 n
176
+ 0000000158 00000 n
177
+ 0000000215 00000 n
178
+ 0000001243 00000 n
179
+ 0000001571 00000 n
180
+ 0000001666 00000 n
181
+ trailer
182
+ << /Size 8
183
+ /Root 2 0 R
184
+ /Info 1 0 R
185
+ >>
186
+ startxref
187
+ 1766
188
+ %%EOF