diff --git a/app/views/finance/invoices/unpaid.html.haml b/app/views/finance/invoices/unpaid.html.haml index e04d514e0..4674c631b 100644 --- a/app/views/finance/invoices/unpaid.html.haml +++ b/app/views/finance/invoices/unpaid.html.haml @@ -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 @@ -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