diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 51602cafe1c..7f475f87f24 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -2291,7 +2291,7 @@ class CommandeFournisseur extends CommonOrder $clause = " WHERE"; - $sql = "SELECT c.rowid, c.date_creation as datec, c.fk_statut,c.date_livraison as delivery_date"; + $sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.fk_statut, c.date_livraison as delivery_date"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) { @@ -2311,15 +2311,15 @@ class CommandeFournisseur extends CommonOrder $response = new WorkboardResponse(); $response->warning_delay=$conf->commande->fournisseur->warning_delay/60/60/24; $response->label=$langs->trans("SuppliersOrdersToProcess"); - $response->url=DOL_URL_ROOT.'/fourn/commande/index.php'; + $response->url=DOL_URL_ROOT.'/fourn/commande/list.php?statut=1,2,3'; $response->img=img_object($langs->trans("Orders"),"order"); while ($obj=$this->db->fetch_object($resql)) { $response->nbtodo++; - $date_to_test = empty($obj->delivery_date) ? $obj->datec : $obj->delivery_date; - if ($obj->fk_statut != 3 && $this->db->jdate($date_to_test) < ($now - $conf->commande->fournisseur->warning_delay)) { + $date_to_test = empty($obj->delivery_date) ? $obj->date_commande : $obj->delivery_date; + if ($obj->fk_statut != 3 && $date_to_test && $this->db->jdate($date_to_test) < ($now - $conf->commande->fournisseur->warning_delay)) { $response->nbtodolate++; } } diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index c21830e66e8..1fffb05b738 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -88,8 +88,14 @@ if ($socid > 0) { $fourn = new Fournisseur($db); $fourn->fetch($socid); - $title .= ' ('.$fourn->name.')'; + $title .= ' - '.$fourn->name; } +if (GETPOST('statut','alpha')) +{ + if (GETPOST('statut','alpha') == '1,2,3') $title.=' - '.$langs->trans("StatusOrderToProcessShort"); + else $title.=' - '.$langs->trans($commandestatic->statuts[GETPOST('statut','alpha')]); +} + llxHeader('',$title); @@ -145,9 +151,9 @@ if ($sall) if ($socid) $sql.= " AND s.rowid = ".$socid; //Required triple check because statut=0 means draft filter -if (GETPOST('statut', 'int') !== '') +if (GETPOST('statut', 'alpha') !== '') { - $sql .= " AND cf.fk_statut IN (".GETPOST('statut').")"; + $sql .= " AND cf.fk_statut IN (".GETPOST('statut', 'alpha').")"; } if ($search_refsupp) { @@ -219,7 +225,7 @@ if ($resql) print '