br_danfe 0.2.3 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/README.md +12 -0
  4. data/lib/br_danfe/danfe.rb +4 -1
  5. data/lib/br_danfe/danfe_lib/det_body.rb +6 -5
  6. data/lib/br_danfe/danfe_lib/options.rb +3 -1
  7. data/lib/br_danfe/version.rb +1 -1
  8. data/spec/features/danfe_spec.rb +20 -0
  9. data/spec/fixtures/cce/lib/barcode#render.pdf +511 -0
  10. data/spec/fixtures/cce/lib/correction#render.pdf +100 -0
  11. data/spec/fixtures/cce/lib/document#box.pdf +55 -0
  12. data/spec/fixtures/cce/lib/document#box.with.block.pdf +72 -0
  13. data/spec/fixtures/cce/lib/document#text.align.pdf +70 -0
  14. data/spec/fixtures/cce/lib/document#text.pad.pdf +70 -0
  15. data/spec/fixtures/cce/lib/document#text.simple.pdf +70 -0
  16. data/spec/fixtures/cce/lib/document#text.size.pdf +70 -0
  17. data/spec/fixtures/cce/lib/document#text.style.pdf +70 -0
  18. data/spec/fixtures/cce/lib/footer#render.pdf +114 -0
  19. data/spec/fixtures/cce/lib/header#render.pdf +72 -0
  20. data/spec/fixtures/cce/lib/nfe_key#render.pdf +88 -0
  21. data/spec/fixtures/cce/lib/protocol#render.pdf +88 -0
  22. data/spec/fixtures/cce/v1.00/cce.fixture.pdf +659 -0
  23. data/spec/fixtures/nfe/lib/dest#render-v2.00.pdf +271 -0
  24. data/spec/fixtures/nfe/lib/dest#render-v3.10.pdf +271 -0
  25. data/spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf +201 -0
  26. data/spec/fixtures/nfe/lib/dest#render-with_cpf.pdf +201 -0
  27. data/spec/fixtures/nfe/lib/dest#render-with_ie.pdf +208 -0
  28. data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +855 -0
  29. data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +512 -0
  30. data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +267 -0
  31. data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +267 -0
  32. data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +246 -0
  33. data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +246 -0
  34. data/spec/fixtures/nfe/lib/det_header#render.pdf +207 -0
  35. data/spec/fixtures/nfe/lib/document#lcnpj-blank.pdf +74 -0
  36. data/spec/fixtures/nfe/lib/document#lcnpj-invalid.pdf +74 -0
  37. data/spec/fixtures/nfe/lib/document#lcnpj-valid.pdf +81 -0
  38. data/spec/fixtures/nfe/lib/document#lie-blank.pdf +74 -0
  39. data/spec/fixtures/nfe/lib/document#lie-invalid.pdf +74 -0
  40. data/spec/fixtures/nfe/lib/document#lie-valid.pdf +81 -0
  41. data/spec/fixtures/nfe/lib/dup#render.pdf +216 -0
  42. data/spec/fixtures/nfe/lib/emit#render.pdf +143 -0
  43. data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +712 -0
  44. data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +650 -0
  45. data/spec/fixtures/nfe/lib/icmstot#render.pdf +255 -0
  46. data/spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf +295 -0
  47. data/spec/fixtures/nfe/lib/infadic#render.pdf +104 -0
  48. data/spec/fixtures/nfe/lib/issqn#render.pdf +143 -0
  49. data/spec/fixtures/nfe/lib/ticket#render.pdf +113 -0
  50. data/spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf +176 -0
  51. data/spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf +176 -0
  52. data/spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf +176 -0
  53. data/spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf +176 -0
  54. data/spec/fixtures/nfe/lib/transp#render.pdf +239 -0
  55. data/spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf +117 -0
  56. data/spec/fixtures/nfe/lib/vol#render.pdf +152 -0
  57. data/spec/fixtures/nfe/v2.00/custom_options.fixture.pdf +1994 -0
  58. data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +1932 -0
  59. data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +5207 -0
  60. data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +1980 -0
  61. data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +5032 -0
  62. data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +2314 -0
  63. data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +2807 -0
  64. data/spec/lib/danfe_lib/det_body_spec.rb +80 -2
  65. data/spec/lib/danfe_lib/options_spec.rb +8 -1
  66. metadata +30 -2
