Allow deletion of financial transactions
This commit is contained in:
parent
260ef90f6b
commit
ff76fa60c0
14 changed files with 79 additions and 8 deletions
|
|
@ -1,4 +1,5 @@
|
|||
- with_ordergroup = local_assigns[:with_ordergroup]
|
||||
- with_hidden = local_assigns[:with_hidden]
|
||||
- with_csv = local_assigns[:with_csv]
|
||||
.pull-right
|
||||
- if with_csv
|
||||
|
|
@ -22,9 +23,11 @@
|
|||
- FinancialTransactionClass.sorted.each do |c|
|
||||
%th
|
||||
= sort_link_helper c.display, "amount"
|
||||
- if with_hidden
|
||||
%th
|
||||
%tbody
|
||||
- @financial_transactions.each do |t|
|
||||
%tr
|
||||
%tr{class: "#{'deleted_row' if t.hidden?}"}
|
||||
%td
|
||||
- if t.financial_link
|
||||
= link_to format_time(t.created_on), finance_link_path(t.financial_link)
|
||||
|
|
@ -40,3 +43,10 @@
|
|||
%td.numeric{style: 'width:5em'}
|
||||
- if t.financial_transaction_type.financial_transaction_class == c
|
||||
= format_currency t.amount
|
||||
- if with_hidden
|
||||
%td.actions{style: 'width:1em'}
|
||||
- unless t.hidden?
|
||||
= link_to finance_ordergroup_transaction_path(t.ordergroup, t), method: :delete,
|
||||
data: {confirm: t('.confirm_revert', name: t.note)}, title: t('.revert_title'),
|
||||
class: 'btn btn-danger btn-mini' do
|
||||
= glyph :remove
|
||||
|
|
|
|||
|
|
@ -19,3 +19,8 @@
|
|||
= f.text_field :amount_gteq, class: 'input-mini'
|
||||
%span.add-on -
|
||||
= f.text_field :amount_lteq, class: 'input-mini search-query'
|
||||
|
||||
|
||||
%label{for: 'show_hidden'}
|
||||
= check_box_tag 'show_hidden', 1, params[:show_hidden]
|
||||
= t '.show_hidden'
|
||||
|
|
|
|||
|
|
@ -22,4 +22,4 @@
|
|||
|
||||
= render 'transactions_search', url: finance_ordergroup_transactions_path(@ordergroup)
|
||||
|
||||
#transactions= render 'transactions', with_csv: true
|
||||
#transactions= render 'transactions', with_csv: true, with_hidden: true
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
$('#transactions').html('<%= escape_javascript(render("transactions", with_csv: true)) %>');
|
||||
$('#transactions').html('<%= escape_javascript(render("transactions", with_csv: true, with_hidden: true)) %>');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue