FIX better fix to generate a PROV ref after clone
This commit is contained in:
parent
b222800012
commit
f385f8bcfa
@ -978,6 +978,7 @@ class Commande extends CommonOrder
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->id=0;
|
$this->id=0;
|
||||||
|
$this->ref = '';
|
||||||
$this->statut=self::STATUS_DRAFT;
|
$this->statut=self::STATUS_DRAFT;
|
||||||
|
|
||||||
// Clear fields
|
// Clear fields
|
||||||
@ -987,17 +988,8 @@ class Commande extends CommonOrder
|
|||||||
$this->date_validation = '';
|
$this->date_validation = '';
|
||||||
$this->ref_client = '';
|
$this->ref_client = '';
|
||||||
|
|
||||||
// Set ref
|
|
||||||
$this->ref = '(PROV)';
|
|
||||||
|
|
||||||
// Create clone
|
// Create clone
|
||||||
$result=$this->create($user);
|
$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 ($result < 0) $error++;
|
||||||
|
|
||||||
if (! $error)
|
if (! $error)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user