FIX Societe - Problem of date on outstanding opened late (#35266)

This commit is contained in:
Alexandre SPANGARO 2025-09-09 19:25:09 +02:00 committed by GitHub
parent c2ed4519b1
commit b03c12c129
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4875,10 +4875,12 @@ class Societe extends CommonObject
$alreadypayed=price2num($paiement + $creditnotes + $deposits,'MT');
$remaintopay=price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits,'MT');
*/
$today = dol_get_first_hour(dol_now('tzuser')); // Returns today at 00:00 in the user's time zone
$sql = "SELECT rowid, ref, total_ht, total_ttc, paye, type, fk_statut as status, close_code FROM ".MAIN_DB_PREFIX.$table." as f";
$sql .= " WHERE fk_soc = ".((int) $this->id);
if (!empty($late)) {
$sql .= " AND date_lim_reglement < '".$this->db->idate(dol_now())."'";
$sql .= " AND date_lim_reglement < '".$this->db->idate($today)."'";
}
if ($mode == 'supplier') {
$sql .= " AND entity IN (".getEntity('facture_fourn').")";