Class: Dorsale::ExpenseGun::ExpensePdf

Inherits:
ApplicationPdf
  • Object
show all
Defined in:
app/pdfs/dorsale/expense_gun/expense_pdf.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ApplicationPdf

#open!

Methods included from PrawnHelpers

#bb, #btb, #draw_debug_bounds!, #draw_debug_bounds?, #get_image, #page_height, #page_width, #placeholder, #t, #tb

Methods included from UsersHelper

#avatar_img, #default_avatar_url

Methods included from ApplicationHelper

#expense_states_for_filters_select

Methods included from BillingMachine::ApplicationHelper

#billing_machine_invoices_chart, #billing_machine_payment_status_for_filter_select, #billing_machine_quotation_states_for_filter_select, #billing_machine_quotation_states_for_select, #bm_currency, #quotation_state_classes

Methods included from ContextHelper

#actions_for, #render_dorsale_page

Constructor Details

#initialize(expense) ⇒ ExpensePdf

Returns a new instance of ExpensePdf.



4
5
6
7
# File 'app/pdfs/dorsale/expense_gun/expense_pdf.rb', line 4

def initialize(expense)
  @expense = expense
  super(page_layout: :landscape)
end

Instance Attribute Details

#expenseObject (readonly)

Returns the value of attribute expense.



2
3
4
# File 'app/pdfs/dorsale/expense_gun/expense_pdf.rb', line 2

def expense
  @expense
end

Instance Method Details

#buildObject



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'app/pdfs/dorsale/expense_gun/expense_pdf.rb', line 11

def build
  font_size  11

  text "Note de frais : #{expense}", align: :center, size: 16, style: :bold

  move_down 10.mm

  info expense, :user

  move_down 10.mm

  font_size 9 do
    table(table_data, width: bounds.width) do |t|
      t.row(0).font_style = :bold
    end
  end

  move_down 10.mm

  info expense, :total_all_taxes, helper: :euros
  info expense, :total_employee_payback, helper: :euros
  info expense, :total_vat_deductible, helper: :euros
end