Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions app/models/invoice_line.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,16 @@ def <=> (il)
return -1 if Invoice_Categories.find_index(il.category).nil?
return Invoice_Categories.find_index(category) <=> Invoice_Categories.find_index(il.category)
end

def notes_with_defaults
if not self.notes.empty?
self.notes
else
if category == "Labor" and self.invoice.status == "Quote"
"Labor hours are estimates; Actual hours will be billed."
else
nil
end
end
end
end
4 changes: 2 additions & 2 deletions app/views/invoices/prettyView.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@
<td><%=line.category %></td>
<td>
<%=line.memo %>
<% if line.notes.to_s.length > 0 then %>
<% if line.notes_with_defaults.to_s.length > 0 then %>
<br>
<div class="pdf-line-notes">
<%= simple_format line.notes %>
<%= simple_format line.notes_with_defaults %>
</div>
<% end %>
</td>
Expand Down
4 changes: 2 additions & 2 deletions app/views/invoices/show.html.erb
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@
<td><%= line.category %></td>
<td>
<%= line.memo %>
<% if line.notes and not line.notes.empty? %>
<%= simple_format line.notes %>
<% if line.notes_with_defaults and not line.notes_with_defaults.empty? %>
<%= simple_format line.notes_with_defaults %>
<% end %>
</td>
<% if can? :readprice, @invoice %>
Expand Down