FIX Societe - Problem of date on outstanding opened late (#35266)
This commit is contained in:
parent
c2ed4519b1
commit
b03c12c129
1 changed files with 3 additions and 1 deletions
|
|
@ -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').")";
|
||||
|
|
|
|||
Loading…
Reference in a new issue