Permalink
Browse files

Show table for line items

  • Loading branch information...
danielfone committed Oct 19, 2013
1 parent f82821e commit 5e52fbc16f4e8609948ae214f47d82a1c6767cfd
Showing with 29 additions and 0 deletions.
  1. +4 −0 app/models/reimbursement.rb
  2. +25 −0 app/views/reimbursements/show.html.erb
@@ -3,4 +3,8 @@ class Reimbursement < ActiveRecord::Base
validates :payee_id, presence: true
+ def line_items
+ @line_items ||= []
+ end
+
end
@@ -14,6 +14,31 @@
<dd><%= @reimbursement.data %></dd>
</dl>
+<h3>Line Items</h3>
+<table class="table">
+ <thead>
+ <tr>
+ <th>Detail</th>
+ <th>Code</th>
+ <th>Dept/Project</th>
+ <th>Amount</th>
+ <th>GST?</th>
+ </tr>
+ </thead>
+ <%- @reimbursement.line_items.each do |li| %>
+ <tr>
+ <td><%= li.detail %></td>
+ <td><%= li.code %></td>
+ <td><%= li.dept %></td>
+ <td><%= number_to_currency li.amount %></td>
+ <td><%= li.gst == '1' %></td>
+ </tr>
+ <%- end -%>
+</table>
+<%- if @reimbursement.line_items.none? -%>
+ <p class="muted">No line items</p>
+<% end %>
+
<div class="form-actions">
<%= link_to t('.back', :default => t("helpers.links.back")),
reimbursements_path, :class => 'btn' %>

0 comments on commit 5e52fbc

Please sign in to comment.