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

Information in stock items vs stock lots #4795

Open
jmcameron opened this issue Aug 6, 2020 · 2 comments
Open

Information in stock items vs stock lots #4795

jmcameron opened this issue Aug 6, 2020 · 2 comments

Comments

@jmcameron
Copy link
Collaborator

jmcameron commented Aug 6, 2020

In working through issue #4749 (see PR #4792), in the process of recording a Stock Exit, the user selects the stock inventory item that they want to exit and then they select which lots of the item to process. In the first step, where we have a stock item that has been selected, it has fields regarding expiration date and lifetime. But don't those apply only to stock lots? Should these attributes be in the stock item since some of the stock lots for that item may be expired and some may not?

I suggest removing these fields (expiration date and lifetime) from stock items and only have them available to specific stock lots.

In the process, it would probably be good to review all the fields in stock inventory items to make sure that they apply to the item regardless of which lot is involved.

@mbayopanda
Copy link
Collaborator

image

Actually, when we distribute stock with the stock exit module we distribute stock by lots and the user has to know when the lot that he selected will expire (lifetime).

The behavior that you describe is a bit like with the stock entry module but with the stock exit module since we distribute lots, having information about lots lifespan is not bad for users of stocks

@jmcameron
Copy link
Collaborator Author

Thanks Bruce. I agree the lot info needs this, definitely!

I was confused. It seemed like the inventory item (which could include several different lots) had the lifetime info, etc. But I just went back and tested and I see that it is really a naming issue in the code that confused me. In Bhima/server/controllers/stock/core.js around line 400 (https://github.com/IMA-WorldHealth/bhima/blob/master/server/controllers/stock/core.js#L400), we loop through "inventory" and deal with inventory.lifetime, etc. But these are actually inventory items that are for SPECIFIC lots, as far as I can tell. So if you agree that these are actually lots (not parent inventory items), I suggest you close this issue. We could consider changing the 'inventory' name to 'lot' in this loop.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants