Account for purchased units in stock availability validation #1525

Closed
wants to merge 1 commit into
from

2 participants

@cyu
cyu commented May 9, 2012

The LineItem#stock_availability validation breaks admin when you try to increase/decrease the LineItem#quantity because the validation isn't account for units already purchased. So for example, reducing a purchased quantity from 5 to 4 when Variant#on_hand is 3 will result in a validation error, as well as increasing quantity on a purchased line item from 4 to 5 (buying one additional unit) under the same scenario.

@radar radar added a commit that referenced this pull request May 11, 2012
@cyu cyu Account for purchased units in stock validation
Merges #1525
b72ef9e
@radar radar added a commit that referenced this pull request May 21, 2012
@cyu cyu Account for purchased units in stock validation
Merges #1525
7c4cd77
@radar
Spree Commerce member

Looks like this got merged, I just didn't close this issue. Doing that right now :)

@radar radar closed this May 21, 2012
@radar radar added a commit that referenced this pull request May 29, 2012
@cyu cyu Account for purchased units in stock validation
Merges #1525
2859de2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment