br_danfe 0.0.9 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +26 -3
  3. data/br_danfe.gemspec +1 -0
  4. data/config/locales/pt-BR.yml +14 -0
  5. data/lib/br_danfe/cce.rb +28 -0
  6. data/lib/br_danfe/cce_lib/barcode.rb +24 -0
  7. data/lib/br_danfe/cce_lib/correction.rb +22 -0
  8. data/lib/br_danfe/cce_lib/document.rb +44 -0
  9. data/lib/br_danfe/cce_lib/footer.rb +15 -0
  10. data/lib/br_danfe/cce_lib/header.rb +15 -0
  11. data/lib/br_danfe/cce_lib/nfe_key.rb +23 -0
  12. data/lib/br_danfe/cce_lib/protocol.rb +23 -0
  13. data/lib/br_danfe/danfe.rb +16 -16
  14. data/lib/br_danfe/danfe_lib/cep.rb +9 -0
  15. data/lib/br_danfe/danfe_lib/consts.rb +6 -0
  16. data/lib/br_danfe/danfe_lib/cst.rb +30 -0
  17. data/lib/br_danfe/danfe_lib/dest.rb +86 -0
  18. data/lib/br_danfe/danfe_lib/det_body.rb +75 -0
  19. data/lib/br_danfe/danfe_lib/det_header.rb +40 -0
  20. data/lib/br_danfe/danfe_lib/document.rb +135 -0
  21. data/lib/br_danfe/danfe_lib/dup.rb +52 -0
  22. data/lib/br_danfe/danfe_lib/emit.rb +23 -0
  23. data/lib/br_danfe/danfe_lib/emit_header.rb +82 -0
  24. data/lib/br_danfe/danfe_lib/helper.rb +64 -0
  25. data/lib/br_danfe/danfe_lib/icmstot.rb +33 -0
  26. data/lib/br_danfe/danfe_lib/infadic.rb +80 -0
  27. data/lib/br_danfe/danfe_lib/issqn.rb +24 -0
  28. data/lib/br_danfe/danfe_lib/options.rb +24 -0
  29. data/lib/br_danfe/danfe_lib/phone.rb +13 -0
  30. data/lib/br_danfe/danfe_lib/plate.rb +9 -0
  31. data/lib/br_danfe/danfe_lib/ticket.rb +17 -0
  32. data/lib/br_danfe/danfe_lib/transp.rb +51 -0
  33. data/lib/br_danfe/danfe_lib/vol.rb +41 -0
  34. data/lib/br_danfe/danfe_lib/xml.rb +38 -0
  35. data/lib/br_danfe/danfe_lib/xprod.rb +48 -0
  36. data/lib/br_danfe/version.rb +1 -1
  37. data/lib/br_danfe.rb +1 -1
  38. data/spec/features/cce_spec.rb +28 -0
  39. data/spec/features/danfe_spec.rb +3 -3
  40. data/spec/fixtures/cce/lib/barcode#render.pdf +511 -0
  41. data/spec/fixtures/cce/lib/correction#render.pdf +100 -0
  42. data/spec/fixtures/cce/lib/document#box.pdf +55 -0
  43. data/spec/fixtures/cce/lib/document#box.with.block.pdf +72 -0
  44. data/spec/fixtures/cce/lib/document#text.align.pdf +70 -0
  45. data/spec/fixtures/cce/lib/document#text.pad.pdf +70 -0
  46. data/spec/fixtures/cce/lib/document#text.simple.pdf +70 -0
  47. data/spec/fixtures/cce/lib/document#text.size.pdf +70 -0
  48. data/spec/fixtures/cce/lib/document#text.style.pdf +70 -0
  49. data/spec/fixtures/cce/lib/footer#render.pdf +114 -0
  50. data/spec/fixtures/cce/lib/header#render.pdf +72 -0
  51. data/spec/fixtures/cce/lib/nfe_key#render.pdf +88 -0
  52. data/spec/fixtures/cce/lib/protocol#render.pdf +88 -0
  53. data/spec/fixtures/cce/v1.00/cce.fixture.pdf +659 -0
  54. data/spec/fixtures/cce/v1.00/cce.xml +1 -0
  55. data/spec/fixtures/{lib → nfe/lib}/dest#render-v2.00.pdf +0 -0
  56. data/spec/fixtures/{lib → nfe/lib}/dest#render-v3.10.pdf +0 -0
  57. data/spec/fixtures/{lib → nfe/lib}/dest#render-with_cnpj.pdf +0 -0
  58. data/spec/fixtures/{lib → nfe/lib}/dest#render-with_cpf.pdf +0 -0
  59. data/spec/fixtures/{lib → nfe/lib}/dest#render-with_ie.pdf +0 -0
  60. data/spec/fixtures/{lib → nfe/lib}/det_body#render-csosn.pdf +0 -0
  61. data/spec/fixtures/{lib → nfe/lib}/det_body#render-cst.pdf +0 -0
  62. data/spec/fixtures/{lib → nfe/lib}/det_body#render-fci.pdf +0 -0
  63. data/spec/fixtures/{lib → nfe/lib}/det_body#render-icms_st.pdf +0 -0
  64. data/spec/fixtures/{lib → nfe/lib}/det_header#render.pdf +0 -0
  65. data/spec/fixtures/{lib → nfe/lib}/document#lcnpj-blank.pdf +0 -0
  66. data/spec/fixtures/{lib → nfe/lib}/document#lcnpj-invalid.pdf +0 -0
  67. data/spec/fixtures/{lib → nfe/lib}/document#lcnpj-valid.pdf +0 -0
  68. data/spec/fixtures/{lib → nfe/lib}/document#lie-blank.pdf +0 -0
  69. data/spec/fixtures/{lib → nfe/lib}/document#lie-invalid.pdf +0 -0
  70. data/spec/fixtures/{lib → nfe/lib}/document#lie-valid.pdf +0 -0
  71. data/spec/fixtures/{lib → nfe/lib}/dup#render.pdf +0 -0
  72. data/spec/fixtures/{lib → nfe/lib}/emit#render.pdf +0 -0
  73. data/spec/fixtures/{lib → nfe/lib}/emit_header#render-with_logo.pdf +0 -0
  74. data/spec/fixtures/{lib → nfe/lib}/emit_header#render-without_logo.pdf +0 -0
  75. data/spec/fixtures/{lib → nfe/lib}/icmstot#render.pdf +0 -0
  76. data/spec/fixtures/{lib → nfe/lib}/infadic#render-extra_volume.pdf +0 -0
  77. data/spec/fixtures/{lib → nfe/lib}/infadic#render.pdf +0 -0
  78. data/spec/fixtures/{lib → nfe/lib}/issqn#render.pdf +0 -0
  79. data/spec/fixtures/{lib → nfe/lib}/ticket#render.pdf +0 -0
  80. data/spec/fixtures/{lib → nfe/lib}/transp#render-modfrete_0.pdf +0 -0
  81. data/spec/fixtures/{lib → nfe/lib}/transp#render-modfrete_1.pdf +0 -0
  82. data/spec/fixtures/{lib → nfe/lib}/transp#render-modfrete_2.pdf +0 -0
  83. data/spec/fixtures/{lib → nfe/lib}/transp#render-modfrete_9.pdf +0 -0
  84. data/spec/fixtures/{lib → nfe/lib}/transp#render.pdf +0 -0
  85. data/spec/fixtures/{lib → nfe/lib}/vol#render-blank-boxes.pdf +0 -0
  86. data/spec/fixtures/{lib → nfe/lib}/vol#render.pdf +0 -0
  87. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_simples_nacional.xml +0 -0
  88. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_simples_nacional.xml.fixture.pdf +0 -0
  89. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_with_extra_volumes.xml +0 -0
  90. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_with_extra_volumes.xml.fixture.pdf +0 -0
  91. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_with_fci.xml +0 -0
  92. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_with_fci.xml.fixture.pdf +0 -0
  93. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_with_logo.xml +0 -0
  94. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_with_ns.xml +0 -0
  95. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_with_ns.xml.fixture.pdf +0 -0
  96. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_without_ns.xml +0 -0
  97. data/spec/fixtures/{v2.00 → nfe/v2.00}/nfe_without_ns.xml.fixture.pdf +0 -0
  98. data/spec/fixtures/{v3.10 → nfe/v3.10}/nfe_simples_nacional.xml +0 -0
  99. data/spec/fixtures/{v3.10 → nfe/v3.10}/nfe_simples_nacional.xml.fixture.pdf +0 -0
  100. data/spec/lib/cce_lib/barcode_spec.rb +26 -0
  101. data/spec/lib/cce_lib/correction_spec.rb +26 -0
  102. data/spec/lib/cce_lib/document_spec.rb +115 -0
  103. data/spec/lib/cce_lib/footer_spec.rb +25 -0
  104. data/spec/lib/cce_lib/header_spec.rb +25 -0
  105. data/spec/lib/cce_lib/nfe_key_spec.rb +26 -0
  106. data/spec/lib/cce_lib/protocol_spec.rb +26 -0
  107. data/spec/lib/{cep_spec.rb → danfe_lib/cep_spec.rb} +2 -2
  108. data/spec/lib/{cst_spec.rb → danfe_lib/cst_spec.rb} +3 -3
  109. data/spec/lib/{dest_spec.rb → danfe_lib/dest_spec.rb} +4 -4
  110. data/spec/lib/{det_body_spec.rb → danfe_lib/det_body_spec.rb} +4 -4
  111. data/spec/lib/{det_header_spec.rb → danfe_lib/det_header_spec.rb} +4 -4
  112. data/spec/lib/{document_spec.rb → danfe_lib/document_spec.rb} +3 -3
  113. data/spec/lib/{dup_spec.rb → danfe_lib/dup_spec.rb} +4 -4
  114. data/spec/lib/{emit_header_spec.rb → danfe_lib/emit_header_spec.rb} +4 -4
  115. data/spec/lib/{emit_spec.rb → danfe_lib/emit_spec.rb} +4 -4
  116. data/spec/lib/{helper_spec.rb → danfe_lib/helper_spec.rb} +11 -11
  117. data/spec/lib/{icmstot_spec.rb → danfe_lib/icmstot_spec.rb} +4 -4
  118. data/spec/lib/{infadic_spec.rb → danfe_lib/infadic_spec.rb} +4 -4
  119. data/spec/lib/{issqn_spec.rb → danfe_lib/issqn_spec.rb} +4 -4
  120. data/spec/lib/{options_spec.rb → danfe_lib/options_spec.rb} +3 -3
  121. data/spec/lib/{phone_spec.rb → danfe_lib/phone_spec.rb} +3 -3
  122. data/spec/lib/{plate_spec.rb → danfe_lib/plate_spec.rb} +2 -2
  123. data/spec/lib/{ticket_spec.rb → danfe_lib/ticket_spec.rb} +4 -4
  124. data/spec/lib/{transp_spec.rb → danfe_lib/transp_spec.rb} +4 -4
  125. data/spec/lib/{vol_spec.rb → danfe_lib/vol_spec.rb} +4 -4
  126. data/spec/lib/{xml_spec.rb → danfe_lib/xml_spec.rb} +2 -2
  127. data/spec/lib/{xprod_spec.rb → danfe_lib/xprod_spec.rb} +5 -5
  128. metadata +242 -174
  129. data/lib/br_danfe/cep.rb +0 -7
  130. data/lib/br_danfe/consts.rb +0 -4
  131. data/lib/br_danfe/cst.rb +0 -28
  132. data/lib/br_danfe/dest.rb +0 -84
  133. data/lib/br_danfe/det_body.rb +0 -73
  134. data/lib/br_danfe/det_header.rb +0 -38
  135. data/lib/br_danfe/document.rb +0 -133
  136. data/lib/br_danfe/dup.rb +0 -50
  137. data/lib/br_danfe/emit.rb +0 -21
  138. data/lib/br_danfe/emit_header.rb +0 -80
  139. data/lib/br_danfe/helper.rb +0 -62
  140. data/lib/br_danfe/icmstot.rb +0 -31
  141. data/lib/br_danfe/infadic.rb +0 -78
  142. data/lib/br_danfe/issqn.rb +0 -22
  143. data/lib/br_danfe/options.rb +0 -22
  144. data/lib/br_danfe/phone.rb +0 -11
  145. data/lib/br_danfe/plate.rb +0 -7
  146. data/lib/br_danfe/ticket.rb +0 -15
  147. data/lib/br_danfe/transp.rb +0 -49
  148. data/lib/br_danfe/vol.rb +0 -39
  149. data/lib/br_danfe/xml.rb +0 -36
  150. data/lib/br_danfe/xprod.rb +0 -46
