Skip to content

Commit

Permalink
Update unpaid.html.haml
Browse files Browse the repository at this point in the history
if markup is set, show both differences without and with markup
  • Loading branch information
mjavurek authored Nov 13, 2024
1 parent 8249f70 commit ec39f11
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions app/views/finance/invoices/unpaid.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
%p
- for invoice in invoices
- invoice_amount_diff = invoice.expected_amount - invoice.net_amount
- invoice_profit = invoice.expected_amount(:with_markup) - invoice.net_amount
- invoices_sum += invoice.amount
- invoices_text << invoice.number
- if supplier.supplier_category.bank_account&.bank_gateway
Expand All @@ -21,10 +22,12 @@
= format_date invoice.date
= ' ' + invoice.number
= ' ' + number_to_currency(invoice.amount)
- if invoice_amount_diff != 0
%span{style: "color:#{invoice_amount_diff < 0 ? 'red' : 'green'}"}
= invoice_amount_diff > 0 ? '+' : '-'
= number_to_currency(invoice_amount_diff.abs)
%span{style: "color:#{invoice_amount_diff < 0 ? 'red' : 'green'}"}
= number_to_currency(invoice_amount_diff)
- if invoice_profit > invoice_amount_diff
= ' / '
%span{style: "color:#{invoice_profit < 0 ? 'red' : 'green'}"}
= number_to_currency(invoice_profit)
- if invoice.attachments.attached?
- for attachment in invoice.attachments
= link_to attachment.filename, attachment.url
Expand Down

0 comments on commit ec39f11

Please sign in to comment.