From c2980f34c774004556ae143473c450eb7aedf3c4 Mon Sep 17 00:00:00 2001 From: Joachim Kueter Date: Tue, 20 Feb 2024 10:37:10 +0100 Subject: [PATCH] Fix: add missing parameters to existing hook (#28304) For this hook to add reasonable additional fields to a line, access to the line number and other related values of the line is required. --- htdocs/product/stock/replenish.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index a3cac8adbc8..4135c31e80a 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -934,7 +934,8 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''.$ordered.' '.$picto.''; // To order - print ''; + $tobuy = (!empty($conf->global->STOCK_ALLOW_ADD_LIMIT_STOCK_BY_WAREHOUSE) && $fk_entrepot > 0) > 0 ? $stocktobuywarehouse : $stocktobuy; + print ''; // Supplier print ''; @@ -942,7 +943,7 @@ while ($i < ($limit ? min($num, $limit) : $num)) { print ''; // Fields from hook - $parameters = array('objp'=>$objp); + $parameters = array('objp'=>$objp, 'i'=>$i, 'tobuy'=>$tobuy); $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint;