2014-06-10 16:09:43 +02:00
|
|
|
- with_ordergroup = local_assigns[:with_ordergroup]
|
2019-11-01 19:30:23 +01:00
|
|
|
- with_hidden = local_assigns[:with_hidden]
|
2014-06-10 16:09:43 +02:00
|
|
|
- with_csv = local_assigns[:with_csv]
|
2014-05-06 19:02:01 +02:00
|
|
|
.pull-right
|
2014-06-10 16:09:43 +02:00
|
|
|
- if with_csv
|
|
|
|
.btn-group
|
|
|
|
= link_to url_for(search: params[:q], format: :csv), class: 'btn' do
|
|
|
|
= glyph :download
|
|
|
|
CSV
|
2014-05-06 19:02:01 +02:00
|
|
|
- if @financial_transactions.total_pages > 1
|
|
|
|
.btn-group= items_per_page wrap: false
|
2012-11-10 16:44:05 +01:00
|
|
|
= pagination_links_remote @financial_transactions
|
|
|
|
%table.table.table-striped
|
|
|
|
%thead
|
|
|
|
%tr
|
2013-11-23 12:05:29 +01:00
|
|
|
%th= sort_link_helper heading_helper(FinancialTransaction, :created_on), "date"
|
2014-05-06 19:02:01 +02:00
|
|
|
- if with_ordergroup
|
|
|
|
%th= heading_helper FinancialTransaction, :ordergroup
|
2013-11-23 12:05:29 +01:00
|
|
|
%th= heading_helper FinancialTransaction, :user
|
2017-03-04 14:15:39 +01:00
|
|
|
- if FinancialTransactionType.has_multiple_types
|
|
|
|
%th= heading_helper FinancialTransaction, :financial_transaction_type
|
2013-11-23 12:05:29 +01:00
|
|
|
%th= sort_link_helper heading_helper(FinancialTransaction, :note), "note"
|
2017-03-04 14:15:39 +01:00
|
|
|
- FinancialTransactionClass.sorted.each do |c|
|
|
|
|
%th
|
|
|
|
= sort_link_helper c.display, "amount"
|
2019-11-01 19:30:23 +01:00
|
|
|
- if with_hidden
|
|
|
|
%th
|
2012-11-10 16:44:05 +01:00
|
|
|
%tbody
|
|
|
|
- @financial_transactions.each do |t|
|
2019-11-01 19:30:23 +01:00
|
|
|
%tr{class: "#{'deleted_row' if t.hidden?}"}
|
2017-10-13 14:36:56 +02:00
|
|
|
%td
|
|
|
|
- if t.financial_link
|
|
|
|
= link_to format_time(t.created_on), finance_link_path(t.financial_link)
|
|
|
|
- else
|
|
|
|
= format_time(t.created_on)
|
2014-05-06 19:02:01 +02:00
|
|
|
- if with_ordergroup
|
2019-11-01 17:25:20 +01:00
|
|
|
%td= h link_to t.ordergroup_name, finance_group_transactions_path(t.ordergroup)
|
2013-09-20 22:40:13 +02:00
|
|
|
%td= h show_user(t.user)
|
2017-03-04 14:15:39 +01:00
|
|
|
- if FinancialTransactionType.has_multiple_types
|
|
|
|
%td= h t.financial_transaction_type.name
|
2019-11-04 04:33:43 +01:00
|
|
|
%td
|
|
|
|
- if t.group_order
|
|
|
|
= link_to t.note, t.group_order
|
|
|
|
- else
|
|
|
|
= t.note
|
2017-03-04 14:15:39 +01:00
|
|
|
- FinancialTransactionClass.sorted.each do |c|
|
2018-09-16 12:05:39 +02:00
|
|
|
%td.numeric{style: 'width:5em'}
|
2023-10-02 23:00:24 +02:00
|
|
|
- if t.financial_transaction_type.financial_transaction_class == c && t.amount
|
2018-09-16 12:05:39 +02:00
|
|
|
= format_currency t.amount
|
2019-11-01 19:30:23 +01:00
|
|
|
- if with_hidden
|
|
|
|
%td.actions{style: 'width:1em'}
|
|
|
|
- unless t.hidden?
|
2019-11-01 17:25:20 +01:00
|
|
|
= link_to finance_transaction_path(t), method: :delete,
|
2019-11-01 19:30:23 +01:00
|
|
|
data: {confirm: t('.confirm_revert', name: t.note)}, title: t('.revert_title'),
|
|
|
|
class: 'btn btn-danger btn-mini' do
|
|
|
|
= glyph :remove
|