Fix hidden option EXPENSEREPORT_LINES_SORTED_BY_ROWID to restore

compatibility.
This commit is contained in:
Laurent Destailleur 2017-08-21 23:41:19 +02:00
parent 9ffcd9e922
commit e647b5562b

View File

@ -1871,7 +1871,7 @@ else
$sql .= ' LEFT JOIN ' . MAIN_DB_PREFIX . 'bank_account as ba ON b.fk_account = ba.rowid';
$sql.= " WHERE e.rowid = '".$id."'";
$sql.= " AND p.fk_expensereport = e.rowid";
$sql.= " AND e.entity = ".$conf->entity;
$sql.= ' AND e.entity IN ('.getEntity('expensereport').')';
$sql.= " AND p.fk_typepayment = c.id";
$sql.= " ORDER BY dp";
@ -1955,7 +1955,14 @@ else
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'c_type_fees as ctf ON fde.fk_c_type_fees=ctf.id';
$sql.= ' LEFT JOIN '.MAIN_DB_PREFIX.'projet as pjt ON fde.fk_projet=pjt.rowid';
$sql.= ' WHERE fde.fk_expensereport = '.$object->id;
$sql.= ' ORDER BY fde.date ASC';
if (! empty($conf->global->EXPENSEREPORT_LINES_SORTED_BY_ROWID))
{
$sql.= ' ORDER BY fde.rang ASC, fde.rowid ASC';
}
else
{
$sql.= ' ORDER BY fde.rang ASC, fde.date ASC';
}
print '<div style="clear: both;"></div>';