Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spree::FulfilmentChanger stock allocation fix #2908

Merged

Conversation

spaghetticode
Copy link
Member

@spaghetticode spaghetticode commented Oct 10, 2018

When splitting a shipment item to the same stock location, if the stock location has currently zero availability for that product then the state of the target shipment inventory unit should be determined by the original shipment inventory unit state:

  • when originally backordered, as there is still no available stock, then it should remain backordered

  • when originally on hand, then it should remain on hand, as there is no actual stock movement in this case (the fact that the stock location now has no availability for that product is not actually relevant)

A clarifying example for the second scenario:

  • stock location L has 1 unit for product A
  • customer purchases 1 unit of product A
  • the order is created with product A on hand
  • product A is automatically included in shipment S
  • stock location L is now empty (0 units) for product A
  • if the admin splits product A from shipment S to a new shipment from the very same stock location L, product A should remain on hand also in the new shipment

@spaghetticode spaghetticode force-pushed the fix_fullfilment_charger_allocation branch from 7f71d0e to 002d785 Compare October 11, 2018 14:14
@kennyadsl
Copy link
Member

@spaghetticode can you please rebase against master? Failures should go away

@spaghetticode spaghetticode force-pushed the fix_fullfilment_charger_allocation branch from 002d785 to f966575 Compare October 19, 2018 16:06
Copy link
Member

@kennyadsl kennyadsl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense, just left a question, thanks!

core/app/models/spree/fulfilment_changer.rb Outdated Show resolved Hide resolved
When splitting a shipment item to the same stock location, if the stock
location has currently zero availability for that product then the state of
the target shipment inventory unit should be determined by the original
shipment inventory unit state:

* when  originally backordered, as there is still no available stock, then it
  should remain backordered

* when originally on hand, then it should remain on hand, as there is no actual
  stock movement in this case (the fact that the stock location now has no
  availability for that product is not actually relevant)

A clarifying example for the second scenario:

* stock location L has 1 unit for product A
* customer purchases 1 unit of product A
* the order is created with product A on hand
* product A is automatically included in shipment S
* stock location L is now empty (0 units) for product A
* if the admin splits product A from shipment S to a new shipment from the
  very same stock location L, product A should remain on hand also in the new
  shipment
@spaghetticode spaghetticode force-pushed the fix_fullfilment_charger_allocation branch from f966575 to 0921e00 Compare October 19, 2018 16:30
Copy link
Contributor

@jacobherrington jacobherrington left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kennyadsl kennyadsl merged commit 9b6ad06 into solidusio:master Nov 26, 2018
@kennyadsl
Copy link
Member

Thanks!

@kennyadsl kennyadsl deleted the fix_fullfilment_charger_allocation branch November 26, 2018 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants