|
@@ -907,7 +907,6 @@ class ExpenseReport extends CommonObject
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
if ($this->fk_statut != 2)
|
|
|
{
|
|
|
$now = dol_now();
|
|
@@ -918,7 +917,7 @@ class ExpenseReport extends CommonObject
|
|
|
$sql.= ", ref_number_int = ".$ref_number_int;
|
|
|
}
|
|
|
$sql.= ' WHERE rowid = '.$this->id;
|
|
|
-
|
|
|
+
|
|
|
$resql=$this->db->query($sql);
|
|
|
if ($resql)
|
|
|
{
|
|
@@ -1635,11 +1634,12 @@ class ExpenseReport extends CommonObject
|
|
|
if ($option == 'topay' && $this->status != 5) return false;
|
|
|
|
|
|
$now = dol_now();
|
|
|
-
|
|
|
if ($option == 'toapprove')
|
|
|
- return $this->datevalid < ($now - $conf->expensereport->approve->warning_delay);
|
|
|
+ {
|
|
|
+ return ($this->datevalid?$this->datevalid:$this->date_valid) < ($now - $conf->expensereport->approve->warning_delay);
|
|
|
+ }
|
|
|
else
|
|
|
- return $this->datevalid < ($now - $conf->expensereport->payment->warning_delay);
|
|
|
+ return ($this->datevalid?$this->datevalid:$this->date_valid) < ($now - $conf->expensereport->payment->warning_delay);
|
|
|
}
|
|
|
}
|
|
|
|