Class: BrDanfe::DanfeLib::NfeLib::Ticket

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

Instance Method Summary collapse

Constructor Details

#initialize(pdf, xml) ⇒ Ticket

Returns a new instance of Ticket.



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

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

Instance Method Details

#renderObject



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

def render
  @pdf.ibox 0.85, 15.60, 0.75, 1.85, I18n.t('danfe.ticket.xNome', xNome: @xml['emit/xNome'])
  @pdf.ibox 0.85, 3.85, 0.75, 2.7, I18n.t('danfe.ticket.received_at')
  @pdf.ibox 0.85, 11.75, 4.60, 2.7, I18n.t('danfe.ticket.receiver')
  @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
end