diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index bd31a438b05..f7c56130c2d 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'; +require_once DOL_DOCUMENT_ROOT .'/product/class/product.class.php'; $langs->load('orders'); $langs->load('deliveries'); @@ -325,22 +326,54 @@ if ($resql) $total=0; $subtotal=0; - $generic_commande = new Commande($db); - while ($i < min($num,$limit)) - { - $objp = $db->fetch_object($resql); - $var=!$var; - print '
| '; - print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); - print ' | '; + print '
| '; + print $generic_commande->getNomUrl(1,($viewstatut != 2?0:$objp->fk_statut)); + print ' | '; + // Shippable Icon + if (($objp->fk_statut > 0) && ($objp->fk_statut < 3)) { + print '';
+ $shippable=0;
+ $text_info='';
+ for ($lig=0; $lig<(count($generic_commande->lines)); $lig++) {
+ if ($generic_commande->lines[$lig]->product_type==0) {
+ $text_info .= $generic_commande->lines[$lig]->qty.' X '.$generic_commande->lines[$lig]->ref.' : '.dol_trunc($generic_commande->lines[$lig]->product_label, 28);
+ $generic_product->id = $generic_commande->lines[$lig]->fk_product;
+ $generic_product->load_stock();
+ if ($generic_product->stock_reel<$generic_commande->lines[$lig]->qty) {
+ $shippable++;
+ $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel." "; + } else { + $text_info.=''.$langs->trans('Available').' : '.$generic_product->stock_reel." "; + } + } + } + if ($shippable==0) { + $text_icon = img_picto('', 'object_sending'); + $text_info = $langs->trans('Shippable').' '.$text_info; + } else { + $text_icon = img_picto('', 'error'); + $text_info = $langs->trans('NonShippable').' '.$text_info; + } + print $form->textwithtooltip('',$text_info,2,1,$text_icon,'',2); + print ' | ';
+ }
+
+ // warning late icon
print ''; if (($objp->fk_statut > 0) && ($objp->fk_statut < 3) && max($db->jdate($objp->date_commande),$db->jdate($objp->date_livraison)) < ($now - $conf->commande->client->warning_delay)) print img_picto($langs->trans("Late"),"warning"); |