Skip to content

Instantly share code, notes, and snippets.

@camhine
Last active August 12, 2020 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camhine/22e849dfc2f699203b317dc42a866de2 to your computer and use it in GitHub Desktop.
Save camhine/22e849dfc2f699203b317dc42a866de2 to your computer and use it in GitHub Desktop.
require "ctm_cancellations"
require 'ctm_daily_sales'
require 'ftp_transport'
(Date.parse("2020-07-07")...Date.current).each do |date|
puts "--------------------------------------------------------------------------------"
puts "Starting date: #{date}"
# Sales
extract = CtmDailySales.new(date)
puts "Exporting sales"
extract.export
puts "Transmitting sales"
FtpTransport.new(extract.filename, 'ctm').transmit
# Cancellations
puts "Exporting cancellations"
extract = CtmCancellations.new(Date.current)
extract.export
puts "Transmitting cancellations"
FtpTransport.new(extract.filename, 'ctm').transmit
puts "Done date: #{date}"
end
@odd13
Copy link

odd13 commented Aug 12, 2020

Looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment