Merge branch '8.0' of git@github.com:Dolibarr/dolibarr.git into 9.0

Conflicts:
	htdocs/contrat/class/contrat.class.php
This commit is contained in:
Laurent Destailleur 2019-03-09 00:44:31 +01:00
commit 57b9be53b3

View File

@ -913,6 +913,7 @@ class Contrat extends CommonObject
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
$sql.= ")";
$resql=$this->db->query($sql);
if ($resql)
{
$error=0;
@ -930,8 +931,8 @@ class Contrat extends CommonObject
{
$modCodeContract = new $module();
if (!empty($modCodeContract->code_auto)) {
// Update ref
if (! empty($modCodeContract->code_auto)) {
// Force the ref to a draft value if numbering module is an automatic numbering
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
if ($this->db->query($sql))
{
@ -940,9 +941,6 @@ class Contrat extends CommonObject
$this->ref="(PROV".$this->id.")";
}
}
} else {
$error++;
$this->error='Failed to get PROV number';
}
}