br_danfe 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/br_danfe/danfe.rb +1 -1
- data/lib/br_danfe/danfe_lib/dest.rb +8 -8
- data/lib/br_danfe/danfe_lib/det_body.rb +3 -3
- data/lib/br_danfe/danfe_lib/det_header.rb +18 -18
- data/lib/br_danfe/danfe_lib/dup.rb +4 -4
- data/lib/br_danfe/danfe_lib/emit.rb +5 -5
- data/lib/br_danfe/danfe_lib/emit_header.rb +14 -14
- data/lib/br_danfe/danfe_lib/helper.rb +1 -1
- data/lib/br_danfe/danfe_lib/icmstot.rb +6 -6
- data/lib/br_danfe/danfe_lib/infadic.rb +9 -9
- data/lib/br_danfe/danfe_lib/issqn.rb +4 -4
- data/lib/br_danfe/danfe_lib/ticket.rb +4 -4
- data/lib/br_danfe/danfe_lib/transp.rb +6 -6
- data/lib/br_danfe/danfe_lib/vol.rb +3 -3
- data/lib/br_danfe/version.rb +1 -1
- data/spec/fixtures/nfe/lib/dest#render-v2.00.pdf +44 -44
- data/spec/fixtures/nfe/lib/dest#render-v3.10.pdf +44 -44
- data/spec/fixtures/nfe/lib/dest#render-with_cnpj.pdf +34 -34
- data/spec/fixtures/nfe/lib/dest#render-with_cpf.pdf +34 -34
- data/spec/fixtures/nfe/lib/dest#render-with_ie.pdf +35 -35
- data/spec/fixtures/nfe/lib/det_body#render-csosn.pdf +159 -159
- data/spec/fixtures/nfe/lib/det_body#render-cst.pdf +88 -88
- data/spec/fixtures/nfe/lib/det_body#render-fci.pdf +50 -43
- data/spec/fixtures/nfe/lib/det_body#render-icms_st.pdf +45 -45
- data/spec/fixtures/nfe/lib/det_header#render.pdf +36 -36
- data/spec/fixtures/nfe/lib/document#lcnpj-blank.pdf +6 -6
- data/spec/fixtures/nfe/lib/document#lcnpj-invalid.pdf +6 -6
- data/spec/fixtures/nfe/lib/document#lcnpj-valid.pdf +7 -7
- data/spec/fixtures/nfe/lib/document#lie-blank.pdf +6 -6
- data/spec/fixtures/nfe/lib/document#lie-invalid.pdf +6 -6
- data/spec/fixtures/nfe/lib/document#lie-valid.pdf +7 -7
- data/spec/fixtures/nfe/lib/dup#render.pdf +26 -26
- data/spec/fixtures/nfe/lib/emit#render.pdf +19 -19
- data/spec/fixtures/nfe/lib/emit_header#render-with_logo.pdf +485 -485
- data/spec/fixtures/nfe/lib/emit_header#render-without_logo.pdf +482 -482
- data/spec/fixtures/nfe/lib/icmstot#render.pdf +39 -39
- data/spec/fixtures/nfe/lib/infadic#render-extra_volume.pdf +38 -38
- data/spec/fixtures/nfe/lib/infadic#render.pdf +6 -6
- data/spec/fixtures/nfe/lib/issqn#render.pdf +18 -18
- data/spec/fixtures/nfe/lib/ticket#render.pdf +14 -14
- data/spec/fixtures/nfe/lib/transp#render-modfrete_0.pdf +27 -27
- data/spec/fixtures/nfe/lib/transp#render-modfrete_1.pdf +27 -27
- data/spec/fixtures/nfe/lib/transp#render-modfrete_2.pdf +27 -27
- data/spec/fixtures/nfe/lib/transp#render-modfrete_9.pdf +27 -27
- data/spec/fixtures/nfe/lib/transp#render.pdf +36 -36
- data/spec/fixtures/nfe/lib/vol#render-blank-boxes.pdf +16 -16
- data/spec/fixtures/nfe/lib/vol#render.pdf +21 -21
- data/spec/fixtures/nfe/v2.00/nfe_simples_nacional.xml.fixture.pdf +354 -354
- data/spec/fixtures/nfe/v2.00/nfe_with_extra_volumes.xml.fixture.pdf +1456 -1456
- data/spec/fixtures/nfe/v2.00/nfe_with_fci.xml.fixture.pdf +743 -736
- data/spec/fixtures/nfe/v2.00/nfe_with_ns.xml.fixture.pdf +1438 -1431
- data/spec/fixtures/nfe/v2.00/nfe_without_ns.xml.fixture.pdf +803 -803
- data/spec/fixtures/nfe/v3.10/nfe_simples_nacional.xml.fixture.pdf +531 -531
- data/spec/lib/danfe_lib/document_spec.rb +6 -6
- data/spec/lib/danfe_lib/transp_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8e9bfcbfa0c6dc45003c6640adbc7572de44220f
|
4
|
+
data.tar.gz: 60be5ca06b36401862526491327904f1fac13739
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fff3ce3ae2923d959d6fbb94353cbd30c691e1fe2933f82bdf3e170ed4f7abde191249e394a4def57344260cbe46b23320d285d92ac72c9083c832d3aafc36e9
|
7
|
+
data.tar.gz: 66a83929a041bcec2dbb57cfdffff99c4680e05295279322c87d03a148a77499c2c4dbc8700532078bd2e9507170b2f8de936ea6d790fb3d28f7e94fee63474f
|
data/lib/br_danfe/danfe.rb
CHANGED
@@ -45,7 +45,7 @@ module BrDanfe
|
|
45
45
|
|
46
46
|
@pdf.page_count.times do |i|
|
47
47
|
@pdf.go_to_page(i + 1)
|
48
|
-
@pdf.ibox 1.00, 2.08, 8.
|
48
|
+
@pdf.ibox 1.00, 2.08, 8.21, 6.96, "",
|
49
49
|
I18n.t("danfe.others.page", current: i+1, total: @pdf.page_count),
|
50
50
|
{ size: 8, align: :center, valign: :center, border: 0, style: :bold }
|
51
51
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
3
|
class Dest
|
4
|
-
Y =
|
4
|
+
Y = 10.00
|
5
5
|
|
6
6
|
def initialize(pdf, xml)
|
7
7
|
@pdf = pdf
|
@@ -14,7 +14,7 @@ module BrDanfe
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def render
|
17
|
-
@pdf.ititle 0.42, 10.00, 0.
|
17
|
+
@pdf.ititle 0.42, 10.00, 0.75, @ltitle, "dest.title"
|
18
18
|
|
19
19
|
render_line1
|
20
20
|
render_line2
|
@@ -25,7 +25,7 @@ module BrDanfe
|
|
25
25
|
|
26
26
|
private
|
27
27
|
def render_line1
|
28
|
-
@pdf.lbox LINE_HEIGHT,
|
28
|
+
@pdf.lbox LINE_HEIGHT, 11.82, 0.75, @l1, @xml, "dest/xNome"
|
29
29
|
render_cnpj_cpf
|
30
30
|
end
|
31
31
|
|
@@ -43,7 +43,7 @@ module BrDanfe
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def render_line2
|
46
|
-
@pdf.i18n_lbox LINE_HEIGHT,
|
46
|
+
@pdf.i18n_lbox LINE_HEIGHT, 9.66, 0.75, @l2, "enderDest.xLgr", street
|
47
47
|
@pdf.lbox LINE_HEIGHT, 4.83, 10.41, @l2, @xml, "enderDest/xBairro"
|
48
48
|
@pdf.i18n_lbox LINE_HEIGHT, 2.20, 15.24, @l2, "enderDest.CEP", cep
|
49
49
|
end
|
@@ -57,7 +57,7 @@ module BrDanfe
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def render_line3
|
60
|
-
@pdf.lbox LINE_HEIGHT,
|
60
|
+
@pdf.lbox LINE_HEIGHT, 6.61, 0.75, @l3, @xml, "enderDest/xMun"
|
61
61
|
@pdf.i18n_lbox LINE_HEIGHT, 4.06, 7.36, @l3, "enderDest.fone", phone
|
62
62
|
@pdf.lbox LINE_HEIGHT, 1.14, 11.42, @l3, @xml, "enderDest/UF"
|
63
63
|
@pdf.lie LINE_HEIGHT, 4.88, 12.56, @l3, @xml, "enderDest/UF", "dest/IE"
|
@@ -75,9 +75,9 @@ module BrDanfe
|
|
75
75
|
hSaiEnt = "ide/hSaiEnt"
|
76
76
|
end
|
77
77
|
|
78
|
-
@pdf.ldate LINE_HEIGHT, 2.
|
79
|
-
@pdf.ldate LINE_HEIGHT, 2.
|
80
|
-
@pdf.ltime LINE_HEIGHT, 2.
|
78
|
+
@pdf.ldate LINE_HEIGHT, 2.42, 17.90, @l1, "ide.dEmi", @xml[dEmi], { align: :right }
|
79
|
+
@pdf.ldate LINE_HEIGHT, 2.42, 17.90, @l2, "ide.dSaiEnt", @xml[dSaiEnt], { align: :right }
|
80
|
+
@pdf.ltime LINE_HEIGHT, 2.42, 17.90, @l3, "ide.hSaiEnt", @xml[hSaiEnt], { align: :right }
|
81
81
|
end
|
82
82
|
|
83
83
|
def phone
|
@@ -13,7 +13,7 @@ module BrDanfe
|
|
13
13
|
}
|
14
14
|
|
15
15
|
@pdf.font_size(6) do
|
16
|
-
@pdf.bounding_box [0.
|
16
|
+
@pdf.bounding_box [0.75.cm, Helper.invert(19.59.cm)], width: 19.57.cm, height: 6.07.cm do
|
17
17
|
@pdf.table products, options do |table|
|
18
18
|
table.column(6..13).style(align: :right)
|
19
19
|
table.column(0..13).border_width = 0.3
|
@@ -54,8 +54,8 @@ module BrDanfe
|
|
54
54
|
|
55
55
|
def column_widths
|
56
56
|
{
|
57
|
-
0 =>
|
58
|
-
1 => 4.
|
57
|
+
0 => 1.50.cm,
|
58
|
+
1 => 4.40.cm,
|
59
59
|
2 => 1.30.cm,
|
60
60
|
3 => 0.80.cm,
|
61
61
|
4 => 1.00.cm,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
|
-
Y =
|
3
|
+
Y = 18.81 + SPACE_BETWEEN_GROUPS
|
4
4
|
|
5
5
|
class DetHeader
|
6
6
|
def initialize(pdf)
|
@@ -11,29 +11,29 @@ module BrDanfe
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def render
|
14
|
-
@pdf.ititle 0.42, 10.00, 0.
|
14
|
+
@pdf.ititle 0.42, 10.00, 0.75, @ltitle, "det.title"
|
15
15
|
|
16
|
-
column(
|
17
|
-
column(4.
|
18
|
-
column(1.30,
|
19
|
-
column(0.80,
|
20
|
-
column(1.00,
|
21
|
-
column(1.00,
|
22
|
-
column(1.30,
|
23
|
-
column(1.50, 12.
|
24
|
-
column(1.50,
|
25
|
-
column(1.50, 15.
|
26
|
-
column(1.00,
|
27
|
-
column(1.00,
|
28
|
-
column(0.90,
|
29
|
-
column(0.86, 19.
|
16
|
+
column(1.50, 0.75, "prod.cProd")
|
17
|
+
column(4.40, 2.25, "prod.xProd")
|
18
|
+
column(1.30, 6.65, "prod.NCM")
|
19
|
+
column(0.80, 7.95, "ICMS.CST")
|
20
|
+
column(1.00, 8.75, "prod.CFOP")
|
21
|
+
column(1.00, 9.75, "prod.uCom")
|
22
|
+
column(1.30, 10.75, "prod.qCom")
|
23
|
+
column(1.50, 12.05, "prod.vUnCom")
|
24
|
+
column(1.50, 13.55, "prod.vProd")
|
25
|
+
column(1.50, 15.05, "ICMS.vBC")
|
26
|
+
column(1.00, 16.55, "ICMS.vICMS")
|
27
|
+
column(1.00, 17.55, "IPI.vIPI")
|
28
|
+
column(0.90, 18.55, "ICMS.pICMS")
|
29
|
+
column(0.86, 19.45, "IPI.pIPI")
|
30
30
|
|
31
|
-
@pdf.horizontal_line 0.
|
31
|
+
@pdf.horizontal_line 0.75.cm, 20.31.cm, at: Helper.invert(19.59.cm)
|
32
32
|
end
|
33
33
|
|
34
34
|
private
|
35
35
|
def column(w, x, title)
|
36
|
-
@pdf.ibox 6.
|
36
|
+
@pdf.ibox 6.40, w, x, @l1, I18n.t("danfe.det.#{title}")
|
37
37
|
end
|
38
38
|
end
|
39
39
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
3
|
class Dup
|
4
|
-
Y =
|
4
|
+
Y = 12.92
|
5
5
|
|
6
6
|
def initialize(pdf, xml)
|
7
7
|
@pdf = pdf
|
@@ -11,10 +11,10 @@ module BrDanfe
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def render
|
14
|
-
@pdf.ititle 0.42, 10.00, 0.
|
15
|
-
@pdf.ibox 0.85,
|
14
|
+
@pdf.ititle 0.42, 10.00, 0.75, @ltitle, "dup.title"
|
15
|
+
@pdf.ibox 0.85, 19.57, 0.75, Y
|
16
16
|
|
17
|
-
x = 0.
|
17
|
+
x = 0.75
|
18
18
|
y = Y
|
19
19
|
@xml.collect("xmlns", "dup") do |det|
|
20
20
|
render_dup(det, x, y)
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
3
|
class Emit
|
4
|
-
Y =
|
4
|
+
Y = 7.88
|
5
5
|
|
6
6
|
def initialize(pdf, xml)
|
7
7
|
@pdf = pdf
|
@@ -12,11 +12,11 @@ module BrDanfe
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def render
|
15
|
-
@pdf.lbox LINE_HEIGHT, 10.
|
16
|
-
@pdf.ibox LINE_HEIGHT,
|
17
|
-
@pdf.lie LINE_HEIGHT, 6.
|
15
|
+
@pdf.lbox LINE_HEIGHT, 10.04, 0.75, @l1, @xml, "ide/natOp"
|
16
|
+
@pdf.ibox LINE_HEIGHT, 9.52, 10.79, @l1, I18n.t("danfe.infProt"), @xml["infProt/nProt"] + " " + Helper.format_datetime(@xml["infProt/dhRecbto"]), { align: :center }
|
17
|
+
@pdf.lie LINE_HEIGHT, 6.36, 0.75, @l2, @xml, "enderEmit/UF", "emit/IE"
|
18
18
|
@pdf.lie LINE_HEIGHT, 6.86, 7.11, @l2, @xml, "enderEmit/UF", "emit/IE_ST"
|
19
|
-
@pdf.lcnpj LINE_HEIGHT, 6.
|
19
|
+
@pdf.lcnpj LINE_HEIGHT, 6.34, 13.97, @l2, @xml, "emit/CNPJ"
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
@@ -16,18 +16,18 @@ module BrDanfe
|
|
16
16
|
|
17
17
|
private
|
18
18
|
def address_box
|
19
|
-
@pdf.ibox 3.92,
|
19
|
+
@pdf.ibox 3.92, 7.46, 0.75, 3.96
|
20
20
|
|
21
|
-
@pdf.ibox 3.92,
|
21
|
+
@pdf.ibox 3.92, 7.46, 0.75, 4.22, "", @xml["emit/xNome"],
|
22
22
|
{ size: 12, align: :center, border: 0, style: :bold }
|
23
23
|
|
24
24
|
if @logo_path.empty?
|
25
|
-
@pdf.ibox 3.92,
|
25
|
+
@pdf.ibox 3.92, 7.46, 1.25, 5.42, "", address, { align: :left, border: 0 }
|
26
26
|
else
|
27
|
-
@pdf.ibox 3.92,
|
27
|
+
@pdf.ibox 3.92, 7.46, 3.25, 5.42, "", address,
|
28
28
|
{ size: 8, align: :left, border: 0 }
|
29
29
|
|
30
|
-
@pdf.image @logo_path, at: [0.
|
30
|
+
@pdf.image @logo_path, at: [1.0.cm, Helper.invert(5.42.cm)],
|
31
31
|
width: 2.cm
|
32
32
|
end
|
33
33
|
end
|
@@ -50,31 +50,31 @@ module BrDanfe
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def danfe_box
|
53
|
-
@pdf.ibox 3.92, 2.08, 8.
|
53
|
+
@pdf.ibox 3.92, 2.08, 8.21, 3.96
|
54
54
|
|
55
|
-
@pdf.ibox 0.60, 2.08, 8.
|
55
|
+
@pdf.ibox 0.60, 2.08, 8.21, 3.96, "", "DANFE",
|
56
56
|
{ size: 12, align: :center, border: 0, style: :bold }
|
57
57
|
|
58
|
-
@pdf.ibox 1.20, 2.08, 8.
|
58
|
+
@pdf.ibox 1.20, 2.08, 8.21, 4.56, "", I18n.t("danfe.others.danfe"),
|
59
59
|
{ size: 8, align: :center, border: 0 }
|
60
60
|
|
61
|
-
@pdf.ibox 0.60, 2.08, 8.
|
61
|
+
@pdf.ibox 0.60, 2.08, 8.21, 5.76, "", "#{@xml['ide/tpNF']} - " + (@xml["ide/tpNF"] == "0" ? I18n.t("danfe.ide.tpNF.entry") : I18n.t("danfe.ide.tpNF.departure")),
|
62
62
|
{ size: 8, align: :center, border: 0 }
|
63
63
|
|
64
|
-
@pdf.ibox 1.00, 2.08, 8.
|
64
|
+
@pdf.ibox 1.00, 2.08, 8.21, 6.36, "",
|
65
65
|
I18n.t("danfe.ide.document", nNF: @xml["ide/nNF"], serie: @xml["ide/serie"]),
|
66
66
|
{ size: 8, align: :center, valign: :center, border: 0, style: :bold }
|
67
67
|
end
|
68
68
|
|
69
69
|
def access_key_box
|
70
|
-
@pdf.ibox 2.22, 10.02, 10.
|
71
|
-
@pdf.ibarcode 1.50, 8.00, 10.
|
72
|
-
@pdf.ibox 0.85, 10.02, 10.
|
70
|
+
@pdf.ibox 2.22, 10.02, 10.29, 3.96
|
71
|
+
@pdf.ibarcode 1.50, 8.00, 10.4010, 5.86, @xml["chNFe"]
|
72
|
+
@pdf.ibox 0.85, 10.02, 10.29, 6.18, I18n.t("danfe.chNFe"), @xml["chNFe"].gsub(/(\d)(?=(\d\d\d\d)+(?!\d))/, "\\1 "),
|
73
73
|
{ style: :bold, align: :center }
|
74
74
|
end
|
75
75
|
|
76
76
|
def sefaz_box
|
77
|
-
@pdf.ibox 0.85, 10.02, 10.
|
77
|
+
@pdf.ibox 0.85, 10.02, 10.29, 7.03, "", I18n.t("danfe.others.sefaz"),
|
78
78
|
{ align: :center, size: 8 }
|
79
79
|
end
|
80
80
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
3
|
class Icmstot
|
4
|
-
Y =
|
4
|
+
Y = 13.77 + SPACE_BETWEEN_GROUPS
|
5
5
|
|
6
6
|
def initialize(pdf, xml)
|
7
7
|
@pdf = pdf
|
@@ -13,20 +13,20 @@ module BrDanfe
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def render
|
16
|
-
@pdf.ititle 0.42, 5.60, 0.
|
16
|
+
@pdf.ititle 0.42, 5.60, 0.75, @ltitle, "ICMSTot.title"
|
17
17
|
|
18
|
-
@pdf.lnumeric LINE_HEIGHT,
|
18
|
+
@pdf.lnumeric LINE_HEIGHT, 3.56, 0.75, @l1, @xml, "ICMSTot/vBC"
|
19
19
|
@pdf.lnumeric LINE_HEIGHT, 4.06, 4.31, @l1, @xml, "ICMSTot/vICMS"
|
20
20
|
@pdf.lnumeric LINE_HEIGHT, 4.06, 8.37, @l1, @xml, "ICMSTot/vBCST"
|
21
21
|
@pdf.lnumeric LINE_HEIGHT, 4.06, 12.43, @l1, @xml, "ICMSTot/vST"
|
22
|
-
@pdf.lnumeric LINE_HEIGHT,
|
22
|
+
@pdf.lnumeric LINE_HEIGHT, 3.82, 16.49, @l1, @xml, "ICMSTot/vProd"
|
23
23
|
|
24
|
-
@pdf.lnumeric LINE_HEIGHT,
|
24
|
+
@pdf.lnumeric LINE_HEIGHT, 2.55, 0.75, @l2, @xml, "ICMSTot/vFrete"
|
25
25
|
@pdf.lnumeric LINE_HEIGHT, 3.05, 3.30, @l2, @xml, "ICMSTot/vSeg"
|
26
26
|
@pdf.lnumeric LINE_HEIGHT, 3.04, 6.35, @l2, @xml, "ICMSTot/vDesc"
|
27
27
|
@pdf.lnumeric LINE_HEIGHT, 3.04, 9.39, @l2, @xml, "ICMSTot/vOutro"
|
28
28
|
@pdf.lnumeric LINE_HEIGHT, 4.06, 12.43, @l2, @xml, "ICMSTot/vIPI"
|
29
|
-
@pdf.lnumeric LINE_HEIGHT,
|
29
|
+
@pdf.lnumeric LINE_HEIGHT, 3.82, 16.49, @l2, @xml, "ICMSTot/vNF", style: :bold
|
30
30
|
end
|
31
31
|
end
|
32
32
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
3
|
class Infadic
|
4
|
-
Y =
|
4
|
+
Y = 27.04 + SPACE_BETWEEN_GROUPS
|
5
5
|
|
6
6
|
def initialize(pdf, xml)
|
7
7
|
@pdf = pdf
|
@@ -12,21 +12,21 @@ module BrDanfe
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def render(nVol)
|
15
|
-
@pdf.ititle 0.42, 10.00, 0.
|
15
|
+
@pdf.ititle 0.42, 10.00, 0.75, @ltitle, "infAdic.title"
|
16
16
|
|
17
17
|
if nVol > 1
|
18
18
|
render_extra_volumes
|
19
19
|
else
|
20
|
-
@pdf.ibox
|
20
|
+
@pdf.ibox 2.65, 12.45, 0.75, @l1, I18n.t("danfe.infAdic.infCpl"), @xml["infAdic/infCpl"], { size: 6, valign: :top }
|
21
21
|
end
|
22
22
|
|
23
|
-
@pdf.ibox
|
23
|
+
@pdf.ibox 2.65, 7.15, 13.20, @l1, I18n.t("danfe.infAdic.reserved")
|
24
24
|
end
|
25
25
|
|
26
26
|
private
|
27
27
|
def render_extra_volumes
|
28
|
-
@pdf.ibox
|
29
|
-
@pdf.ibox
|
28
|
+
@pdf.ibox 2.65, 12.45, 0.75, @l1, I18n.t("danfe.infAdic.infCpl"), "", { size: 8, valign: :top }
|
29
|
+
@pdf.ibox 2.65, 12.45, 0.75, Y + 0.27, "", I18n.t("danfe.infAdic.vol.title"), { size: 5, valign: :top, border: 0 }
|
30
30
|
|
31
31
|
volumes = 0
|
32
32
|
y = Y + 0.34
|
@@ -38,12 +38,12 @@ module BrDanfe
|
|
38
38
|
end
|
39
39
|
end
|
40
40
|
|
41
|
-
@pdf.ibox
|
42
|
-
@pdf.ibox
|
41
|
+
@pdf.ibox 1.65, 12.45, 0.75, y + 0.30, "", I18n.t("danfe.infAdic.others"), { size: 6, valign: :top, border: 0 }
|
42
|
+
@pdf.ibox 1.65, 12.45, 0.75, y + 0.50, "", @xml["infAdic/infCpl"], { size: 5, valign: :top, border: 0 }
|
43
43
|
end
|
44
44
|
|
45
45
|
def render_extra_volume(det, y)
|
46
|
-
render_field "qVol", det, 0.70, 0.
|
46
|
+
render_field "qVol", det, 0.70, 0.75, 0.70, 1.04, y, :text
|
47
47
|
render_field "esp", det, 0.50, 1.35, 3.00, 1.75, y, :text
|
48
48
|
render_field "marca", det, 0.70, 4.15, 2.00, 4.75, y, :text
|
49
49
|
render_field "nVol", det, 1.00, 6.10, 1.00, 6.70, y, :text
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
3
|
class Issqn
|
4
|
-
Y =
|
4
|
+
Y = 25.72 + SPACE_BETWEEN_GROUPS
|
5
5
|
|
6
6
|
def initialize(pdf, xml)
|
7
7
|
@pdf = pdf
|
@@ -12,12 +12,12 @@ module BrDanfe
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def render
|
15
|
-
@pdf.ititle 0.42, 10.00, 0.
|
15
|
+
@pdf.ititle 0.42, 10.00, 0.75, @ltitle, "issqn.title"
|
16
16
|
|
17
|
-
@pdf.lbox LINE_HEIGHT,
|
17
|
+
@pdf.lbox LINE_HEIGHT, 4.64, 0.75, @l1, @xml, "emit/IM"
|
18
18
|
@pdf.lnumeric LINE_HEIGHT, 5.14, 5.39, @l1, @xml, "total/ISSQNtot/vServ"
|
19
19
|
@pdf.lnumeric LINE_HEIGHT, 5.14, 10.53, @l1, @xml, "total/ISSQNtot/vBC"
|
20
|
-
@pdf.lnumeric LINE_HEIGHT,
|
20
|
+
@pdf.lnumeric LINE_HEIGHT, 4.64, 15.67, @l1, @xml, "total/ISSQNtot/vISS"
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -7,10 +7,10 @@ module BrDanfe
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def render
|
10
|
-
@pdf.ibox 0.85,
|
11
|
-
@pdf.ibox 0.85,
|
12
|
-
@pdf.ibox 0.85,
|
13
|
-
@pdf.ibox 1.70, 4.
|
10
|
+
@pdf.ibox 0.85, 15.60, 0.75, 1.85, I18n.t("danfe.ticket.xNome", xNome: @xml["emit/xNome"])
|
11
|
+
@pdf.ibox 0.85, 3.85, 0.75, 2.7, I18n.t("danfe.ticket.received_at")
|
12
|
+
@pdf.ibox 0.85, 11.75, 4.60, 2.7, I18n.t("danfe.ticket.receiver")
|
13
|
+
@pdf.ibox 1.70, 4.00, 16.35, 1.85, "", I18n.t("danfe.ticket.document", nNF: @xml["ide/nNF"], serie: @xml["ide/serie"]), {align: :center, valign: :center}
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
3
|
class Transp
|
4
|
-
Y =
|
4
|
+
Y = 15.89 + SPACE_BETWEEN_GROUPS
|
5
5
|
|
6
6
|
def initialize(pdf, xml)
|
7
7
|
@pdf = pdf
|
@@ -13,18 +13,18 @@ module BrDanfe
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def render
|
16
|
-
@pdf.ititle 0.42, 10.00, 0.
|
16
|
+
@pdf.ititle 0.42, 10.00, 0.75, @ltitle, "transporta.title"
|
17
17
|
|
18
|
-
@pdf.lbox LINE_HEIGHT,
|
18
|
+
@pdf.lbox LINE_HEIGHT, 8.52, 0.75, @l1, @xml, "transporta/xNome"
|
19
19
|
@pdf.i18n_lbox LINE_HEIGHT, 2.79, 9.27, @l1, "transp.modFrete.title", mod_frete
|
20
20
|
@pdf.lbox LINE_HEIGHT, 1.78, 12.06, @l1, @xml, "veicTransp/RNTC"
|
21
21
|
@pdf.i18n_lbox LINE_HEIGHT, 2.29, 13.84, @l1, "veicTransp.placa", plate
|
22
22
|
@pdf.lbox LINE_HEIGHT, 0.76, 16.13, @l1, @xml, "veicTransp/UF"
|
23
|
-
@pdf.lcnpj LINE_HEIGHT, 3.
|
24
|
-
@pdf.lbox LINE_HEIGHT,
|
23
|
+
@pdf.lcnpj LINE_HEIGHT, 3.44, 16.89, @l1, @xml, "transporta/CNPJ"
|
24
|
+
@pdf.lbox LINE_HEIGHT, 8.52, 0.75, @l2, @xml, "transporta/xEnder"
|
25
25
|
@pdf.lbox LINE_HEIGHT, 6.86, 9.27, @l2, @xml, "transporta/xMun"
|
26
26
|
@pdf.lbox LINE_HEIGHT, 0.76, 16.13, @l2, @xml, "transporta/UF"
|
27
|
-
@pdf.lie LINE_HEIGHT, 3.
|
27
|
+
@pdf.lie LINE_HEIGHT, 3.44, 16.89, @l2, @xml, "transporta/UF", "transporta/IE"
|
28
28
|
end
|
29
29
|
|
30
30
|
private
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module BrDanfe
|
2
2
|
module DanfeLib
|
3
3
|
class Vol
|
4
|
-
Y =
|
4
|
+
Y = 18.01
|
5
5
|
|
6
6
|
def initialize(pdf, xml)
|
7
7
|
@pdf = pdf
|
@@ -25,12 +25,12 @@ module BrDanfe
|
|
25
25
|
|
26
26
|
private
|
27
27
|
def render_vol(det)
|
28
|
-
@pdf.ibox 0.85, 2.
|
28
|
+
@pdf.ibox 0.85, 2.42, 0.75, @l1, I18n.t("danfe.vol.qVol"), det.css("qVol").text
|
29
29
|
@pdf.ibox 0.85, 3.05, 3.17, @l1, I18n.t("danfe.vol.esp"), det.css("esp").text
|
30
30
|
@pdf.ibox 0.85, 3.05, 6.22, @l1, I18n.t("danfe.vol.marca"), det.css("marca").text
|
31
31
|
@pdf.ibox 0.85, 4.83, 9.27, @l1, I18n.t("danfe.vol.nVol")
|
32
32
|
@pdf.inumeric 0.85, 3.43, 14.10, @l1, "vol.pesoB", det.css("pesoB").text, { decimals: 3 }
|
33
|
-
@pdf.inumeric 0.85,
|
33
|
+
@pdf.inumeric 0.85, 2.80, 17.53, @l1, "vol.pesoL", det.css("pesoL").text, { decimals: 3 }
|
34
34
|
end
|
35
35
|
|
36
36
|
def render_blank_boxes
|
data/lib/br_danfe/version.rb
CHANGED