LocalOrbit / localorbit

Local Orbit is an open source web application and service that empowers food hubs to efficiently sell and distribute local food.
https://localorbit.com
MIT License
16 stars 11 forks source link

Error when merging an order with fractional order item quantity if that product has zero available inventory #3525

Open rbarreca opened 4 years ago

rbarreca commented 4 years ago

Describe the bug Validation failed error when merging an order with fractional order item quantity if that product has zero available inventory.

To Reproduce Steps to reproduce the behavior:

  1. Place an order for 1 lb Grape
  2. Place a second order for 1 lb Apple
  3. Update second order to be 0.5 lb Apple
  4. Go to products page and ensure Apple inventory = 0
  5. Merge second order to first order
  6. See error Validation failed: Unfortunately, there are only 0 Apples available.

Expected behavior Merges fine

Additional context Rollbar item: https://rollbar.com/LocalOrbit/Local-Orbit/items/698/occurrences/114031853146/