Add Inventory Flow tab with quantity tracking and date filtering
Resolves #5249
Description
Quantity in has donations, purchases, adjustments that increase the inventory. Quantity out has distributions and adjustments that decrease the inventory
Kit allocations result in quantity in for the kit, and quantity out for the components
See the current Inventory In and Inventory Out tabs for details
Change is Quantity In minus Quantity Out. Negatives are presented in red.
Include anything else we should know about. -->
Type of change
- New feature (non-breaking change which adds functionality)
How Has This Been Tested?
go to /storage_locations page
Screenshots
notes for my functional testing (which won't be until at least tomorrow): beyond basic checks, check what happens if we try to go back before the first snapshot. Are we already constraining this / should we be and how are we communicating that otherwise. (this may require using prod data to test well) (Note: thinking about it - if we base this on eventables (which is probably the best bet ) we should constrain it to start no earlier than the first snapshot)
@AlexeyKasianenko Thank you for this! I'm going to add things I notice here on-the-go while I test. I'm not looking at the code, just trying out the functionality.
1/ First thing is that I'm afraid the performance is slow. I'm checking it with the production data for one of active bank. Using the production branch, the storage location view comes up in 4 seconds, on your current branch it takes 89 seconds.
2/ You're showing items that aren't on the inventory in / out tabs (again, this is testing with production data). I'm about 90% sure that they don't show inactive items, if so you should do the same.
3/ If I update the date range and click "filter", it's going back to the first tab. This is potentially confusion/annoying for our users. Let's have it stay on the same tab.
4/ The current "all time" is not working properly (with all time, in plus out should equal inventory on the first page) with production data. However, I want to check with the senior team about whether we should just constrain the date range-- i suspect that's going to make sense.
5/ When I did a "this year" in the date range, and filtered (with production data), when I returned to the page there was only one item. I know there are more. I'll try to recreate that with the seed data. (Edit: no immediate luck -- I'll need to poke further on this one)
@awwaiid I would counter that we want to hard-wire that the start date can be no earlier than 2024-09-01. I, for one, don't want to have to work more than a full year of data if I'm checking into something that happened 2 weeks ago.
Hmmm.
To start testing this out, signed in as [email protected], I made a donation of 22 Adult Briefs (Medium/Large) to Bulk Storage Location.
I then went to the Inventory Flow tab, and selected the date range "Today".
I expected that there would be an entry for Adult Briefs (Medium/Large) with Quantity In of 22.
There was not.
Hey @cielf. Fixed that
Hey, @cielf , we discussed with stakeholders on Wednesday and they said that it makes sense to include adjustments, so that all totals are represented
@AlexeyKasianenko ok ONE more change! Everything looks good, but we forgot to include the Audit event type. Could you add that in too? I manually verified that all the other cases work great.
@awwaiid added Audits