2017-10-22 02:21:27 +02:00
|
|
|
- title t('.title')
|
|
|
|
|
|
|
|
- for supplier in @suppliers
|
2019-10-30 11:53:44 +01:00
|
|
|
- invoices = supplier.invoices
|
2017-10-22 02:21:27 +02:00
|
|
|
- if invoices.any?
|
|
|
|
%h3= supplier.name
|
|
|
|
- invoices_sum = 0
|
|
|
|
- invoices_text = []
|
|
|
|
%p
|
|
|
|
- for invoice in invoices
|
2022-02-18 13:03:34 +01:00
|
|
|
- invoice_amount_diff = invoice.expected_amount - invoice.net_amount
|
2017-10-22 02:21:27 +02:00
|
|
|
- invoices_sum += invoice.amount
|
|
|
|
- invoices_text << invoice.number
|
|
|
|
= link_to finance_invoice_path(invoice) do
|
|
|
|
= format_date invoice.date
|
|
|
|
= ' ' + invoice.number
|
|
|
|
= ' ' + number_to_currency(invoice.amount)
|
2022-02-18 13:03:34 +01:00
|
|
|
- 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)
|
2019-10-30 12:43:23 +01:00
|
|
|
- if invoice.attachment_data?
|
|
|
|
= link_to finance_invoice_attachment_path(invoice) do
|
|
|
|
= glyph :download
|
|
|
|
- if invoice.note?
|
|
|
|
= '(' + invoice.note + ')'
|
2017-10-22 02:21:27 +02:00
|
|
|
%br/
|
|
|
|
%p
|
|
|
|
- if supplier.iban.present?
|
|
|
|
%b= heading_helper(Supplier, :iban) + ':'
|
2021-02-20 12:16:21 +01:00
|
|
|
= format_iban supplier.iban
|
2017-10-22 02:21:27 +02:00
|
|
|
%br/
|
|
|
|
%b= t('.invoices_text') + ':'
|
|
|
|
= invoices_text.join(', ')
|
|
|
|
%br/
|
|
|
|
%b= t('.invoices_sum') + ':'
|
|
|
|
= number_to_currency invoices_sum
|