diff --git a/app/models/invoice_line.rb b/app/models/invoice_line.rb index e10686f4..f25b4501 100644 --- a/app/models/invoice_line.rb +++ b/app/models/invoice_line.rb @@ -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 diff --git a/app/views/invoices/prettyView.html.erb b/app/views/invoices/prettyView.html.erb index 739eaa33..72a76097 100644 --- a/app/views/invoices/prettyView.html.erb +++ b/app/views/invoices/prettyView.html.erb @@ -159,10 +159,10 @@ <%=line.category %> <%=line.memo %> - <% if line.notes.to_s.length > 0 then %> + <% if line.notes_with_defaults.to_s.length > 0 then %>
- <%= simple_format line.notes %> + <%= simple_format line.notes_with_defaults %>
<% end %> diff --git a/app/views/invoices/show.html.erb b/app/views/invoices/show.html.erb old mode 100755 new mode 100644 index df36a562..40eb9c0d --- a/app/views/invoices/show.html.erb +++ b/app/views/invoices/show.html.erb @@ -57,8 +57,8 @@ <%= line.category %> <%= 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 %> <% if can? :readprice, @invoice %>