Skip to content

fix qty calculation for the sold product reports #22871

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

Closed

Conversation

polkan-msk
Copy link

@polkan-msk polkan-msk commented May 13, 2019

Description (*)

without the "group by" I'm adding in this commit, report has the same
products several times. So to get proper total qty one need to manually
sum all the qtys for the product.

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. go to Reports > Products > Ordered
  2. select dateFrom = 01/01/2018 and dateTo = 05/05/2019
  3. select Show By = Year and Submit
  4. make sure there are no duplicates in the table (each product exists in a single example and its qty summed)

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

without the "group by" I'm adding in this commit, report has the same
products several times. So to get proper total qty one need to manually
sum all the qtys for the product.
@m2-assistant
Copy link

m2-assistant bot commented May 13, 2019

Hi @polkan-msk. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@magento-cicd2
Copy link
Contributor

magento-cicd2 commented May 13, 2019

CLA assistant check
All committers have signed the CLA.

@swnsma swnsma self-requested a review May 13, 2019 18:07
@swnsma swnsma self-assigned this May 13, 2019
@swnsma
Copy link
Contributor

swnsma commented May 14, 2019

HI @polkan-msk,
Thank you for your contribution.
As you PR provide functional changes, I need to clarify this question with Product Owner of Magento Reports. It could take some time.

@polkan-msk
Copy link
Author

hi @swnsma
yes, sure, but I believe it is a bug, though.
please see the screenshots:
before the fix: https://drive.google.com/open?id=1-ptjvG-2T8i8MXmvohVxNR6X9bPp-mhr
after the fix: https://drive.google.com/open?id=1w9GNxkvo-SWhOmNPiaPbnWONWoz-UVKq

@misha-kotov
Copy link

Hi @polkan-msk, does the problem happen with a specific product type only (simple, configurable, etc)?

@polkan-msk
Copy link
Author

hi @misha-kotov. no, it happens for all types. the sql just does not have a 'group by' clause.

@misha-kotov
Copy link

@polkan-msk thanks for confirming. So in your example, how are the quantities 13, 12, 11, 6, and 3 grouped? Are those product quantities in individual orders?

@swnsma
Copy link
Contributor

swnsma commented May 18, 2019

Hi @misha-kotov,
I have checked this case and can say that those items are grouped by individual orders.

@misha-kotov
Copy link

OK in that case I agree with the proposed fix.

@magento-engcom-team
Copy link
Contributor

Hi @swnsma, thank you for the review.
ENGCOM-5133 has been created to process this Pull Request

@sivaschenko
Copy link
Member

Hi @polkan-msk , thanks for the pull request! However, this issue was fixed earlier in #22646

I have to close this pull request as duplicate, but let's collaborate on delivering the earlier pull request with the best quality.

@m2-assistant
Copy link

m2-assistant bot commented May 20, 2019

Hi @polkan-msk, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

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.

7 participants