Module: InvoicesHelper
- Defined in:
- app/helpers/invoices_helper.rb
Instance Method Summary collapse
- #header_tags ⇒ Object
- #invoice_list_tabs(invoices = { }) ⇒ Object
- #invoice_menu(invoice = nil) {|menu_items| ... } ⇒ Object
- #invoice_status(invoice) ⇒ Object
Instance Method Details
#header_tags ⇒ Object
48 49 50 51 |
# File 'app/helpers/invoices_helper.rb', line 48 def return stylesheet_link_tag("invoice.css", :plugin => "chiliproject_invoice", :media => 'all') + stylesheet_link_tag("invoice_print.css", :plugin => "chiliproject_invoice", :media => 'print') end |
#invoice_list_tabs(invoices = { }) ⇒ Object
3 4 5 6 7 8 |
# File 'app/helpers/invoices_helper.rb', line 3 def invoice_list_tabs(invoices = { }) tabs = [{:name => 'open', :label => "label_open_invoices", :items => invoices[:open]}, {:name => 'late', :label => "label_late_invoices", :items => invoices[:late]}, {:name => 'closed', :label => "label_closed_invoices", :items => invoices[:closed]} ] end |
#invoice_menu(invoice = nil) {|menu_items| ... } ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'app/helpers/invoices_helper.rb', line 29 def (invoice=nil, &block) = [] << link_to(l(:label_invoice_list), invoice_index_path, :class => 'icon icon-invoice-list') << link_to(l(:label_new_invoice), new_invoice_path, :class => 'icon icon-invoice-new') << link_to(l(:label_new_autofilled_invoice), autocreate_invoice_path, :class => 'icon icon-invoice-new') if invoice.nil? << link_to(l(:label_new_payment), new_payment_path, :class => 'icon icon-payment-new') else << link_to(l(:label_new_payment), new_invoice_payment_path(invoice), :class => 'icon icon-payment-new') end yield if block_given? return content_tag(:div, .join(' '), :class => "contextual nonprinting", :id => "invoice-menu") + content_tag(:div, '', :style => 'clear: both') end |
#invoice_status(invoice) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'app/helpers/invoices_helper.rb', line 10 def invoice_status(invoice) case true when invoice.fully_paid? return content_tag(:div, content_tag(:p, l(:label_paid_invoice)), :class => "invoice-message fully-paid nonprinting") when invoice.late? return content_tag(:div, content_tag(:p, l(:label_late_invoices)), :class => "invoice-message late nonprinting") else return content_tag(:div, content_tag(:p, l(:label_open_invoices)), :class => "invoice-message pending nonprinting") end end |