FIX Pb in management of date end of projects
This commit is contained in:
parent
ff4eddb8dc
commit
71a573df61
@ -785,6 +785,7 @@ else
|
|||||||
// Date end
|
// Date end
|
||||||
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
||||||
print dol_print_date($object->date_end,'day');
|
print dol_print_date($object->date_end,'day');
|
||||||
|
if ($object->hasDelay()) print img_warning($langs->trans('Late'));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
if (! empty($conf->global->PROJECT_USE_OPPORTUNITIES))
|
||||||
|
|||||||
@ -237,6 +237,14 @@ class Project extends CommonObject
|
|||||||
$this->description = trim($this->description);
|
$this->description = trim($this->description);
|
||||||
if ($this->opp_amount < 0) $this->opp_amount='';
|
if ($this->opp_amount < 0) $this->opp_amount='';
|
||||||
if ($this->opp_percent < 0) $this->opp_percent='';
|
if ($this->opp_percent < 0) $this->opp_percent='';
|
||||||
|
if ($this->date_end && $this->date_end < $this->date_start)
|
||||||
|
{
|
||||||
|
$this->error = $langs->trans("ErrorDateEndLowerThanDateStart");
|
||||||
|
$this->errors[] = $this->error;
|
||||||
|
$this->db->rollback();
|
||||||
|
dol_syslog(get_class($this)."::update error -3 " . $this->error, LOG_ERR);
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
|
||||||
if (dol_strlen(trim($this->ref)) > 0)
|
if (dol_strlen(trim($this->ref)) > 0)
|
||||||
{
|
{
|
||||||
@ -1721,11 +1729,11 @@ class Project extends CommonObject
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (! ($this->statut == 1)) return false;
|
if (! ($this->statut == 1)) return false;
|
||||||
if (! $this->datee) return false;
|
if (! $this->datee && ! $this->date_end) return false;
|
||||||
|
|
||||||
$now = dol_now();
|
$now = dol_now();
|
||||||
|
|
||||||
return $this->datee < ($now - $conf->projet->warning_delay);
|
return ($this->datee ? $this->datee : $this->date_end) < ($now - $conf->projet->warning_delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user