solidusio / solidus

🛒 Solidus, the open-source eCommerce framework for industry trailblazers.
https://solidus.io
Other
4.97k stars 1.29k forks source link

Spree::Shipment#item_cost is wrong for split shipments #2919

Open joshua-honig opened 5 years ago

joshua-honig commented 5 years ago

Steps to reproduce

Expected behavior

Actual behavior

System configuration

Solidus Version:

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:

https://github.com/solidusio/solidus/blob/853bc56249861803388eacfe2151b79ca8e125fa/core/app/models/spree/shipment.rb#L187-L189

DanielePalombo commented 5 years ago

I'm on it