Adjust the task form for showing invoice information for billed task (refs: #69f890)

This commit is contained in:
Paul van Tilburg 2012-01-02 14:00:56 +01:00
parent cc0bb4a371
commit 0ba447524d
1 changed files with 14 additions and 1 deletions

View File

@ -1510,6 +1510,10 @@ module StopTime::Views
# Form for updating the properties of a task (Models::Task).
def task_form
h2 "Task Information"
p.warn do
em "This task is already billed! Only make changes if you know " +
"what you are doing!"
end if task.billed?
form :action => R(*@target), :method => :post do
ol do
li do
@ -1531,7 +1535,16 @@ module StopTime::Views
end
end
end
# FIXME: add link(s) to related invoice(s)
if task.billed?
li do
label "Invoice number"
a @task.invoice.number,
:href => R(CustomersNInvoicesX, @customer.id, @task.invoice.number)
end
li do
_form_input_with_label("Invoice comment", "invoice_comment", :text)
end
end
end
input :type => "submit", :name => @method, :value => @method.capitalize
input :type => "submit", :name => "cancel", :value => "Cancel"