msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
23 stars 15 forks source link

Items not merged create confusion-Expiring items Report #4846

Open regotaina opened 1 month ago

regotaina commented 1 month ago

What went wrong? 😲

While looking at R&R reports with @louisaw123 and @richardmoizeau they noticed that if items with same expiry date and same batch are not merged (due to item origin being 'outbound shipment' and 'inventory adjustments', for example), the 'Expiring Items Report gets really confusing because some of the metrics are not correct.

In the screenshot below, 'Items at risk' number won't make sense because the SOH is skewed, due to items not being merged.

Screenshot 2024-09-24 at 12 57 55β€―PM

Expected behaviour πŸ€”

Items with same batch and expiry number can be merged to 1 unique stock line

How to Reproduce πŸ”¨

Steps to reproduce the behaviour:

  1. Go to 'Inbound shipment' from supplier A and create a shipment for an item with batch number A123 and expiry date 05/2025
  2. Confirm shipment as verified. Items will appear on stock.
  3. Now create an inbound return from a supplier B and add 50 units of this item with same batch and expiry date
  4. Now you will have 2 identical stock lines for this item, only difference being 1 from Supplier A and another from Supplier B

Your environment 🌱

richardmoizeau commented 1 month ago

I think this is pretty well explained, thanks Taina. Yes item with same batch/same expiry should definitely be merged in this report.

Djibouti was quite upset to see two or three line for the same item/batch/expiry in the dashboard and in general, I think that if there is no differentiator between 2 stocklines, they should be merged.

louisaw123 commented 1 month ago

Thanks @regotaina !

Add on to this "Items with same batch and expiry number can be merged to 1 unique stock line", I would expect this only if there are no other differences in the stock line (e.g., location, price, pack size which is not shown in this report - would suggest this to be added in, not sure if this should be a separate issue). If the only difference is how a stock is received in to the store, then these should not be appearing as separate lines.

louisaw123 commented 1 month ago

@richardmoizeau would you agree with those differences?

richardmoizeau commented 1 month ago

Add on to this "Items with same batch and expiry number can be merged to 1 unique stock line", I would expect this only if there are no other differences in the stock line (e.g., location, price, pack size which is not shown in this report - would suggest this to be added in, not sure if this should be a separate issue). If the only difference is how a stock is received in to the store, then these should not be appearing as separate lines.

@louisaw123, the expiring report should really be about one batch/expiry date. If there are > 1 stock line for one batch, then data should be aggregated (I'm talking about quantity: SoH, Stock at risk and possibly price data eg. total value at risk). Unsure it is useful to see other information such as the "source/supplier" in this report since the main objective is to know whether I have some stock at risk or not.

I suppose it is different when you talk about the "View stock" list where you should have one unique stock line if at least of the stock line's fields is different. However, I think OG gives users the ability to merge stock line so maybe something that could be added, regardless of the source or the pack size.

lache-melvin commented 1 month ago

Daily triage: I don't think we have a "merged" view of stock lines anywhere (it's either individual stock lines, or by item)

To do that properly would likely be a bigger piece of work that would need to be prioritised - but negatives on this report doesn't make much sense! Will leave for triage/refinement team for thoughts on short/long term solution πŸš€

louisaw123 commented 1 month ago

Add on to this "Items with same batch and expiry number can be merged to 1 unique stock line", I would expect this only if there are no other differences in the stock line (e.g., location, price, pack size which is not shown in this report - would suggest this to be added in, not sure if this should be a separate issue). If the only difference is how a stock is received in to the store, then these should not be appearing as separate lines.

@louisaw123, the expiring report should really be about one batch/expiry date. If there are > 1 stock line for one batch, then data should be aggregated (I'm talking about quantity: SoH, Stock at risk and possibly price data eg. total value at risk). Unsure it is useful to see other information such as the "source/supplier" in this report since the main objective is to know whether I have some stock at risk or not.

I suppose it is different when you talk about the "View stock" list where you should have one unique stock line if at least of the stock line's fields is different. However, I think OG gives users the ability to merge stock line so maybe something that could be added, regardless of the source or the pack size.

@richardmoizeau I think being able to merge and separate lines would be good. Otherwise if the same batch/expiry stock is in multiple locations then you'll need to create a separate report to figure this information out like for knowing if you need to transfer stock between locations if that is important?

richardmoizeau commented 1 month ago

Daily triage: I don't think we have a "merged" view of stock lines anywhere (it's either individual stock lines, or by item) To do that properly would likely be a bigger piece of work that would need to be prioritised - but negatives on this report doesn't make much sense! Will leave for triage/refinement team for thoughts on short/long term solution πŸš€

It's not so much about the negative figure here, more the fact that for the same batch, one line says there is no stock at risk, and another says there are some but yep, another bug is that it shows a negative number where it should be 0

DhanyaHerath commented 1 month ago

Yup, agreed that this is a bug! Two thoughts: