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

Product management and specific prices new rules in Order #20145

Merged
merged 74 commits into from Aug 28, 2020

Conversation

jolelievre
Copy link
Contributor

@jolelievre jolelievre commented Jul 10, 2020

Questions Answers
Branch? 1.7.7.x
Description? This PR has the purpose of bringin more rules to the product management in order, to sum it up:
- duplicate products are not allowed any more in an Order unless they are assigned to different invoices
- each product has one single price even if it has duplicates among invoices (all invoices are updated)
- some additional popup are displayed to prevent the user when he is about to change several products prices at once
- when adding a product the preset values for prices must match the specific price if present (#19490)
Type? bug fix
Category? BO
BC breaks? no
Deprecations? no
Fixed ticket? Fixes #20010 and fixes #19490 and fixes #18237 (EPIC #20161) and #20533 and #20542
How to test? You can follow the instructions and use cases from the issue

This change is Reviewable

@jolelievre jolelievre requested a review from a team as a code owner July 10, 2020 17:32
@prestonBot prestonBot added 1.7.7.x Branch Bug Type: Bug Waiting for wording Status: action required, waiting for wording labels Jul 10, 2020
@jolelievre jolelievre changed the title Specific prices new rules Order product and specific prices new rules in Order Jul 10, 2020
@jolelievre jolelievre changed the title Order product and specific prices new rules in Order Product management and specific prices new rules in Order Jul 10, 2020
@Junebyun Junebyun added Wording ✔️ Status: check done, wording approved and removed Waiting for wording Status: action required, waiting for wording labels Jul 13, 2020
@prestonBot prestonBot added the Waiting for wording Status: action required, waiting for wording label Jul 13, 2020
@MatShir MatShir linked an issue Jul 13, 2020 that may be closed by this pull request
5 tasks
@Progi1984 Progi1984 added this to the 1.7.7.0 milestone Jul 13, 2020
@Progi1984
Copy link
Contributor

Travis is 🔴 for integration tests :

    Features/Scenario/Order/order_cart_rules.feature:161
    Features/Scenario/Order/order_from_bo.feature:80
    Features/Scenario/Order/order_from_bo.feature:97
    Features/Scenario/Order/order_from_bo.feature:149

@LouiseBonnard LouiseBonnard removed the Waiting for wording Status: action required, waiting for wording label Jul 16, 2020
Copy link
Contributor

@atomiix atomiix left a comment

Choose a reason for hiding this comment

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

LGTM, Maybe add a test for adding the same product but a different combination?

@matthieu-rolland matthieu-rolland added the WIP Status: Work In Progress label Jul 20, 2020
@matthieu-rolland matthieu-rolland changed the title Product management and specific prices new rules in Order [WIP] Product management and specific prices new rules in Order Jul 20, 2020
@prestonBot prestonBot added the Waiting for wording Status: action required, waiting for wording label Jul 20, 2020
@matthieu-rolland
Copy link
Contributor

matthieu-rolland commented Jul 20, 2020

@atomiix sorry this PR is a work in progress, I should have added the label 😅
There is still work to do:

  • Edit invoices having the same product (with same combination if any)
  • Edit (or refresh?) all same products line in the frontend after adding the product (today it adds a line for the new product, but former products are not edited, now it's needed)
  • Update behat tests, add behat tests regarding the effects of creating a new specific price rules

@matthieu-rolland matthieu-rolland force-pushed the specific-prices-new-rules branch 2 times, most recently from 40aa632 to 0a161b4 Compare July 23, 2020 13:30
Copy link
Contributor Author

@jolelievre jolelievre left a comment

Choose a reason for hiding this comment

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

I believe it's still in WIP but I commented a few things
Also you managed the js for add product, but don't forget to do the same (confirm modal + udpate prices) for product edition 😉

classes/order/OrderInvoice.php Outdated Show resolved Hide resolved
src/Adapter/Order/AbstractOrderHandler.php Outdated Show resolved Hide resolved
src/Adapter/Order/AbstractOrderHandler.php Show resolved Hide resolved
src/Adapter/Order/OrderAmountUpdater.php Outdated Show resolved Hide resolved
src/Adapter/Order/OrderAmountUpdater.php Outdated Show resolved Hide resolved
src/Adapter/Order/OrderAmountUpdater.php Outdated Show resolved Hide resolved
src/Adapter/Order/OrderAmountUpdater.php Outdated Show resolved Hide resolved
src/Adapter/Order/AbstractOrderHandler.php Outdated Show resolved Hide resolved
Copy link
Contributor Author

@jolelievre jolelievre left a comment

Choose a reason for hiding this comment

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

Some new comments for things to be finished ^^

@jolelievre
Copy link
Contributor Author

Hi @khouloudbelguith
Thank you I'll look into it

@jolelievre
Copy link
Contributor Author

Hi @khouloudbelguith,

I just fixed the bug it's ok now, actually the price was only checked when adding a product to a new invoice not to an existing one..

PierreRambaud
PierreRambaud previously approved these changes Aug 26, 2020
NeOMakinG
NeOMakinG previously approved these changes Aug 26, 2020
@NeOMakinG NeOMakinG added Waiting for QA Status: action required, waiting for test feedback and removed Waiting for author Status: action required, waiting for author feedback Waiting for dev Status: action required, waiting for tech feedback labels Aug 26, 2020
@khouloudbelguith
Copy link
Contributor

Hi @jolelievre,

I found this issue following these steps:

  1. Create an order with a Product1
  2. Change the status of the Order to payment accepted
  3. Try to add the same product to the order with editing the price
  4. Click Add
    image
  5. See error => the pop up "Edit the price" is displayed instead of this alert "Error! This product is already in your order, please edit the quantity instead."
    image

At this time, if you click Update => the right alert is displayed.

A related issue following these steps:

  1. Create an order with a Product1
  2. Try to add the same product to the order with editing the price
    image
  3. see error => an empty pop up is displayed
    image

Thanks!

@khouloudbelguith khouloudbelguith added Waiting for author Status: action required, waiting for author feedback Waiting for dev Status: action required, waiting for tech feedback and removed Waiting for QA Status: action required, waiting for test feedback labels Aug 27, 2020
@jolelievre jolelievre added Waiting for QA Status: action required, waiting for test feedback and removed Waiting for author Status: action required, waiting for author feedback Waiting for dev Status: action required, waiting for tech feedback labels Aug 28, 2020
@Robin-Fischer-PS Robin-Fischer-PS added QA ✔️ Status: check done, code approved and removed Waiting for QA Status: action required, waiting for test feedback labels Aug 28, 2020
@prestashop-issue-bot
Copy link

QA OK without required approvals !? :trollface:

@jolelievre jolelievre merged commit 947dd79 into PrestaShop:1.7.7.x Aug 28, 2020
@jolelievre jolelievre deleted the specific-prices-new-rules branch August 28, 2020 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.7.x Branch Bug Type: Bug QA ✔️ Status: check done, code approved Wording ✔️ Status: check done, wording approved
Projects
None yet