diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 1530795b8dd..b941ba37249 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -404,6 +404,7 @@ if ($resql) // Shippable Icon if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && ! empty($conf->global->SHIPPABLE_ORDER_ICON_IN_LIST)) { $notshippable=0; + $warning = 0; $text_info=''; $nbprod=0; for ($lig=0; $lig<(count($generic_commande->lines)); $lig++) { @@ -444,7 +445,11 @@ if ($resql) } $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' '.dol_trunc($generic_commande->lines[$lig]->product_label, 25); $text_stock_reel = $generic_product->stock_reel.'/'.$stock_order; - if (($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) || ($stock_order > $generic_product->stock_reel)) { + if ($stock_order > $generic_product->stock_reel && ! ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty)) { + $warning++; + $text_warning.=''.$langs->trans('Available').' : '.$text_stock_reel.''; + } + if ($generic_product->stock_reel < $generic_commande->lines[$lig]->qty) { $notshippable++; $text_info.=''.$langs->trans('Available').' : '.$text_stock_reel.''; } else { @@ -469,6 +474,11 @@ if ($resql) print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2); print ''; } + if ($warning) { + print '