Add vat_rate field to the Task model
This commit is contained in:
parent
52e23a927a
commit
808b09f91f
1 changed files with 16 additions and 0 deletions
16
stoptime.rb
16
stoptime.rb
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue