Merge pull request #24091 from Easya-Solutions/develop_fix_entity_invoice_anterior_date

FIX: validation date for invoice was compared in all entities.
This commit is contained in:
Laurent Destailleur 2023-03-02 16:09:36 +01:00 committed by GitHub
commit 2d8adba37e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5768,6 +5768,7 @@ class Facture extends CommonInvoice
$sql .= " FROM ".MAIN_DB_PREFIX."facture";
$sql .= " WHERE type = " . (int) $this->type ;
$sql .= " AND date_valid IS NOT NULL";
$sql .= " AND entity IN (".getEntity('invoice').")";
$sql .= " ORDER BY datef DESC LIMIT 1";
$result = $this->db->query($sql);