foodsoft/app/views/finance/invoices/_invoices.html.haml
Patrick Gansterer a5582e9542 Rename Delivery.delivered_on to date
This aligns it with column names of StockTaking and us to use inheritance
in a next step to share common code between the entities.
2020-09-05 13:52:18 +02:00

43 lines
1.7 KiB
Text

- if Invoice.count > 20
= items_per_page
= pagination_links_remote @invoices
%table.table.table-striped
%thead
%tr
%th= heading_helper Invoice, :number
%th= heading_helper Invoice, :supplier
%th= heading_helper Invoice, :date
%th= heading_helper Invoice, :paid_on
%th= heading_helper Invoice, :amount
- if Delivery.any?
%th= heading_helper Invoice, :deliveries
%th= heading_helper Invoice, :orders
%th= heading_helper Invoice, :note
%th
%th
%tbody
- for invoice in @invoices
%tr
%td= link_to h(invoice.number), finance_invoice_path(invoice)
%td= invoice.supplier.name
%td= link_to h(format_date invoice.date), finance_invoice_path(invoice)
%td= format_date invoice.paid_on
%td= number_to_currency invoice.amount
- if Delivery.any?
%td><
- invoice.deliveries.each_with_index do |delivery, index|
= ', ' if index > 0
= link_to format_date(delivery.date), [delivery.supplier,delivery]
%td><
- invoice.orders.each_with_index do |order, index|
= ', ' if index > 0
= link_to format_date(order.ends), new_finance_order_path(order_id: order)
%td= truncate(invoice.note)
%td
- if invoice.user_can_edit?(current_user)
= link_to t('ui.edit'), edit_finance_invoice_path(invoice), class: 'btn btn-mini'
%td
- if invoice.user_can_edit?(current_user)
= link_to t('ui.delete'), finance_invoice_path(invoice), :data => {:confirm => t('ui.confirm_delete', name: invoice.number)}, :method => :delete,
class: 'btn btn-danger btn-mini'