mauroagr Posted October 10, 2018 Share Posted October 10, 2018 I try to add product in backoffice, in a order but when i add the item....they reduct the stock two times. example: stock before add: 10 add in order: 2 expected stock result: 8 result in TB: 6 I solved here in controller/admin/AdminOrderController.php Line 2429 (comment the line): // StockAvailable::updateQuantity($orderDetail->product_id, $orderDetail->product_attribute_id, ($orderDetail->product_quantity * -1), $order->id_shop); Line 2775: Before: // Update product available quantity StockAvailable::updateQuantity($orderDetail->product_id, $orderDetail->product_attribute_id, ($oldQuantity - $orderDetail->product_quantity), $order->id_shop); After: StockAvailable::updateQuantity($orderDetail->product_id, $orderDetail->product_attribute_id, ($oldQuantity - $productQuantity), $order->id_shop); I dont right if this will impact in more places.... Thanks Mauro Link to comment Share on other sites More sharing options...
dosbiner Posted October 10, 2018 Share Posted October 10, 2018 hi interesting found. just to clarify, are you using advance stock management? and is this bug always occurs or just occasionally? Link to comment Share on other sites More sharing options...
Traumflug Posted October 10, 2018 Share Posted October 10, 2018 Let's track this: https://github.com/thirtybees/thirtybees/issues/622 Link to comment Share on other sites More sharing options...
mauroagr Posted October 10, 2018 Author Share Posted October 10, 2018 @dosbiner I don't use advanced stock, and i migrate from PS 1.6.0.14 to TB 1.0.7 Thanks Mauro Link to comment Share on other sites More sharing options...
mauroagr Posted October 10, 2018 Author Share Posted October 10, 2018 @traumflug said in Bug in stock to add product in backoffice: Let's track this: https://github.com/thirtybees/thirtybees/issues/622 I put here, in production, to test more the solution and working fine with the sugestions. I think this is important to test and patch, about the impact in stock is big if use admin to make orders or update it. Thanks... Mauro Link to comment Share on other sites More sharing options...
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