FIX invoices order on sells journal

On sells journal, invoices are ordered by date (datef) but when several invoices have the same date, sometimes they are not ordered by reference.
This commit is contained in:
Thibault Fiacre 2023-03-22 08:14:58 +01:00 committed by GitHub
parent 05de5d7e9f
commit 45b7a911d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,7 +147,7 @@ if ($in_bookkeeping == 'notyet') {
$sql .= " AND f.rowid NOT IN (SELECT fk_doc FROM ".MAIN_DB_PREFIX."accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')";
// $sql .= " AND fd.rowid NOT IN (SELECT fk_docdet FROM " . MAIN_DB_PREFIX . "accounting_bookkeeping as ab WHERE ab.doc_type='customer_invoice')"; // Useless, we save one line for all products with same account
}
$sql .= " ORDER BY f.datef";
$sql .= " ORDER BY f.datef, f.ref";
//print $sql; exit;
dol_syslog('accountancy/journal/sellsjournal.php', LOG_DEBUG);