I found a Bug in the Advanced Stock Management when you try to transfer not-usable products.
You can recreate this, if you do the following steps:
* The Stock of WarhouseA is empty (Physical and usable)
* Add Products to WarehouseA and set the "usable for sale" to false/no
* Now use Transferstock in the Action-List of WarehouseA
* set a quantity to transfer
* Select usable in source to false/no (there is no usable Stock, so you want to move the physical)
* Select WarhouseB as the destination
* Finaly you select usable for destination to true/yes
* click on transfer
-> you will end up with this error:
"It is not possible to transfer the specified quantity. No stock was transferred. "
i found the line where i think it goes wrong in classes/stock/StockManager.php
in Line 602:
public function getPhysicalProductQuantities($productStockCriteria)
{
...
isset($productStockCriteria['usable']) ? : false
...
}
this changes the submitted "usable_from" from false to true because the variable exists (with a value of "false") and therefore isset will return true.
This could be fixed in a simple way:
public function getPhysicalProductQuantities($productStockCriteria)
{
...
isset($productStockCriteria['usable']) ? $productStockCriteria['usable'] : false
...
}
Now the statement not only checks, if 'usable' exists, it also uses the value of it and defaults to false, if it's missing.
Question
CHitzmann
I found a Bug in the Advanced Stock Management when you try to transfer not-usable products. You can recreate this, if you do the following steps: * The Stock of WarhouseA is empty (Physical and usable) * Add Products to WarehouseA and set the "usable for sale" to false/no * Now use Transferstock in the Action-List of WarehouseA * set a quantity to transfer * Select usable in source to false/no (there is no usable Stock, so you want to move the physical) * Select WarhouseB as the destination * Finaly you select usable for destination to true/yes * click on transfer -> you will end up with this error: "It is not possible to transfer the specified quantity. No stock was transferred. "
i found the line where i think it goes wrong in classes/stock/StockManager.php in Line 602:
public function getPhysicalProductQuantities($productStockCriteria) { ... isset($productStockCriteria['usable']) ? : false ... }
this changes the submitted "usable_from" from false to true because the variable exists (with a value of "false") and therefore isset will return true.
This could be fixed in a simple way:
public function getPhysicalProductQuantities($productStockCriteria) { ... isset($productStockCriteria['usable']) ? $productStockCriteria['usable'] : false ... }
Now the statement not only checks, if 'usable' exists, it also uses the value of it and defaults to false, if it's missing.5 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