Skip to content

Commit

Permalink
Merge pull request Dolibarr#248 from atm-florianm/FIX_13.0_ama_retour…
Browse files Browse the repository at this point in the history
…s_reapprovisionnement_new_hook_spe_ama

FIX retour réappro
  • Loading branch information
John BOTELLA authored Dec 17, 2021
2 parents 84a022c + 5d37d21 commit 74f2b54
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions htdocs/product/stock/replenish.php
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,14 @@
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
$sql .= $hookmanager->resPrint;

/******************** START SPÉ AMA ***********************/
// pourquoi ce hook et pas printFieldListWhere?? Parce que printFieldListWhere va être déplacé
// prochainement et ne conviendra plus pour remplacer l'intégralité de cette requête (ce que fait
// actuellement [2021-12-09] le hook du cliama)
$parameters = array('usevirtualstock' => $usevirtualstock, 'alertchecked' => &$alertchecked);
$reshook = $hookmanager->executeHooks('cliamaReplaceSQL', $parameters, $sql); // Note that $action and $object may have been modified by hook
/******************** END SPÉ AMA ***********************/

$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
$result = $db->query($sql);
Expand Down Expand Up @@ -807,6 +815,13 @@
$desiredstockwarehouse = ($objp->desiredstockpse ? $objp->desiredstockpse : 0);
$alertstockwarehouse = ($objp->seuil_stock_alertepse ? $objp->seuil_stock_alertepse : 0);

/******************** START SPÉ AMA ***********************/
if ($fk_entrepot > 0 || !empty(GETPOST('multiwarehouse'))) {
$desiredstock = $desiredstockwarehouse;
$alertstock = $alertstockwarehouse;
}
/******************** END SPÉ AMA ***********************/

$warning = '';
if ($alertstock && ($stock < $alertstock))
{
Expand Down

0 comments on commit 74f2b54

Please sign in to comment.