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

Add option to view CMM calculation details to dropdown in "Articles in Stock" #5291

Closed
jniles opened this issue Jan 14, 2021 · 0 comments · Fixed by #5317 or #5341
Closed

Add option to view CMM calculation details to dropdown in "Articles in Stock" #5291

jniles opened this issue Jan 14, 2021 · 0 comments · Fixed by #5317 or #5341
Assignees
Labels
priority:urgent Issues that should be tackled as soon as possible Stock

Comments

@jniles
Copy link
Collaborator

jniles commented Jan 14, 2021

We should add an option to the "Articles in Stock" registry to view the details of the CMM calculation. It would be call "View Calculation Details" or something similar. Here is where it would go:

image

Clicking this would bring up a large modal with the following information:

  1. The name of the inventory item (e.g. Quinine 500mg)
  2. The depot the CMM calculation is relevant for (e.g. Pharmacie PAX)
  3. The time period on which the calculation is relevant. This would be the current date minus the months specified in the depot settings. It would be in the format "Time Period: ${start_date} - ${end_date}". Note that this is not the period of time we have data for. It should be the full date range derived from the depot settings.
  4. The total number of items consumed that time. (e.g. 50,000 comprimes)
  5. The total number of days where there were stock outs during that period. (e.g 7 jours de rupture de stock)
  6. The total number of days where there was stock available (.e.g 156 jours de stock)
  7. The full, written out CMM calculation, based on the algorithm chosen. For example, for the MSH algorithm, we would have:

CMM = (∑consumed_quantity / ( #month − (∑stock_out_days) / 30.5)))
CMM = (50000 / (6 − (7 / 30.5)))
CMM = 8664.773

This would allow the user to have full transparency into the way the calculation was taking place.

@jniles jniles added Stock priority:urgent Issues that should be tackled as soon as possible labels Jan 14, 2021
@jniles jniles self-assigned this Jan 15, 2021
jniles added a commit to jniles/bhima that referenced this issue Jan 27, 2021
Adds the ability to view the AMC/CMM calculations in the Articles in
Stock Registry.  A summary of the information is presented for the user
to examine and the explicit formula used to calculate the AMC is shown
for the user to validate.

CLoses Third-Culture-Software#5291.
jniles added a commit to jniles/bhima that referenced this issue Jan 27, 2021
Adds the ability to view the AMC/CMM calculations in the Articles in
Stock Registry.  A summary of the information is presented for the user
to examine and the explicit formula used to calculate the AMC is shown
for the user to validate.

CLoses Third-Culture-Software#5291.
jniles added a commit to jniles/bhima that referenced this issue Jan 27, 2021
Adds the ability to view the AMC/CMM calculations in the Articles in
Stock Registry.  A summary of the information is presented for the user
to examine and the explicit formula used to calculate the AMC is shown
for the user to validate.

Closes Third-Culture-Software#5291.
jniles added a commit to jniles/bhima that referenced this issue Jan 28, 2021
Adds the ability to view the AMC/CMM calculations in the Articles in
Stock Registry.  A summary of the information is presented for the user
to examine and the explicit formula used to calculate the AMC is shown
for the user to validate.

Closes Third-Culture-Software#5291.
jniles added a commit to jniles/bhima that referenced this issue Feb 1, 2021
Allows you to double click from anywhere in the cell, plus removes the
double click on the row header.  Starts process towards getting proper
AMC quantity in stock projections working.  Finally, adds translation
for french.

Closes Third-Culture-Software#5291.
jniles added a commit to jniles/bhima that referenced this issue Feb 1, 2021
Allows you to double click from anywhere in the cell, plus removes the
double click on the row header.  Starts process towards getting proper
AMC quantity in stock projections working.  Finally, adds translation
for french.

Closes Third-Culture-Software#5291.
bors bot added a commit that referenced this issue Feb 1, 2021
5317: feat(stock): add option to view AMC calcs r=jniles a=jniles

Adds the ability to view the AMC/CMM calculations in the Articles in Stock Registry.  A summary of the information is presented for the user to examine and the explicit formula used to calculate the AMC is shown for the user to validate.

Closes #5291.

**Example using Algorithm 1**
![image](https://user-images.githubusercontent.com/896472/106009293-764def00-60b8-11eb-815b-a9dc7ca6941f.png)

**Example using Algorithm 2**
![image](https://user-images.githubusercontent.com/896472/106009860-1ad03100-60b9-11eb-8927-78a1ac5fcb1e.png)

**Example using Algorithm 3**
![image](https://user-images.githubusercontent.com/896472/106008578-ba8cbf80-60b7-11eb-8c0f-be436068fd5a.png)

**Example using Algorithm 4 (MSH)**
![image](https://user-images.githubusercontent.com/896472/106008076-3f2b0e00-60b7-11eb-99d1-a9ae9078847f.png)

**Example showing Algorithm (MSH) for 12 months**
![image](https://user-images.githubusercontent.com/896472/106008960-1eaf8380-60b8-11eb-97fd-9ee13524dc84.png)




Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
jniles added a commit to jniles/bhima that referenced this issue Feb 17, 2021
Adds the ability to view the AMC/CMM calculations in the Articles in
Stock Registry.  A summary of the information is presented for the user
to examine and the explicit formula used to calculate the AMC is shown
for the user to validate.

Closes Third-Culture-Software#5291.
jniles added a commit to jniles/bhima that referenced this issue Feb 17, 2021
Allows you to double click from anywhere in the cell, plus removes the
double click on the row header.  Starts process towards getting proper
AMC quantity in stock projections working.  Finally, adds translation
for french.

Closes Third-Culture-Software#5291.
jniles added a commit to jniles/bhima that referenced this issue Feb 23, 2021
Adds the ability to view the AMC/CMM calculations in the Articles in
Stock Registry.  A summary of the information is presented for the user
to examine and the explicit formula used to calculate the AMC is shown
for the user to validate.

Closes Third-Culture-Software#5291.
jniles added a commit to jniles/bhima that referenced this issue Feb 23, 2021
Allows you to double click from anywhere in the cell, plus removes the
double click on the row header.  Starts process towards getting proper
AMC quantity in stock projections working.  Finally, adds translation
for french.

Closes Third-Culture-Software#5291.
mbayopanda pushed a commit to mbayopanda/bhima that referenced this issue Mar 2, 2021
Adds the ability to view the AMC/CMM calculations in the Articles in
Stock Registry.  A summary of the information is presented for the user
to examine and the explicit formula used to calculate the AMC is shown
for the user to validate.

Closes Third-Culture-Software#5291.
mbayopanda pushed a commit to mbayopanda/bhima that referenced this issue Mar 2, 2021
Allows you to double click from anywhere in the cell, plus removes the
double click on the row header.  Starts process towards getting proper
AMC quantity in stock projections working.  Finally, adds translation
for french.

Closes Third-Culture-Software#5291.
bors bot added a commit that referenced this issue Mar 4, 2021
5341: Refactor: Stock Management r=jniles a=jniles

This is the off-main-branch work that @jmcameron and @jniles are working on to refactor stock management.  It shouldn't be merged until we have finished all the major stock management upgrades and can test it as a whole.

The goal of this branch is to do a major upgrade to our stock management modules that may have far reaching implications and are integrated too tightly to be able to do progressively on `master`.  Basically, we'll relax our requirements to allow ourselves to "break things" temporarily on this branch, then have a single large merge into the main branch.

### Issues Closed by the PR

Closes #4304.    
Closes #5073.    
Closes #5144.    
Closes #5183.    
Closes #5185.    
Closes #5186.    
Closes #5291.    
Closes #5311.    
Closes #5319.    
Closes #5322.    
Closes #5325.    
Closes #5326.    
Closes #5327.    
Closes #5328.    
Closes #5332.    
Closes #5333.    
Closes #5349.    
Closes #5354.    
Closes #5360.    
Closes #5416.    
Closes #5422.    
Closes #5430.    
Closes #5431.    
Closes #5444.    
Closes #5447. 

 ### Things to Test

Report/Module | Assigned to | Issues Found | Works on master? (Y/N) | Fix Here? (Y/N) | Fixed? (Y/N)
-- | -- | -- | -- | -- | --
Rapports >   Articles en Stock | @mbayopanda | Status, CMM, etc broken | N  | Y  |  
Rapports >   Comparaison des articles factures sur les recus |  @jniles |  #5414 | Y | N |  
Rapports >   Consommations Menseulles | @jmcameron   |  SQL Error  | Y  | Y  |   Y (#5436)
Rapports >   Entrees des stocks | @mbayopanda   |   | Y  | N  |  
Rapports >   Fiche de stock |  @jniles   | #5415  |  Y | Y  | Y (#5415)
Rapports >   Rapport d'expiration | @jmcameron   |   |  Y  | Y  |  Y (#5438)
Rapports >   Rapport graphique des mouvements |  @mbayopanda   |  #5416  | Y | N  |  
Rapports >   Sorties des stocks | @jniles  | #5419 | Y  |  N |  
Rapports >   Valeur de stock | @jmcameron   | OK  | Y | N  |  
Rapports >   Rapport graphique de la consommation de stock | @mbayopanda   | #5418  | Y  | N  |  
Rapports >   Rapport sur les variations de stock | @jniles  |  OK |  Y  | N  |  
Stock >   Ajustement |  @jmcameron  | OK  | Y | N |  
Stock >   Ajustement des stocks | @mbayopanda   | #5428  | Y | N  | N | 
Stock >   Articles en stock |  @jniles  | #5422  |  Y  | Y  | Y( #5432)
Stock >   Assignation de stock | @jmcameron   | Y | Y | N |  
Stock >   Entrée de stock | @mbayopanda   | #5429 is related to purchase analysis  | Y | N  | 
Stock >   Gestion de depots | @jniles  | #5423  | Y |  N |  
Stock >   Importation de stock |  @jmcameron | N (wrong num args) | N #5426 |  Y |  Y (#5427)
Stock >   Lots en stock |  @mbayopanda | #5430, #5431  | Y, Y  | N, Y  | 
Stock >   Movements de stock | @jniles  | #5424  | Y  | Y |   Y(#5459)
Stock >   Parametres de stock | @jmcameron   | Seems OK  | Y | N |  
Stock >   Requisition | @mbayopanda  | Seems OK   | Y  | N  |  
Stock >   Sortie de stock | @jniles   | #5425 |  N | N  |  
Stock >   Tableau de bord | @jmcameron   |  #5400 (comment)  | Y | N |  

I've left @lomamech off this list because I believe he is working on a separate PR.  If he gets done with that, we'll move some of these over to him.

@mbayopanda can you review the titles of these modules?  I think the French may be wrong for some of them.  For example, I don't understand why we have "Ajustement des stocks" and "value de stock".  Shouldn't we use "des stocks" or "de stock" in every one?

Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
Co-authored-by: bors[bot] <26634292+bors[bot]@users.noreply.github.com>
Co-authored-by: Jonathan Cameron <jmcameron@gmail.com>
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@bors bors bot closed this as completed in 9d943a5 Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:urgent Issues that should be tackled as soon as possible Stock
Projects
None yet
1 participant