br_danfe 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 495bde96f88c5762bebf455e55b41d9ea1bda6c6
4
- data.tar.gz: 1117b6d8838a67787ff32d1c3da4a903d76fbebc
3
+ metadata.gz: 3712b595595cd9e77ee93121dd2cbf1156409dd5
4
+ data.tar.gz: 413eff13e45e7ad2216ec35955cd75df9a7fd592
5
5
  SHA512:
6
- metadata.gz: 0a8868c455f39fe42752c198453e3357f34a39d5d6b9572212300e631ee90e2cbec2cefab159e1dd19129df9ae28404a3032fbab41fc435246e4aedcd02219d3
7
- data.tar.gz: f5db6c1c3b5a0146bf1b33b0b21e4cd0a7067ca8eaed888247731ae8d483e8d8730ef84fe8599126564f64f4732a471fb6bbb780282feaca58f114b45ec70a36
6
+ metadata.gz: c75d38f7cb84d29752d2ea4703690d0c3181a8a1b8544efdd99761f425070ecc376e31c6556acd8cf5745a1b7e330e603a7d32ed3fb424d8d5f2ad1b149c458c
7
+ data.tar.gz: ff64caf2a013c3f0aa7907386216ec8a8198f99a8d894c870e65c0a753b321763ec7039de42c3a7b60cfa40cd893f49286ae0c261344b52f6aee183ff40d21d6
@@ -63,10 +63,10 @@ pt-BR:
63
63
  transp:
64
64
  modFrete:
65
65
  title: "FRETE POR CONTA"
66
- emitter: "0 - EMITENTE"
67
- recipient: "1 - DEST."
68
- third_party: "2 - TERCEIROS"
69
- no_freight: "9 - SEM FRETE"
66
+ emitter: "0-Emitente"
67
+ recipient: "1-Destinatário"
68
+ third_party: "2-Terceiros"
69
+ no_freight: "9-Sem Frete"
70
70
  veicTransp:
71
71
  RNTC: "CODIGO ANTT"
72
72
  placa: "PLACA DO VEÍCULO"
@@ -32,11 +32,18 @@ module BrDanfe
32
32
  end
33
33
 
34
34
  def mod_frete
35
- if @xml["transp/modFrete"] == "0"
36
- I18n.t("danfe.transp.modFrete.emitter")
37
- else
38
- I18n.t("danfe.transp.modFrete.recipient")
35
+ case @xml["transp/modFrete"]
36
+ when "0"
37
+ modality = "emitter"
38
+ when "1"
39
+ modality = "recipient"
40
+ when "2"
41
+ modality = "third_party"
42
+ when "9"
43
+ modality = "no_freight"
39
44
  end
45
+
46
+ I18n.t("danfe.transp.modFrete.#{modality}")
40
47
  end
41
48
  end
42
49
  end
@@ -1,3 +1,3 @@
1
1
  module BrDanfe
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
@@ -46,15 +46,6 @@ describe BrDanfe::Danfe do
46
46
 
47
47
  expect(danfe.render_pdf).to eq expected
48
48
  end
49
-
50
- it "renders a NF-e with logo" do
51
- danfe = BrDanfe::Danfe.new(File.read("#{base_dir}nfe_with_logo.xml"))
52
- danfe.options.logo_path = "spec/fixtures/logo.png"
53
-
54
- expected = IO.binread("#{base_dir}nfe_with_logo.xml.fixture.pdf")
55
-
56
- expect(danfe.render_pdf).to eq expected
57
- end
58
49
  end
59
50
 
60
51
  describe "#save_pdf" do
@@ -104,16 +95,6 @@ describe BrDanfe::Danfe do
104
95
 
105
96
  expect("#{base_dir}nfe_with_extra_volumes.xml.fixture.pdf").to be_same_file_as(output_pdf)
106
97
  end
