Add vat_rate field to the Task model

This commit is contained in:
Paul van Tilburg 2012-09-28 10:09:42 +02:00
parent 52e23a927a
commit 808b09f91f
1 changed files with 16 additions and 0 deletions

View File

@ -214,6 +214,7 @@ module StopTime::Models
# [name] description (String)
# [fixed_cost] fixed cost of the task (Float)
# [hourly_rate] hourly rate for the task (Float)
# [vat_rate] VAT rate at time of billing (Float)
# [invoice_comment] extra comment for the invoice (String)
# [created_at] time of creation (Time)
# [updated_at] time of last update (Time)
@ -633,6 +634,21 @@ module StopTime::Models
end
end
class VATRatePerTaskSupport < V 1.94 # :nodoc:
def self.up
add_column(Task.table_name, :vat_rate, :float)
config = Config.instance
Task.all.each do |t|
t.vat_rate = config['vat_rate']
t.save
end
end
def self.down
remove_column(Task.table_name, :vat_rate)
end
end
end # StopTime::Models
# = The Stop… Camping Time! controllers