Create an order with a line item that has a quantity > 1
Create a split shipment for that line item
Examine item_cost for each of the shipments
Expected behavior
shipment.item_cost should be the total of the items included only in the given shipment
Actual behavior
shipment.item_cost includes the entire cost of all line items associated with the shipment
System configuration
Solidus Version:
2.6.0
Extensions in use:
n/a. This is solidus_core:
Notes
spree_shipments to spree_line_items is a many-to-many relationship via spree_inventory_units. Spree::Shipment#item_cost as written is only correct when there is a one (shipment) to many (line item) relationship:
Steps to reproduce
item_cost
for each of the shipmentsExpected behavior
shipment.item_cost
should be the total of the items included only in the given shipmentActual behavior
shipment.item_cost
includes the entire cost of all line items associated with the shipmentSystem configuration
Solidus Version:
Extensions in use: n/a. This is solidus_core:
Notes
spree_shipments
tospree_line_items
is a many-to-many relationship viaspree_inventory_units
.Spree::Shipment#item_cost
as written is only correct when there is a one (shipment) to many (line item) relationship:https://github.com/solidusio/solidus/blob/853bc56249861803388eacfe2151b79ca8e125fa/core/app/models/spree/shipment.rb#L187-L189