Class: BrDanfe::DanfeLib::NfeLib::DetBody

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pdf, xml) ⇒ DetBody

Returns a new instance of DetBody.



7
8
9
10
11
12
# File 'lib/br_danfe/danfe_lib/nfe_lib/det_body.rb', line 7

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

  @y_position_with_entrega = Entrega.delivery_local?(@xml) ? 3.00 : 0.00
end

Instance Attribute Details

#y_position_with_entregaObject (readonly)

Returns the value of attribute y_position_with_entrega.



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

def y_position_with_entrega
  @y_position_with_entrega
end

Instance Method Details

#render(has_issqn) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/br_danfe/danfe_lib/nfe_lib/det_body.rb', line 14

def render(has_issqn)
  table_height_on_first_page = table_height_on_first_page has_issqn
  first_table = create_table
  next_table = create_table

  fill_tables first_table, next_table, table_height_on_first_page
  render_tables first_table, next_table, table_height_on_first_page
end