diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index ea682ba0419..6d90794dbd0 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -405,6 +405,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++) { @@ -445,7 +446,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) { + 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 { @@ -470,6 +475,11 @@ if ($resql) print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2); print ''; } + if ($warning) { + print '