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

fix: Stock Analytics Report must consider warehouse during calculation #26673

Merged
merged 4 commits into from
Aug 11, 2021

Conversation

marination
Copy link
Collaborator

@marination marination commented Jul 27, 2021

Consider the following:

  • Here are SLEs for Item Bottle for the month of June.
  • The total quantity in June should be (balance qty in Work In Progress - GP + balance qty in Stores - GP) = 11 + 6 = 17
    Screenshot 2021-08-11 at 10 44 07 AM

Issue:

  • Screenshot 2021-08-10 at 8 52 42 PM
  • Stock Analytics Report haphazardly added actual_qty from SLEs irrespective of warehouse to generate the total qty in a month
  • This gave out faulty values because while accounting for Stock Recos, considering warehouse is very important.
  • It just added balance of SLEs in Work In Progress - GP to that of SLEs in Stores - GP, and so the balance shows as 11, which is just the balance of Stores - GP.
  • Due to the stock reco on 15-06-2021, the first SLE in Work In Progress - GP is reset or ignored.

Fix:

  • Maintain period and warehouse wise balances
  • Add the all warehouse balances in a certain period, to get its actual total qty
  • The total quantity in June is (balance qty in Work In Progress - GP + balance qty in Stores - GP) = 11 + 6 = 17
    Screenshot 2021-08-10 at 8 51 18 PM
  • Fixed brand filter which was not working

This can be tested using Quick Stock balance too. All the balances until the end of a month of each warehouse should add up to the value in the report

To test:

  • create an item and create stock transactions in different warehouses
  • in one warehouse's transactions, add a stock reco
  • check values in stock analytics, month/week/quarter wise

@marination marination marked this pull request as ready for review August 10, 2021 15:25
@marination marination merged commit 6302728 into frappe:develop Aug 11, 2021
@frappe-pr-bot
Copy link
Collaborator

The backport to version-13-hotfix failed.
Please backport the PR manually. 🤖

The process '/usr/bin/git' failed with exit code 1

asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
fix: Stock Analytics Report must consider warehouse during calculation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants