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:
commit
57b9be53b3
@ -913,6 +913,7 @@ class Contrat extends CommonObject
|
|||||||
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
|
$sql.= ", ".(!empty($this->ref_ext)?("'".$this->db->escape($this->ref_ext)."'"):"NULL");
|
||||||
$sql.= ")";
|
$sql.= ")";
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
|
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
$error=0;
|
$error=0;
|
||||||
@ -930,8 +931,8 @@ class Contrat extends CommonObject
|
|||||||
{
|
{
|
||||||
$modCodeContract = new $module();
|
$modCodeContract = new $module();
|
||||||
|
|
||||||
if (!empty($modCodeContract->code_auto)) {
|
if (! empty($modCodeContract->code_auto)) {
|
||||||
// Update ref
|
// 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;
|
$sql = 'UPDATE '.MAIN_DB_PREFIX."contrat SET ref='(PROV".$this->id.")' WHERE rowid=".$this->id;
|
||||||
if ($this->db->query($sql))
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
@ -940,9 +941,6 @@ class Contrat extends CommonObject
|
|||||||
$this->ref="(PROV".$this->id.")";
|
$this->ref="(PROV".$this->id.")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
$error++;
|
|
||||||
$this->error='Failed to get PROV number';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user