metadata CHANGED
@@ -1,27 +1,27 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: br_danfe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - ASSEINFO
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-20 00:00:00.000000000 Z
11
+ date: 2015-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
@@ -70,70 +70,84 @@ dependencies:
70
70
  name: i18n
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: br_documents
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: 0.0.8
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: 0.0.8
97
+ - !ruby/object:Gem::Dependency
98
+ name: byebug
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '='
102
+ - !ruby/object:Gem::Version
103
+ version: 3.5.1
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '='
109
+ - !ruby/object:Gem::Version
110
+ version: 3.5.1
97
111
  - !ruby/object:Gem::Dependency
98
112
  name: rspec
99
113
  requirement: !ruby/object:Gem::Requirement
100
114
  requirements:
101
- - - '>='
115
+ - - ">="
102
116
  - !ruby/object:Gem::Version
103
117
  version: 3.0.0
104
118
  type: :development
105
119
  prerelease: false
106
120
  version_requirements: !ruby/object:Gem::Requirement
107
121
  requirements:
108
- - - '>='
122
+ - - ">="
109
123
  - !ruby/object:Gem::Version
110
124
  version: 3.0.0
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: simplecov
113
127
  requirement: !ruby/object:Gem::Requirement
114
128
  requirements:
115
- - - '>='
129
+ - - ">="
116
130
  - !ruby/object:Gem::Version
117
131
  version: 0.9.0
118
132
  type: :development
119
133
  prerelease: false
120
134
  version_requirements: !ruby/object:Gem::Requirement
121
135
  requirements:
122
- - - '>='
136
+ - - ">="
123
137
  - !ruby/object:Gem::Version
124
138
  version: 0.9.0
125
139
  - !ruby/object:Gem::Dependency
126
140
  name: codeclimate-test-reporter
127
141
  requirement: !ruby/object:Gem::Requirement
128
142
  requirements:
129
- - - '>='
143
+ - - ">="
130
144
  - !ruby/object:Gem::Version
131
145
  version: '0'
132
146
  type: :development
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
- - - '>='
150
+ - - ">="
137
151
  - !ruby/object:Gem::Version
138
152
  version: '0'
139
153
  description:
@@ -142,9 +156,9 @@ executables: []
142
156
  extensions: []
143
157
  extra_rdoc_files: []
144
158
  files:
145
- - .gitignore
146
- - .rspec
147
- - .travis.yml
159
+ - ".gitignore"
160
+ - ".rspec"
161
+ - ".travis.yml"
148
162
  - Gemfile
149
163
  - README.md
150
164
  - Rakefile
@@ -152,98 +166,129 @@ files:
152
166
  - circle.yml
153
167
  - config/locales/pt-BR.yml
154
168
  - lib/br_danfe.rb
