From dc7b6245fded8726ff160b8d457b2826c921e770 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Thu, 9 Jan 2025 13:32:43 +1100 Subject: [PATCH] Allow creating backorders before order cycle opens Admins may want to pre-process some orders manually for going public. And it's good to reserve stock for these. At some point in the future, the supplier may have an order cycle with its own times but the current FDC implementation allows orders at any time. --- app/jobs/amend_backorder_job.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/jobs/amend_backorder_job.rb b/app/jobs/amend_backorder_job.rb index 4b85beec15..883bed5328 100644 --- a/app/jobs/amend_backorder_job.rb +++ b/app/jobs/amend_backorder_job.rb @@ -27,9 +27,9 @@ class AmendBackorderJob < ApplicationJob user = order.distributor.owner urls = nil # Not needed to send order. The backorder id is the URL. FdcBackorderer.new(user, urls).send_order(backorder) - elsif order.order_cycle.open? + elsif !order.order_cycle.closed? - # We don't have an order to amend but the order cycle is open. + # We don't have an order to amend but the order cycle is or will open. # We can assume that this job was triggered by an admin creating a new # order or adding backorderable items to an order. BackorderJob.new.place_backorder(order)