From 808b09f91fbfa6cbd79b6c31c6c10b77c588998d Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Fri, 28 Sep 2012 10:09:42 +0200 Subject: [PATCH] Add vat_rate field to the Task model --- stoptime.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/stoptime.rb b/stoptime.rb index be269c3..c29fc21 100644 --- a/stoptime.rb +++ b/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