155
- - lib/br_danfe/cep.rb
156
- - lib/br_danfe/consts.rb
157
- - lib/br_danfe/cst.rb
169
+ - lib/br_danfe/cce.rb
170
+ - lib/br_danfe/cce_lib/barcode.rb
171
+ - lib/br_danfe/cce_lib/correction.rb
172
+ - lib/br_danfe/cce_lib/document.rb
173
+ - lib/br_danfe/cce_lib/footer.rb
174
+ - lib/br_danfe/cce_lib/header.rb
175
+ - lib/br_danfe/cce_lib/nfe_key.rb
176
+ - lib/br_danfe/cce_lib/protocol.rb
158
177
  - lib/br_danfe/danfe.rb
159
- - lib/br_danfe/dest.rb
160
- - lib/br_danfe/det_body.rb
161
- - lib/br_danfe/det_header.rb
162
- - lib/br_danfe/document.rb
163
- - lib/br_danfe/dup.rb
164
- - lib/br_danfe/emit.rb
165
- - lib/br_danfe/emit_header.rb
166
- - lib/br_danfe/helper.rb
167
- - lib/br_danfe/icmstot.rb
168
- - lib/br_danfe/infadic.rb
169
- - lib/br_danfe/issqn.rb
170
- - lib/br_danfe/options.rb
171
- - lib/br_danfe/phone.rb
172
- - lib/br_danfe/plate.rb
173
- - lib/br_danfe/ticket.rb
174
- - lib/br_danfe/transp.rb
178
+ - lib/br_danfe/danfe_lib/cep.rb
179
+ - lib/br_danfe/danfe_lib/consts.rb
180
+ - lib/br_danfe/danfe_lib/cst.rb
181
+ - lib/br_danfe/danfe_lib/dest.rb
182
+ - lib/br_danfe/danfe_lib/det_body.rb
183
+ - lib/br_danfe/danfe_lib/det_header.rb
184
+ - lib/br_danfe/danfe_lib/document.rb
185
+ - lib/br_danfe/danfe_lib/dup.rb
186
+ - lib/br_danfe/danfe_lib/emit.rb
187
+ - lib/br_danfe/danfe_lib/emit_header.rb
188
+ - lib/br_danfe/danfe_lib/helper.rb
189
+ - lib/br_danfe/danfe_lib/icmstot.rb
190
+ - lib/br_danfe/danfe_lib/infadic.rb
191
+ - lib/br_danfe/danfe_lib/issqn.rb
192
+ - lib/br_danfe/danfe_lib/options.rb
193
+ - lib/br_danfe/danfe_lib/phone.rb
194
+ - lib/br_danfe/danfe_lib/plate.rb
195
+ - lib/br_danfe/danfe_lib/ticket.rb
196
+ - lib/br_danfe/danfe_lib/transp.rb
197
+ - lib/br_danfe/danfe_lib/vol.rb
198
+ - lib/br_danfe/danfe_lib/xml.rb
199
+ - lib/br_danfe/danfe_lib/xprod.rb
175
200
  - lib/br_danfe/version.rb
176
- - lib/br_danfe/vol.rb
177
- - lib/br_danfe/xml.rb
178
- - lib/br_danfe/xprod.rb
201
+ - spec/features/cce_spec.rb
179
202
  - spec/features/danfe_spec.rb
180
- - spec/fixtures/lib/dest#render-v2.00.pdf
181
- - spec/fixtures/lib/dest#render-v3.10.pdf
182
- - spec/fixtures/lib/dest#render-with_cnpj.pdf
183
- - spec/fixtures/lib/dest#render-with_cpf.pdf
184
- - spec/fixtures/lib/dest#render-with_ie.pdf
185
- - spec/fixtures/lib/det_body#render-csosn.pdf
186
- - spec/fixtures/lib/det_body#render-cst.pdf
187
- - spec/fixtures/lib/det_body#render-fci.pdf
188
- - spec/fixtures/lib/det_body#render-icms_st.pdf
189
- - spec/fixtures/lib/det_header#render.pdf
190
- - spec/fixtures/lib/document#lcnpj-blank.pdf
191
- - spec/fixtures/lib/document#lcnpj-invalid.pdf
192
- - spec/fixtures/lib/document#lcnpj-valid.pdf
193
- - spec/fixtures/lib/document#lie-blank.pdf
194
- - spec/fixtures/lib/document#lie-invalid.pdf
195
- - spec/fixtures/lib/document#lie-valid.pdf
196
- - spec/fixtures/lib/dup#render.pdf
197
- - spec/fixtures/lib/emit#render.pdf
198
- - spec/fixtures/lib/emit_header#render-with_logo.pdf
199
- - spec/fixtures/lib/emit_header#render-without_logo.pdf
200
- - spec/fixtures/lib/icmstot#render.pdf
201
- - spec/fixtures/lib/infadic#render-extra_volume.pdf
202
- - spec/fixtures/lib/infadic#render.pdf
203
- - spec/fixtures/lib/issqn#render.pdf
204
- - spec/fixtures/lib/ticket#render.pdf
205
- - spec/fixtures/lib/transp#render-modfrete_0.pdf
206
- - spec/fixtures/lib/transp#render-modfrete_1.pdf
207
- - spec/fixtures/lib/transp#render-modfrete_2.pdf
208
- - spec/fixtures/lib/transp#render-modfrete_9.pdf
209
- - spec/fixtures/lib/transp#render.pdf
210
- - spec/fixtures/lib/vol#render-blank-boxes.pdf
211
- - spec/fixtures/lib/vol#render.pdf
203
+ - spec/fixtures/cce/lib/barcode#render.pdf
204
+ - spec/fixtures/cce/lib/correction#render.pdf
205
+ - spec/fixtures/cce/lib/document#box.pdf
206
+ - spec/fixtures/cce/lib/document#box.with.block.pdf
207
+ - spec/fixtures/cce/lib/document#text.align.pdf
208
+ - spec/fixtures/cce/lib/document#text.pad.pdf
209
+ - spec/fixtures/cce/lib/document#text.simple.pdf
210
+ - spec/fixtures/cce/lib/document#text.size.pdf
211
+ - spec/fixtures/cce/lib/document#text.style.pdf
212
+ - spec/fixtures/cce/lib/footer#render.pdf
213
+ - spec/fixtures/cce/lib/header#render.pdf
214
+ - spec/fixtures/cce/lib/nfe_key#render.pdf
215
+ - spec/fixtures/cce/lib/protocol#render.pdf
216
+ - spec/fixtures/cce/v1.00/cce.fixture.pdf
217
+ - spec/fixtures/cce/v1.00/cce.xml
212
218
  - spec/fixtures/logo.png
213
- - spec/fixtures/v2.00/nfe_simples_nacional.xml
214
- - spec/fixtures/v2.00/nfe_simples_nacional.xml.fixture.pdf
215
- - spec/fixtures/v2.00/nfe_with_extra_volumes.xml
216
- - spec/fixtures/v2.00/nfe_with_extra_volumes.xml.fixture.pdf
217
- - spec/fixtures/v2.00/nfe_with_fci.xml
218
- - spec/fixtures/v2.00/nfe_with_fci.xml.fixture.pdf
219
- - spec/fixtures/v2.00/nfe_with_logo.xml
220
- - spec/fixtures/v2.00/nfe_with_ns.xml
221
- - spec/fixtures/v2.00/nfe_with_ns.xml.fixture.pdf
222
- - spec/fixtures/v2.00/nfe_without_ns.xml
223
- - spec/fixtures/v2.00/nfe_without_ns.xml.fixture.pdf
224
- - spec/fixtures/v3.10/nfe_simples_nacional.xml
225
- - spec/fixtures/v3.10/nfe_simples_nacional.xml.fixture.pdf
226
- - spec/lib/cep_spec.rb
227
- - spec/lib/cst_spec.rb
228
- - spec/lib/dest_spec.rb
229
- - spec/lib/det_body_spec.rb
230
- - spec/lib/det_header_spec.rb
231
- - spec/lib/document_spec.rb
232
- - spec/lib/dup_spec.rb
233
- - spec/lib/emit_header_spec.rb
234
- - spec/lib/emit_spec.rb
235
- - spec/lib/helper_spec.rb
236
- - spec/lib/icmstot_spec.rb
237
- - spec/lib/infadic_spec.rb
238
- - spec/lib/issqn_spec.rb
239
- - spec/lib/options_spec.rb
240
- - spec/lib/phone_spec.rb
241
- - spec/lib/plate_spec.rb
242
- - spec/lib/ticket_spec.rb
243
- - spec/lib/transp_spec.rb
244
- - spec/lib/vol_spec.rb
245
- - spec/lib/xml_spec.rb
246
- - spec/lib/xprod_spec.rb
219
+ - spec/fixtures/nfe/lib/dest#render-v2.00.pdf
220
+ - spec/fixtures/nfe/lib/dest#render-v3.10.pdf
221
+ - spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf
222
+ - spec/fixtures/nfe/lib/dest#render-with_cpf.pdf
223
+ - spec/fixtures/nfe/lib/dest#render-with_ie.pdf
224
+ - spec/fixtures/nfe/lib/det_body#render-csosn.pdf
225
+ - spec/fixtures/nfe/lib/det_body#render-cst.pdf
226
+ - spec/fixtures/nfe/lib/det_body#render-fci.pdf
227
+ - spec/fixtures/nfe/lib/det_body#render-icms_st.pdf
228
+ - spec/fixtures/nfe/lib/det_header#render.pdf
229
+ - spec/fixtures/nfe/lib/document#lcnpj-blank.pdf
230
+ - spec/fixtures/nfe/lib/document#lcnpj-invalid.pdf
231
+ - spec/fixtures/nfe/lib/document#lcnpj-valid.pdf
232
+ - spec/fixtures/nfe/lib/document#lie-blank.pdf
233
+ - spec/fixtures/nfe/lib/document#lie-invalid.pdf
234
+ - spec/fixtures/nfe/lib/document#lie-valid.pdf
235
+ - spec/fixtures/nfe/lib/dup#render.pdf
236
+ - spec/fixtures/nfe/lib/emit#render.pdf
237
+ - spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf
238
+ - spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf
239
+ - spec/fixtures/nfe/lib/icmstot#render.pdf
240
+ - spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf
241
+ - spec/fixtures/nfe/lib/infadic#render.pdf
242
+ - spec/fixtures/nfe/lib/issqn#render.pdf
243
+ - spec/fixtures/nfe/lib/ticket#render.pdf
244
+ - spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf
245
+ - spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf
246
+ - spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf
247
+ - spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf
248
+ - spec/fixtures/nfe/lib/transp#render.pdf
249
+ - spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf
250
+ - spec/fixtures/nfe/lib/vol#render.pdf
251
+ - spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml
252
+ - spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf
253
+ - spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml
254
+ - spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf
255
+ - spec/fixtures/nfe/v2.00/nfe_with_fci.xml
256
+ - spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf
257
+ - spec/fixtures/nfe/v2.00/nfe_with_logo.xml
258
+ - spec/fixtures/nfe/v2.00/nfe_with_ns.xml
259
+ - spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf
260
+ - spec/fixtures/nfe/v2.00/nfe_without_ns.xml
261
+ - spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf
262
+ - spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml
263
+ - spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf
264
+ - spec/lib/cce_lib/barcode_spec.rb
265
+ - spec/lib/cce_lib/correction_spec.rb
266
+ - spec/lib/cce_lib/document_spec.rb
267
+ - spec/lib/cce_lib/footer_spec.rb
268
+ - spec/lib/cce_lib/header_spec.rb
269
+ - spec/lib/cce_lib/nfe_key_spec.rb
270
+ - spec/lib/cce_lib/protocol_spec.rb
271
+ - spec/lib/danfe_lib/cep_spec.rb
272
+ - spec/lib/danfe_lib/cst_spec.rb
273
+ - spec/lib/danfe_lib/dest_spec.rb
274
+ - spec/lib/danfe_lib/det_body_spec.rb
275
+ - spec/lib/danfe_lib/det_header_spec.rb
276
+ - spec/lib/danfe_lib/document_spec.rb
277
+ - spec/lib/danfe_lib/dup_spec.rb
278
+ - spec/lib/danfe_lib/emit_header_spec.rb
279
+ - spec/lib/danfe_lib/emit_spec.rb
280
+ - spec/lib/danfe_lib/helper_spec.rb
281
+ - spec/lib/danfe_lib/icmstot_spec.rb
282
+ - spec/lib/danfe_lib/infadic_spec.rb
283
+ - spec/lib/danfe_lib/issqn_spec.rb
284
+ - spec/lib/danfe_lib/options_spec.rb
285
+ - spec/lib/danfe_lib/phone_spec.rb
286
+ - spec/lib/danfe_lib/plate_spec.rb
287
+ - spec/lib/danfe_lib/ticket_spec.rb
288
+ - spec/lib/danfe_lib/transp_spec.rb
289
+ - spec/lib/danfe_lib/vol_spec.rb
290
+ - spec/lib/danfe_lib/xml_spec.rb
291
+ - spec/lib/danfe_lib/xprod_spec.rb
247
292
  - spec/spec_helper.rb
