From 407fe902b49019c9bd62549d12e40f7d237c6a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Mon, 9 Dec 2019 16:42:57 +0100 Subject: [PATCH 1/2] missing $db for line 711 --- htdocs/core/class/utils.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index 8ce4cca7ca6..12972a89752 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -586,7 +586,7 @@ class Utils */ function generateDoc($module) { - global $conf, $langs; + global $conf, $langs, $db; global $dirins; $error = 0; From 97ec8b8e0261689194ba5a1be20d702aea6ff2a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9rald=20Lelarge?= Date: Mon, 9 Dec 2019 14:56:20 +0100 Subject: [PATCH 2/2] FIX #12665 Mass invoice validation with stock management Normally the mass invoice validation is not authorized due to the need to choose the warehouse where to increase or decrease the stock. A message ErrorMassValidationNotAllowedWhenStockIncreaseOnAction is displayed to inform the user to do this validation manually one by one. The invoices should not be validated. --- htdocs/core/actions_massactions.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/actions_massactions.inc.php b/htdocs/core/actions_massactions.inc.php index 03cf1eae755..99bc62dff79 100644 --- a/htdocs/core/actions_massactions.inc.php +++ b/htdocs/core/actions_massactions.inc.php @@ -1079,7 +1079,7 @@ if (! $error && $massaction == 'validate' && $permtocreate) { $objecttmp=new $objectclass($db); - if ($objecttmp->element == 'invoice' && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) + if (($objecttmp->element == 'facture' || $objecttmp->element == 'invoice') && ! empty($conf->stock->enabled) && ! empty($conf->global->STOCK_CALCULATE_ON_BILL)) { $langs->load("errors"); setEventMessages($langs->trans('ErrorMassValidationNotAllowedWhenStockIncreaseOnAction'), null, 'errors');