FIX Send remind to pay invoice only on validated invoices

This commit is contained in:
Laurent Destailleur 2022-07-07 19:10:46 +02:00
parent b2cbdde1ce
commit b2e4b6ab5d

View File

@ -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') {