From b2e4b6ab5decbb9c8a2e811ce65b5a56e99278fa Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 7 Jul 2022 19:10:46 +0200 Subject: [PATCH] FIX Send remind to pay invoice only on validated invoices --- htdocs/compta/facture/class/facture.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 94184934d42..ec8e4a93b80 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -5078,6 +5078,7 @@ class Facture extends CommonInvoice $sql .= ", ".MAIN_DB_PREFIX."c_paiement as cp"; } $sql .= " WHERE f.paye = 0"; + $sql .= " AND f.fk_statut = ".self::STATUS_VALIDATED; $sql .= " AND f.date_lim_reglement = '".$this->db->idate($tmpidate, 'gmt')."'"; $sql .= " AND f.entity IN (".getEntity('facture').")"; if (!empty($paymentmode) && $paymentmode != 'all') {