Errors when you enter the decimal values in the stocktakes #2905
Replies: 12 comments 1 reply
-
Until we know why decimal pack sizes are possible in mSupply - we will prevent decimals in pack sizes for open mSupply. |
Beta Was this translation helpful? Give feedback.
-
In the meantime should we update the front-end to only accept integer input? |
Beta Was this translation helpful? Give feedback.
-
Think we don't require |
Beta Was this translation helpful? Give feedback.
-
Some relevant discussion in HSH because we ended up having to support decimal pack sizes after initially gunning for integer in uploaded tenders from mSupply https://github.com/msupply-foundation/health-supply-hub/issues/637
This will affect migration of mobile and desktop data to open mSupply as well - open mSupply will fundamentally just lose data if we migrate a store on a system using decimal values for pack size. Reiterating the second point above, things that are in litres really cannot be easily fixed by converting the decimal L values to integer mL values, it affects all stock and transaction history throwing quantities and monetary values out of whack too. @Gwalior-84 said there were reasons, IDK if they're the ones I've mentioned here so he should add them if they don't. While HSH didn't require a KDD for this, I think open mSupply absolutely should seeing as common sense is that pack size should be integer! |
Beta Was this translation helpful? Give feedback.
-
Just to point out that we're only talking about decimal pack sizes here, not decimal number of packs (although that was also an issue for HSH it seems?). Fractional number of packs is more easily avoided - e.g. repack a bottle of 100 tablets to 100 packs of 1; as @Chris-Petty has pointed out, migrating from fractional pack sizes is not so easy... However, even fractional packs can become a bigger issue if the original item unit has been defined as a multiple of the smallest possible unit e.g. if dispensing sites are only added on later after the initial implementation was designed only for warehouses. Unfortunately, switching from integers to floats in Rust is not trivial, but I'm not sure that we can continue to restrict either of these fields to integer-only? The alternative is to enforce migration for any sites which have fractional values for either before they switch to omSupply, but that doesn't account for any fractional values that are in HSH - I don't know much about how that integrates with the rest of mSupply, but I'd imagine that the same customers who want fractional values there will also want them in omSupply? |
Beta Was this translation helpful? Give feedback.
-
Can our incoming sync code recognise fractions in pack size, set pack size to 1 and then adjust number of packs accordingly ? (if this is done for stock lines and invoice lines I think it works ¯_(ツ)_/¯ ? For the use case where an item is defined as 1000ml at central level, and lower levels uses like 10ml, pack variants would actually work quite well (it's UI layer translations, to make it look like base unit is 10ml, and behind the scenes fractional number of packs are used) Originally I was quite anti decimal number of packs, but it seems like the simplest solution for those real use cases, however I think fractional pack size should be avoided, unless absolutely necessary, so would vote against it in omSupply. |
Beta Was this translation helpful? Give feedback.
-
Yep, go for it! Thanks |
Beta Was this translation helpful? Give feedback.
-
Actually, this is already done in #2794. Should we close this issue or leave it open for the wider discussion of fractional pack sizes / migrating them from mSupply? |
Beta Was this translation helpful? Give feedback.
-
@CarlosNZ I think close this, but we need a new issue for a KDD deciding what we're going to do for making legacy data with decimal pack sizes migrate-able to open mSupply. @andreievg might want to start that off, I'd say with 1 option being move from integer to decimal type for packsize, and 2 what you're suggesting? Or I can and you can fill in your one. |
Beta Was this translation helpful? Give feedback.
-
Righto, have linked to #2794 so will close when that's merged :) |
Beta Was this translation helpful? Give feedback.
-
Once pack variant is merged, and that alternative is can be shown |
Beta Was this translation helpful? Give feedback.
-
And https://github.com/msupply-foundation/org-issues/discussions/40 for where we got to 18 months ago. |
Beta Was this translation helpful? Give feedback.
-
What went wrong? 😲
Screen.Recording.2024-01-24.at.12.49.27.mov
Expected behaviour 🤔
How to Reproduce 🔨
Steps to reproduce the behaviour:
Your environment 🌱
Beta Was this translation helpful? Give feedback.
All reactions