add view for all transactions + csv

This commit is contained in:
wvengen 2014-05-06 19:02:01 +02:00
parent b5b4ccd922
commit ef0888f38d
15 changed files with 111 additions and 19 deletions

View file

@ -1,10 +1,18 @@
- if @ordergroup.financial_transactions.count > 20
= items_per_page
- with_ordergroup ||= false
.pull-right
.btn-group
= link_to url_for(q: params[:q], format: :csv), class: 'btn' do
= glyph :download
CSV
- if @financial_transactions.total_pages > 1
.btn-group= items_per_page wrap: false
= pagination_links_remote @financial_transactions
%table.table.table-striped
%thead
%tr
%th= sort_link_helper heading_helper(FinancialTransaction, :created_on), "date"
- if with_ordergroup
%th= heading_helper FinancialTransaction, :ordergroup
%th= heading_helper FinancialTransaction, :user
%th= sort_link_helper heading_helper(FinancialTransaction, :note), "note"
%th= sort_link_helper heading_helper(FinancialTransaction, :amount), "amount"
@ -12,6 +20,8 @@
- @financial_transactions.each do |t|
%tr
%td= format_time(t.created_on)
- if with_ordergroup
%td= h link_to t.ordergroup.name, finance_ordergroup_transactions_path(t.ordergroup)
%td= h show_user(t.user)
%td= h t.note
%td.currency{:style => "color:#{t.amount < 0 ? 'red' : 'black'}; width:5em"}= number_to_currency(t.amount)