107
-
108
- it "renders a NF-e with logo" do
109
- expect(File.exist?(output_pdf)).to be_falsey
110
-
111
- danfe = BrDanfe::Danfe.new(File.read("#{base_dir}nfe_with_logo.xml"))
112
- danfe.options.logo_path = "spec/fixtures/logo.png"
113
- danfe.save_pdf output_pdf
114
-
115
- expect("#{base_dir}nfe_with_logo.xml.fixture.pdf").to be_same_file_as(output_pdf)
116
- end
117
98
  end
118
99
  end
119
100
 
@@ -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 1531
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 7.086614173228347 427.07143307086625 Td
28
+ /F2.0 8 Tf
29
+ [<5452414e53504f52> 40 <54> 90 <41444f52202f2056> 45 <4f4c554d4553205452414e53504f52> 40 <54> 90 <41444f53>] TJ
30
+ ET
31
+
32
+ 7.087 401.953 255.685 22.677 re
33
+ S
34
+
35
+ BT
36
+ 9.086614173228348 418.53192125984253 Td
37
+ /F1.0 6 Tf
38
+ [<52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+ 262.772 401.953 79.087 22.677 re
42
+ S
43
+
44
+ BT
45
+ 264.7716535433071 418.53192125984253 Td
46
+ /F1.0 6 Tf
47
+ [<465245544520504f5220434f4e54> 93 <41>] TJ
48
+ ET
49
+
50
+
51
+ BT
52
+ 264.7716535433071 404.79992125984256 Td
53
+ /F1.0 10 Tf
54
+ [<302d456d6974656e7465>] TJ
55
+ ET
56
+
57
+ 341.858 401.953 50.457 22.677 re
58
+ S
59
+
60
+ BT
61
+ 343.85826771653547 418.53192125984253 Td
62
+ /F1.0 6 Tf
63
+ [<434f4449474f20414e5454>] TJ
64
+ ET
65
+
66
+ 392.315 401.953 64.913 22.677 re
67
+ S
68
+
69
+ BT
70
+ 394.3149606299213 418.53192125984253 Td
71
+ /F1.0 6 Tf
72
+ [<504c41> 40 <434120444f205645cd43554c4f>] TJ
73
+ ET
74
+
75
+ 457.228 401.953 21.543 22.677 re
76
+ S
77
+
78
+ BT
79
+ 459.2283464566929 418.53192125984253 Td
80
+ /F1.0 6 Tf
81
+ [<5546>] TJ
82
+ ET
83
+
84
+ 478.772 401.953 111.685 22.677 re
85
+ S
86
+
87
+ BT
88
+ 480.77165354330714 418.53192125984253 Td
89
+ /F1.0 6 Tf
90
+ [<434e504a2f435046>] TJ
91
+ ET
92
+
93
+ 7.087 379.276 255.685 22.677 re
94
+ S
95
+
96
+ BT
97
+ 9.086614173228348 395.85475590551187 Td
98
+ /F1.0 6 Tf
99
+ [<454e44455245c74f>] TJ
100
+ ET
101
+
102
+ 262.772 379.276 194.457 22.677 re
103
+ S
104
+
105
+ BT
106
+ 264.7716535433071 395.85475590551187 Td
107
+ /F1.0 6 Tf
108
+ [<4d554e4943cd50494f>] TJ
109
+ ET
110
+
111
+ 457.228 379.276 21.543 22.677 re
112
+ S
113
+
114
+ BT
115
+ 459.2283464566929 395.85475590551187 Td
116
+ /F1.0 6 Tf
117
+ [<5546>] TJ
118
+ ET
119
+
120
+ 478.772 379.276 111.685 22.677 re
121
+ S
122
+
123
+ BT
124
+ 480.77165354330714 395.85475590551187 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
+ 0000001798 00000 n
167
+ 0000001990 00000 n
168
+ 0000002088 00000 n
169
+ trailer
170
+ << /Size 8
171
+ /Root 2 0 R
172
+ /Info 1 0 R
173
+ >>
174
+ startxref
175
+ 2187
176
+ %%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 1539
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 7.086614173228347 427.07143307086625 Td
28
+ /F2.0 8 Tf
29
+ [<5452414e53504f52> 40 <54> 90 <41444f52202f2056> 45 <4f4c554d4553205452414e53504f52> 40 <54> 90 <41444f53>] TJ
30
+ ET
31
+
32
+ 7.087 401.953 255.685 22.677 re
33
+ S
34
+
35
+ BT
36
+ 9.086614173228348 418.53192125984253 Td
37
+ /F1.0 6 Tf
38
+ [<52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+ 262.772 401.953 79.087 22.677 re
42
+ S
43
+
44
+ BT
45
+ 264.7716535433071 418.53192125984253 Td
46
+ /F1.0 6 Tf
47
+ [<465245544520504f5220434f4e54> 93 <41>] TJ
48
+ ET
49
+
50
+
51
+ BT
52
+ 264.7716535433071 404.79992125984256 Td
53
+ /F1.0 10 Tf
54
+ [<312d44657374696e6174e172696f>] TJ
55
+ ET
56
+
57
+ 341.858 401.953 50.457 22.677 re
58
+ S
59
+
60
+ BT
61
+ 343.85826771653547 418.53192125984253 Td
62
+ /F1.0 6 Tf
63
+ [<434f4449474f20414e5454>] TJ
64
+ ET
65
+
66
+ 392.315 401.953 64.913 22.677 re
67
+ S
68
+
69
+ BT
70
+ 394.3149606299213 418.53192125984253 Td
71
+ /F1.0 6 Tf
72
+ [<504c41> 40 <434120444f205645cd43554c4f>] TJ
73
+ ET
74
+
75
+ 457.228 401.953 21.543 22.677 re
76
+ S
77
+
78
+ BT
79
+ 459.2283464566929 418.53192125984253 Td
80
+ /F1.0 6 Tf
81
+ [<5546>] TJ
82
+ ET
83
+
84
+ 478.772 401.953 111.685 22.677 re
85
+ S
86
+
87
+ BT
88
+ 480.77165354330714 418.53192125984253 Td
89
+ /F1.0 6 Tf
90
+ [<434e504a2f435046>] TJ
91
+ ET
92
+
93
+ 7.087 379.276 255.685 22.677 re
94
+ S
95
+
96
+ BT
97
+ 9.086614173228348 395.85475590551187 Td
98
+ /F1.0 6 Tf
99
+ [<454e44455245c74f>] TJ
100
+ ET
101
+
102
+ 262.772 379.276 194.457 22.677 re
103
+ S
104
+
105
+ BT
106
+ 264.7716535433071 395.85475590551187 Td
107
+ /F1.0 6 Tf
108
+ [<4d554e4943cd50494f>] TJ
109
+ ET
110
+
111
+ 457.228 379.276 21.543 22.677 re
112
+ S
113
+
114
+ BT
115
+ 459.2283464566929 395.85475590551187 Td
116
+ /F1.0 6 Tf
117
+ [<5546>] TJ
118
+ ET
119
+
120
+ 478.772 379.276 111.685 22.677 re
121
+ S
122
+
123
+ BT
124
+ 480.77165354330714 395.85475590551187 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
+ 0000001806 00000 n
167
+ 0000001998 00000 n
168
+ 0000002096 00000 n
169
+ trailer
170
+ << /Size 8
171
+ /Root 2 0 R
172
+ /Info 1 0 R
173
+ >>
174
+ startxref
175
+ 2195
176
+ %%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 1539
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 7.086614173228347 427.07143307086625 Td
28
+ /F2.0 8 Tf
29
+ [<5452414e53504f52> 40 <54> 90 <41444f52202f2056> 45 <4f4c554d4553205452414e53504f52> 40 <54> 90 <41444f53>] TJ
30
+ ET
31
+
32
+ 7.087 401.953 255.685 22.677 re
33
+ S
34
+
35
+ BT
36
+ 9.086614173228348 418.53192125984253 Td
37
+ /F1.0 6 Tf
38
+ [<52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+ 262.772 401.953 79.087 22.677 re
42
+ S
43
+
44
+ BT
45
+ 264.7716535433071 418.53192125984253 Td
46
+ /F1.0 6 Tf
47
+ [<465245544520504f5220434f4e54> 93 <41>] TJ
48
+ ET
49
+
50
+
51
+ BT
52
+ 264.7716535433071 404.79992125984256 Td
53
+ /F1.0 10 Tf
54
+ [<322d54> 70 <6572636569726f73>] TJ
55
+ ET
56
+
57
+ 341.858 401.953 50.457 22.677 re
58
+ S
59
+
60
+ BT
61
+ 343.85826771653547 418.53192125984253 Td
62
+ /F1.0 6 Tf
63
+ [<434f4449474f20414e5454>] TJ
64
+ ET
65
+
66
+ 392.315 401.953 64.913 22.677 re
67
+ S
68
+
69
+ BT
70
+ 394.3149606299213 418.53192125984253 Td
71
+ /F1.0 6 Tf
72
+ [<504c41> 40 <434120444f205645cd43554c4f>] TJ
73
+ ET
74
+
75
+ 457.228 401.953 21.543 22.677 re
76
+ S
77
+
78
+ BT
79
+ 459.2283464566929 418.53192125984253 Td
80
+ /F1.0 6 Tf
81
+ [<5546>] TJ
82
+ ET
83
+
84
+ 478.772 401.953 111.685 22.677 re
85
+ S
86
+
87
+ BT
88
+ 480.77165354330714 418.53192125984253 Td
89
+ /F1.0 6 Tf
90
+ [<434e504a2f435046>] TJ
91
+ ET
92
+
93
+ 7.087 379.276 255.685 22.677 re
94
+ S
95
+
96
+ BT
97
+ 9.086614173228348 395.85475590551187 Td
98
+ /F1.0 6 Tf
99
+ [<454e44455245c74f>] TJ
100
+ ET
101
+
102
+ 262.772 379.276 194.457 22.677 re
103
+ S
104
+
105
+ BT
106
+ 264.7716535433071 395.85475590551187 Td
107
+ /F1.0 6 Tf
108
+ [<4d554e4943cd50494f>] TJ
109
+ ET
110
+
111
+ 457.228 379.276 21.543 22.677 re
112
+ S
113
+
114
+ BT
115
+ 459.2283464566929 395.85475590551187 Td
116
+ /F1.0 6 Tf
117
+ [<5546>] TJ
118
+ ET
119
+
120
+ 478.772 379.276 111.685 22.677 re
121
+ S
122
+
123
+ BT
124
+ 480.77165354330714 395.85475590551187 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
+ 0000001806 00000 n
167
+ 0000001998 00000 n
168
+ 0000002096 00000 n
169
+ trailer
170
+ << /Size 8
171
+ /Root 2 0 R
172
+ /Info 1 0 R
173
+ >>
174
+ startxref
175
+ 2195
176
+ %%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 1533
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 7.086614173228347 427.07143307086625 Td
28
+ /F2.0 8 Tf
29
+ [<5452414e53504f52> 40 <54> 90 <41444f52202f2056> 45 <4f4c554d4553205452414e53504f52> 40 <54> 90 <41444f53>] TJ
30
+ ET
31
+
32
+ 7.087 401.953 255.685 22.677 re
33
+ S
34
+
35
+ BT
36
+ 9.086614173228348 418.53192125984253 Td
37
+ /F1.0 6 Tf
38
+ [<52415ac3> 55 <4f20534f4349414c>] TJ
39
+ ET
40
+
41
+ 262.772 401.953 79.087 22.677 re
42
+ S
43
+
44
+ BT
45
+ 264.7716535433071 418.53192125984253 Td
46
+ /F1.0 6 Tf
47
+ [<465245544520504f5220434f4e54> 93 <41>] TJ
48
+ ET
49
+
50
+
51
+ BT
52
+ 264.7716535433071 404.79992125984256 Td
53
+ /F1.0 10 Tf
54
+ [<392d53656d204672657465>] TJ
55
+ ET
56
+
57
+ 341.858 401.953 50.457 22.677 re
58
+ S
59
+
60
+ BT
61
+ 343.85826771653547 418.53192125984253 Td
62
+ /F1.0 6 Tf
63
+ [<434f4449474f20414e5454>] TJ
64
+ ET
65
+
66
+ 392.315 401.953 64.913 22.677 re
67
+ S
68
+
69
+ BT
70
+ 394.3149606299213 418.53192125984253 Td
71
+ /F1.0 6 Tf
72
+ [<504c41> 40 <434120444f205645cd43554c4f>] TJ
73
+ ET
74
+
75
+ 457.228 401.953 21.543 22.677 re
76
+ S
77
+
78
+ BT
79
+ 459.2283464566929 418.53192125984253 Td
80
+ /F1.0 6 Tf
81
+ [<5546>] TJ
82
+ ET
83
+
84
+ 478.772 401.953 111.685 22.677 re
85
+ S
86
+
87
+ BT
88
+ 480.77165354330714 418.53192125984253 Td
89
+ /F1.0 6 Tf
90
+ [<434e504a2f435046>] TJ
91
+ ET
92
+
93
+ 7.087 379.276 255.685 22.677 re
94
+ S
95
+
96
+ BT
97
+ 9.086614173228348 395.85475590551187 Td
98
+ /F1.0 6 Tf
99
+ [<454e44455245c74f>] TJ
100
+ ET
101
+
102
+ 262.772 379.276 194.457 22.677 re
103
+ S
104
+
105
+ BT
106
+ 264.7716535433071 395.85475590551187 Td
107
+ /F1.0 6 Tf
108
+ [<4d554e4943cd50494f>] TJ
109
+ ET
110
+
111
+ 457.228 379.276 21.543 22.677 re
112
+ S
113
+
114
+ BT
115
+ 459.2283464566929 395.85475590551187 Td
116
+ /F1.0 6 Tf
117
+ [<5546>] TJ
118
+ ET
119
+
120
+ 478.772 379.276 111.685 22.677 re
121
+ S
122
+
123
+ BT
124
+ 480.77165354330714 395.85475590551187 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
+ 0000001800 00000 n
167
+ 0000001992 00000 n
168
+ 0000002090 00000 n
169
+ trailer
170
+ << /Size 8
171
+ /Root 2 0 R
172
+ /Info 1 0 R
173
+ >>
174
+ startxref
175
+ 2189
176
+ %%EOF
@@ -17,7 +17,7 @@ endobj
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
20
- << /Length 2395
20
+ << /Length 2391
21
21
  >>
22
22
  stream
23
23
  q
@@ -58,7 +58,7 @@ ET
58
58
  BT
59
59
  264.7716535433071 404.79992125984256 Td
60
60
  /F1.0 10 Tf
61
- [<30202d20454d4954454e5445>] TJ
61
+ [<302d456d6974656e7465>] TJ
62
62
  ET
63
63
 
64
64
  341.858 401.953 50.457 22.677 re
@@ -226,14 +226,14 @@ xref
226
226
  0000000109 00000 n
227
227
  0000000158 00000 n
228
228
  0000000215 00000 n
229
- 0000002662 00000 n
230
- 0000002854 00000 n
231
- 0000002952 00000 n
229
+ 0000002658 00000 n
230
+ 0000002850 00000 n
231
+ 0000002948 00000 n
232
232
  trailer
233
233
  << /Size 8
234
234
  /Root 2 0 R
235
235
  /Info 1 0 R
236
236
  >>
237
237
  startxref
238
- 3051
238
+ 3047
239
239
  %%EOF
@@ -672,7 +672,7 @@ endobj
672
672
  /F3.0 10 0 R
673
673
  >>
674
674
  >>
675
- /Length 17171
675
+ /Length 17167
676
676
  >>
677
677
  stream
678
678
  q
@@ -1545,7 +1545,7 @@ ET
1545
1545
  BT
1546
1546
  264.7716535433071 404.79992125984256 Td
1547
1547
  /F1.0 10 Tf
1548
- [<30202d20454d4954454e5445>] TJ
1548
+ [<302d456d6974656e7465>] TJ
1549
1549
  ET
1550
1550
 
1551
1551
  341.858 401.953 50.457 22.677 re
@@ -1866,13 +1866,13 @@ xref
1866
1866
  0000007670 00000 n
1867
1867
  0000008188 00000 n
1868
1868
  0000008287 00000 n
1869
- 0000025633 00000 n
1870
- 0000025731 00000 n
1869
+ 0000025629 00000 n
1870
+ 0000025727 00000 n
1871
1871
  trailer
1872
1872
  << /Size 11
1873
1873
  /Root 2 0 R
1874
1874
  /Info 1 0 R
1875
1875
  >>
1876
1876
  startxref
1877
- 25832
1877
+ 25828
1878
1878
  %%EOF
@@ -2273,7 +2273,7 @@ endobj
2273
2273
  /F3.0 10 0 R
2274
2274
  >>
2275
2275
  >>
2276
- /Length 26487
2276
+ /Length 26483
2277
2277
  >>
2278
2278
  stream
2279
2279
  q
@@ -3434,7 +3434,7 @@ ET
3434
3434
  BT
3435
3435
  264.7716535433071 404.79992125984256 Td
3436
3436
  /F1.0 10 Tf
3437
- [<30202d20454d4954454e5445>] TJ
3437
+ [<302d456d6974656e7465>] TJ
3438
3438
  ET
3439
3439
 
3440
3440
  341.858 401.953 50.457 22.677 re
@@ -5193,15 +5193,15 @@ xref
5193
5193
  0000027872 00000 n
5194
5194
  0000028390 00000 n
5195
5195
  0000028489 00000 n
5196
- 0000055151 00000 n
5197
- 0000055249 00000 n
5198
- 0000055350 00000 n
5199
- 0000069119 00000 n
5196
+ 0000055147 00000 n
5197
+ 0000055245 00000 n
5198
+ 0000055346 00000 n
5199
+ 0000069115 00000 n
5200
5200
  trailer
5201
5201
  << /Size 13
5202
5202
  /Root 2 0 R
5203
5203
  /Info 1 0 R
5204
5204
  >>
5205
5205
  startxref
5206
- 69342
5206
+ 69338
5207
5207
  %%EOF
@@ -341,7 +341,7 @@ endobj
341
341
  /F3.0 10 0 R
342
342
  >>
343
343
  >>
344
- /Length 24353
344
+ /Length 24349
345
345
  >>
346
346
  stream
347
347
  q
@@ -1516,7 +1516,7 @@ ET
1516
1516
  BT
1517
1517
  264.7716535433071 404.79992125984256 Td
1518
1518
  /F1.0 10 Tf
1519
- [<30202d20454d4954454e5445>] TJ
1519
+ [<302d456d6974656e7465>] TJ
1520
1520
  ET
1521
1521
 
1522
1522
  341.858 401.953 50.457 22.677 re
@@ -1961,13 +1961,13 @@ xref
1961
1961
  0000003599 00000 n
1962
1962
  0000004117 00000 n
1963
1963
  0000004216 00000 n
1964
- 0000028744 00000 n
1965
- 0000028842 00000 n
1964
+ 0000028740 00000 n
1965
+ 0000028838 00000 n
1966
1966
  trailer
1967
1967
  << /Size 11
1968
1968
  /Root 2 0 R
1969
1969
  /Info 1 0 R
1970
1970
  >>
1971
1971
  startxref
1972
- 28943
1972
+ 28939
1973
1973
  %%EOF
@@ -2273,7 +2273,7 @@ endobj
2273
2273
  /F3.0 10 0 R
2274
2274
  >>
2275
2275
  >>
2276
- /Length 24196
2276
+ /Length 24192
2277
2277
  >>
2278
2278
  stream
2279
2279
  q
@@ -3434,7 +3434,7 @@ ET
3434
3434
  BT
3435
3435
  264.7716535433071 404.79992125984256 Td
3436
3436
  /F1.0 10 Tf
3437
- [<30202d20454d4954454e5445>] TJ
3437
+ [<302d456d6974656e7465>] TJ
3438
3438
  ET
3439
3439
 
3440
3440
  341.858 401.953 50.457 22.677 re
@@ -5011,15 +5011,15 @@ xref
5011
5011
  0000027872 00000 n
5012
5012
  0000028390 00000 n
5013
5013
  0000028489 00000 n
5014
- 0000052860 00000 n
5015
- 0000052958 00000 n
5016
- 0000053059 00000 n
5017
- 0000066828 00000 n
5014
+ 0000052856 00000 n
5015
+ 0000052954 00000 n
5016
+ 0000053055 00000 n
5017
+ 0000066824 00000 n
5018
5018
  trailer
5019
5019
  << /Size 13
5020
5020
  /Root 2 0 R
5021
5021
  /Info 1 0 R
5022
5022
  >>
5023
5023
  startxref
5024
- 67051
5024
+ 67047
5025
5025
  %%EOF
@@ -753,7 +753,7 @@ endobj
753
753
  /F2.0 9 0 R
754
754
  >>
755
755
  >>
756
- /Length 23698
756
+ /Length 23694
757
757
  >>
758
758
  stream
759
759
  q
@@ -1865,7 +1865,7 @@ ET
1865
1865
  BT
1866
1866
  264.7716535433071 404.79992125984256 Td
1867
1867
  /F1.0 10 Tf
1868
- [<30202d20454d4954454e5445>] TJ
1868
+ [<302d456d6974656e7465>] TJ
1869
1869
  ET
1870
1870
 
1871
1871
  341.858 401.953 50.457 22.677 re
@@ -2303,12 +2303,12 @@ xref
2303
2303
  0000008806 00000 n
2304
2304
  0000009324 00000 n
2305
2305
  0000009423 00000 n
2306
- 0000033283 00000 n
2306
+ 0000033279 00000 n
2307
2307
  trailer
2308
2308
  << /Size 10
2309
2309
  /Root 2 0 R
2310
2310
  /Info 1 0 R
2311
2311
  >>
2312
2312
  startxref
2313
- 33381
2313
+ 33377
2314
2314
  %%EOF
@@ -1610,7 +1610,7 @@ endobj
1610
1610
  /F3.0 10 0 R
1611
1611
  >>
1612
1612
  >>
1613
- /Length 16659
1613
+ /Length 16655
1614
1614
  >>
1615
1615
  stream
1616
1616
  q
@@ -2385,7 +2385,7 @@ ET
2385
2385
  BT
2386
2386
  264.7716535433071 404.79992125984256 Td
2387
2387
  /F1.0 10 Tf
2388
- [<30202d20454d4954454e5445>] TJ
2388
+ [<302d456d6974656e7465>] TJ
2389
2389
  ET
2390
2390
 
2391
2391
  341.858 401.953 50.457 22.677 re
@@ -2720,13 +2720,13 @@ xref
2720
2720
  0000019324 00000 n
2721
2721
  0000019842 00000 n
2722
2722
  0000019941 00000 n
2723
- 0000036775 00000 n
2724
- 0000036873 00000 n
2723
+ 0000036771 00000 n
2724
+ 0000036869 00000 n
2725
2725
  trailer
2726
2726
  << /Size 11
2727
2727
  /Root 2 0 R
2728
2728
  /Info 1 0 R
2729
2729
  >>
2730
2730
  startxref
2731
- 36974
2731
+ 36970
2732
2732
  %%EOF
@@ -47,5 +47,93 @@ describe BrDanfe::Transp do
47
47
 
48
48
  expect("#{base_dir}transp#render.pdf").to be_same_file_as(output_pdf)
49
49
  end
50
+
51
+ context "when modFrete is 0" do
52
+ let(:xml_as_string) do
53
+ <<-eos
54
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
55
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="2.00">
56
+ <transp>
57
+ <modFrete>0</modFrete>
58
+ </transp>
59
+ </infNFe>
60
+ </NFe>
61
+ eos
62
+ end
63
+
64
+ it "renders '0-Emitente' to the pdf" do
65
+ expect(File.exist?(output_pdf)).to be_falsey
66
+
67
+ pdf.render_file output_pdf
68
+
69
+ expect("#{base_dir}transp#render-modfrete_0.pdf").to be_same_file_as(output_pdf)
70
+ end
71
+ end
72
+
73
+ context "when modFrete is 1" do
74
+ let(:xml_as_string) do
75
+ <<-eos
76
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
77
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="2.00">
78
+ <transp>
79
+ <modFrete>1</modFrete>
80
+ </transp>
81
+ </infNFe>
82
+ </NFe>
83
+ eos
84
+ end
85
+
86
+ it "renders '1-Destinatário' to the pdf" do
87
+ expect(File.exist?(output_pdf)).to be_falsey
88
+
89
+ pdf.render_file output_pdf
90
+
91
+ expect("#{base_dir}transp#render-modfrete_1.pdf").to be_same_file_as(output_pdf)
92
+ end
93
+ end
94
+
95
+ context "when modFrete is 2" do
96
+ let(:xml_as_string) do
97
+ <<-eos
98
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
99
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="2.00">
100
+ <transp>
101
+ <modFrete>2</modFrete>
102
+ </transp>
103
+ </infNFe>
104
+ </NFe>
105
+ eos
106
+ end
107
+
108
+ it "renders '2-Terceiros' to the pdf" do
109
+ expect(File.exist?(output_pdf)).to be_falsey
110
+
111
+ pdf.render_file output_pdf
112
+
113
+ expect("#{base_dir}transp#render-modfrete_2.pdf").to be_same_file_as(output_pdf)
114
+ end
115
+ end
116
+
117
+ context "when modFrete is 3" do
118
+ let(:xml_as_string) do
119
+ <<-eos
120
+ <NFe xmlns="http://www.portalfiscal.inf.br/nfe">
121
+ <infNFe Id="NFe25111012345678901234550020000134151000134151" versao="2.00">
122
+ <transp>
123
+ <modFrete>9</modFrete>
124
+ </transp>
125
+ </infNFe>
126
+ </NFe>
127
+ eos
128
+ end
129
+
130
+ it "renders '9-Sem Frete' to the pdf" do
131
+ expect(File.exist?(output_pdf)).to be_falsey
132
+
133
+ pdf.render_file output_pdf
134
+
135
+ expect("#{base_dir}transp#render-modfrete_9.pdf").to be_same_file_as(output_pdf)
136
+ end
137
+ end
50
138
  end
51
139
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_danfe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - ASSEINFO
@@ -201,6 +201,10 @@ files:
201
201
  - spec/fixtures/lib/infadic#render.pdf
202
202
  - spec/fixtures/lib/issqn#render.pdf
203
203
  - spec/fixtures/lib/ticket#render.pdf
204
+ - spec/fixtures/lib/transp#render-modfrete_0.pdf
205
+ - spec/fixtures/lib/transp#render-modfrete_1.pdf
206
+ - spec/fixtures/lib/transp#render-modfrete_2.pdf
207
+ - spec/fixtures/lib/transp#render-modfrete_9.pdf
204
208
  - spec/fixtures/lib/transp#render.pdf
205
209
  - spec/fixtures/lib/vol#render.pdf
206
210
  - spec/fixtures/logo.png
@@ -292,6 +296,10 @@ test_files:
292
296
  - spec/fixtures/lib/infadic#render.pdf
293
297
  - spec/fixtures/lib/issqn#render.pdf
294
298
  - spec/fixtures/lib/ticket#render.pdf
299
+ - spec/fixtures/lib/transp#render-modfrete_0.pdf
300
+ - spec/fixtures/lib/transp#render-modfrete_1.pdf
301
+ - spec/fixtures/lib/transp#render-modfrete_2.pdf
302
+ - spec/fixtures/lib/transp#render-modfrete_9.pdf
295
303
  - spec/fixtures/lib/transp#render.pdf
296
304
  - spec/fixtures/lib/vol#render.pdf
297
305
  - spec/fixtures/logo.png