Skip to content

Commit

Permalink
Update show.html.haml: use format_currency_difference()
Browse files Browse the repository at this point in the history
  • Loading branch information
mjavurek authored Nov 21, 2024
1 parent 165dab6 commit 44d6b24
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions app/views/finance/invoices/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -76,16 +76,12 @@
%dd= number_to_currency(total_fc)

%dt= t('.fc_profit') + (total_fc > total ? t('.without_extra_charge') : '') + ':'
- profit = total - @invoice.net_amount
%dd
%span{style: "color:#{profit < 0 ? 'red' : 'green'}"}
= number_to_currency(profit)
= format_currency_difference(total - @invoice.net_amount)
- if total_fc > total
%dt= t('.fc_profit') + ' ' + t('.with_extra_charge') + ':'
- profit = total_fc - @invoice.net_amount
%dd
%span{style: "color:#{profit < 0 ? 'red' : 'green'}"}
= number_to_currency(profit)
= format_currency_difference(total_fc - @invoice.net_amount)

- if @invoice.attachments.attached?
%dt= heading_helper(Invoice, :attachment) + ':'
Expand Down

0 comments on commit 44d6b24

Please sign in to comment.