248
293
  - spec/support/have_same_content_of.rb
249
294
  homepage: http://github.com/asseinfo/br_danfe
@@ -256,88 +301,111 @@ require_paths:
256
301
  - lib
257
302
  required_ruby_version: !ruby/object:Gem::Requirement
258
303
  requirements:
259
- - - '>='
304
+ - - ">="
260
305
  - !ruby/object:Gem::Version
261
306
  version: '2.0'
262
307
  required_rubygems_version: !ruby/object:Gem::Requirement
263
308
  requirements:
264
- - - '>='
309
+ - - ">="
265
310
  - !ruby/object:Gem::Version
266
311
  version: '0'
267
312
  requirements: []
268
313
  rubyforge_project:
269
- rubygems_version: 2.2.2
314
+ rubygems_version: 2.4.2
270
315
  signing_key:
271
316
  specification_version: 4
272
317
  summary: DANFE pdf generator for Brazilian invoices.
273
318
  test_files:
319
+ - spec/features/cce_spec.rb
274
320
  - spec/features/danfe_spec.rb
275
- - spec/fixtures/lib/dest#render-v2.00.pdf
276
- - spec/fixtures/lib/dest#render-v3.10.pdf
277
- - spec/fixtures/lib/dest#render-with_cnpj.pdf
278
- - spec/fixtures/lib/dest#render-with_cpf.pdf
279
- - spec/fixtures/lib/dest#render-with_ie.pdf
280
- - spec/fixtures/lib/det_body#render-csosn.pdf
281
- - spec/fixtures/lib/det_body#render-cst.pdf
282
- - spec/fixtures/lib/det_body#render-fci.pdf
283
- - spec/fixtures/lib/det_body#render-icms_st.pdf
284
- - spec/fixtures/lib/det_header#render.pdf
285
- - spec/fixtures/lib/document#lcnpj-blank.pdf
286
- - spec/fixtures/lib/document#lcnpj-invalid.pdf
287
- - spec/fixtures/lib/document#lcnpj-valid.pdf
288
- - spec/fixtures/lib/document#lie-blank.pdf
289
- - spec/fixtures/lib/document#lie-invalid.pdf
290
- - spec/fixtures/lib/document#lie-valid.pdf
291
- - spec/fixtures/lib/dup#render.pdf
292
- - spec/fixtures/lib/emit#render.pdf
293
- - spec/fixtures/lib/emit_header#render-with_logo.pdf
294
- - spec/fixtures/lib/emit_header#render-without_logo.pdf
295
- - spec/fixtures/lib/icmstot#render.pdf
296
- - spec/fixtures/lib/infadic#render-extra_volume.pdf
297
- - spec/fixtures/lib/infadic#render.pdf
298
- - spec/fixtures/lib/issqn#render.pdf
299
- - spec/fixtures/lib/ticket#render.pdf
300
- - spec/fixtures/lib/transp#render-modfrete_0.pdf
301
- - spec/fixtures/lib/transp#render-modfrete_1.pdf
302
- - spec/fixtures/lib/transp#render-modfrete_2.pdf
303
- - spec/fixtures/lib/transp#render-modfrete_9.pdf
304
- - spec/fixtures/lib/transp#render.pdf
305
- - spec/fixtures/lib/vol#render-blank-boxes.pdf
306
- - spec/fixtures/lib/vol#render.pdf
321
+ - spec/fixtures/cce/lib/barcode#render.pdf
322
+ - spec/fixtures/cce/lib/correction#render.pdf
323
+ - spec/fixtures/cce/lib/document#box.pdf
324
+ - spec/fixtures/cce/lib/document#box.with.block.pdf
325
+ - spec/fixtures/cce/lib/document#text.align.pdf
326
+ - spec/fixtures/cce/lib/document#text.pad.pdf
327
+ - spec/fixtures/cce/lib/document#text.simple.pdf
328
+ - spec/fixtures/cce/lib/document#text.size.pdf
329
+ - spec/fixtures/cce/lib/document#text.style.pdf
330
+ - spec/fixtures/cce/lib/footer#render.pdf
331
+ - spec/fixtures/cce/lib/header#render.pdf
332
+ - spec/fixtures/cce/lib/nfe_key#render.pdf
333
+ - spec/fixtures/cce/lib/protocol#render.pdf
334
+ - spec/fixtures/cce/v1.00/cce.fixture.pdf
335
+ - spec/fixtures/cce/v1.00/cce.xml
307
336
  - spec/fixtures/logo.png
