Module: Ruport::Controller::Invoice::InvoiceHelpers

Included in:
PDF
Defined in:
lib/ruport/util/invoice.rb

Instance Method Summary collapse

Instance Method Details

#add_title(title) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/ruport/util/invoice.rb', line 40

def add_title( title )  
  rounded_text_box("<b>#{title}</b>") do |o|
    o.fill_color = Color::RGB::Gray80
    o.radius    = 5  
    o.width     = options.header_width || 200
    o.height    = options.header_height || 20
    o.font_size = options.header_font_size || 11
    o.x         = pdf_writer.absolute_right_margin - o.width 
    o.y         = pdf_writer.absolute_top_margin
  end
end

#build_company_headerObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/ruport/util/invoice.rb', line 12

def build_company_header
  @tod = pdf_writer.y
  rounded_text_box(options.company_info) { |o| 
      o.radius    = 3  
      o.width     = options.header_width || 200
      o.height    = options.header_height || 50
      o.font_size = options.header_font_size || 10
      o.y         = pdf_writer.y
      o.x         = pdf_writer.absolute_left_margin + 10
  }
end

#build_customer_headerObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/ruport/util/invoice.rb', line 24

def build_customer_header
  move_cursor(-5)
  rounded_text_box(options.customer_info) { |o| 
      o.radius    = 3
      o.width     = options.header_width || 200
      o.height    = options.header_height || 50
      o.font_size = options.header_font_size || 10
      o.y         = pdf_writer.y
      o.x         = pdf_writer.absolute_left_margin + 10
  }
end

#build_order_headerObject



52
53
54
55
56
57
58
59
60
61
62
63
64
# File 'lib/ruport/util/invoice.rb', line 52

def build_order_header
  if options.order_info
    rounded_text_box("<b>#{options.order_info}</b>") do |o|
      o.radius    = 5  
      o.heading   = "Billing Information"
      o.width     = options.header_width || 200
      o.height    = options.header_height || 80
      o.font_size = options.header_font_size || 10
      o.x         = pdf_writer.absolute_right_margin - o.width 
      o.y         = pdf_writer.absolute_top_margin - 25
    end 
  end
end

#build_titleObject



36
37
38
# File 'lib/ruport/util/invoice.rb', line 36

def build_title
  add_title(options.title) if options.title
end

#horizontal_line(x1, x2) ⇒ Object



66
67
68
69
# File 'lib/ruport/util/invoice.rb', line 66

def horizontal_line(x1,x2)
  pdf_writer.line(x1,pdf_writer.y,x2,pdf_writer.y)
  pdf_writer.stroke
end