Test: Stock Movement Workflows - msupply-foundation/open-msupply GitHub Wiki

Before you get started

  • This test suit is designed to test in a single store environment (e.g. not between Store A and Store B, but rather all actions are taken within a single store). In future, the test suit will be expanded to include more scenarios.

  • When testing, you will mostly be checking 3 areas of Admin: Catalogue -> Items, Inventory -> View Stock and Ledger.

  • Catalogue -> Items can be found here (⬇️) - clicking on a specific item will lead you to the item's Ledger.

  • Inventory -> View Stock can be found here (⬇️) - clicking on a specific stock line will lead you to the line's Ledger.
  • This is the most up-to-date diagram of how different manipulations with stock affect Available Quantity and Stock On Hand

Stock!

Item Ledger

Change via Stocktake

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Go to Inventory -> Stocktakes and create a new Stocktake. Add the batch you are testing.
  • Finalise the Stocktake.
  • Go back to Inventory -> View Stock and click on the stock line you just tested -> Go to Ledger. The increase/decrease via Stocktake should have created a new ledger line. Check the numbers and the details are correct.

Change via positive Inventory Adjustment (existing stock line)

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Do an inventory adjustment and increase the number of units of this specific item.
  • 'Increase/Decrease' dropdown allows you to choose which way to adjust the inventory. If decreasing, Reason field becomes compulsory. Enter the number of packs.
  • Finalise by clicking Save.
  • Go back to Inventory -> View Stock and click on the stock line you were testing. Ledger should be showing the increase via stocktake.

Change via positive Inventory Adjustment (new stock line)

  • Go to Inventory -> View Stock and click on the button on the top right 'New stock'
  • Choose an item from the catalogue. Pack Qty is the only compulsory field in the modal, but you can add details like batch, number of units and expiry date. If 'Reason' is configured, choose an option form the drop down list.
  • Finalise by clicking on Save - this will bring you to a more detailed view of the stockline you just added. Note the tabs appeared at the top - Log and Ledger.
  • Go to Ledger -> as this is a new stockline, you will only see one entry there - it should say Inventory Adjustment.

Change via negative Inventory Adjustment

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Do an inventory adjustment and decrease the number of units of this specific item.
  • 'Increase/Decrease' dropdown allows you to choose which way to adjust the inventory. If decreasing, Reason field becomes compulsory. Enter the number of packs.
  • Finalise by clicking Save.
  • Go back to Inventory -> View Stock and click on the stock line you were testing. Ledger should be showing the decrease via stocktake.

Change via Outbound Shipment

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Go to Outbound shipments and create a new shipment.
  • Add 2 units of the item you chose to be tested.
  • Confirm the shipment as Picked.
  • Go back to Inventory -> View Stock and click on the stock line you just tested. Ledger should be showing the decrease in stock and outbound shipment details. Check the details to make sure they match.

Change via Inbound Shipment

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Go to Inbound shipments and create a new shipment.
  • Add 2 units of the item you chose to test.
  • Confirm the shipment as Delivered
  • Go back to 'stock' and click on the stock line selected to be tested
  • Go back to Inventory -> View Stock and click on the stock line you just tested. Ledger should be showing the decrease in stock and outbound shipment details. Check the details to make sure they match.

Change via Dispensing

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Go to Dispensary -> Prescriptions and create a new prescription.
  • Add 2 units of the item you chose to test.
  • As you add an item to the prescription, the status will automatically change to Picked.
  • Go back to Inventory -> View Stock and click on the stock line you just tested. Ledger should be showing the decrease in stock and prescription details. Check the details to make sure they match.
  • Go to the prescription module, select your Picked prescription and delete it.
  • Go back to Inventory -> View Stock and click on the stock line you just tested. Ledger line should be removed now as the prescription is deleted.
  • When verifying a prescription, it has no further changes on ledger or stock levels.

Change via Customer Return

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Go to Distribution -> Outbound Shipments and create a new Customer return
  • Add 2 units of the item you chose to test.
  • Confirm the status as Verified
  • Go back to Inventory -> View Stock and click on the stock line you just tested. Ledger should be showing the increase in stock and customer return details. Check the details to make sure they match.

Change via Supplier Return

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Go to Replenishment -> Inbound Shipments and create a new Supplier return.
  • Add 2 units of the item you chose to test.
  • Confirm the status as Picked.
  • Go back to Inventory -> View Stock and click on the stock line you just tested. Ledger should be showing the decrease in stock and customer return details. Check the details to make sure they match.

