It is possible to make Stock on Hand a negative number

Description

When testing and I noticed that it is possible to make Stock on Hand a negative number. As for now it is a bit unclear what exactly causes the bug. A few files attached for better understanding of the issue.

Reproducing steps:

  1. Mind that this is not the only way to reproduce this bug. The SoH value can be influenced through Requisitions, Physical Inventory, Adjustments etc.

  2. Redeploy application to UAT server to make sure you operate on the same numbers

  3. Log in as an administrator

  4. Go to Stock Management → Adjustments → Family Planning → choose Levora lot MA2017A and submit 13 lost items

  5. Go to Stock Management → Issue → Family Planning → Levora MA2017A → transfer out 11 items to Balaka

  6. Go to Stock Management → Stock on Hand → Family Planning → everything should be OK in numbers, check if it is

  7. Go to Stock Management → Physical Inventory → Family Planning → set everything just as it is except for Levora lot MA2017A (set it to 50 instead of 66, no reasons)

  8. Go to Stock Management → Stock on Hand → notice diifferent Stock on Hand’s values

  9. Go to Stock Management → Issue → Family Planning → transfer out to Balaka 40 items (more than in visible SoH) of Levora lot MA2017A

  10. Go to Stock Management → Stock on Hand → notice how confusing the numbers are looking now

  11. Go to Stock Management → Adjustments → SoH should be e negative number → notice that you can declare 8 damaged items but not 12 (different SoH values are in use now - visible and the real one)

Acceptance criteria:
1. Stock on Hand cannot be a negative number at any time and it should always show the correct value

Environment

None

Assignee

Klaudia Pałkowska

Reporter

Paweł Pinker

Story Points

8

Time tracking

32h

Epic Link

Components

Sprint

None

Fix versions

Priority

Critical
Configure