foodsoft/app/views/finance/financial_transactions/_transactions.html.haml
Patrick Gansterer 53bb096046 Add FinancialLinks
For now this is only usefull for plugins, since there is no UI.
2017-10-28 20:17:16 +02:00

33 lines
1.3 KiB
Text

- with_ordergroup = local_assigns[:with_ordergroup]
- with_csv = local_assigns[:with_csv]
.pull-right
- if with_csv
.btn-group
= link_to url_for(search: 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"
%tbody
- @financial_transactions.each do |t|
%tr
%td
- if t.financial_link
= link_to format_time(t.created_on), finance_link_path(t.financial_link)
- else
= 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)