From 35f893c2d39fb2154b0f2aaa8097cb0ce231dc69 Mon Sep 17 00:00:00 2001 From: mjavurek <57668028+mjavurek@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:39:42 +0100 Subject: [PATCH 1/2] Update show.html.haml: show balance --- .../finance/financial_links/show.html.haml | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/app/views/finance/financial_links/show.html.haml b/app/views/finance/financial_links/show.html.haml index 5144f486e..4f13b6c4f 100644 --- a/app/views/finance/financial_links/show.html.haml +++ b/app/views/finance/financial_links/show.html.haml @@ -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) # total_plus + total_minus) + %th %p = @financial_link.note From 4b1e8d930618316254f8ae4876d0ce1cce2bc172 Mon Sep 17 00:00:00 2001 From: mjavurek <57668028+mjavurek@users.noreply.github.com> Date: Mon, 2 Dec 2024 11:56:25 +0100 Subject: [PATCH 2/2] Update show.html.haml: removed outdated comment --- app/views/finance/financial_links/show.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/finance/financial_links/show.html.haml b/app/views/finance/financial_links/show.html.haml index 4f13b6c4f..ec7f73fbf 100644 --- a/app/views/finance/financial_links/show.html.haml +++ b/app/views/finance/financial_links/show.html.haml @@ -57,7 +57,7 @@ %th %th= 'total (bank transactions + invoices - financial transactions):' %th - %th.numeric{style: 'width:5em'}= format_currency(@financial_link.amount) # total_plus + total_minus) + %th.numeric{style: 'width:5em'}= format_currency(@financial_link.amount) %th %p