308
- - spec/fixtures/v2.00/nfe_simples_nacional.xml
309
- - spec/fixtures/v2.00/nfe_simples_nacional.xml.fixture.pdf
310
- - spec/fixtures/v2.00/nfe_with_extra_volumes.xml
311
- - spec/fixtures/v2.00/nfe_with_extra_volumes.xml.fixture.pdf
312
- - spec/fixtures/v2.00/nfe_with_fci.xml
313
- - spec/fixtures/v2.00/nfe_with_fci.xml.fixture.pdf
314
- - spec/fixtures/v2.00/nfe_with_logo.xml
315
- - spec/fixtures/v2.00/nfe_with_ns.xml
316
- - spec/fixtures/v2.00/nfe_with_ns.xml.fixture.pdf
317
- - spec/fixtures/v2.00/nfe_without_ns.xml
318
- - spec/fixtures/v2.00/nfe_without_ns.xml.fixture.pdf
319
- - spec/fixtures/v3.10/nfe_simples_nacional.xml
320
- - spec/fixtures/v3.10/nfe_simples_nacional.xml.fixture.pdf
321
- - spec/lib/cep_spec.rb
322
- - spec/lib/cst_spec.rb
323
- - spec/lib/dest_spec.rb
324
- - spec/lib/det_body_spec.rb
325
- - spec/lib/det_header_spec.rb
326
- - spec/lib/document_spec.rb
327
- - spec/lib/dup_spec.rb
328
- - spec/lib/emit_header_spec.rb
329
- - spec/lib/emit_spec.rb
330
- - spec/lib/helper_spec.rb
331
- - spec/lib/icmstot_spec.rb
332
- - spec/lib/infadic_spec.rb
333
- - spec/lib/issqn_spec.rb
334
- - spec/lib/options_spec.rb
335
- - spec/lib/phone_spec.rb
336
- - spec/lib/plate_spec.rb
337
- - spec/lib/ticket_spec.rb
338
- - spec/lib/transp_spec.rb
339
- - spec/lib/vol_spec.rb
340
- - spec/lib/xml_spec.rb
341
- - spec/lib/xprod_spec.rb
337
+ - spec/fixtures/nfe/lib/dest#render-v2.00.pdf
338
+ - spec/fixtures/nfe/lib/dest#render-v3.10.pdf
339
+ - spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf
340
+ - spec/fixtures/nfe/lib/dest#render-with_cpf.pdf
341
+ - spec/fixtures/nfe/lib/dest#render-with_ie.pdf
342
+ - spec/fixtures/nfe/lib/det_body#render-csosn.pdf
343
+ - spec/fixtures/nfe/lib/det_body#render-cst.pdf
344
+ - spec/fixtures/nfe/lib/det_body#render-fci.pdf
345
+ - spec/fixtures/nfe/lib/det_body#render-icms_st.pdf
346
+ - spec/fixtures/nfe/lib/det_header#render.pdf
347
+ - spec/fixtures/nfe/lib/document#lcnpj-blank.pdf
348
+ - spec/fixtures/nfe/lib/document#lcnpj-invalid.pdf
349
+ - spec/fixtures/nfe/lib/document#lcnpj-valid.pdf
350
+ - spec/fixtures/nfe/lib/document#lie-blank.pdf
351
+ - spec/fixtures/nfe/lib/document#lie-invalid.pdf
352
+ - spec/fixtures/nfe/lib/document#lie-valid.pdf
353
+ - spec/fixtures/nfe/lib/dup#render.pdf
354
+ - spec/fixtures/nfe/lib/emit#render.pdf
355
+ - spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf
356
+ - spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf
357
+ - spec/fixtures/nfe/lib/icmstot#render.pdf
358
+ - spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf
359
+ - spec/fixtures/nfe/lib/infadic#render.pdf
360
+ - spec/fixtures/nfe/lib/issqn#render.pdf
361
+ - spec/fixtures/nfe/lib/ticket#render.pdf
362
+ - spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf
363
+ - spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf
364
+ - spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf
365
+ - spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf
366
+ - spec/fixtures/nfe/lib/transp#render.pdf
367
+ - spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf
368
+ - spec/fixtures/nfe/lib/vol#render.pdf
369
+ - spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml
370
+ - spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf
371
+ - spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml
372
+ - spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf
373
+ - spec/fixtures/nfe/v2.00/nfe_with_fci.xml
374
+ - spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf
375
+ - spec/fixtures/nfe/v2.00/nfe_with_logo.xml
376
+ - spec/fixtures/nfe/v2.00/nfe_with_ns.xml
377
+ - spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf
378
+ - spec/fixtures/nfe/v2.00/nfe_without_ns.xml
379
+ - spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf
380
+ - spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml
381
+ - spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf
382
+ - spec/lib/cce_lib/barcode_spec.rb
383
+ - spec/lib/cce_lib/correction_spec.rb
384
+ - spec/lib/cce_lib/document_spec.rb
385
+ - spec/lib/cce_lib/footer_spec.rb
386
+ - spec/lib/cce_lib/header_spec.rb
387
+ - spec/lib/cce_lib/nfe_key_spec.rb
388
+ - spec/lib/cce_lib/protocol_spec.rb
389
+ - spec/lib/danfe_lib/cep_spec.rb
390
+ - spec/lib/danfe_lib/cst_spec.rb
391
+ - spec/lib/danfe_lib/dest_spec.rb
392
+ - spec/lib/danfe_lib/det_body_spec.rb
393
+ - spec/lib/danfe_lib/det_header_spec.rb
394
+ - spec/lib/danfe_lib/document_spec.rb
395
+ - spec/lib/danfe_lib/dup_spec.rb
396
+ - spec/lib/danfe_lib/emit_header_spec.rb
397
+ - spec/lib/danfe_lib/emit_spec.rb
398
+ - spec/lib/danfe_lib/helper_spec.rb
399
+ - spec/lib/danfe_lib/icmstot_spec.rb
400
+ - spec/lib/danfe_lib/infadic_spec.rb
401
+ - spec/lib/danfe_lib/issqn_spec.rb
402
+ - spec/lib/danfe_lib/options_spec.rb
403
+ - spec/lib/danfe_lib/phone_spec.rb
404
+ - spec/lib/danfe_lib/plate_spec.rb
405
+ - spec/lib/danfe_lib/ticket_spec.rb
406
+ - spec/lib/danfe_lib/transp_spec.rb
407
+ - spec/lib/danfe_lib/vol_spec.rb
408
+ - spec/lib/danfe_lib/xml_spec.rb
409
+ - spec/lib/danfe_lib/xprod_spec.rb
342
410
  - spec/spec_helper.rb
