Updated SQL query that fetches invoices by adding the 'ORDER BY' clause

This commit is contained in:
Alessandro Ponzio 2013-05-10 14:38:15 +02:00
parent a5199962f3
commit 0817d035a3

View File

@ -473,6 +473,9 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
$sql .= ' AND type = 2'; // If paying back a credit note, we show all credit notes $sql .= ' AND type = 2'; // If paying back a credit note, we show all credit notes
} }
// Sort invoices by date and serial number: the older one comes first
$sql.=' ORDER BY f.datef ASC, f.facnumber ASC';
$resql = $db->query($sql); $resql = $db->query($sql);
if ($resql) if ($resql)
{ {