Skip to content

Bundle product: incorrect child item invoice_qty when dynamic price is set to false #31750

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

Conversation

engcom-Hotel
Copy link
Contributor

Description (*)

#30802

Related Pull Requests

Fixed Issues (if relevant)

#30802

Manual testing scenarios (*)

#30802

Questions or comments

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)

@m2-assistant
Copy link

m2-assistant bot commented Jan 18, 2021

Hi @engcom-Hotel. 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 give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests
  13. Semantic Version Checker

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. labels Jan 18, 2021
@engcom-Hotel engcom-Hotel self-assigned this Jan 18, 2021
@engcom-Hotel
Copy link
Contributor Author

@magento run all tests

@engcom-Hotel
Copy link
Contributor Author

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE, Integration Tests

@engcom-Hotel
Copy link
Contributor Author

@magento run all tests

@engcom-Hotel
Copy link
Contributor Author

@magento run Functional Tests CE, Functional Tests EE

@engcom-Hotel
Copy link
Contributor Author

Failing tests are not related to the changes.

@engcom-Hotel
Copy link
Contributor Author

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

1 similar comment
@engcom-Hotel
Copy link
Contributor Author

@magento run Functional Tests B2B, Functional Tests CE, Functional Tests EE

@engcom-Hotel
Copy link
Contributor Author

@magento run Functional Tests B2B, Functional Tests CE

1 similar comment
@engcom-Hotel
Copy link
Contributor Author

@magento run Functional Tests B2B, Functional Tests CE

@eduard13 eduard13 self-requested a review January 26, 2021 13:18
@eduard13 eduard13 self-assigned this Jan 26, 2021
@eduard13 eduard13 added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Jan 26, 2021
Copy link
Contributor

@eduard13 eduard13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job 👍.
I've left a minor note.

* @param int $orderId
* @return array
*/
private function getOrderItemsQtyOrdered(int $orderId): array
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a note, private methods/properties should be declared after public declarations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have been moved.

Copy link
Contributor

@eduard13 eduard13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@magento-engcom-team
Copy link
Contributor

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

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Manual testing scenario:

  1. Create a new bundle product via Magento 2 administration
    1.1. Change "Dynamic Pricing" setting to false
    1.2. Add a price i.e. 75 $
    1.3. Perhaps not relevant, but in my use case: [Add visible to "not visible individually"]
    1.4. Add bundle options with setting "ship bundle items" set to "together"
    1 4
    1.4.1. Add one bundle option with a name of your choice of input type "checkbox" and set to "required"
    1.4.2. Add two simple products of your choice (i.e. ID 1 and ID 2 of the demo content products)
    1.4.3. Change the qty settings of the simple products to a qty > 1 (i.e. 2 and 3)
    1.4.4. leave the price range setting on "fixed"
    1.4.5. Mark the checkbox "is Default"
    1.5. Save the product
  2. Create a new order via Magento 2 administration
    2.1. Add the new bundle product to your order
    2 1
    2.2. Click on configure and only change the qty to 2
    2.3. Save the product items (uncheck the discount if it has been set, but dont recalculate)
    2.4. Add a payment of your choice
    2.5. Add a shipping of your choice
    order
    2.6. Save the order
  3. Create a new invoice via Magento 2 administration
    3.1. Skip the shipping procedure entirely, just create an invoice
    3.2. Leave all settings as is
    3.3. Save the invoice
    invoiced
  4. Check the database table sales_order_items selected on the order number (order id gets in parent_id column)

    (in our case the database values should be displayed in an pdf invoice, which also reflect the wrong qty's)

--> the order_qty has correctly been changed, but the invoice_qty has not been changed correctly and refers to the parent items qty... see screenshots in the following sections

Before: ✖️ After creating the invoice the simple items within the bundle actually have the wrong qty - the qty of the parent item (the bundle item) instead.

Screenshot from 2021-01-27 11-36-26

After: ✔️ After creating the invoice the simple items within the bundle have the correct qty

Screenshot from 2021-01-27 23-36-19

@m2-assistant
Copy link

m2-assistant bot commented Feb 18, 2021

Hi @engcom-Hotel, 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
Labels
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Component: Sales Priority: P2 A defect with this priority could have functionality issues which are not to expectations. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S2 Major restrictions or short-term circumventions are required until a fix is available. Type: Bug Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants