mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-07 16:41:48 +01:00
FIX better fix to generate a PROV ref after clone
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user