Skip to content
Open
Show file tree
Hide file tree
Changes from 2 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 get_notes_with_defaults(status)
Comment thread
tomas-goncalves marked this conversation as resolved.
Outdated
Comment thread
tomas-goncalves marked this conversation as resolved.
Outdated
if not self.notes.empty?
self.notes
else
if category == "Labor" and 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.get_notes_with_defaults(@invoice.status).to_s.length > 0 then %>
<br>
<div class="pdf-line-notes">
<%= simple_format line.notes %>
<%= simple_format line.get_notes_with_defaults(@invoice.status) %>
</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.get_notes_with_defaults(@invoice.status) and not line.get_notes_with_defaults(@invoice.status).empty? %>
<%= simple_format line.get_notes_with_defaults(@invoice.status) %>
<% end %>
</td>
<% if can? :readprice, @invoice %>
Expand Down