Module: Ruport::Renderer::Invoice::InvoiceHelpers

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

Instance Method Summary collapse

Instance Method Details

#add_title(title) ⇒ Object



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

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



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

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



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

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



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

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



38
39
40
# File 'lib/ruport/util/invoice.rb', line 38

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

#horizontal_line(x1, x2) ⇒ Object



68
69
70
71
# File 'lib/ruport/util/invoice.rb', line 68

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