mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Remove conditionals related to Config.track_inventory_levels, this config is always true in OFN
This commit is contained in:
@@ -172,7 +172,7 @@ module Spree
|
||||
end
|
||||
|
||||
def line_items
|
||||
if order.complete? && Spree::Config[:track_inventory_levels]
|
||||
if order.complete?
|
||||
order.line_items.select { |li| inventory_units.pluck(:variant_id).include?(li.variant_id) }
|
||||
else
|
||||
order.line_items
|
||||
|
||||
@@ -17,15 +17,11 @@ module OrderManagement
|
||||
def default_package
|
||||
package = OrderManagement::Stock::Package.new(stock_location, order)
|
||||
order.line_items.each do |line_item|
|
||||
if Spree::Config.track_inventory_levels
|
||||
next unless stock_location.stock_item(line_item.variant)
|
||||
next unless stock_location.stock_item(line_item.variant)
|
||||
|
||||
on_hand, backordered = stock_location.fill_status(line_item.variant, line_item.quantity)
|
||||
package.add line_item.variant, on_hand, :on_hand if on_hand.positive?
|
||||
package.add line_item.variant, backordered, :backordered if backordered.positive?
|
||||
else
|
||||
package.add line_item.variant, line_item.quantity, :on_hand
|
||||
end
|
||||
on_hand, backordered = stock_location.fill_status(line_item.variant, line_item.quantity)
|
||||
package.add line_item.variant, on_hand, :on_hand if on_hand.positive?
|
||||
package.add line_item.variant, backordered, :backordered if backordered.positive?
|
||||
end
|
||||
package
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user