FIX clone customer order create new order with validate ref and not with PROV
This commit is contained in:
parent
12a08ae4e1
commit
b222800012
@ -988,14 +988,16 @@ class Commande extends CommonOrder
|
|||||||
$this->ref_client = '';
|
$this->ref_client = '';
|
||||||
|
|
||||||
// Set ref
|
// Set ref
|
||||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$conf->global->COMMANDE_ADDON.'.php';
|
$this->ref = '(PROV)';
|
||||||
$obj = $conf->global->COMMANDE_ADDON;
|
|
||||||
$modCommande = new $obj;
|
|
||||||
$this->ref = $modCommande->getNextValue($objsoc,$this);
|
|
||||||
|
|
||||||
|
|
||||||
// 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