Skip to content

Commit

Permalink
FIX #3240
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Nov 3, 2015
1 parent 74be7bf commit df4f09e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
8 changes: 4 additions & 4 deletions htdocs/fourn/class/fournisseur.commande.class.php
Expand Up @@ -2291,7 +2291,7 @@ function load_board($user)

$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)
{
Expand All @@ -2311,15 +2311,15 @@ function load_board($user)
$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++;
}
}
Expand Down
14 changes: 10 additions & 4 deletions htdocs/fourn/commande/list.php
Expand Up @@ -88,8 +88,14 @@
{
$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);

Expand Down Expand Up @@ -145,9 +151,9 @@
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)
{
Expand Down Expand Up @@ -219,7 +225,7 @@
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre">&nbsp;</td>';
print '<td class="liste_titre" align="right">';
$formorder->selectSupplierOrderStatus($search_status,1,'search_status');
$formorder->selectSupplierOrderStatus((strstr($search_status, ',')?-1:$search_status),1,'search_status');
print '</td>';
print '<td class="liste_titre" align="right"><input type="image" class="liste_titre" name="button_search" src="'.img_picto($langs->trans("Search"),'search.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("Search")).'" title="'.dol_escape_htmltag($langs->trans("Search")).'">';
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("Search"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
Expand Down

0 comments on commit df4f09e

Please sign in to comment.