Skip to content

Commit

Permalink
financial links: show balance (#7)
Browse files Browse the repository at this point in the history
* Update show.html.haml: show balance

* Update show.html.haml: removed outdated comment
  • Loading branch information
mjavurek authored Dec 23, 2024
1 parent 6bebbe1 commit fc95ffa
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions app/views/finance/financial_links/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,34 @@
%td.numeric{style: 'width:5em'}= format_currency item[:amount]
%td= link_to t('.remove_from_link'), item[:remove_path], :data => {:confirm => t('.remove_from_link_confirm')}, :method => :delete,
class: 'btn btn-danger btn-mini'
%thead
- if @financial_link.bank_transactions.count > 1
%tr
%th
%th= 'sum of bank transactions:'
%th
%th.numeric{style: 'width:5em'}= format_currency(@financial_link.bank_transactions.sum(:amount))
%th
- if @financial_link.invoices.count > 1
%tr
%th
%th= 'sum of invoices:'
%th
%th.numeric{style: 'width:5em'}= format_currency(@financial_link.invoices.sum(:amount))
%th
- if @financial_link.financial_transactions.count > 1
%tr
%th
%th= 'sum of financial transactions:'
%th
%th.numeric{style: 'width:5em'}= format_currency(@financial_link.financial_transactions.sum(:amount))
%th
%tr
%th
%th= 'total (bank transactions + invoices - financial transactions):'
%th
%th.numeric{style: 'width:5em'}= format_currency(@financial_link.amount)
%th

%p
= @financial_link.note

0 comments on commit fc95ffa

Please sign in to comment.