Change via Repack (all packs)

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Click Repack -> New and double the pack size. If pack size was 1, make it 2 :)
  • Fill out all the details and confirm the repack. When repacking all packs, the old stock line will disappear (as now you will have a new stock line reflecting the new pack size). The system will show you a prompt warning the stock line will be removed and you will be redirected to the new stock line.
  • In Inventory -> View Stock, the old stock line is removed and new one will be shown. You should not be able to see any lines containing the old pack size.
  • In Catalogue -> Items -> the item you are testing -> Ledger, the ledger will be showing the repack. Make sure all the details are correct. Note there will be 2 lines per repack - one will show something like -50 to account for the first stock line, and another one will show 50 added back as a repack. The balance and Stock on Hand values should stay the same overall.

Change via Repack (only a few packs)

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Click Repack -> New and double the pack size. If pack size was 1, make it 2 :)
  • Fill out all the details and confirm the repack. You will stay on the same page and in Ledger, you will see for example -50 showing the repack was done.
  • Go back to Inventory -> View Stock -> you will now see 2 entries of the item you are testing. One will have the old pack size and one will have the new one. Make sure the total number of units is the same as before repacking (e.g. the system shows the numbers accurately).
  • In Catalogue -> Items -> the item you are testing -> Ledger, the ledger will be showing the repack. Make sure all the details are correct. Note there will be 2 lines per repack - one will show something like -50 to account for the first stock line, and another one will show 50 added back as a repack. The balance and Stock on Hand values should stay the same overall.

Inbound Shipments

  • Start off by creating a new Inbound Shipment.
  • When status is New, the item quantity under Catalogue -> Items & Inventory -> View Stock is not updated. Deleting a batch from New inbound shipment will not update the stock levels either.
  • When status is updated to Delivered, the item quantity under Catalogue -> Items is updated. Inventory -> View Stock will now show an extra line with the batch number you just added, and the Pack Qty should match the quantity you entered previously. If you are entering multiple batches of the same item, then 2 separate lines will show, now one with the combined quantity.
  • Deleting a batch from Delivered inbound shipment should update the quantity under Catalogue -> Items. Inventory -> View Stock will be updated also - if one batch is deleted, then just that specific line will be removed.
  • Back to adding the items -> Ledger should update the quantity with Type set to Inbound Shipment
  • Changing the status to Verified should not have any impact on the stock levels.

Outbound Shipments

  • Start off by creating a new Outbound Shipment.
  • When entering a new Outbound Shipment, you will select an item and quantity you want to issue - for example, 20 packs of 1 tablet each. At this point, Outbound Shipment is still in New and is not affecting any stock levels. Deleting a batch from New outbound shipment will not update the stock levels either.
  • When pressing Confirm Allocated, it will change the item quantity under Catalogue -> Items, but will not change it under Inventory -> View Stock. Ledger will not have any updates at this stage either. Deleting an item/batch will reverse any changes done to Catalogue -> Items - e.g. the item should return back to the original quantity.
  • Confirm Picked -> the item quantity under Catalogue -> Items stays the same, and Inventory -> View Stock quantity has now changed. Ledger will be updated with the Outbound Shipment's details and the quantity will be displayed as something like '-20'.
  • Confirm Shipped/Delivered/Verified do not have any further changes on the stock levels.

Customer Returns

  • Start off by creating a new Customer Return.
  • When selecting an item returning, enter the quantity that is being returned to the store -> Customer Return is sitting as New. At this stage, both Catalogue -> Items and Inventory -> View Stock quantities are unchanged. Ledger does not have any updates.
  • Confirm Delivered -> Catalogue -> Items quantity is updated to include the returned quantity, and Inventory -> View Stock will now have a new extra line for the returned quantity. Ledger for that entry is updated with the quantity being added and Type Customer Return.
  • Confirm Verified does not have any further changes on the stock levels.

Supplier Returns

  • Start off by creating a new Supplier Return.
  • When selecting an item to return, enter the quantity that is going to be returned -> Supplier Return is sitting as New. At this stage, Catalogue -> Items quantity is unchanged and Inventory -> View Stock quantity is unchanged. Ledger does not have any updates.
  • Confirm Picked -> Catalogue -> Items quantity is updated to exclude the returning quantity, and Inventory -> View Stock quantity has also changed. Ledger will be updated with the Outbound Shipment's details and the quantity.
  • Confirm Shipped/Delivered/Verified do not have any further changes on the stock levels.

Repacks

