openfoodnetwork
openfoodnetwork copied to clipboard
[BO Orders] Update Entreprise fees when decreasing quantity
What? Why?
- Closes #12158
The order used to not update when decreasing quantity of a line item in a BO order.
What should we test?
- Log as hub owner/admin
- Click 'Administration'
- Set up an order cycle with an enterprise fee per line item or check that the order cycle your are testing has Enterprise fees (Cf. https://guide.openfoodnetwork.org/basic-features/shopfront/enterprise-fees )
- Create a back office order for this order cycle.
- Decrease the quantity of line item (Edit icon, increase, then save icon)
- Fee value is updated
Release notes
Changelog Category (reviewers may add a label for the release notes):
- [ ] User facing changes
- [X] API changes (V0, V1, DFC or Webhook)
- [X] Technical changes only
- [ ] Feature toggled
The title of the pull request will be included in the release notes.
Dependencies
Documentation updates
Hello @drummer83 , Could it be possible to relaunch the tests ( there is no fail for me locally)
Hi @cyrillefr, Thanks for another PR!
Below you can see an order where I increased the amount from 3 to 4 items and decreased it back to 3. All fees were immediately applied correctly.
This is all good, moving to Ready To Go for a final check-in with our product team.
Thanks again! 🙏
@openfoodfoundation/train-drivers-product-owners Could you please confirm that this was in deed a bug? It came to my mind that it might be a feature to only apply updated fees immediately when the amount is INCREASED. Changing an order and increasing the amount adds additional transport, packing and so on. However, changing an order and DECREASING the amount, does not always reduce transport and packing because maybe the item has already been transported and packed. So the fees would remain unchanged until the button 'Update and recalculate fees' is pressed. Do you think this was intentional? It seems quite complex and intransparent to me though.
If you think it's good that we changed this behaviour, then please go ahead and merge. Thanks!
I don't know if @kirstenalarsen or @tschumilas remember something around this?
I think we want all fees to change whenever anything on an order is changed. In this example - if I decrease an item from an order, then the fee (admin fee, transport fee...) associated with that item should also change. So yes, I'd say this was a bug and thanks for fixing it.