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

Stock movements without descriptions on some lines of their transactions #5444

Closed
jniles opened this issue Mar 1, 2021 · 1 comment · Fixed by #5341
Closed

Stock movements without descriptions on some lines of their transactions #5444

jniles opened this issue Mar 1, 2021 · 1 comment · Fixed by #5341
Assignees

Comments

@jniles
Copy link
Collaborator

jniles commented Mar 1, 2021

At bandunduville, we are running into a few stock movements that are missing descriptions on one line of their journal transaction. This causes the rule that descriptions can't be NULL to fail. Here is an example:
image

They appear to all be negative adjustments:
image

Clearly there is something broken. It looks like the negative adjustments module at Bandunduville isn't blocking on an empty description and that is what is causing the issue.

@jniles
Copy link
Collaborator Author

jniles commented Mar 1, 2021

Okay, I can reproduce this with Vanga's online version after upgrading to v1.17.4. It's happened sometime in the last couple of versions. Negative stock adjustments with empty descriptions result in empty descriptions in the journal.

However, if you put a description, this will pass. So the issue is that people are not putting descriptions (quick fix) and the long term fix is that we should:

  1. block empty descriptions
  2. ensure that we template in a description for stock adjustments.

@jniles jniles self-assigned this Mar 1, 2021
jniles added a commit to jniles/bhima that referenced this issue Mar 1, 2021
This commit creates templated descriptions to adjustments and makes
the description mandatory.

Closes Third-Culture-Software#5444.
jniles added a commit to jniles/bhima that referenced this issue Mar 2, 2021
This commit creates templated descriptions to adjustments and makes
the description mandatory.

Closes Third-Culture-Software#5444.
bors bot added a commit that referenced this issue Mar 3, 2021
5445: fix(stock): give descriptions to adjustments r=mbayopanda a=jniles

This commit creates templated descriptions to adjustments and makes
the description mandatory.

Closes #5444.

Here is what it looks like:
![image](https://user-images.githubusercontent.com/896472/109557011-d41a9000-7ad7-11eb-8220-bd09192c2856.png)

----

How to test:

1. Load any database off master or refactor-stock-management. 
2. Try to do a negative stock adjustment for any product, _without_ putting in a description.
3. Observe the receipt renders and the app accepts the submit, despite showing a red mark on the description box.
3. Notice that the receipt does not print with a "note" field.

Now, load this branch.

You should not be able to make an adjustment without a description.  And when the description renders, it should look something like what the screenshot I posted above.

Co-authored-by: Jonathan Niles <jonathanwniles@gmail.com>
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 #5341 Mar 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant