Last active
December 29, 2017 21:07
-
-
Save avidas/68ddfebda9092b7594ff600c94f2de9a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
TenantService.switch_to_rest_of_world_tenant | |
account = Account.find_by_short_code '6HZMS1' | |
primary_reservations = account.primary_reservations.active.where(description: ['08-113', '08-100', '08-109']) | |
# Set commitment terms | |
start_date = Date.today.next_month.beginning_of_year | |
months = 12 | |
primary_reservations.map{|res| CommitmentTermService.new(res).create(months, start_date) } | |
# Update escalation dates | |
#08-113: 11,200 until 02-01-2019 | |
pr113 = primary_reservations.find { |p| p.description == '08-113' } | |
pr113.update_attributes(escalation_date: Date.parse("2019-02-01"), price: 11200.0) | |
#08-100: 67, 322 until 01-01-2019 | |
pr100 = primary_reservations.find { |p| p.description == '08-100' } | |
pr100.update_attributes(escalation_date: Date.parse("2019-01-01"), price: 67322.0) | |
#08-109: 15, 833 until 01-01-2019 | |
pr109 = primary_reservations.find { |p| p.description == '08-109' } | |
pr109.update_attributes(escalation_date: Date.parse("2019-01-01"), price: 15833.0) | |
end |
π
π
π
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
π