Class: BrDanfe::DanfeLib::NfeLib::Icmstot

Inherits:
Object
  • Object
show all
Defined in:
lib/br_danfe/danfe_lib/nfe_lib/icmstot.rb

Constant Summary collapse

Y_POSITION =
13.77 + SPACE_BETWEEN_GROUPS

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pdf, xml) ⇒ Icmstot

Returns a new instance of Icmstot.



9
10
11
12
13
14
15
16
17
18
# File 'lib/br_danfe/danfe_lib/nfe_lib/icmstot.rb', line 9

def initialize(pdf, xml)
  @pdf = pdf
  @xml = xml

  @y_position = Entrega.delivery_local?(@xml) ? Y_POSITION + 3.00 : Y_POSITION

  @ltitle = @y_position - 0.42
  @l1 = @y_position
  @l2 = @y_position + LINE_HEIGHT
end

Instance Attribute Details

#y_positionObject (readonly)

Returns the value of attribute y_position.



5
6
7
# File 'lib/br_danfe/danfe_lib/nfe_lib/icmstot.rb', line 5

def y_position
  @y_position
end

Instance Method Details

#renderObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/br_danfe/danfe_lib/nfe_lib/icmstot.rb', line 20

def render
  @pdf.ititle 0.42, 5.60, 0.75, @ltitle, 'ICMSTot.title'

  @pdf.lnumeric LINE_HEIGHT, 3.56, 0.75, @l1, @xml, 'ICMSTot/vBC'
  @pdf.lnumeric LINE_HEIGHT, 4.06, 4.31, @l1, @xml, 'ICMSTot/vICMS'
  @pdf.lnumeric LINE_HEIGHT, 4.06, 8.37, @l1, @xml, 'ICMSTot/vBCST'
  @pdf.lnumeric LINE_HEIGHT, 4.06, 12.43, @l1, @xml, 'ICMSTot/vST'
  @pdf.lnumeric LINE_HEIGHT, 3.82, 16.49, @l1, @xml, 'ICMSTot/vProd'

  @pdf.lnumeric LINE_HEIGHT, 2.55, 0.75, @l2, @xml, 'ICMSTot/vFrete'
  @pdf.lnumeric LINE_HEIGHT, 3.05, 3.30, @l2, @xml, 'ICMSTot/vSeg'
  @pdf.lnumeric LINE_HEIGHT, 3.04, 6.35, @l2, @xml, 'ICMSTot/vDesc'
  @pdf.lnumeric LINE_HEIGHT, 3.04, 9.39, @l2, @xml, 'ICMSTot/vOutro'
  @pdf.lnumeric LINE_HEIGHT, 4.06, 12.43, @l2, @xml, 'ICMSTot/vIPI'
  @pdf.lnumeric LINE_HEIGHT, 3.82, 16.49, @l2, @xml, 'ICMSTot/vNF', style: :bold
end