2021-02-08 01:07:10 +01:00
|
|
|
.pull-right
|
|
|
|
.btn-group
|
|
|
|
= link_to url_for(query: params[:query], format: :csv), class: 'btn' do
|
|
|
|
= glyph :download
|
|
|
|
CSV
|
|
|
|
- if @invoices.total_pages > 1
|
|
|
|
= items_per_page
|
2012-11-10 16:44:05 +01:00
|
|
|
= pagination_links_remote @invoices
|
|
|
|
|
|
|
|
%table.table.table-striped
|
|
|
|
%thead
|
|
|
|
%tr
|
2013-10-09 23:37:08 +02:00
|
|
|
%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
|
2016-03-06 14:01:24 +01:00
|
|
|
- if Delivery.any?
|
|
|
|
%th= heading_helper Invoice, :deliveries
|
2016-02-25 12:56:34 +01:00
|
|
|
%th= heading_helper Invoice, :orders
|
2013-10-09 23:37:08 +02:00
|
|
|
%th= heading_helper Invoice, :note
|
2012-11-10 16:44:05 +01:00
|
|
|
%th
|
|
|
|
%th
|
|
|
|
%tbody
|
|
|
|
- for invoice in @invoices
|
|
|
|
%tr
|
|
|
|
%td= link_to h(invoice.number), finance_invoice_path(invoice)
|
|
|
|
%td= invoice.supplier.name
|
2016-02-17 16:11:20 +01:00
|
|
|
%td= link_to h(format_date invoice.date), finance_invoice_path(invoice)
|
2012-11-10 16:44:05 +01:00
|
|
|
%td= format_date invoice.paid_on
|
|
|
|
%td= number_to_currency invoice.amount
|
2016-03-06 14:01:24 +01:00
|
|
|
- if Delivery.any?
|
|
|
|
%td><
|
|
|
|
- invoice.deliveries.each_with_index do |delivery, index|
|
|
|
|
= ', ' if index > 0
|
2020-08-01 18:39:34 +02:00
|
|
|
= link_to format_date(delivery.date), [delivery.supplier,delivery]
|
2016-02-25 12:56:34 +01:00
|
|
|
%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)
|
2012-11-10 16:44:05 +01:00
|
|
|
%td= truncate(invoice.note)
|
2016-02-17 21:07:35 +01:00
|
|
|
%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)
|
2016-03-04 23:13:28 +01:00
|
|
|
= link_to t('ui.delete'), finance_invoice_path(invoice), :data => {:confirm => t('ui.confirm_delete', name: invoice.number)}, :method => :delete,
|
2016-02-17 21:07:35 +01:00
|
|
|
class: 'btn btn-danger btn-mini'
|