mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-24 17:53:17 +01:00
FIX clone customer order create new order with validate ref and not with PROV
This commit is contained in:
@@ -988,14 +988,16 @@ class Commande extends CommonOrder
|
||||
$this->ref_client = '';
|
||||
|
||||
// Set ref
|
||||
require_once DOL_DOCUMENT_ROOT ."/core/modules/commande/".$conf->global->COMMANDE_ADDON.'.php';
|
||||
$obj = $conf->global->COMMANDE_ADDON;
|
||||
$modCommande = new $obj;
|
||||
$this->ref = $modCommande->getNextValue($objsoc,$this);
|
||||
|
||||
$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