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) } |
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 | |
def cancel_price_escalation(account, location) | |
TenantService.switch_tenant_with_location_uuid(location.uuid) | |
prs = account.primary_reservations.active.select { |res| res.location_id == location.id } | |
prs.map{ |res| res.update_attributes(annual_escalator_rate: nil, escalation_date: nil) } | |
end | |
account = Account.find_by_short_code('2XL9P8') | |
raise 'Incorrect Account' unless account.name == 'IAIelta' |
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 | |
mairap = Account.find_by short_code: '5KH06R' | |
res = mairap.primary_reservations.active.find_by(description: 'DD34') | |
res.commitment_term.archive! | |
end |
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 | |
ActiveRecord::Base.transaction do | |
TenantService.switch_to_rest_of_world_tenant | |
office_of_baby_uuid = '8083d9a1-ec36-480f-b257-31fd67cd0001' | |
office_of_baby = Account.find_by_uuid office_of_baby_uuid | |
oob_primary_res = office_of_baby.primary_reservations.active.last | |
oob_conf_allotment = oob_primary_res.conference_room_allotments.active.last |
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 | |
account = Account.find_by_short_code '7RFQTX' | |
location = Location.find_by_code 'ATL02' | |
price = account.anywhere_reservations.active.first.price | |
start_jan_date = Date.today.next_month.beginning_of_month | |
end_feb_date = Date.today.next_month.next_month.end_of_month | |
full_discount_for_two_months = { type: "discount", started_on: start_jan_date, ended_on: end_feb_date, price: -price } |
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 | |
def cancel_price_escalation(account, location) | |
TenantService.switch_tenant_with_location_uuid(location.uuid) | |
prs = account.primary_reservations.active.select { |res| res.location_id == location.id } | |
prs.map{ |res| res.update_attributes(annual_escalator_rate: nil, escalation_date: nil) } | |
end | |
account = Account.find_by_short_code('1VHUN0') | |
raise 'Incorrect Account' unless account.name == 'UBQ' |
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('HUJW06') | |
raise 'Incorrect Account' unless account.name == 'Shopic' | |
location = Location.find(98) | |
raise 'Incorrect Location' unless location.name == 'Ibn Gabirol' | |
prs = account.primary_reservations.active.select { |res| res.location_id == location.id } |
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
#!/bin/bash | |
from=( | |
FeeHelper | |
InvoiceCorrection | |
InvoiceReverser | |
InvoiceOpener | |
LineItemReverser | |
TaxHelper | |
VatHelper |
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
# JIRA: REVENG-149 | |
# Remove Sidekiq enterprise schedules so late payment notices do not get sent | |
# | |
# When Sidekiq enterprise creates a cron job, it sets the keys loop-UNIQUE-ID, loops-UNIQUE-ID | |
# This keys are not getting cleaned up from Redis when we remove the cron jobs from codebase | |
# and restart sidekiq and app servers. | |
require 'sidekiq/api' | |
begin |
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
# cancel move out for office 337 in Yangping Luy for 上海唐艾文化传播有限公司 - KIB7YC | |
begin | |
Rails.logger.info "JIRA REVENG-121 starting to cancel move out for Office 337 for Gimbal EUAETK" | |
TenantService.switch_to_apac_tenant | |
reservable = Account.find_by_short_code("KIB7YC").primary_reservations.map(&:reservable).detect { |res| res.type == "Office" && res.name == "337" } | |
pr = Account.find_by_short_code("KIB7YC").primary_reservations.where("reservable_id = #{reservable.id}").first | |
pr.ended_on = nil | |
pr.save! | |
Rails.logger.info "JIRA REVENG-121 done canceling move out for Office 337 for Gimbal EUAETK " | |
end |