mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-13 11:15:21 +01:00
Fix: If multiprice is enabled and level is not defined for customer, we always use the level 1. We can't use the denormalized price stored in product table as this price is the last price saved (it might be any level) and should never bee seen by user when multiprice is activated.
So we force the level to 1 if not defined.
This commit is contained in:
@@ -18,21 +18,20 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
\file htdocs/commonobject.class.php
|
||||
\ingroup core
|
||||
\brief Fichier de la classe mere des classes metiers (facture, contrat, propal, commande, etc...)
|
||||
\version $Id$
|
||||
* \file htdocs/commonobject.class.php
|
||||
* \ingroup core
|
||||
* \brief Fichier de la classe mere des classes metiers (facture, contrat, propal, commande, etc...)
|
||||
* \version $Id$
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
\class CommonObject
|
||||
\brief Classe mere pour heritage des classes metiers
|
||||
* \class CommonObject
|
||||
* \brief Classe mere pour heritage des classes metiers
|
||||
*/
|
||||
|
||||
class CommonObject
|
||||
{
|
||||
|
||||
/**
|
||||
* \brief Ajoute un contact associe au l'entite definie dans $this->element
|
||||
* \param fk_socpeople Id du contact a ajouter
|
||||
@@ -352,9 +351,15 @@ class CommonObject
|
||||
*/
|
||||
function fetch_client()
|
||||
{
|
||||
global $conf;
|
||||
|
||||
$client = new Societe($this->db);
|
||||
$result=$client->fetch($this->socid);
|
||||
$this->client = $client;
|
||||
|
||||
// Use first price level if level not defined for third party
|
||||
if ($conf->global->PRODUIT_MULTIPRICES && empty($this->client->price_level)) $this->client->price_level=1;
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user