343
411
  - spec/support/have_same_content_of.rb
data/lib/br_danfe/cep.rb DELETED
@@ -1,7 +0,0 @@
1
- module BrDanfe
2
- class Cep
3
- def self.format(cep)
4
- cep.sub(/(\d{2})(\d{3})(\d{3})/, "\\1.\\2-\\3")
5
- end
6
- end
7
- end
@@ -1,4 +0,0 @@
1
- module BrDanfe
2
- LINE_HEIGHT = 0.80
3
- SPACE_BETWEEN_GROUPS = 0.52
4
- end
data/lib/br_danfe/cst.rb DELETED
@@ -1,28 +0,0 @@
1
- module BrDanfe
2
- class Cst
3
- def self.to_danfe(xml)
4
- value = origin(xml)
5
-
6
- if csosn?(xml)
7
- value += xml.css("ICMS/*/CSOSN").text
8
- elsif cst?(xml)
9
- value += xml.css("ICMS/*/CST").text
10
- end
11
-
12
- value
13
- end
14
-
15
- private
16
- def self.origin(xml)
17
- xml.css("ICMS/*/orig").text
18
- end
19
-
20
- def self.cst?(xml)
21
- xml.css("ICMS/*/CST").text != ""
22
- end
23
-
24
- def self.csosn?(xml)
25
- xml.css("ICMS/*/CSOSN").text != ""
26
- end
27
- end
28
- end