openfoodnetwork
openfoodnetwork copied to clipboard
Fees don't automatically update when items go out of stock for subscription orders
Description
A user raised that subscription orders containing items that had gone out of stock were not updating to reflect the correct enterprise fees and customers were therefore being overcharged on fees.
This is similar to issue 6363 which appears to have been partly resolved i.e. out of stock items no longer show in edit order, but enterprise fees for out of stock items are persisting.
Expected Behavior
Subscription orders should automatically update to reflect the enterprise fees associated with products in stock at the time the subscription order is generated.
Actual Behaviour
Subscription orders are charged the enterprise fees applying to the original subscription and don't reflect items in stock when orders are generated.
Steps to Reproduce
- Create an enterprise sales fee with a flat rate per item (e.g. 50p per item)
- Create a subscription with two items with stock counts >0
- Create an order cycle where the dates are in the future with the schedule of the subscription and applying the sales fee of flat rate per item on outgoing products
- Adjust stock levels of one item in the subscription to 0
- Adjust order cycle dates to now to trigger subscription order generation
- Go to edit order screen for generated subscription order and observe 1 item in order, and 2 sales fees applied (e.g. £1 total)
N.B. I have just used the flat rate fee for ease of description, this also applies to flat percent etc fees.
Animated Gif/Screenshot
Enterprise sales fee flat rate per item 50p:
Subscription with two items:
Inventory showing one item in stock, one out of stock:
Subscription order generated showing one item and sales fee charged twice (2 x 50p):
Workaround
From edit order screen can click 'update & recalculate fees' to correct fees.
Severity
bug-s3: a feature is broken but there is a workaround The workaround is not immediately obvious to user and is often missed meaning customers are incorrectly charged and manual refunds have to be made. This is particularly frustrating for users with multiple subscriptions.
Your Environment
- Version used: UK prod
- Browser name and version:
- Operating System and version (desktop or mobile):