mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Move Shipment#line_items to private
This commit is contained in:
@@ -183,15 +183,6 @@ module Spree
|
||||
@scoper ||= OpenFoodNetwork::ScopeVariantToHub.new(order.distributor)
|
||||
end
|
||||
|
||||
def line_items
|
||||
if order.complete?
|
||||
inventory_unit_ids = inventory_units.pluck(:variant_id)
|
||||
order.line_items.select { |li| inventory_unit_ids.include?(li.variant_id) }
|
||||
else
|
||||
order.line_items
|
||||
end
|
||||
end
|
||||
|
||||
def finalize!
|
||||
InventoryUnit.finalize_units!(inventory_units)
|
||||
manifest.each { |item| manifest_unstock(item) }
|
||||
@@ -292,6 +283,15 @@ module Spree
|
||||
|
||||
private
|
||||
|
||||
def line_items
|
||||
if order.complete?
|
||||
inventory_unit_ids = inventory_units.pluck(:variant_id)
|
||||
order.line_items.select { |li| inventory_unit_ids.include?(li.variant_id) }
|
||||
else
|
||||
order.line_items
|
||||
end
|
||||
end
|
||||
|
||||
def manifest_unstock(item)
|
||||
stock_location.unstock item.variant, item.quantity, self
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user