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:
Laurent Destailleur
2009-06-19 07:32:39 +00:00
parent 127ab8911d
commit 2be9a2fdb4
11 changed files with 73 additions and 59 deletions

View File

@@ -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;
}