Create a supply order. Add a product with quantity equal 0 and choose for example order 2 new products.
Current instant state: Physical quantity = 0 | Usable quantity = 0 | Real quantity = 0
Change the status to Order Validated.
Current instant state: Physical quantity = 0 | Usable quantity = 0 | Real quantity = 0
Change the status to Pending Receipt.
Current instant state: Physical quantity = 0 | Usable quantity = 0 | Real quantity = 2
Go to the front office. You can see that there are 2 items to be ordered when you haven't received the products:
I guess is a heritated bug from Prestashop. But I think can produce severe problems in many stores. If the supplier needs 5 days to deliver your order, you can be in serious troubles with your customers :)
I have been taking a look in the code, and I think the problem must be in the AdminSupplyOrdersController.php line 1223:
```
// create stock entry if not exist when order is in pendingreceipt
if ($newstate->pendingreceipt) {
$supplyorderdetails = $supplyorder->getEntries();
foreach ($supplyorderdetails as $supplyorderdetail) {
$ispresent = Stock::productIsPresentInStock($supplyorderdetail['idproduct'], $supplyorderdetail['idproductattribute'], $supplyorder->idwarehouse);
if (!$is_present) {
$stock = new Stock();
Question
TobyMudito
Hello.
I want to share with you a bug that I have detected.
[Conditions] - Advanced Stock Management: Activated.
To reproduce the bug just follow the steps:
I guess is a heritated bug from Prestashop. But I think can produce severe problems in many stores. If the supplier needs 5 days to deliver your order, you can be in serious troubles with your customers :)
I have been taking a look in the code, and I think the problem must be in the AdminSupplyOrdersController.php line 1223:
``` // create stock entry if not exist when order is in pendingreceipt if ($newstate->pendingreceipt) { $supplyorderdetails = $supplyorder->getEntries(); foreach ($supplyorderdetails as $supplyorderdetail) { $ispresent = Stock::productIsPresentInStock($supplyorderdetail['idproduct'], $supplyorderdetail['idproductattribute'], $supplyorder->idwarehouse); if (!$is_present) { $stock = new Stock();
``` I hope this can help to fix the bug.
Thank you very much and regards.
0 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now