<h1>Listing invoices</h1>

<table>
  <thead>
    <tr>
      <th>Purchase</th>
      <th>Reference number</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% @invoices.each do |invoice| %>
      <tr>
        <td><%= invoice.purchase %></td>
        <td><%= invoice.reference_number %></td>
        <td><%= link_to 'Show', invoice %></td>
        <td><%= link_to 'Edit', edit_invoice_path(invoice) %></td>
        <td><%= link_to 'Destroy', invoice, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Invoice', new_invoice_path %>

<h1>Listing invoices</h1>

<table>
  <thead>
    <tr>
      <th>Purchase</th>
      <th>Reference number</th>
      <th></th>
      <th></th>
      <th></th>
    </tr>
  </thead>

  <tbody>
    <% @invoices.each do |invoice| %>
      <tr>
        <td><%= display_purchase(invoice) %></td>
        <td><%= invoice.reference_number %></td>
        <td><%= link_to 'Show', invoice %></td>
        <td><%= link_to 'Edit', edit_invoice_path(invoice) %></td>
        <td><%= link_to 'Destroy', invoice, method: :delete, data: { confirm: 'Are you sure?' } %></td>
      </tr>
    <% end %>
  </tbody>
</table>

<br>

<%= link_to 'New Invoice', new_invoice_path %>

Add Display Purchase to Index
Add Display Purchase to Index
