Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
reports:purchasing [2024/10/25 23:17] – [Adjust by % of days out of stock] Mark Gloverreports:purchasing [2025/06/06 05:06] (current) – [mSupply's better algorithm] Nick Pendergrast
Line 55: Line 55:
  
 == Report on purchase orders... == == Report on purchase orders... ==
-In the same way, you can also filter your reports on properties of the purchase orders involved: category, status and both purchase order custom fields.  For more information on purchase order categories see [[purchasing:show_po_categories | here]]+In the same way, you can also filter your reports on properties of the purchase orders involved: category, status and both purchase order custom fields.  For more information on purchase order categories see [[purchasing:show_po_categories | here]]
 + 
 +<WRAP info center round 90%> 
 +Please note there is also a //Purchases by suppliers// report that relates stock received to purchase orders made. This is one of the item ledger type reports and details can be foiund on the [[reports:items_and_stock#item_ledger|13.02. Stock and items reports]] page. 
 +</WRAP>
  
 =====  Purchases ===== =====  Purchases =====
Line 96: Line 100:
 This method takes each historic month's consumption, and adjusts it for the number of days in the month the item was out of stock. This method takes each historic month's consumption, and adjusts it for the number of days in the month the item was out of stock.
 We multiply the consumption for the month by (Days in month divided by Days in stock) to get an //Adjusted// AMC We multiply the consumption for the month by (Days in month divided by Days in stock) to get an //Adjusted// AMC
-Take this example:+Take this example for a single month where Item B had nil stock for a period of time:
   * Item B was in stock for 10 days in the month   * Item B was in stock for 10 days in the month
   * Its historic consumption was 500   * Its historic consumption was 500
Line 104: Line 108:
 === Only consider fully stocked months === === Only consider fully stocked months ===
 Here, we are attempting to address months with low stock by excluding them from our calculations, rather than adjusting their consumption. Here, we are attempting to address months with low stock by excluding them from our calculations, rather than adjusting their consumption.
-There is a field shown **% of days in stock to be considered fully stocked** that defaults to "90%" +There is a field shown **% of days in stock to be considered fully stocked** that defaults to ''90%'' 
-Note that you need to set the lookback period long enough that mSupply will be able to find enough fully stocked months to run the calculation. You can also include more months by setting the **% of days in stock to be considered fully stocked** field to  (say) 50%.+<WRAP center round tip 60%> 
 +For this method to work, you need to set the lookback period long enough that mSupply will be able to find enough fully stocked months to run the calculation. You can also include more low stock months by setting the **% of days in stock to be considered fully stocked** field to say) ''50%'' Do this with caution, as there is a real danger that it will result in an underestimate of AMC. 
 +</WRAP> 
 === mSupply's better algorithm === === mSupply's better algorithm ===
 We've tried to come up with a better algorithm here by: We've tried to come up with a better algorithm here by:
   * ignoring months that are in stock for < 33% of days. That is, if the item was in stock for less than 10 days in the month, the consumption on those days is too erratic to draw conclusions about what the consumption for the whole month would have been.           * ignoring months that are in stock for < 33% of days. That is, if the item was in stock for less than 10 days in the month, the consumption on those days is too erratic to draw conclusions about what the consumption for the whole month would have been.        
-  * For months with stock >= 33% of days, Multiply the consumption for the month by Square Root(Days in month/Days in stock) to get adjusted AMC. This adjusts the consumption up due to being out of stock, but by a factor up to 1.7 - so not as big an adjustment as the "Adjust by % of days out of stock" method.+  * For months with stock >= 33% of days, Multiply the consumption for the month by (Days in month/Days in stock) to get adjusted AMC. This adjusts the consumption up due to being out of stock, but by a factor up to 1.7 - so not as big an adjustment as the "Adjust by % of days out of stock" method.
   * We also ignore months where the mean stock on hand is less than "% of typical AMC that stock level is considered compromised:" value you enter. This is a bit complicated, but here's an example:   * We also ignore months where the mean stock on hand is less than "% of typical AMC that stock level is considered compromised:" value you enter. This is a bit complicated, but here's an example:
     * Consider Item A - we have set the "when we calculate consumption there are 3 months that were "fully stocked" - those three months give us an AMC of 1500 per month.     * Consider Item A - we have set the "when we calculate consumption there are 3 months that were "fully stocked" - those three months give us an AMC of 1500 per month.
-    * Now, there's another month that was fully stocked (as in, on all 31 days in the month, there was _some_ stock on hand. +    * Now, there's another month that was fully stocked (as in, on all 31 days in the month, there was //some// stock on hand. 
-    * But it turns out that the average stock on hand was only 50 - clearly they could never have had "normal" consumption, although they did have stock - if the cutoff is set to 100%, we're saying "ignore this month unless the average stock on hand was 1500 - in this case it's 50, so this month isn't used in the AMC calculations+    * But it turns out that the average stock on hand was only 50 - clearly they could never have had "normal" consumption, although they did have stock - if the cut-off is set to 100%, we're saying "ignore this month unless the average stock on hand was 1500 - in this case it's 50, so this month isn't used in the AMC calculations
    
-We then sum the adjusted consumption for all the eligible months & divide by the number eligible months to get the best AMC eva ;-)+We then sum the adjusted consumption for all the eligible months & divide by the number eligible months to get the best forecast AMC eva ;-) 
 + 
 + 
 + 
 + 
 +Here's a diagram: 
 + 
 +<mermaid> 
 +graph TD 
 +    A(Was the Month fully stocked?)-->|Yes|B(Use consumption from these months to calculate typical AMC) 
 +    A-->|NO|C(Ignore these months) 
 +    B-->D(Was there months having <10 days with stock)-->|Yes|E(Ignore these months) 
 +    D-->|No|F(Increase consumption with adjusted AMC to account for days out of stock for these months) 
 +  classDef OR fill:Orange 
 +  class A,B,C,D,E,F OR 
 +</mermaid>   
 + 
 + 
 + 
  
 =============== ===============
Line 312: Line 338:
 \\ \\
 \\ \\
-|  //  Previous:  **[[reports:transactions]]** | | Next: **[[reports:requisitions]]** //  |+|  //  Previous:  **[[reports:transactions]]** | | Next: **[[reports:stocktakes]]** //  |
 ---- struct data ---- ---- struct data ----
 pagestatus.status    : All Good pagestatus.status    : All Good
 ---- ----
  
  • Last modified: 2024/10/25 23:17
  • by Mark Glover