Skip to content
Snippets Groups Projects
Commit 4ea7215e authored by Per Cederqvist's avatar Per Cederqvist
Browse files

Added RecurringItemRange::spread_out.

parent bd706c91
No related branches found
No related tags found
No related merge requests found
......@@ -13,5 +13,8 @@
<p><label for="recurring_item_range_enddate">Enddate</label><br/>
<%= date_select 'recurring_item_range', 'enddate', :include_blank => true %></p>
<p><label for="recurring_item_range_spread_out">Spread out</label><br/>
<%= check_box 'recurring_item_range', 'spread_out' %></p>
<!--[eoform:recurring_item_range]-->
......@@ -13,6 +13,7 @@ class CreateRecurringItems < ActiveRecord::Migration
RecurringItem.create :description => "Pers lön"
RecurringItem.create :description => "Pers lön 10"
RecurringItem.create :description => "Telia"
RecurringItem.create :description => "Mat"
end
end
......
......@@ -8,12 +8,14 @@ class CreateRecurringItemRanges < ActiveRecord::Migration
t.column :startdate, :date
t.column :enddate, :date
t.column :schedule_id, :integer
t.column :spread_out, :boolean
end
if RAILS_ENV == "development"
pay = RecurringItem.find_by_description("Pers lön").id
pay10 = RecurringItem.find_by_description("Pers lön 10").id
telia = RecurringItem.find_by_description("Telia").id
food = RecurringItem.find_by_description("Mat").id
month = Schedule.find_by_name("Månad").id
quarter = Schedule.find_by_name("Kvartal").id
......@@ -22,28 +24,39 @@ class CreateRecurringItemRanges < ActiveRecord::Migration
:amount => "22200",
:startdate => Date.civil(2006, 8, 25),
:enddate => Date.civil(2006, 10, 24),
:schedule_id => month)
:schedule_id => month,
:spread_out => false)
RecurringItemRange.create(:recurring_item_id => pay10,
:amount => "-3700",
:startdate => Date.civil(2006, 8, 25),
:enddate => Date.civil(2006, 10, 24),
:schedule_id => month)
:schedule_id => month,
:spread_out => false)
RecurringItemRange.create(:recurring_item_id => pay,
:amount => "23200",
:startdate => Date.civil(2006, 10, 25),
:schedule_id => month)
:schedule_id => month,
:spread_out => false)
RecurringItemRange.create(:recurring_item_id => pay10,
:amount => "-3900",
:startdate => Date.civil(2006, 10, 25),
:schedule_id => month)
:schedule_id => month,
:spread_out => false)
RecurringItemRange.create(:recurring_item_id => telia,
:amount => "-1200",
:startdate => Date.civil(2006, 9, 10),
:schedule_id => quarter)
:schedule_id => quarter,
:spread_out => false)
RecurringItemRange.create(:recurring_item_id => food,
:amount => "-4000",
:startdate => Date.civil(2006, 8, 25),
:schedule_id => month,
:spread_out => true)
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment