<% unless invoices.empty? %> <%= form_with(url: invoice_path, method: :get) do |form| %> <% if invoices.count > 1 %>
<%= check_box_tag "select-all-invoices", "1", false, id: "select-all-invoices" %> <%= label_tag "select-all-invoices", t(:label_select_all) %>

<% end %> <% invoices.sort.reverse.each do |invoice| %>
<%= check_box_tag "invoice_ids[]", invoice.id, false, onchange: "updateLink()", class: "invoice-checkbox" if invoices.count > 1 %> <%= link_to "##{invoice.doc_number}", invoice_path(invoice), target: :_blank %> <%= invoice.txn_date %>
<% end %> <% if invoices.count > 1 %> <%= form.submit t(:button_bulk_pdf) %> <% end %> <% end %> <% else %>

<%=t(:label_no_invoices)%>.

<% end %>