Last active
October 5, 2020 21:53
-
-
Save gtan66/c976cfc9f3a66f36dd8a to your computer and use it in GitHub Desktop.
This file contains 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
def cancel_future_move_in_with_active_sd_invoice(account_uuid, office_num) | |
a = Account.find_by(uuid: account_uuid) | |
pr = a.primary_reservations.all.detect { |r| r.reservable.name == office_num } | |
sdr = pr.children.where(reservable: Resource.security_deposit).last | |
sdr.invoices.can_delete.each{|ei| ei.destroy! } | |
sdr.reload.archive! | |
ReservationService.new.archive!(pr, nil, true) | |
pr.reservable.occupancy.refresh | |
pr.reservable.occupancy.publish_entity(true) | |
end | |
#https://weworkengine.zendesk.com/agent/tickets/998 | |
#https://wework.atlassian.net/browse/SM-132 | |
cancel_future_move_in_with_active_sd_invoice("c602d499-a653-4fb5-9c6a-742642c84445", "1137") | |
#https://weworkengine.zendesk.com/agent/tickets/994 | |
#https://wework.atlassian.net/browse/SM-133 | |
cancel_future_move_in_with_active_sd_invoice("9138e1d0-c46f-0132-0b1d-5a0957d574b3", "405") | |
#https://wework.atlassian.net/browse/SM-131 | |
rake 'one_time:update_account_info[HMKWDU, IMN Holding B.V.]' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please remove this or make it a private gist as this is publicly searchable.