br_danfe 0.0.9 → 0.2.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 (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
@@ -0,0 +1,72 @@
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 181
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 122.06499999999997 783.8149999999999 Td
28
+ /F1.0 25 Tf
29
+ [<436172746120646520436f727265e7e36f20456c657472f46e696361202d20434365>] TJ
30
+ ET
31
+
32
+ 30.000 771.890 535.280 40.000 re
33
+ S
34
+ Q
35
+
36
+ endstream
37
+ endobj
38
+ 5 0 obj
39
+ << /Type /Page
40
+ /Parent 3 0 R
41
+ /MediaBox [0 0 595.28 841.89]
42
+ /Contents 4 0 R
43
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
44
+ /Font << /F1.0 6 0 R
45
+ >>
46
+ >>
47
+ >>
48
+ endobj
49
+ 6 0 obj
50
+ << /Type /Font
51
+ /Subtype /Type1
52
+ /BaseFont /Times-Roman
53
+ /Encoding /WinAnsiEncoding
54
+ >>
55
+ endobj
56
+ xref
57
+ 0 7
58
+ 0000000000 65535 f
59
+ 0000000015 00000 n
60
+ 0000000109 00000 n
61
+ 0000000158 00000 n
62
+ 0000000215 00000 n
63
+ 0000000447 00000 n
64
+ 0000000627 00000 n
65
+ trailer
66
+ << /Size 7
67
+ /Root 2 0 R
68
+ /Info 1 0 R
69
+ >>
70
+ startxref
71
+ 726
72
+ %%EOF
@@ -0,0 +1,88 @@
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 279
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 35 801.4259999999999 Td
28
+ /F2.0 8 Tf
29
+ [<434841> 145 <56452044452041> 55 <434553534f>] TJ
30
+ ET
31
+
32
+
33
+ BT
34
+ 35 784.4699999999999 Td
35
+ /F1.0 12 Tf
36
+ [<3432313530333033383833333639303030313838353530303130303030303030333831303030303030333831>] TJ
37
+ ET
38
+
39
+ 30.000 775.890 535.280 36.000 re
40
+ S
41
+ Q
42
+
43
+ endstream
44
+ endobj
45
+ 5 0 obj
46
+ << /Type /Page
47
+ /Parent 3 0 R
48
+ /MediaBox [0 0 595.28 841.89]
49
+ /Contents 4 0 R
50
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
51
+ /Font << /F2.0 6 0 R
52
+ /F1.0 7 0 R
53
+ >>
54
+ >>
55
+ >>
56
+ endobj
57
+ 6 0 obj
58
+ << /Type /Font
59
+ /Subtype /Type1
60
+ /BaseFont /Times-Bold
61
+ /Encoding /WinAnsiEncoding
62
+ >>
63
+ endobj
64
+ 7 0 obj
65
+ << /Type /Font
66
+ /Subtype /Type1
67
+ /BaseFont /Times-Roman
68
+ /Encoding /WinAnsiEncoding
69
+ >>
70
+ endobj
71
+ xref
72
+ 0 8
73
+ 0000000000 65535 f
74
+ 0000000015 00000 n
75
+ 0000000109 00000 n
76
+ 0000000158 00000 n
77
+ 0000000215 00000 n
78
+ 0000000545 00000 n
79
+ 0000000737 00000 n
80
+ 0000000835 00000 n
81
+ trailer
82
+ << /Size 8
83
+ /Root 2 0 R
84
+ /Info 1 0 R
85
+ >>
86
+ startxref
87
+ 934
88
+ %%EOF
@@ -0,0 +1,88 @@
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 268
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 35 801.4259999999999 Td
28
+ /F2.0 8 Tf
29
+ [<5052> 30 <4f> 40 <54> 18 <4f434f4c4f2044452041> 50 <5554> 18 <4f52495a41> 55 <c7c3> 45 <4f>] TJ
30
+ ET
31
+
32
+
33
+ BT
34
+ 35 784.4699999999999 Td
35
+ /F1.0 12 Tf
36
+ [<333432313530303030313738363233>] TJ
37
+ ET
38
+
39
+ 30.000 775.890 535.280 36.000 re
40
+ S
41
+ Q
42
+
43
+ endstream
44
+ endobj
45
+ 5 0 obj
46
+ << /Type /Page
47
+ /Parent 3 0 R
48
+ /MediaBox [0 0 595.28 841.89]
49
+ /Contents 4 0 R
50
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
51
+ /Font << /F2.0 6 0 R
52
+ /F1.0 7 0 R
53
+ >>
54
+ >>
55
+ >>
56
+ endobj
57
+ 6 0 obj
58
+ << /Type /Font
59
+ /Subtype /Type1
60
+ /BaseFont /Times-Bold
61
+ /Encoding /WinAnsiEncoding
62
+ >>
63
+ endobj
64
+ 7 0 obj
65
+ << /Type /Font
66
+ /Subtype /Type1
67
+ /BaseFont /Times-Roman
68
+ /Encoding /WinAnsiEncoding
69
+ >>
70
+ endobj
71
+ xref
72
+ 0 8
73
+ 0000000000 65535 f
74
+ 0000000015 00000 n
75
+ 0000000109 00000 n
76
+ 0000000158 00000 n
77
+ 0000000215 00000 n
78
+ 0000000534 00000 n
79
+ 0000000726 00000 n
80
+ 0000000824 00000 n
81
+ trailer
82
+ << /Size 8
83
+ /Root 2 0 R
84
+ /Info 1 0 R
85
+ >>
86
+ startxref
87
+ 923
88
+ %%EOF