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
interval = Date.new(2020, 5, 1)..Date.new(2020, 6, 7) | |
module FixStuckShipments | |
FINAL_STATES = %w[ | |
shipped | |
canceled | |
].freeze | |
SHIPMENT_STATUS_MAP = { | |
'Complete' => 'shipped', |
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
# Get Status | |
get_status = -> (po_number) do | |
r = Supplier::Alphabroder::OrderStatusV2::GetOrderStatus.new.call(po_number) | |
doc = Nokogiri::XML(r.body) | |
nodes = doc.xpath("//order[not(shipstatus)]") | |
pnode = Supplier::Alphabroder::OrderStatusV2::OrderXmlNode.new(nodes) | |
pnode.ship_method_nodes.map do |n| | |
{ | |
number: n.shipper_number, |
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
# May | |
interval = Date.new(2020, 5, 1).all_month | |
stock_location_ids = Spree::Supplier.alphabroder.stock_location_ids | |
order_ids = Spree::Order.joins(:shipments).where( | |
completed_at: interval, | |
spree_shipments: { | |
state: 'processing', | |
stock_location_id: stock_location_ids | |
} |
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
# frozen_string_literal: true | |
module AssignmentsBenchmark | |
@@zip = '02026' | |
@@orders = {} | |
@@ready = false | |
def self.prepare | |
generator = OrderGenerator.new(500) | |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |