Merge pull request #10467 from atm-gauthier/7.0_fix_nextnumref

FIX : need an order by in case we found other invoice with same number but not same date
This commit is contained in:
Laurent Destailleur 2019-02-01 15:38:16 +01:00 committed by GitHub
commit f00271fee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -178,6 +178,7 @@ class mod_facture_mars extends ModeleNumRefFactures
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
$sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'";
$sql.= " AND entity IN (".getEntity('invoicenumber').")";
$sql.= " ORDER BY ref DESC";
dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG);
$resql=$db->query($sql);

View File

@ -194,6 +194,7 @@ class mod_facture_terre extends ModeleNumRefFactures
$sql.= " FROM ".MAIN_DB_PREFIX."facture";
$sql.= " WHERE facnumber LIKE '".$prefix."____-".$num."'";
$sql.= " AND entity IN (".getEntity('invoicenumber').")";
$sql.= " ORDER BY ref DESC";
dol_syslog(get_class($this)."::getNextValue", LOG_DEBUG);
$resql=$db->query($sql);