diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php
index 44f0b9e3505..4b5b1ae1038 100644
--- a/htdocs/comm/index.php
+++ b/htdocs/comm/index.php
@@ -277,7 +277,7 @@ print '
';
*
*/
-$sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
+$sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code, c.libelle, a.fk_user_author, s.nom as sname, s.idp";
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", sc.fk_soc, sc.fk_user";
$sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s";
if (!$user->rights->commercial->client->voir && !$socidp) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
@@ -287,7 +287,7 @@ if ($socidp)
{
$sql .= " AND s.idp = $socidp";
}
-$sql .= " ORDER BY a.datea DESC, a.id DESC";
+$sql .= " ORDER BY a.datep DESC, a.id DESC";
$resql=$db->query($sql);
if ($resql)
@@ -306,28 +306,28 @@ if ($resql)
$var=!$var;
print " | ";
- if ($oldyear == strftime("%Y",$obj->da) )
+ if ($oldyear == strftime("%Y",$obj->dp) )
{
print '| | | ';
}
else
{
- print ''.strftime("%Y",$obj->da)." | \n";
- $oldyear = strftime("%Y",$obj->da);
+ print ''.strftime("%Y",$obj->dp)." | \n";
+ $oldyear = strftime("%Y",$obj->dp);
}
- if ($oldmonth == strftime("%Y%b",$obj->da) )
+ if ($oldmonth == strftime("%Y%b",$obj->dp) )
{
print '| | ';
}
else
{
- print '' .strftime("%b",$obj->da)." | \n";
- $oldmonth = strftime("%Y%b",$obj->da);
+ print '' .strftime("%b",$obj->dp)." | \n";
+ $oldmonth = strftime("%Y%b",$obj->dp);
}
- print ''.strftime("%d",$obj->da)." | \n";
- if (date("U",$obj->da) < time())
+ print ''.strftime("%d",$obj->dp)." | \n";
+ if (date("U",$obj->dp) < time())
{
print "".img_warning($langs->trans("Late"))." | ";
} else {