Update api_proposals.class.php

This commit is contained in:
Laurent Destailleur 2017-12-19 18:01:38 +01:00 committed by GitHub
parent 171e388f6d
commit 3635e88396
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -424,11 +424,11 @@ class Proposals extends DolibarrApi
}
// update end of validity date
if(!empty($this->propal->duree_validite) && !empty($this->propal->date_creation) )
if (empty($this->propal->fin_validite) && !empty($this->propal->duree_validite) && !empty($this->propal->date_creation))
{
$this->propal->fin_validite = $this->propal->date_creation + ($this->propal->duree_validite * 24 * 3600);
}
if(!empty($this->propal->fin_validite))
if (!empty($this->propal->fin_validite))
{
if($this->propal->set_echeance(DolibarrApiAccess::$user, $this->propal->fin_validite)<0)
{