br_danfe 0.6.1 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +25 -25
  3. data/lib/br_danfe/danfe.rb +52 -25
  4. data/lib/br_danfe/danfe_lib/det_body.rb +105 -46
  5. data/lib/br_danfe/danfe_lib/document.rb +3 -7
  6. data/lib/br_danfe/danfe_lib/emit_header.rb +36 -20
  7. data/lib/br_danfe/danfe_lib/infadic.rb +12 -12
  8. data/lib/br_danfe/danfe_lib/issqn.rb +19 -8
  9. data/lib/br_danfe/version.rb +1 -1
  10. data/spec/features/danfe_spec.rb +45 -0
  11. data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +1932 -332
  12. data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +1182 -138
  13. data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +809 -43
  14. data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +809 -43
  15. data/spec/fixtures/nfe/lib/det_body#render-quantity_with_custom_precision.pdf +807 -41
  16. data/spec/fixtures/nfe/lib/det_body#render-three_pages.pdf +22414 -0
  17. data/spec/fixtures/nfe/lib/det_body#render-two_pages.pdf +21442 -0
  18. data/spec/fixtures/nfe/lib/det_body#render-unit_price_with_custom_precision.pdf +807 -41
  19. data/spec/fixtures/nfe/lib/det_body#render-with_infadprod.pdf +1012 -0
  20. data/spec/fixtures/nfe/lib/det_body#render-with_issqn.pdf +10124 -0
  21. data/spec/fixtures/nfe/lib/det_body#render-without_issqn.pdf +10124 -0
  22. data/spec/fixtures/nfe/lib/emit_header#render-second_page.pdf +792 -0
  23. data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +88 -8
  24. data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +85 -5
  25. data/spec/fixtures/nfe/lib/infadic#render-footer_information.pdf +111 -0
  26. data/spec/fixtures/nfe/lib/{issqn#render.pdf → issqn#render-with_issqn.pdf} +0 -0
  27. data/spec/fixtures/nfe/lib/issqn#render-with_one_issqn_value.pdf +129 -0
  28. data/spec/fixtures/nfe/lib/issqn#render-without_issqn.pdf +54 -0
  29. data/spec/fixtures/nfe/v2.00/custom_options.fixture.pdf +2190 -1067
  30. data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +2183 -1059
  31. data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +8803 -3208
  32. data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +1825 -1258
  33. data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +8609 -3014
  34. data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +2664 -1541
  35. data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +4701 -1909
  36. data/spec/fixtures/nfe/v3.10/with_footer.fixture.pdf +8660 -0
  37. data/spec/fixtures/nfe/v3.10/with_footer.xml +621 -0
  38. data/spec/fixtures/nfe/v3.10/with_issqn.fixture.pdf +8646 -0
  39. data/spec/fixtures/nfe/v3.10/with_issqn.xml +621 -0
  40. data/spec/fixtures/nfe/v3.10/with_three_pages.fixture.pdf +25420 -0
  41. data/spec/fixtures/nfe/v3.10/with_three_pages.xml +1281 -0
  42. data/spec/fixtures/nfe/v3.10/withot_issqn.fixture.pdf +10338 -0
  43. data/spec/fixtures/nfe/v3.10/withot_issqn.xml +688 -0
  44. data/spec/lib/danfe_lib/det_body_spec.rb +350 -264
  45. data/spec/lib/danfe_lib/emit_header_spec.rb +42 -18
  46. data/spec/lib/danfe_lib/issqn_spec.rb +39 -7
  47. metadata +38 -14
  48. data/lib/br_danfe/danfe_lib/det_header.rb +0 -40
  49. data/lib/br_danfe/danfe_lib/emit.rb +0 -23
  50. data/spec/fixtures/nfe/lib/det_header#render.pdf +0 -207
  51. data/spec/fixtures/nfe/lib/emit#render.pdf +0 -143
  52. data/spec/lib/danfe_lib/det_header_spec.rb +0 -26
  53. data/spec/lib/danfe_lib/emit_spec.rb +0 -60
@@ -17,7 +17,7 @@ endobj
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
20
- << /Length 9598
20
+ << /Length 10845
21
21
  >>
22
22
  stream
23
23
  q
@@ -61,7 +61,7 @@ ET
61
61
 
62
62
 
63
63
  q
64
- 80.0 0.0 0.0 80.0 23.5276 656.89 cm
64
+ 80.0 0.0 0.0 80.0 23.5276 656.7244 cm
65
65
  /I1 Do
66
66
  Q
67
67
  232.7244 654.5197 58.9606 111.1181 re
@@ -115,6 +115,13 @@ BT
115
115
  [<53c95249452031>] TJ
116
116
  ET
117
117
 
118
+
119
+ BT
120
+ 236.9807 661.6932 Td
121
+ /F2.0 8 Tf
122
+ [<464f4c484120312064652031>] TJ
123
+ ET
124
+
118
125
  291.685 702.7087 284.0315 62.9291 re
119
126
  S
120
127
  294.8315 711.7795 m
@@ -605,6 +612,79 @@ BT
605
612
  [<6f75206e6f207369746520646120536566> 10 <617a204175746f72697a61646f7261>] TJ
606
613
  ET
607
614
 
615
+ 21.2598 631.8425 284.5984 22.6772 re
616
+ S
617
+
618
+ BT
619
+ 23.2598 648.4217 Td
620
+ /F1.0 6 Tf
621
+ [<4e> 35 <41> 111 <545552455a412044> 40 <41204f50455241> 40 <c7c3> 55 <4f>] TJ
622
+ ET
623
+
624
+
625
+ BT
626
+ 23.2598 634.6897 Td
627
+ /F1.0 10 Tf
628
+ [<56> 111 <656e6461732064652070726f647563616f20646f206573746162656c6563696d656e746f>] TJ
629
+ ET
630
+
631
+ 305.8583 631.8425 269.8583 22.6772 re
632
+ S
633
+
634
+ BT
635
+ 307.8583 648.4217 Td
636
+ /F1.0 6 Tf
637
+ [<5052> 40 <4f> 40 <54> 18 <4f434f4c4f2044452041> 55 <5554> 18 <4f52495a41> 40 <c7c3> 55 <4f2044452055534f>] TJ
638
+ ET
639
+
640
+
641
+ BT
642
+ 360.2274 634.6897 Td
643
+ /F1.0 10 Tf
644
+ [<3332353131303031323836363332302032392f31302f323031312031343a33373a3039>] TJ
645
+ ET
646
+
647
+ 21.2598 609.1654 180.2835 22.6772 re
648
+ S
649
+
650
+ BT
651
+ 23.2598 625.7445 Td
652
+ /F1.0 6 Tf
653
+ [<494e53435249c7c3> 55 <4f20455354> 93 <414455> 40 <414c>] TJ
654
+ ET
655
+
656
+
657
+ BT
658
+ 23.2598 612.0125 Td
659
+ /F1.0 10 Tf
660
+ [<3532362e3932362e3331332e353533>] TJ
661
+ ET
662
+
663
+ 201.5433 609.1654 194.4567 22.6772 re
664
+ S
665
+
666
+ BT
667
+ 203.5433 625.7445 Td
668
+ /F1.0 6 Tf
669
+ [<494e53432e455354> 93 <414455> 40 <414c20444f205355425354> 74 <2e2054524942> 10 <5554> 93 <c152494f>] TJ
670
+ ET
671
+
672
+ 396.0 609.1654 179.7165 22.6772 re
673
+ S
674
+
675
+ BT
676
+ 398.0 625.7445 Td
677
+ /F1.0 6 Tf
678
+ [<434e504a>] TJ
679
+ ET
680
+
681
+
682
+ BT
683
+ 398.0 612.0125 Td
684
+ /F1.0 10 Tf
685
+ [<36322e3031332e3239342f303030312d3433>] TJ
686
+ ET
687
+
608
688
  Q
609
689
 
610
690
  endstream
@@ -697,16 +777,16 @@ xref
697
777
  0000000109 00000 n
698
778
  0000000158 00000 n
699
779
  0000000215 00000 n
700
- 0000009865 00000 n
701
- 0000010082 00000 n
702
- 0000010180 00000 n
703
- 0000010279 00000 n
704
- 0000012666 00000 n
780
+ 0000011113 00000 n
781
+ 0000011330 00000 n
782
+ 0000011428 00000 n
783
+ 0000011527 00000 n
784
+ 0000013914 00000 n
705
785
  trailer
706
786
  << /Size 10
707
787
  /Root 2 0 R
708
788
  /Info 1 0 R
709
789
  >>
710
790
  startxref
711
- 13040
791
+ 14288
712
792
  %%EOF
@@ -17,7 +17,7 @@ endobj
17
17
  >>
18
18
  endobj
19
19
  4 0 obj
20
- << /Length 9551
20
+ << /Length 10796
21
21
  >>
22
22
  stream
23
23
  q
@@ -110,6 +110,13 @@ BT
110
110
  [<53c95249452031>] TJ
111
111
  ET
112
112
 
113
+
114
+ BT
115
+ 236.9807 661.6932 Td
116
+ /F2.0 8 Tf
117
+ [<464f4c484120312064652031>] TJ
118
+ ET
119
+
113
120
  291.685 702.7087 284.0315 62.9291 re
114
121
  S
115
122
  294.8315 711.7795 m
@@ -600,6 +607,79 @@ BT
600
607
  [<6f75206e6f207369746520646120536566> 10 <617a204175746f72697a61646f7261>] TJ
601
608
  ET
602
609
 
610
+ 21.2598 631.8425 284.5984 22.6772 re
611
+ S
612
+
613
+ BT
614
+ 23.2598 648.4217 Td
615
+ /F1.0 6 Tf
616
+ [<4e> 35 <41> 111 <545552455a412044> 40 <41204f50455241> 40 <c7c3> 55 <4f>] TJ
617
+ ET
618
+
619
+
620
+ BT
621
+ 23.2598 634.6897 Td
622
+ /F1.0 10 Tf
623
+ [<56> 111 <656e6461732064652070726f647563616f20646f206573746162656c6563696d656e746f>] TJ
624
+ ET
625
+
626
+ 305.8583 631.8425 269.8583 22.6772 re
627
+ S
628
+
629
+ BT
630
+ 307.8583 648.4217 Td
631
+ /F1.0 6 Tf
632
+ [<5052> 40 <4f> 40 <54> 18 <4f434f4c4f2044452041> 55 <5554> 18 <4f52495a41> 40 <c7c3> 55 <4f2044452055534f>] TJ
633
+ ET
634
+
635
+
636
+ BT
637
+ 360.2274 634.6897 Td
638
+ /F1.0 10 Tf
639
+ [<3332353131303031323836363332302032392f31302f323031312031343a33373a3039>] TJ
640
+ ET
641
+
642
+ 21.2598 609.1654 180.2835 22.6772 re
643
+ S
644
+
645
+ BT
646
+ 23.2598 625.7445 Td
647
+ /F1.0 6 Tf
648
+ [<494e53435249c7c3> 55 <4f20455354> 93 <414455> 40 <414c>] TJ
649
+ ET
650
+
651
+
652
+ BT
653
+ 23.2598 612.0125 Td
654
+ /F1.0 10 Tf
655
+ [<3532362e3932362e3331332e353533>] TJ
656
+ ET
657
+
658
+ 201.5433 609.1654 194.4567 22.6772 re
659
+ S
660
+
661
+ BT
662
+ 203.5433 625.7445 Td
663
+ /F1.0 6 Tf
664
+ [<494e53432e455354> 93 <414455> 40 <414c20444f205355425354> 74 <2e2054524942> 10 <5554> 93 <c152494f>] TJ
665
+ ET
666
+
667
+ 396.0 609.1654 179.7165 22.6772 re
668
+ S
669
+
670
+ BT
671
+ 398.0 625.7445 Td
672
+ /F1.0 6 Tf
673
+ [<434e504a>] TJ
674
+ ET
675
+
676
+
677
+ BT
678
+ 398.0 612.0125 Td
679
+ /F1.0 10 Tf
680
+ [<36322e3031332e3239342f303030312d3433>] TJ
681
+ ET
682
+
603
683
  Q
604
684
 
605
685
  endstream
@@ -637,14 +717,14 @@ xref
637
717
  0000000109 00000 n
638
718
  0000000158 00000 n
639
719
  0000000215 00000 n
640
- 0000009818 00000 n
641
- 0000010010 00000 n
642
- 0000010108 00000 n
720
+ 0000011064 00000 n
721
+ 0000011256 00000 n
722
+ 0000011354 00000 n
643
723
  trailer
644
724
  << /Size 8
645
725
  /Root 2 0 R
646
726
  /Info 1 0 R
647
727
  >>
648
728
  startxref
649
- 10207
729
+ 11453
650
730
  %%EOF
@@ -0,0 +1,111 @@
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 579
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 21.2598 98.8195 Td
28
+ /F2.0 8 Tf
29
+ [<44> 35 <41444f532041444943494f4e> 20 <414953>] TJ
30
+ ET
31
+
32
+ 21.2598 21.5433 352.9134 75.1181 re
33
+ S
34
+
35
+ BT
36
+ 23.2598 90.5634 Td
37
+ /F1.0 6 Tf
38
+ [<494e464f524d41> 40 <c7d5455320434f4d504c454d454e54> 93 <41524553>] TJ
39
+ ET
40
+
41
+
42
+ BT
43
+ 23.2598 79.5634 Td
44
+ /F1.0 6 Tf
45
+ [<556d61206f6273657276> 25 <61e7e36f>] TJ
46
+ ET
47
+
48
+ 374.1732 21.5433 202.6772 75.1181 re
49
+ S
50
+
51
+ BT
52
+ 376.1732 90.5634 Td
53
+ /F1.0 6 Tf
54
+ [<5245534552> 80 <56> 135 <41444f2041> 55 <4f20464953434f>] TJ
55
+ ET
56
+
57
+
58
+ BT
59
+ 23.2598 14.1283 Td
60
+ /F1.0 5 Tf
61
+ [<47657261646f2061747261> 20 <76> 15 <e97320646f2054> 70 <65737465>] TJ
62
+ ET
63
+
64
+ Q
65
+
66
+ endstream
67
+ endobj
68
+ 5 0 obj
69
+ << /Type /Page
70
+ /Parent 3 0 R
71
+ /MediaBox [0 0 595.28 841.89]
72
+ /Contents 4 0 R
73
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
74
+ /Font << /F2.0 6 0 R
75
+ /F1.0 7 0 R
76
+ >>
77
+ >>
78
+ >>
79
+ endobj
80
+ 6 0 obj
81
+ << /Type /Font
82
+ /Subtype /Type1
83
+ /BaseFont /Times-Bold
84
+ /Encoding /WinAnsiEncoding
85
+ >>
86
+ endobj
87
+ 7 0 obj
88
+ << /Type /Font
89
+ /Subtype /Type1
90
+ /BaseFont /Times-Roman
91
+ /Encoding /WinAnsiEncoding
92
+ >>
93
+ endobj
94
+ xref
95
+ 0 8
96
+ 0000000000 65535 f
97
+ 0000000015 00000 n
98
+ 0000000109 00000 n
99
+ 0000000158 00000 n
100
+ 0000000215 00000 n
101
+ 0000000845 00000 n
102
+ 0000001037 00000 n
103
+ 0000001135 00000 n
104
+ trailer
105
+ << /Size 8
106
+ /Root 2 0 R
107
+ /Info 1 0 R
108
+ >>
109
+ startxref
110
+ 1234
111
+ %%EOF
@@ -0,0 +1,129 @@
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 768
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+
26
+ BT
27
+ 21.2598 136.5203 Td
28
+ /F2.0 8 Tf
29
+ [<43c14c43554c4f20444f20495353514e>] TJ
30
+ ET
31
+
32
+ 21.2598 111.4016 131.5276 22.6772 re
33
+ S
34
+
35
+ BT
36
+ 23.2598 127.9807 Td
37
+ /F1.0 6 Tf
38
+ [<494e53435249c7c3> 55 <4f204d554e49434950> 92 <414c>] TJ
39
+ ET
40
+
41
+
42
+ BT
43
+ 23.2598 114.2487 Td
44
+ /F1.0 10 Tf
45
+ [<32333435>] TJ
46
+ ET
47
+
48
+ 152.7874 111.4016 145.7008 22.6772 re
49
+ S
50
+
51
+ BT
52
+ 154.7874 127.9807 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.9882 114.2487 Td
60
+ /F1.0 10 Tf
61
+ [<312c3433>] TJ
62
+ ET
63
+
64
+ 298.4882 111.4016 145.7008 22.6772 re
65
+ S
66
+
67
+ BT
68
+ 300.4882 127.9807 Td
69
+ /F1.0 6 Tf
70
+ [<42> 35 <4153452044452043c14c43554c4f20444f20495353514e>] TJ
71
+ ET
72
+
73
+ 444.189 111.4016 131.5276 22.6772 re
74
+ S
75
+
76
+ BT
77
+ 446.189 127.9807 Td
78
+ /F1.0 6 Tf
79
+ [<56> 135 <414c4f5220444f20495353514e>] TJ
80
+ ET
81
+
82
+ Q
83
+
84
+ endstream
85
+ endobj
86
+ 5 0 obj
87
+ << /Type /Page
88
+ /Parent 3 0 R
89
+ /MediaBox [0 0 595.28 841.89]
90
+ /Contents 4 0 R
91
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
92
+ /Font << /F2.0 6 0 R
93
+ /F1.0 7 0 R
94
+ >>
95
+ >>
96
+ >>
97
+ endobj
98
+ 6 0 obj
99
+ << /Type /Font
100
+ /Subtype /Type1
101
+ /BaseFont /Times-Bold
102
+ /Encoding /WinAnsiEncoding
103
+ >>
104
+ endobj
105
+ 7 0 obj
106
+ << /Type /Font
107
+ /Subtype /Type1
108
+ /BaseFont /Times-Roman
109
+ /Encoding /WinAnsiEncoding
110
+ >>
111
+ endobj
112
+ xref
113
+ 0 8
114
+ 0000000000 65535 f
115
+ 0000000015 00000 n
116
+ 0000000109 00000 n
117
+ 0000000158 00000 n
118
+ 0000000215 00000 n
119
+ 0000001034 00000 n
120
+ 0000001226 00000 n
121
+ 0000001324 00000 n
122
+ trailer
123
+ << /Size 8
124
+ /Root 2 0 R
125
+ /Info 1 0 R
126
+ >>
127
+ startxref
128
+ 1423
129
+ %%EOF
@@ -0,0 +1,54 @@
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 10
21
+ >>
22
+ stream
23
+ q
24
+ 0.3 w
25
+ Q
26
+
27
+ endstream
28
+ endobj
29
+ 5 0 obj
30
+ << /Type /Page
31
+ /Parent 3 0 R
32
+ /MediaBox [0 0 595.28 841.89]
33
+ /Contents 4 0 R
34
+ /Resources << /ProcSet [/PDF /Text /ImageB /ImageC /ImageI]
35
+ /Font << >>
36
+ >>
37
+ >>
38
+ endobj
39
+ xref
40
+ 0 6
41
+ 0000000000 65535 f
42
+ 0000000015 00000 n
43
+ 0000000109 00000 n
44
+ 0000000158 00000 n
45
+ 0000000215 00000 n
46
+ 0000000275 00000 n
47
+ trailer
48
+ << /Size 6
49
+ /Root 2 0 R
50
+ /Info 1 0 R
51
+ >>
52
+ startxref
53
+ 443
54
+ %%EOF