Last active
August 12, 2020 03:57
-
-
Save camhine/22e849dfc2f699203b317dc42a866de2 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
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Looks good.