Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balance column of stock history does not always show correct running total #122

Closed
jmiranda opened this issue Nov 16, 2015 · 1 comment
Closed
Assignees
Labels
type: bug Addresses unintended behaviours of the app
Milestone

Comments

@jmiranda
Copy link
Member

TL;DR This is a known issue with the Balance column of the Stock History report (only).

Unlike the quantity on hand calculation, the Balance column calculation is done inline (in the GSP - yuck) and contains somewhat hacky logic that does not take all edge cases into account. For example, the attached screenshot shows a Balance of 6500 on Aug 5. This is because the calculation does not zero out lot number 130221 that was recorded on May 18. The QoH calculation does handle this, but again the Stock History was hastily put together and needs some work.
amoxicillin 125mg 5ml powder for suspension 100ml bottle - stock history
amoxicillin 125mg 5ml powder for suspension 100ml bottle

@jmiranda jmiranda added the type: bug Addresses unintended behaviours of the app label Nov 16, 2015
@jmiranda jmiranda self-assigned this Nov 16, 2015
@jmiranda jmiranda added this to the 0.7.4 milestone Nov 16, 2015
@jmiranda
Copy link
Member Author

jmiranda commented Jun 23, 2016

Finally found some time to look into this issue. Fixed it by setting the balance to 0 whenever we encounter a product inventory transaction.

Screenshot shows that there's an extra 75,000 EA added to the balance. This means that there's an inventory item in the balance that's never 0'd out.
ferrous sulphate 200 mg tablet

Screenshot showing the bug has been fixed.
ferrous sulphate 200 mg tablet - fixed

jmiranda added a commit that referenced this issue Jun 23, 2016
…me quantity that should have been zero'd out
@jmiranda jmiranda modified the milestones: 0.7.10, 0.8.0 Jun 23, 2016
jmiranda added a commit that referenced this issue Jun 23, 2016
* #122: Fixed bug with the stock history balance column holding onto some quantity that should have been zero'd out

* bumped app version to 0.7.10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Addresses unintended behaviours of the app
Projects
None yet
Development

No branches or pull requests

1 participant