openfoodnetwork icon indicating copy to clipboard operation
openfoodnetwork copied to clipboard

[BO Orders] Update Entreprise fees when decreasing quantity

Open cyrillefr opened this issue 11 months ago • 1 comments

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

cyrillefr avatar Mar 04 '24 20:03 cyrillefr

Hello @drummer83 , Could it be possible to relaunch the tests ( there is no fail for me locally)

cyrillefr avatar Mar 04 '24 21:03 cyrillefr

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.

grafik

grafik

grafik

This is all good, moving to Ready To Go for a final check-in with our product team.

Thanks again! 🙏

drummer83 avatar Mar 18 '24 16:03 drummer83

@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!

drummer83 avatar Mar 18 '24 16:03 drummer83

I don't know if @kirstenalarsen or @tschumilas remember something around this?

RachL avatar Mar 18 '24 21:03 RachL

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.

tschumilas avatar Mar 19 '24 12:03 tschumilas