.page-header
  %h1 Receipts
  %p.lead See what you bought each time you visited the Coop

= paginate @receipts

- @receipts.each do |receipt|
  %div.panel.panel-default
    %div.panel-heading
      = time_ago_in_words(receipt.date)
      ago
      (#{receipt.date.to_s(:long)})

    %div.panel-body
      %table.table
        %thead
          %tr
            %th Stock Code
            %th Description
            %th Quantity
            %th Total
        %tbody
          - receipt.line_items.each do |line_item|
            %tr
              %td= line_item.product.stock_code
              %td= link_to_unless line_item.product.stock_code.empty?, line_item.product.description, line_item.product
              %td= line_item.quantity
              %td= number_to_currency(line_item.total_inc_gst)
          %tr
            %td
            %td
            %td
            %td
              %strong= number_to_currency(receipt.total_inc_gst)

.page-header
  %h1 Receipts
  %p.lead See what you bought each time you visited the Coop

= paginate @receipts

- @receipts.each do |receipt|
  %div.panel.panel-default
    %div.panel-heading
      = time_ago_in_words(receipt.date)
      ago
      (#{receipt.date.to_s(:long)})

    %div.panel-body
      %table.table
        %thead
          %tr
            %th Quantity
            %th Description
            %th Total
        %tbody
          - receipt.line_items.each do |line_item|
            %tr
              %td= line_item.quantity
              %td= link_to_unless line_item.product.stock_code.empty?, line_item.product.description, line_item.product
              %td= number_to_currency(line_item.total_inc_gst)
          %tr
            %td
            %td
            %td
              %strong= number_to_currency(receipt.total_inc_gst)

Remove stock code from receipts and swap order of quantity and description
Remove stock code from receipts and swap order of quantity and description
