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

Prestashop 8.x: Incorrect Increase in Physical Quantity when Order Status Changes #36024

Open
2 tasks done
Sekar33000 opened this issue Apr 25, 2024 · 2 comments
Open
2 tasks done
Labels
8.1.x Branch Bug Type: Bug NMI Status: issue needs more information Order Component: Which BO section is concerned Stocks Label: Which BO under menu is concerned Waiting for author Status: action required, waiting for author feedback

Comments

@Sekar33000
Copy link

Sekar33000 commented Apr 25, 2024

Prerequisites

Describe the bug and add attachments

When an order placed in "Awaiting bank transfer or check payment" status is cancelled (status change) and the order is then set to "Awaiting bank transfer payment" or "Awaiting check payment" status in versions 8... (tested on 8.0.5, 8.1.1, and 8.1.5), the system increases the physical quantity. Here's an example of the incorrect behavior:

Initial stock (physical/reserved/available): 15/0/15.
Order status: Awaiting bank transfer payment -> Physical quantity: 15, Reserved quantity: 1, Available: 14.
The order is cancelled -> Physical quantity: 15, Reserved quantity: 0, Available: 15.
The order is set again to "Awaiting bank transfer payment" or "Awaiting check payment" -> Physical quantity: 16, Reserved quantity: 1, Available: 15.

This incorrect behavior is observed in versions 8... of Prestashop and leads to an incorrect increase in the physical quantity reserved when an order is cancelled and modified again to the "Awaiting bank transfer payment" or "Awaiting check payment" status. It's not acceptable for stock levels to increase in this way; if, for example, an employee mistakenly changes the status to cancelled and then reverts to the initial status, the physical quantity will have increased.

Expected behavior

I expected that when an order is cancelled and then set back to the "Awaiting bank transfer payment" or "Awaiting check payment" status in Prestashop 8.x, the system should not increase the physical quantity. Instead, the physical quantity should remain the same as before the cancellation.

Steps to reproduce

  1. Place an order in Prestashop 8.x and set the status to "Awaiting bank transfer payment" or "Awaiting check payment".
  2. Verify the initial stock levels (physical/reserved/available).
  3. Cancel the order.
  4. Confirm that the physical quantity remains the same after cancellation.
  5. Set the order status back to "Awaiting bank transfer payment" or "Awaiting check payment".
  6. Verify the stock levels again and observe that the physical quantity has increased incorrectly.

PrestaShop version(s) where the bug happened

8.0.0 - 8.1.6

PHP version(s) where the bug happened

7.4

If your bug is related to a module, specify its name and its version

No response

Your company or customer's name goes here (if applicable).

No response

@Sekar33000 Sekar33000 added Bug Type: Bug New New issue not yet processed by QA labels Apr 25, 2024
@florine2623
Copy link
Contributor

Hello @Sekar33000 ,

Is your issue similar to #27631 ?

Waiting for your feedback.
Thanks!

@florine2623 florine2623 added NMI Status: issue needs more information Order Component: Which BO section is concerned Stocks Label: Which BO under menu is concerned 8.1.x Branch Waiting for author Status: action required, waiting for author feedback and removed New New issue not yet processed by QA labels Apr 25, 2024
@Sekar33000
Copy link
Author

According to me, the issues encountered are different:

In the problem described in the other post, when an order is placed for a product with zero stock in PrestaShop 1.7.7.8 (and possibly in earlier versions), the system incorrectly changes the quantity of the product in the database. For example, when the order is marked as "shipped" or "refunded", the quantity of the product can become negative or the physical stock can be incorrectly modified.

On the other hand, in the problem I'm addressing, when you cancel an order in PrestaShop 8.x and then re-place it in "Awaiting bank transfer payment" or "Awaiting check payment" status, the physical quantity of the product increases incorrectly.

While both issues involve incorrect changes in product quantities during order processing, they are caused by different mechanisms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.1.x Branch Bug Type: Bug NMI Status: issue needs more information Order Component: Which BO section is concerned Stocks Label: Which BO under menu is concerned Waiting for author Status: action required, waiting for author feedback
Projects
None yet
Development

No branches or pull requests

2 participants