Add FinancialLinks
For now this is only usefull for plugins, since there is no UI.
This commit is contained in:
parent
75deec9f06
commit
53bb096046
12 changed files with 95 additions and 7 deletions
23
app/views/finance/financial_links/show.html.haml
Normal file
23
app/views/finance/financial_links/show.html.haml
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
- title t('.title', number: @financial_link.id)
|
||||
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= t '.date'
|
||||
%th= t '.type'
|
||||
%th= t '.description'
|
||||
%th= t '.amount'
|
||||
%tbody
|
||||
- @items.each do |item|
|
||||
%tr
|
||||
%td
|
||||
- if item[:link_to]
|
||||
= link_to format_date(item[:date]), item[:link_to]
|
||||
- else
|
||||
= format_date item[:date]
|
||||
%td= item[:type]
|
||||
%td= item[:description]
|
||||
%td.currency{:style => "color:#{item[:amount] < 0 ? 'red' : 'black'}; width:5em"}= number_to_currency(item[:amount])
|
||||
|
||||
%p
|
||||
= @financial_link.note
|
||||
|
|
@ -21,7 +21,11 @@
|
|||
%tbody
|
||||
- @financial_transactions.each do |t|
|
||||
%tr
|
||||
%td= format_time(t.created_on)
|
||||
%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)
|
||||
|
|
|
|||
|
|
@ -65,6 +65,10 @@
|
|||
%p
|
||||
%b= heading_helper(Invoice, :note) + ':'
|
||||
=h @invoice.note
|
||||
- if @invoice.financial_link
|
||||
%p
|
||||
%b= heading_helper(Invoice, :financial_link) + ':'
|
||||
= link_to t('ui.show'), finance_link_path(@invoice.financial_link)
|
||||
|
||||
- if @invoice.user_can_edit?(current_user)
|
||||
= link_to t('ui.edit'), edit_finance_invoice_path(@invoice), class: 'btn'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue