Module: Admin::PaymentsHelper

Includes:
IsActiveColumnHelper
Defined in:
app/helpers/admin/payments_helper.rb

Instance Method Summary collapse

Instance Method Details

#amount_column(record) ⇒ Object



4
5
6
# File 'app/helpers/admin/payments_helper.rb', line 4

def amount_column(record)
  h_money record.amount
end

#amount_unallocated_form_column(record, input_name) ⇒ Object



16
17
18
# File 'app/helpers/admin/payments_helper.rb', line 16

def amount_unallocated_form_column(record, input_name)
  '<span class="active-scaffold_detail_value" id="record_amount_unallocated_%s">%s</span>' % [record.id, '(Enter a Payment Amount)']
end

#invoice_assignment_form_column(record, input_name) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'app/helpers/admin/payments_helper.rb', line 26

def invoice_assignment_form_column(record, input_name)
#    list_i = nil
#    
#    Client.find(:all, :order => 'company_name ASC').in_groups_of((Client.count(:all).to_f/3).ceil, false).collect{ |group|
#      '<ul class="checkbox-list">'+
#        group.collect{ |client|
#          list_i = (list_i) ? list_i+1 : 0
#          chk_name = "%s[%d][id]" % [input_name, client.id]
#          
#          '<li>%s<label for="%s[%d][id]">%s</label></li>' % [ 
#            check_box_tag(chk_name, client.id, record.client_ids.include?(client.id) ), 
#            chk_name,
#            list_i,
#            client.company_name
#          ]
#        }.join+
#      '</ul>'
#    }.join
  '<div id="record_invoice_assignment_%s">%s</div>' % [record.id, '<span class="active-scaffold_detail_value">(Choose a Client)</span>']
end

#invoice_assignments_column(record) ⇒ Object



20
21
22
23
24
# File 'app/helpers/admin/payments_helper.rb', line 20

def invoice_assignments_column(record)
  record.invoice_assignments.collect{|ia| 
    '%s to Invoice %d' % [ia.amount.format, ia.invoice.id   ]
  }.join ', '
end

#payment_method_identifier_form_column(record, input_name) ⇒ Object



8
9
10
11
12
13
14
# File 'app/helpers/admin/payments_helper.rb', line 8

def payment_method_identifier_form_column(record, input_name)
  text_field_tag(
    input_name, 
    record.payment_method_identifier, 
    options_for_column('payment_method_identifier').merge({:size => 30})
  )
end