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

[CE 2.1.0 rc3] - Cancel an order [configurable product] #5313

Closed
5 tasks
mhabou opened this issue Jun 28, 2016 · 4 comments
Closed
5 tasks

[CE 2.1.0 rc3] - Cancel an order [configurable product] #5313

mhabou opened this issue Jun 28, 2016 · 4 comments
Labels
bug report Component: Sales Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release triage wanted

Comments

@mhabou
Copy link

mhabou commented Jun 28, 2016

Salamo Alaykom Magento team,

NB : All the products are configurable

The test products :

Product 1 :

Chaz Kangeroo Hoodie
SKU: MH01-XS-Black
Color: Black
Size: XS

Product 2 :

Chaz Kangeroo Hoodie
SKU: MH01-M-Orange
Color: Orange
Size: M

  • 1st issue -- Steps to reproduce

  1. Add the 2 configurable products above to the cart [product 1 qty 2 product 2 qty 3]
  2. Place the order
  3. Invoice & ship partially the order
  4. Cancel the order

Magento shows Cancel button after i canceled the order
When i click on Cancel again, it returns to the old state

See the video
https://youtu.be/hA7Ov6t3P-Q

Other issues :

  • Scenario 1 :

When i cancel the order --> no stock return of the item canceled

- Before the order
Product qty on stock
product 1 100
product 2 100
- Order then invoice, ship and cancel
Product qty_ordered qty_invoiced qty_shipped qty_canceled
product 1 2 1 2 0
product 2 3 2 0 1
- After the order

Actual result

Product qty on stock
product 1 98
product 2 97

Expected result

Product qty on stock
product 1 98
product 2 98
  • Scenario 2 :
- Before the order
Product qty on stock
product 1 100
product 2 100
- Order then invoice, ship and cancel
Product qty_ordered qty_invoiced qty_shipped qty_canceled
product 1 2 0 1 1
product 2 3 0 2 1
- After the order

Actual result

Product qty on stock
product 1 100
product 2 100

Expected Result

Product qty on stock
product 1 99
product 2 98
  • Scenario 3 :
- Before the order
Product qty on stock
product 1 100
product 2 100
- Order then invoice, ship and cancel
Product qty_ordered qty_invoiced qty_shipped qty_canceled
product 1 2 1 0 1
product 2 3 2 0 1
- After the order

Actual result

Product qty on stock
product 1 98
product 2 97

Expected Result

Product qty on stock
product 1 99
product 2 98
  • Scenario 4 :
- Before the order
Product qty on stock
product 1 100
product 2 100
- Order then invoice, ship, refund , cancel

Actual result

Product qty_ordered qty_invoiced qty_shipped qty_refunded qty_canceled
product 1 2 1 1 1 0
product 2 3 2 1 1 1

Expected Result

Product qty_ordered qty_invoiced qty_shipped qty_refunded qty_canceled
product 1 2 1 1 1 1
product 2 3 2 1 1 1

In the case of the " Product 1"
QtyToCancel = min(QtyToInvoice,QtyToShip)
QtyToCancel =min(1,0) = 0 ==> False

QtyToCancel must be 1 because QtyToShip must be 1 not 0
QtyToShip must be 1 because , qty_ordered=2 , qty_invoiced=1 ,qty_shipped=1 then i refunded 1 qty
So the remaining qty to invoice & to ship is 1

 public function getQtyToCancel()
    {

        $qtyToCancel = min($this->getQtyToInvoice(), $this->getQtyToShip());
        return max($qtyToCancel, 0);
    }
 public function getQtyToInvoice()
    {

        if ($this->isDummy()) {
            return 0;
        }

        $qty = $this->getQtyOrdered() - $this->getQtyInvoiced() - $this->getQtyCanceled();
        return max($qty, 0);
    }
 public function getQtyToShip()
    {
        if ($this->isDummy(true)) {
            return 0;
        }

        return $this->getSimpleQtyToShip();
    }
    public function getSimpleQtyToShip()
    {

        $qty = $this->getQtyOrdered() - $this->getQtyShipped() - $this->getQtyRefunded() - $this->getQtyCanceled();
        return max($qty, 0);
    }
- After the order

Actual result

Product qty on stock
product 1 98
product 2 97

Expected Result

Product qty on stock
product 1 99
product 2 98

I hope that everything is clear for you

