senaite.core
senaite.core copied to clipboard
Reference definitions are not able to handle minus values
Description
When adding a % difference, the min and max values are mixed up. It looks like the calculation is done without taking into account the negative values and only adding them once the calculation is done.
Reproduction guide
I added 20% as the error, and it shows the min value as -24 and the max value as -36.
Observed behaviour
This is wrong, as -36 is less than -24.
Expected behaviour
The minimum value should be -36, and the maximum value should be -24.
Versions
- OS: Linux
Screenshot
Thanks @Lunga001 for reporting. Addressed with #2470.