Fixed produces product amount handling when consuming meal plan shadow recipes (references #2160)

This commit is contained in:
Bernd Bestel
2023-03-12 22:45:04 +01:00
parent 792c710bdc
commit 6857796ef0
4 changed files with 10 additions and 7 deletions

View File

@@ -1702,7 +1702,7 @@ class StockService extends BaseService
$this->getDatabaseService()->ExecuteDbStatement('UPDATE shopping_list SET product_id = ' . $productIdToKeep . ', amount = amount * ' . $factor . ' WHERE product_id = ' . $productIdToRemove);
$this->getDatabaseService()->ExecuteDbStatement('DELETE FROM products WHERE id = ' . $productIdToRemove);
}
catch (Exception $ex)
catch (\Exception $ex)
{
$this->getDatabaseService()->GetDbConnectionRaw()->rollback();
throw $ex;
@@ -1749,7 +1749,7 @@ class StockService extends BaseService
}
}
}
catch (Exception $ex)
catch (\Exception $ex)
{
$this->getDatabaseService()->GetDbConnectionRaw()->rollback();
throw $ex;