msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
23 stars 14 forks source link

Supplier Returns: unable to delete Quantity to Return if the Quantity Available for Return is a decimal number #5121

Open marthakeezy opened 1 month ago

marthakeezy commented 1 month ago

What went wrong? 😲

I am playing around with Return Items, and it seems you are not able to delete the Quantity to Return number entered if the Quantity Available for Return is a decimal number.

For example, I have 20.64 units available for return.

On a related note, yes to issues #4214 and #4179 - we should be able to enter decimal numbers in Returns and other areas of omSupply :)

Video of the behaviour is uploaded here

Expected behaviour 🤔

If the user is not able to enter decimal values in those cells (for now), there should be a clear behaviour to what the system does and also they should be able to still edit the cell if needed.

How to Reproduce 🔨

Steps to reproduce the behaviour:

  1. Go to Replenishment -> Supplier Returns
  2. Create a Return -> make sure it's for an item that has decimal values in stock. It might be easier to select an item, set quantity available to something decimal and then intentionally choose it for the return you are testing.
  3. Try entering the scenarios described above (e.g. same number, whole number, number higher, decimal number) - then try to edit the cell and remove the number
  4. See error

Your environment 🌱

roxy-dao commented 1 month ago

The functionality has not been implemented yet as you have noted so this is expected behaviour for now until decimal packs is implemented for returns. The max number you can input is however much you have.

I've also tried changing input and it works fine for me

lache-melvin commented 1 month ago

I can replicate this for stock lines with 2dp or more.

As Roxy said, we haven't implemented support for decimal packs sizes in returns/most of the app yet, so you shouldn't be able to enter decimal values, except that when you enter a large number, it defaults to max quantity available.

I don't think decimal packs support is on the immediate horizon, so I think we should get in a quick fix to allow a user to clear the field after it defaults to the decimal max (particularly on android, where highlighting the whole cell is hard)

Either - if total is 20.64, only allow return of 20, or allow backspacing of decimals as an "incomplete" value?

marthakeezy commented 1 month ago

Yes, until the functionality for decimal numbers is implemented, my only concern is that users should be able to backspace the value entered 🙏🏼

andreievg commented 1 month ago

Short term solution, max value on those inputs to be floored max available, we have other issues to solve it properly