@mhabou mhabou changed the title [CE 2.1 rc3] - Cancel an order [CE 2.1 cr3] - Cancel an order Jun 28, 2016
@mhabou mhabou changed the title [CE 2.1 cr3] - Cancel an order [CE 2.1 rc3] - Cancel an order Jun 28, 2016
@mhabou mhabou changed the title [CE 2.1 rc3] - Cancel an order [CE 2.1.0 rc3] - Cancel an order Jun 28, 2016
@mhabou mhabou changed the title [CE 2.1.0 rc3] - Cancel an order [CE 2.1.0 rc3] - Cancel an order [configurable product] Jun 28, 2016
@mhabou
Copy link
Author

mhabou commented Jul 4, 2016

@NadiyaS i didn't receive any response

@NadiyaS NadiyaS added the CS label Jul 5, 2016
@NadiyaS NadiyaS self-assigned this Jul 5, 2016
@vkorotun vkorotun removed the CS label Aug 4, 2016
@NadiyaS NadiyaS removed their assignment Aug 17, 2016
@magento-engcom-team magento-engcom-team added bug report Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Component: Sales labels Sep 11, 2017
@magento-engcom-team magento-engcom-team added Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed 2.1.x Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 18, 2017
@magento-engcom-team
Copy link
Contributor

@Dayssam, thank you for your report.
We've created internal ticket(s) MAGETWO-82221 to track progress on the issue.

@magento-engcom-team magento-engcom-team added the Event: distributed-cd Distributed Contribution Day label Mar 19, 2018
@magento-engcom-team magento-engcom-team added triage wanted and removed Event: distributed-cd Distributed Contribution Day labels Apr 10, 2018
@magento-engcom-team
Copy link
Contributor

@Dayssam, thank you for your report.

Unfortunately, we are archiving this ticket now as it did not get much attention from both Magento Community and Core developers for an extended period. This is done in an effort to create a quality, community-driven backlog which will allow us to allocate the required attention more easily.

You may learn more about this initiative following this link.

Please feel free to comment or reopen the ticket if you think it should be reviewed once more. Thank you for collaboration.

@tuyennn
Copy link
Member

tuyennn commented Aug 23, 2018

#5261 @magento-engcom-team I still could reproduce this on 2.1.9, any bug fix commit or reference link for this issue.

magento-engcom-team pushed a commit that referenced this issue Jan 28, 2019
…#5313

- Fixed an issue with incorrect qty_invoiced value for configurable products;
magento-engcom-team pushed a commit that referenced this issue Jan 28, 2019
magento-engcom-team pushed a commit that referenced this issue Jan 28, 2019
Fixed:
MAGETWO-58212 [GITHUB] Magento 2.1 CE, Cannot change attribute set for bundled product #5999
MAGETWO-96842 [2.3.x] [Magento Cloud] [QUANS] Tiered block displayed on configurable products without any tiered pricing
MAGETWO-96412 [2.3.x] Not possible to drag specified Related/Upsell/Cross-sell products to new positions in Windows 10 machine
MAGETWO-96847 [2.3.x] Special price does not work when "default config" scope timezone does not match "website" scope timezone
MAGETWO-96424 [2.3.x] [Magento Cloud] Requesition list qty of configurable product variation not updated individually
MAGETWO-91589 Slow query delete on sub SELECT query
MAGETWO-82221 [CE 2.1.0 rc3] - Cancel an order [configurable product] #5313
MAGETWO-92226 Product export creates 2 rows for Simple product with custom options
MAGETWO-60910 Session initialized during reindex from CLI and result fatal error
MAGETWO-97260 creating new shipment: gettting all trackers. after this commit 2307e16
MAGETWO-96342 MySQL connection issue
MAGETWO-97434 MFTF test cases have parsing error
MAGETWO-91513 Password reset email cannot be sent if the customer does not have customer attribute set that is changed to required after original account creation
MAGETWO-95802 [EE] Admin date wrong formatting for French locale
magento-cicd2 pushed a commit that referenced this issue Apr 28, 2020
[tango] MC-18280: Dynamic Block based on segment not displaying correctly for visitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Component: Sales Issue: Clear Description Gate 2 Passed. Manual verification of the issue description passed Issue: Confirmed Gate 3 Passed. Manual verification of the issue completed. Issue is confirmed Issue: Format is not valid Gate 1 Failed. Automatic verification of issue format is failed Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release triage wanted
Projects
None yet
Development

No branches or pull requests

6 participants