99. Technical resources

Command lines

Inventory management extension comes with a few command lines.

They can be executed in console mode using php bin/magento CMD, where “CMD” has to be replaced with one of the available commands.

Warning

  • If you get this error running one of the following command lines : “Area code is already set”

Please open the php file containing the command code (these files are located in app\code\BoostMyShop\AdvancedStock\Console\Command\, and named as command lines names)

Then, find and replace the following line :

$this->_state->setAreaCode('adminhtml');

by :

try{
     $this->_state->setAreaCode('adminhtml');
}catch(\Exception $ex)
{
}

Stock Discrepencies

php bin/magento bms_advancedstock:check_stock_discrepencies

Runs a report to check possible stock errors, available from Stores > Configuration > Boostmyshop > Advanced inventory > Stock discrepencies.

Note

You can also complete this command line adding the --fix option, to try to fix all errors found :

php bin/magento bms_advancedstock:check_stock_discrepencies --fix

More information on the stock discrepancies different probes : Stock discrepancies documentation

Note

If you get a “memory exhausted” error executing the stock discrepencies command line, like :

Fatal error: Allowed memory size of XXX bytes exhausted (tried to allocate XXX bytes)

You can solve this problem setting a “-d memory_limit” instruction at the start of the php command line :

php -d memory_limit=2G  bin/magento bms_advancedstock:check_stock_discrepencies --fix

If the problem persists, please increase the value from “2G” to an higher one, until it’s solved.

Fix Reservation

php bin/magento bms_advancedstock:fix_reservation

Check if there are some reservation problems (products over/under reserved).

Refresh Qty To Ship

php bin/magento bms_advancedstock:refresh_quantity_to_ship

Update products “quantity to ship” for all warehouses.

Refresh Sellable Qty

php bin/magento bms_advancedstock:refresh_sellable_quantity

Update products “Sellable quantity” in Magento, based on the quantity available in the different warehouses.

Refresh Sales History

php bin/magento bms_advancedstock:refresh_sales_history

Refresh products “Sales History” statistics.

Note

Statistics are NOT updated automatically by default, you have to create a cron task to automate this update.