@@ -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 540
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 21.25984251968504 98.81946456692918 Td
28
+ /F2.0 8 Tf
29
+ [<44> 35 <41444f532041444943494f4e> 20 <414953>] TJ
30
+ ET
31
+
32
+ 21.260 21.543 352.913 75.118 re
33
+ S
34
+
35
+ BT
36
+ 23.25984251968504 90.56341732283484 Td
37
+ /F1.0 6 Tf
38
+ [<494e464f524d41> 40 <c7d5455320434f4d504c454d454e54> 93 <41524553>] TJ
39
+ ET
40
+
41
+
42
+ BT
43
+ 23.25984251968504 79.56341732283484 Td
44
+ /F1.0 6 Tf
45
+ [<556d61206f6273657276> 25 <61e7e36f>] TJ
46
+ ET
47
+
48
+ 374.173 21.543 202.677 75.118 re
49
+ S
50
+
51
+ BT
52
+ 376.1732283464567 90.56341732283484 Td
53
+ /F1.0 6 Tf
54
+ [<5245534552> 80 <56> 135 <41444f2041> 55 <4f20464953434f>] TJ
55
+ ET
56
+
57
+ Q
58
+
59
+ endstream
60
+ endobj
61
+ 5 0 obj
62
+ << /Type /Page
63
+ /Parent 3 0 R
64
+ /MediaBox [0 0 595.28 841.89]
65
+ /Contents 4 0 R
66
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
67
+ /Font << /F2.0 6 0 R
68
+ /F1.0 7 0 R
69
+ >>
70
+ >>
71
+ >>
72
+ endobj
73
+ 6 0 obj
74
+ << /Type /Font
75
+ /Subtype /Type1
76
+ /BaseFont /Times-Bold
77
+ /Encoding /WinAnsiEncoding
78
+ >>
79
+ endobj
80
+ 7 0 obj
81
+ << /Type /Font
82
+ /Subtype /Type1
83
+ /BaseFont /Times-Roman
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
+ 0000000806 00000 n
95
+ 0000000998 00000 n
96
+ 0000001096 00000 n
97
+ trailer
98
+ << /Size 8
99
+ /Root 2 0 R
100
+ /Info 1 0 R
101
+ >>
102
+ startxref
103
+ 1195
104
+ %%EOF
@@ -0,0 +1,143 @@
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 1047
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 21.25984251968504 136.52025196850406 Td
28
+ /F2.0 8 Tf
29
+ [<43c14c43554c4f20444f20495353514e>] TJ
30
+ ET
31
+
32
+ 21.260 111.402 131.528 22.677 re
33
+ S
34
+
35
+ BT
36
+ 23.25984251968504 127.98074015748041 Td
37
+ /F1.0 6 Tf
38
+ [<494e53435249c7c3> 55 <4f204d554e49434950> 92 <414c>] TJ
39
+ ET
40
+
41
+
42
+ BT
43
+ 23.25984251968504 114.24874015748041 Td
44
+ /F1.0 10 Tf
45
+ [<32333435>] TJ
46
+ ET
47
+
48
+ 152.787 111.402 145.701 22.677 re
49
+ S
50
+
51
+ BT
52
+ 154.78740157480317 127.98074015748041 Td
53
+ /F1.0 6 Tf
54
+ [<56> 135 <414c4f522054> 18 <4f> 40 <54> 93 <414c20444f5320534552> 80 <5649c74f53>] TJ
55
+ ET
56
+
57
+
58
+ BT
59
+ 278.98818897637796 114.24874015748041 Td
60
+ /F1.0 10 Tf
61
+ [<312c3433>] TJ
62
+ ET
63
+
64
+ 298.488 111.402 145.701 22.677 re
65
+ S
66
+
67
+ BT
68
+ 300.48818897637796 127.98074015748041 Td
69
+ /F1.0 6 Tf
70
+ [<42> 35 <4153452044452043c14c43554c4f20444f20495353514e>] TJ
71
+ ET
72
+
73
+
74
+ BT
75
+ 424.68897637795277 114.24874015748041 Td
76
+ /F1.0 10 Tf
77
+ [<322c3334>] TJ
78
+ ET
79
+
80
+ 444.189 111.402 131.528 22.677 re
81
+ S
82
+
83
+ BT
84
+ 446.18897637795277 127.98074015748041 Td
85
+ /F1.0 6 Tf
86
+ [<56> 135 <414c4f5220444f20495353514e>] TJ
87
+ ET
88
+
89
+
90
+ BT
91
+ 556.2165354330709 114.24874015748041 Td
92
+ /F1.0 10 Tf
93
+ [<332c3435>] TJ
94
+ ET
95
+
96
+ Q
97
+
98
+ endstream
99
+ endobj
100
+ 5 0 obj
101
+ << /Type /Page
102
+ /Parent 3 0 R
103
+ /MediaBox [0 0 595.28 841.89]
104
+ /Contents 4 0 R
105
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
106
+ /Font << /F2.0 6 0 R
107
+ /F1.0 7 0 R
108
+ >>
109
+ >>
110
+ >>
111
+ endobj
112
+ 6 0 obj
113
+ << /Type /Font
114
+ /Subtype /Type1
115
+ /BaseFont /Times-Bold
116
+ /Encoding /WinAnsiEncoding
117
+ >>
118
+ endobj
119
+ 7 0 obj
120
+ << /Type /Font
121
+ /Subtype /Type1
122
+ /BaseFont /Times-Roman
123
+ /Encoding /WinAnsiEncoding
124
+ >>
125
+ endobj
126
+ xref
127
+ 0 8
128
+ 0000000000 65535 f
129
+ 0000000015 00000 n
130
+ 0000000109 00000 n
131
+ 0000000158 00000 n
132
+ 0000000215 00000 n
133
+ 0000001314 00000 n
134
+ 0000001506 00000 n
135
+ 0000001604 00000 n
136
+ trailer
137
+ << /Size 8
138
+ /Root 2 0 R
139
+ /Info 1 0 R
140
+ >>
141
+ startxref
142
+ 1703
143
+ %%EOF
@@ -0,0 +1,113 @@
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 1001
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+ 21.260 801.354 442.205 24.094 re
26
+ S
27
+
28
+ BT
29
+ 23.25984251968504 819.350818897638 Td
30
+ /F1.0 6 Tf
31
+ [<5245434542454d4f53204445204e6f6d6520646f2052656d6574656e7465204c746461204f53205052> 40 <4f445554> 18 <4f532f534552> 80 <5649c74f5320434f4e5354> 93 <414e5445532044> 40 <41204e4f> 40 <54> 93 <412046495343414c20494e4449434144> 40 <412041> 55 <4f204c41444f>] TJ
32
+ ET
33
+
34
+ 21.260 777.260 109.134 24.094 re
35
+ S
36
+
37
+ BT
38
+ 23.25984251968504 795.2563307086616 Td
39
+ /F1.0 6 Tf
40
+ [<44> 40 <41> 111 <54> 93 <41204445205245434542494d454e54> 18 <4f>] TJ
41
+ ET
42
+
43
+ 130.394 777.260 333.071 24.094 re
44
+ S
45
+
46
+ BT
47
+ 132.3937007874016 795.2563307086616 Td
48
+ /F1.0 6 Tf
49
+ [<4944454e544946494341> 40 <c7c3> 55 <4f204520415353494e> 35 <41> 111 <5455524120444f20524543454245444f52>] TJ
50
+ ET
51
+
52
+ 463.465 777.260 113.386 48.189 re
53
+ S
54
+
55
+ BT
56
+ 509.88248031496073 808.1843307086615 Td
57
+ /F1.0 10 Tf
58
+ [<4e462d65>] TJ
59
+ ET
60
+
61
+
62
+ BT
63
+ 509.5474803149607 797.0243307086615 Td
64
+ /F1.0 10 Tf
65
+ [<4eb02e2031>] TJ
66
+ ET
67
+
68
+
69
+ BT
70
+ 502.5174803149607 785.8643307086616 Td
71
+ /F1.0 10 Tf
72
+ [<53c95249452031>] TJ
73
+ ET
74
+
75
+ Q
76
+
77
+ endstream
78
+ endobj
79
+ 5 0 obj
80
+ << /Type /Page
81
+ /Parent 3 0 R
82
+ /MediaBox [0 0 595.28 841.89]
83
+ /Contents 4 0 R
84
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
85
+ /Font << /F1.0 6 0 R
86
+ >>
87
+ >>
88
+ >>
89
+ endobj
90
+ 6 0 obj
91
+ << /Type /Font
92
+ /Subtype /Type1
93
+ /BaseFont /Times-Roman
94
+ /Encoding /WinAnsiEncoding
95
+ >>
96
+ endobj
97
+ xref
98
+ 0 7
99
+ 0000000000 65535 f
100
+ 0000000015 00000 n
101
+ 0000000109 00000 n
102
+ 0000000158 00000 n
103
+ 0000000215 00000 n
104
+ 0000001268 00000 n
105
+ 0000001448 00000 n
106
+ trailer
107
+ << /Size 7
108
+ /Root 2 0 R
109
+ /Info 1 0 R
110
+ >>
111
+ startxref
112
+ 1547
113
+ %%EOF
@@ -0,0 +1,176 @@
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 1514
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 21.25984251968504 415.1659212598426 Td
28
+ /F2.0 8 Tf
29
+ [<5452414e53504f52> 40 <54> 90 <41444f52202f2056> 45 <4f4c554d4553205452414e53504f52> 40 <54> 90 <41444f53>] TJ
30
+ ET
31
+
32
+ 21.260 390.047 241.512 22.677 re
33
+ S
34
+
35
+ BT
36
+ 23.25984251968504 406.626409448819 Td
37
+ /F1.0 6 Tf
38
+ [<52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+ 262.772 390.047 79.087 22.677 re
42
+ S
43
+
44
+ BT
45
+ 264.7716535433071 406.626409448819 Td
46
+ /F1.0 6 Tf
47
+ [<465245544520504f5220434f4e54> 93 <41>] TJ
48
+ ET
49
+
50
+
51
+ BT
52
+ 264.7716535433071 392.89440944881903 Td
53
+ /F1.0 10 Tf
54
+ [<302d456d6974656e7465>] TJ
55
+ ET
56
+
57
+ 341.858 390.047 50.457 22.677 re
58
+ S
59
+
60
+ BT
61
+ 343.85826771653547 406.626409448819 Td
62
+ /F1.0 6 Tf
63
+ [<434f4449474f20414e5454>] TJ
64
+ ET
65
+
66
+ 392.315 390.047 64.913 22.677 re
67
+ S
68
+
69
+ BT
70
+ 394.3149606299213 406.626409448819 Td
71
+ /F1.0 6 Tf
72
+ [<504c41> 40 <434120444f205645cd43554c4f>] TJ
73
+ ET
74
+
75
+ 457.228 390.047 21.543 22.677 re
76
+ S
77
+
78
+ BT
79
+ 459.2283464566929 406.626409448819 Td
80
+ /F1.0 6 Tf
81
+ [<5546>] TJ
82
+ ET
83
+
84
+ 478.772 390.047 97.512 22.677 re
85
+ S
86
+
87
+ BT
88
+ 480.77165354330714 406.626409448819 Td
89
+ /F1.0 6 Tf
90
+ [<434e504a2f435046>] TJ
91
+ ET
92
+
93
+ 21.260 367.370 241.512 22.677 re
94
+ S
95
+
96
+ BT
97
+ 23.25984251968504 383.9492440944882 Td
98
+ /F1.0 6 Tf
99
+ [<454e44455245c74f>] TJ
100
+ ET
101
+
102
+ 262.772 367.370 194.457 22.677 re
103
+ S
104
+
105
+ BT
106
+ 264.7716535433071 383.9492440944882 Td
107
+ /F1.0 6 Tf
108
+ [<4d554e4943cd50494f>] TJ
109
+ ET
110
+
111
+ 457.228 367.370 21.543 22.677 re
112
+ S
113
+
114
+ BT
115
+ 459.2283464566929 383.9492440944882 Td
116
+ /F1.0 6 Tf
117
+ [<5546>] TJ
118
+ ET
119
+
120
+ 478.772 367.370 97.512 22.677 re
121
+ S
122
+
123
+ BT
124
+ 480.77165354330714 383.9492440944882 Td
125
+ /F1.0 6 Tf
126
+ [<494e53435249c7c2> 55 <4f20455354> 93 <414455> 40 <414c>] TJ
127
+ ET
128
+
129
+ Q
130
+
131
+ endstream
132
+ endobj
133
+ 5 0 obj
134
+ << /Type /Page
135
+ /Parent 3 0 R
136
+ /MediaBox [0 0 595.28 841.89]
137
+ /Contents 4 0 R
138
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
139
+ /Font << /F2.0 6 0 R
140
+ /F1.0 7 0 R
141
+ >>
142
+ >>
143
+ >>
144
+ endobj
145
+ 6 0 obj
146
+ << /Type /Font
147
+ /Subtype /Type1
148
+ /BaseFont /Times-Bold
149
+ /Encoding /WinAnsiEncoding
150
+ >>
151
+ endobj
152
+ 7 0 obj
153
+ << /Type /Font
154
+ /Subtype /Type1
155
+ /BaseFont /Times-Roman
156
+ /Encoding /WinAnsiEncoding
157
+ >>
158
+ endobj
159
+ xref
160
+ 0 8
161
+ 0000000000 65535 f
162
+ 0000000015 00000 n
163
+ 0000000109 00000 n
164
+ 0000000158 00000 n
165
+ 0000000215 00000 n
166
+ 0000001781 00000 n
167
+ 0000001973 00000 n
168
+ 0000002071 00000 n
169
+ trailer
170
+ << /Size 8
171
+ /Root 2 0 R
172
+ /Info 1 0 R
173
+ >>
174
+ startxref
175
+ 2170
176
+ %%EOF