Merge branch 'develop' of https://github.com/bafbes/dolibarr into dev
This commit is contained in:
commit
7ecb263a04
@ -1001,26 +1001,30 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) return 0;
|
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id))
|
||||||
|
return 0;
|
||||||
|
|
||||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
require_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
|
||||||
|
|
||||||
$idtofetch=isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty);
|
$idtofetch = isset($this->socid) ? $this->socid : (isset($this->fk_soc) ? $this->fk_soc : $this->fk_thirdparty);
|
||||||
if ($force_thirdparty_id) $idtofetch=$force_thirdparty_id;
|
if ($force_thirdparty_id)
|
||||||
|
$idtofetch = $force_thirdparty_id;
|
||||||
|
|
||||||
$thirdparty = new Societe($this->db);
|
if ($idtofetch) {
|
||||||
$result=$thirdparty->fetch($idtofetch);
|
$thirdparty = new Societe($this->db);
|
||||||
$this->client = $thirdparty; // deprecated
|
$result = $thirdparty->fetch($idtofetch);
|
||||||
$this->thirdparty = $thirdparty;
|
$this->client = $thirdparty; // deprecated
|
||||||
|
$this->thirdparty = $thirdparty;
|
||||||
|
|
||||||
// Use first price level if level not defined for third party
|
// Use first price level if level not defined for third party
|
||||||
if (! empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->thirdparty->price_level))
|
if (!empty($conf->global->PRODUIT_MULTIPRICES) && empty($this->thirdparty->price_level)) {
|
||||||
{
|
$this->client->price_level = 1; // deprecated
|
||||||
$this->client->price_level=1; // deprecated
|
$this->thirdparty->price_level = 1;
|
||||||
$this->thirdparty->price_level=1;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
} else
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user