Repack all packs from 1 specific item line

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Click on the stock line -> Repack
  • Choose to repack ALL available packs
  • Double the package size. If pack size = 1, make it 2, for example.
  • Confirm the repack -> you will see a confirmation modal pop-up, warning the existing line will be removed. You will be taken to the newly created stock line.
  • You should not be able to see any lines containing the old pack size.
  • Go to Catalogue -> Items -> the item you were testing -> Ledger. The repack should have created a new line, showing the quantity and the details. Confirm everything is shown correctly.

Repack only a few packs from 1 specific item line

  • Go to Inventory -> View Stock and choose a stock line to be tested. Note the batch you will be testing.
  • Click on the stock line -> Repack
  • Choose to repack only half of the available packs
  • Double the package size. If pack size = 1, make it 2, for example.
  • Confirm the repack
  • Automatically the ledger tab will have the total quantity repacked with a negative sign. If repacked 20 packs, it will show -20
  • Go back to item view and use the filter to find the item you chose to test. New stock lines should have been created with the correct pack size.
    • Under ledger tab of these new line, the changes via repacks should have created a new ledger line. If repacked 20 packs, it will show 20
  • Go back to items view. The old pack size should be there, with the remaining packs you did not repack.

Stocktakes

  • Before testing Stocktakes, take note of an item you are testing and take down the quantity - for example, I am testing Ibuprofen Tablets 400mg.
  • When creating a new Stocktake, add the item you are testing to that Stocktake and enter the Counted Packs quantity. If the Stocktake is New, the quantity of the item will remain unchanged under Catalogue -> Items or under Inventory -> View Stock.
  • When the Stocktake is Finalised, the quantity of the item will should change under Catalogue -> Items and under Inventory -> View Stock. Under Inventory -> View Stock, the batch you edited will reflect the updated quantity instead of it being shown as a new line.
  • When testing, it is important to test both scenarios - Stocktakes that increase stock and Stocktakes that decrease stock. Also, change the quantity of several batches to make sure the updates are being shown correctly under Inventory -> View Stock.

Prescriptions

  • Before testing Prescriptions, take note of an item you are testing and take down the quantity - for example, I am testing Mebendazole Chewable Tablets 100mg.
  • When creating a new Prescription, add an item you are testing -> as soon as you press 'OK', the status of the prescription is going to change from New to Picked. At this point, the item quantity is going to go down under Catalogue -> Items and Inventory -> View Stock. Under Inventory -> View Stock, you can click on a batch you prescribed and under Ledger you should be able to see the stock movement with Prescription set as Type.
  • Changing the quantity prescribed, adding another batch or deleting a prescription should reverse the changes displayed under Catalogue -> Items and Inventory -> View Stock.
  • Confirming prescription as Verified should not have any further changes on the item quantity and you should not be able to edit the prescription either.

When backdating

Pfizer Vaccine

Date Movement Balance
26.05.2025 +500 500
26.05.2025 +100 600
27.05.2025 +225 825
27.05.2025 +300 1125
27.05.2025 +145 1270
27.05.2025 +45 1315
27.05.2025 -145 1170
27.05.2025 -5 1165
29.05.2025 -34 1131
30.05.2025 -20 1111
30.05.2025 -135 976
  • Ordering before 26.05.2025 should not be allowed as the stock was not in the system 🚫
  • Ordering more than 976 at any given point of time should not be allowed - you only have 976 units in stock now, and if you try to backdate for more than 976, it should give an error as it should account for future transactions 🚫
  • Backdating prescriptions manipulates stock in the system at the end of the day - meaning any changes to stock movement will be noted down as 23:59PM in the system. E.g. if your backdated prescription is for last Monday, it will be 23:59PM of that Monday.
  • At any given point of time, the system is looking for the lowest number and helps you figure out how much you can dispense. For example, if you were to dispense a backdated prescription on 26th of May, the system will be looking at the in-between of these two transactions:
Date Movement Balance
26.05.2025 +100 600
27.05.2025 +225 825

Therefore you should be able to dispense 600 ✅

  • If you are looking at dispensing on 28th of May, you will be looking at the in-between of these two:
Date Movement Balance
27.05.2025 -5 1165
29.05.2025 -34 1131

But because you only have 976 units in stock now, you should be able to dispense 976 units ✅

Ledger

  • Prescription is New/Picked: creating a Prescription and adding an item to it will be reflected in the Ledger as Type: Prescription
  • Prescription is Verified: stays the same as above - reflected in the Ledger as Type: Prescription