Module: Ruport::Controller::Invoice::InvoiceHelpers
- Included in:
- Defined in:
- lib/ruport/util/invoice.rb
Instance Method Summary collapse
- #add_title(title) ⇒ Object
- #build_company_header ⇒ Object
- #build_customer_header ⇒ Object
- #build_order_header ⇒ Object
- #build_title ⇒ Object
- #horizontal_line(x1, x2) ⇒ Object
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 = .header_width || 200 o.height = .header_height || 20 o.font_size = .header_font_size || 11 o.x = pdf_writer.absolute_right_margin - o.width o.y = pdf_writer.absolute_top_margin end end |
#build_company_header ⇒ Object
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(.company_info) { |o| o.radius = 3 o.width = .header_width || 200 o.height = .header_height || 50 o.font_size = .header_font_size || 10 o.y = pdf_writer.y o.x = pdf_writer.absolute_left_margin + 10 } end |
#build_customer_header ⇒ Object
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(.customer_info) { |o| o.radius = 3 o.width = .header_width || 200 o.height = .header_height || 50 o.font_size = .header_font_size || 10 o.y = pdf_writer.y o.x = pdf_writer.absolute_left_margin + 10 } end |
#build_order_header ⇒ Object
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 .order_info rounded_text_box("<b>#{.order_info}</b>") do |o| o.radius = 5 o.heading = "Billing Information" o.width = .header_width || 200 o.height = .header_height || 80 o.font_size = .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_title ⇒ Object
36 37 38 |
# File 'lib/ruport/util/invoice.rb', line 36 def build_title add_title(.title) if .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 |