<h1>Listing invoices</h1>

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

<% @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, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

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

<h1>Listing invoices</h1>

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

<% @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, :confirm => 'Are you sure?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

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

Add display purchase helper to index
Add display purchase helper to index
