To date: <%= Date.today.to_s %> from <%= @report.date_from %> to <%= @report.date_to %>.
<% sum_report = Hash.new sum_reality = Hash.new sum_remaining = Hash.new def separate_thousands(num) return num # musi se doprepsat i pro hashe return ('%d' % num).gsub(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1,") end %>category | budgeted | reality up to now | probably paid | estimate for future | total | remaining |
---|---|---|---|---|---|---|
<% if item.account == nil %> Nonexisting account with id: <%= item.account_id %> <% else %> <%= link_to item.account.popis, :action => 'show', :controller =>'account', :id => item.account.id, :report=> @report.id %> <% end %> | <%= separate_thousands( item.amount ) %> | <%= separate_thousands( reality ) %> | <%= separate_thousands( item.reality ) %> | <%= separate_thousands(item.amount.to_multicash_h-reality) %> | ||
total | <%= separate_thousands(sum_report) %> | <%= separate_thousands(sum_reality) %> | <%= separate_thousands(sum_reality ) %> | <%= separate_thousands(sum_remaining) %> |
<%= link_to 'Edit report', edit_report_path(@report) %> | <%= link_to 'Report list', reports_path %>