mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
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.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user