2
0
forked from Wavyzz/dolibarr

FIX better fix to generate a PROV ref after clone

This commit is contained in:
phf
2015-10-28 14:34:34 +01:00
parent b222800012
commit f385f8bcfa

View File

@@ -978,6 +978,7 @@ class Commande extends CommonOrder
}
$this->id=0;
$this->ref = '';
$this->statut=self::STATUS_DRAFT;
// Clear fields
@@ -986,18 +987,9 @@ class Commande extends CommonOrder
$this->date_creation = '';
$this->date_validation = '';
$this->ref_client = '';
// Set ref
$this->ref = '(PROV)';
// Create clone
$result=$this->create($user);
if ($result < 0) $error++;
// Set new ref
$newref='(PROV'.$this->id.')';
$sql = 'UPDATE '.MAIN_DB_PREFIX."commande SET ref='".$this->db->escape($newref)."' WHERE rowid=".$this->id;
$result=$this->db->query($sql);
if ($result < 0) $error++;
if (! $error)