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

Updates for Stock Value Report #6150

Closed
jmcameron opened this issue Dec 9, 2021 · 0 comments · Fixed by #6504
Closed

Updates for Stock Value Report #6150

jmcameron opened this issue Dec 9, 2021 · 0 comments · Fixed by #6504
Assignees

Comments

@jmcameron
Copy link
Collaborator

jmcameron commented Dec 9, 2021

Stock > Report > [Stock] Stock Value Report

There seems to be a bug: If you do the report in the enterprise currency, some stock articles are marked in pink. But if you do the report in some other currency different rows are shaded pink!

Suggestions

  • Fix name: [Stock] Stock Value Report => Stock Value Report
  • The currency should default to the enterprise currency
  • The report is very slow. With the Vanga database and on my laptop, it takes nearly 20 seconds to generate the report.
  • The depot and currency are not cached for this report, so they are cleared every time the report is revisited.
  • It is not clear why some rows are highlighted in pink. The report needs to be fixed or updated to make this clearer (perhaps add a column with status: near expiration/out of stock/etc). Notice the first two rows have different colors but otherwise seem similar (eg, 0 count):
    image
  • If the "Exclude inventories with zero stock value" option is selected, it might be a good idea to add a footnote at the end of the report indicating that.
@jniles jniles self-assigned this Apr 6, 2022
jniles added a commit to jniles/bhima that referenced this issue Apr 6, 2022
This commit fixes various components of the stock value report cited in
issue IMA-WorldHealth#6150.  Notably, the query now uses the stock_movement_status
table to pull in the quantities in stock for a given depot and loads the
stock_value table to get the value of the items in stock.  This speeds
the query up signficantly.

Closes IMA-WorldHealth#6150.
bors bot added a commit that referenced this issue Apr 7, 2022
6504: fix(stock): improve Stock Value Report r=jmcameron a=jniles

This PR fixes various components of the stock value report cited in issue #6150. 

Notably, the query now uses the `stock_movement_status` table to pull in the quantities in stock for a given depot and loads the
`stock_value` table to get the value of the items in stock.  This speeds the query up significantly.

Miscellaneous changes:

- The report now defaults to the enterprise currency.
- The majority of the values are now cached, except for the date that defaults to today.
- Performance improvements as cited above.
- I've removed the coloration entirely.  

Closes #6150.

Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
@bors bors bot closed this as completed in aa59dc6 Apr 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants