diff --git a/cashdesk/facturation_verif.php b/cashdesk/facturation_verif.php
index b228a08..bcdb28b 100755
--- a/cashdesk/facturation_verif.php
+++ b/cashdesk/facturation_verif.php
@@ -21,6 +21,11 @@ require('../main.inc.php');
 require_once(DOL_DOCUMENT_ROOT.'/cashdesk/include/environnement.php');
 require_once(DOL_DOCUMENT_ROOT.'/cashdesk/class/Facturation.class.php');
 
+/** add Ditto */
+require_once(DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php');
+require_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
+/** end add Ditto */
+
 $obj_facturation = unserialize ($_SESSION['serObjFacturation']);
 unset ($_SESSION['serObjFacturation']);
 
@@ -59,6 +64,28 @@ switch ( $_GET['action'] )
 						$ret[$key] = $value;
 					}
 
+					/** add Ditto for MultiPrix*/
+					if(true || $conf->global->PRODUIT_MULTIPRICES)
+					{
+						$thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
+						$productid = $ret['rowid'];
+						
+						$societe = new Societe($db);
+						$societe->fetch($thirdpartyid);
+						
+						$product = new Product($db, $productid);
+						
+						if(isset($product->multiprices[$societe->price_level]))
+						{
+							$ret['price'] = $product->multiprices_ttc[$societe->price_level];
+							// $product->multiprices_min[$societe->price_level];
+							// $product->multiprices_min_ttc[$societe->price_level];
+							// $product->multiprices_base_type[$societe->price_level];
+							$ret['tva_tx'] = $product->multiprices_tva_tx[$societe->price_level];
+						}
+					}						
+					/** end add Ditto */
+					
 					$obj_facturation->id( $ret['rowid'] );
 					$obj_facturation->ref( $ret['ref'] );
 					$obj_facturation->stock( $ret['reel'] );
diff --git a/cashdesk/tpl/liste_articles.tpl.php b/cashdesk/tpl/liste_articles.tpl.php
index b90ccf4..f3da71d 100644
--- a/cashdesk/tpl/liste_articles.tpl.php
+++ b/cashdesk/tpl/liste_articles.tpl.php
@@ -3,6 +3,13 @@ $langs->load("main");
 $langs->load("bills");
 $langs->load("cashdesk");
 ?>
+<?php
+/** add Ditto */
+require_once(DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php');
+require_once(DOL_DOCUMENT_ROOT.'/product/class/product.class.php');
+/** end add Ditto */
+?>
+
 <!--Copyright (C) 2007-2008 Jeremie Ollivier <jeremie.o@laposte.net>
 
 This program is free software; you can redistribute it and/or modify
@@ -34,12 +41,32 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 	if ( $db->num_rows($res) ) {
 
 		$ret=array(); $i=0;
+		
+		/** add Ditto for MultiPrix*/
+		$thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY'];
+		$societe = new Societe($db);
+		$societe->fetch($thirdpartyid);
+		/** end add Ditto */			
+		
 		while ( $tab = $db->fetch_array($res) )
 		{
 			foreach ( $tab as $cle => $valeur )
 			{
 				$ret[$i][$cle] = $valeur;
 			}
+			/** add Ditto for MultiPrix*/
+			if(true || $conf->global->PRODUIT_MULTIPRICES)
+			{
+				$product = new Product($db, $ret[$i]['id']);
+				
+				if(isset($product->multiprices[$societe->price_level]))
+				{
+					$ret[$i]['price'] = $product->multiprices_ttc[$societe->price_level];
+				}
+			}						
+			/** end add Ditto */			
+			
+			
 			$i++;
 		}
 		$tab = $ret;
diff --git a/compta/facture/class/facture.class.php b/compta/facture/class/facture.class.php
index e7189c1..025a12e 100644
--- a/compta/facture/class/facture.class.php
+++ b/compta/facture/class/facture.class.php
@@ -1512,7 +1512,7 @@ class Facture extends CommonObject
                             $mouvP = new MouvementStock($this->db);
                             // We decrease stock for product
                             $entrepot_id = "1"; // TODO ajouter possibilite de choisir l'entrepot
-                            $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice);
+                            $result=$mouvP->livraison($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $num); // Ditto : add invoice number
                             if ($result < 0) { $error++; }
                         }
                     }
@@ -1620,7 +1620,7 @@ class Facture extends CommonObject
                         $mouvP = new MouvementStock($this->db);
                         // We decrease stock for product
                         $entrepot_id = "1"; // TODO ajouter possibilite de choisir l'entrepot
-                        $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice);
+                        $result=$mouvP->reception($user, $this->lines[$i]->fk_product, $entrepot_id, $this->lines[$i]->qty, $this->lines[$i]->subprice, $this->ref); // Ditto : add invoice number
                     }
                 }
             }
diff --git a/core/class/html.formfile.class.php b/core/class/html.formfile.class.php
index 894a523..6817de0 100644
--- a/core/class/html.formfile.class.php
+++ b/core/class/html.formfile.class.php
@@ -242,6 +242,18 @@ class FormFile
 					include_once(DOL_DOCUMENT_ROOT.'/includes/modules/facture/modules_facture.php');
 					$model=new ModelePDFFactures();
 					$modellist=$model->liste_modeles($this->db);
+
+					/** Ditto : add selected t&c to the invoice */
+					$filescgv=glob(DOL_DOCUMENT_ROOT."/../documents/cgv/*.pdf");
+					if ($filescgv) {
+					    $cgvlist = array();
+					    foreach ($filescgv as $cgvfilename) {
+					        $cgvlist[] = basename($cgvfilename, ".pdf");
+					    }
+					} else {
+					    $cgvlist = false;
+					}
+					/** Ditto : end */
 				}
 			}
 			elseif ($modulepart == 'project')
@@ -330,13 +342,28 @@ class FormFile
 			print '<tr '.$bc[$var].'>';
 
 			// Model
+			/** Ditto : add pdf at the end of a created pdf, like t&c to an invoice
+			            more info here: www.dolibarr.fr/forum/12-howto--aide/3075-conditions-generales-de-vente
+			*/
 			if (! empty($modellist))
 			{
 				print '<td align="center">';
 				print $langs->trans('Model').' ';
 				print $html->selectarray('model',$modellist,$modelselected,$showempty,0,0);
+			    if (isset($cgvlist) && !empty($cgvlist)) {
+			        print $html->selectarray('cgv',$cgvlist,"-1",1,0,1);
+			    }
 				print '</td>';
 			}
+			/** Ditto : comment out original code for the above change
+			if (! empty($modellist))
+			{
+				print '<td align="center">';
+				print $langs->trans('Model').' ';
+				print $html->selectarray('model',$modellist,$modelselected,$showempty,0,0);
+				print '</td>';
+			}
+			*/
 			else
 			{
 				print '<td align="left">';
diff --git a/langs/fr_FR/products.lang b/langs/fr_FR/products.lang
index 3633348..65010e7 100755
--- a/langs/fr_FR/products.lang
+++ b/langs/fr_FR/products.lang
@@ -67,6 +67,7 @@ PublicPrice=Prix public
 CurrentPrice=Prix actuel
 NewPrice=Nouveau prix
 MinPrice=Prix de vente min.
+CostPrice=Prix de revient
 CantBeLessThanMinPrice=Le prix de vente ne doit pas être inférieur au minimum pour ce produit (%s HT)
 ContractStatus=État du contrat
 ContractStatusClosed=Clôturé
diff --git a/lib/agenda.lib.php b/lib/agenda.lib.php
index f432e9c..804b3b1 100755
--- a/lib/agenda.lib.php
+++ b/lib/agenda.lib.php
@@ -33,7 +33,7 @@
  * @param 		$year
  * @param 		$month
  * @param 		$day
- * @param 		$showborthday
+ * @param 		$showbirthday
  * @param 		$action
  * @param 		$filtera
  * @param 		$filtert
@@ -41,7 +41,7 @@
  * @param 		$pid
  * @param 		$socid
  */
-function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showborthday,$action,$filtera,$filtert,$filterd,$pid,$socid)
+function print_actions_filter($form,$canedit,$status,$year,$month,$day,$showbirthday,$action,$filtera,$filtert,$filterd,$pid,$socid)
 {
 	global $conf,$langs;
 
diff --git a/product/class/product.class.php b/product/class/product.class.php
index b910a50..25b3430 100644
--- a/product/class/product.class.php
+++ b/product/class/product.class.php
@@ -76,6 +76,8 @@ class Product extends CommonObject
 
 	//! Stock
 	var $stock_reel;
+	/** Ditto : */ //! Average stock value of reel stock
+	var $stock_reel_pmp;
 	//! Stock value (PMP)
 	var $pmp;
 
@@ -949,8 +951,17 @@ class Product extends CommonObject
             $sql.= " recuperableonly='".$newnpr."'";
 			$sql.= " WHERE rowid = ".$id;
 
+			/** Ditto : Only store product.price etc. in level 0 or 1 */
+			if ($level < 2)
+			{
 			dol_syslog("Product::update_price sql=".$sql, LOG_DEBUG);
 			$resql=$this->db->query($sql);
+			}
+			else
+			{
+				$resql = $resql=$this->db->query("SELECT 1 FROM ".MAIN_DB_PREFIX."product");
+			}
+
 			if ($resql)
 			{
 				$this->price = $price;
@@ -975,6 +986,40 @@ class Product extends CommonObject
 		return 1;
 	}
 
+	/** Ditto : */
+	/**
+	 *	\brief  	Modify pmp
+	 *	\param  	id          	Id of product/service to change
+	 *	\param  	newprice		New price
+	 * 	\return		int				<0 if KO, >0 if OK
+	 */
+	function update_pmp($id, $newprice)
+	{
+		global $conf,$langs;
+
+		dol_syslog("Product::update_pmp id=".$id." newprice=".$newprice);
+
+		$newpmp = price2num($newprice,'MU');
+
+		$sql = "UPDATE ".MAIN_DB_PREFIX."product SET";
+		$sql.= " pmp=".$newpmp."";
+		$sql.= " WHERE rowid = ".$id;
+
+		dol_syslog("Product::update_pmp sql=".$sql, LOG_DEBUG);
+		$resql=$this->db->query($sql);
+		if ($resql)
+		{
+			$this->pmp = $newpmp;
+		}
+		else
+		{
+			dol_print_error($this->db);
+			return 0;
+		}
+
+		return 1;
+	}
+
 
 	/**
 	 *      Load a product in memory from database
@@ -2339,6 +2384,7 @@ class Product extends CommonObject
 	function load_stock()
 	{
 		$this->stock_reel = 0;
+		$this->stock_reel_pmp = 0;
 
 		$sql = "SELECT reel, fk_entrepot, pmp";
 		$sql.= " FROM ".MAIN_DB_PREFIX."product_stock";
@@ -2357,15 +2403,16 @@ class Product extends CommonObject
 					$row = $this->db->fetch_object($result);
 					$this->stock_warehouse[$row->fk_entrepot]->real = $row->reel;
 					$this->stock_warehouse[$row->fk_entrepot]->pmp = $row->pmp;
+					$this->stock_reel_pmp+=($row->reel*($row->pmp > 0 ? $row->pmp : $this->pmp));
 					$this->stock_reel+=$row->reel;
 					$i++;
 				}
-
-				$this->no_stock = 0;
+				$this->stock_reel_pmp = ($this->stock_reel ? $this->stock_reel_pmp / $this->stock_reel : 0);
+				// $this->no_stock = 0; // Ditto : unused !?
 			}
 			else
 			{
-				$this->no_stock = 1;
+				// $this->no_stock = 1; // Ditto : unused !?
 			}
 			$this->db->free($result);
 			return 1;
diff --git a/product/liste.php b/product/liste.php
index e9dd916..4706df3 100755
--- a/product/liste.php
+++ b/product/liste.php
@@ -281,6 +281,8 @@ if ($resql)
 		{
 		 	$moreforfilter.=$langs->trans('Categories'). ': ';
 			$moreforfilter.=$htmlother->select_categories(0,$search_categ,'search_categ');
+		 	$moreforfilter.=' &nbsp; ';
+			$moreforfilter.='<input type="image" class="liste_titre" name="button_search" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/search.png" alt="'.$langs->trans("Search").'">';
 		 	$moreforfilter.=' &nbsp; &nbsp; &nbsp; ';
 		}
 	 	if ($moreforfilter)
@@ -406,10 +408,31 @@ if ($resql)
 			}
 
 			// Price
+
+			/** Ditto : if multiprice is enabled, show first and second price, else product price */
+			if($conf->global->PRODUIT_MULTIPRICES)
+			{
+				$product = new Product($db, $objp->rowid);
+
+			    // show first two prices
+				print '<td align="right">';
+				if ($product->multiprices_base_type[1] == 'TTC') print price($product->multiprices_ttc[1]).' '.$langs->trans("TTC");
+				else print price($product->multiprices[1]).' '.$langs->trans("HT");
+				print ' / ';
+				if ($product->multiprices_base_type[2] == 'TTC') print price($product->multiprices_ttc[2]).' '.$langs->trans("TTC");
+				else print price($product->multiprices[2]).' '.$langs->trans("HT");
+				print '</td>';
+
+			}
+			else
+		    {
+			/** Ditto : show product.price if not MULTIPRICES */
+
 			print '<td align="right">';
 			if ($objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC");
 			else print price($objp->price).' '.$langs->trans("HT");
 			print '</td>';
+			}
 
 			// Show stock
 			if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1)
diff --git a/product/price.php b/product/price.php
index 647577d..7c7ba3b 100755
--- a/product/price.php
+++ b/product/price.php
@@ -54,6 +54,17 @@ if ($_POST["action"] == 'update_price' && ! $_POST["cancel"] && ($user->rights->
 
 	$result = $product->fetch($_GET["id"]);
 
+	/** Ditto : Save PMP */
+	$isPMP = False;
+
+	if (isset($_POST["pmp"]))
+	{
+		$newprice=price2num($_POST["pmp"],'MU');
+		$product->update_pmp($product->id, $newprice, $user);
+		$isPMP = True;
+	}
+
+
 	// MultiPrix
 	if($conf->global->PRODUIT_MULTIPRICES)
 	{
@@ -86,7 +97,7 @@ if ($_POST["action"] == 'update_price' && ! $_POST["cancel"] && ($user->rights->
 		$newvat=str_replace('*','',$_POST["tva_tx"]);
 	}
 
-	if ($product->update_price($product->id, $newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr) > 0)
+	if ($isPMP || $product->update_price($product->id, $newprice, $newpricebase, $user, $newvat, $newprice_min, $level, $newnpr) > 0)
 	{
 		$_GET["action"] = '';
 		$mesg = '<div class="ok">'.$langs->trans("RecordSaved").'</div>';
@@ -221,6 +232,27 @@ if($conf->global->PRODUIT_MULTIPRICES)
 			{
 				print ' '.$langs->trans($product->price_base_type);
 			}
+
+			/** Ditto : Show Markup or Profit Margin */
+			if ($product->multiprices["$i"] <> 0)
+			{
+				$pmp = ($product->pmp > 0 ? $product->pmp : $product->stock_reel_pmp);
+				// Markup = (Sale price / Cost) - 1
+				$mu = ($pmp > 0 ? (($product->multiprices["$i"] / $pmp) - 1 ) : 0);
+				if($mu) print '  ( '.number_format($mu,2).' )';
+
+				// // Profit Margin = (Sale price - Cost) / Sale price
+				// $pm = ($pmp > 0 ? (($product->multiprices["$i"] - $pmp) / $product->multiprices["$i"] ) : 0);
+			}
+			/** Ditto : end */
+
+			/** Ditto : Wholesale / Retail ratio */
+			if ($i == 1 && $product->multiprices[1] <> 0 && $product->multiprices[2] <> 0)
+			{
+				print '  ( '.number_format($product->multiprices[1]/$product->multiprices[2],2).' )';
+			}
+			/** Ditto : end */
+
 			print '</td></tr>';
 
 			// Prix mini
@@ -272,6 +304,12 @@ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><t
 print $product->getLibStatut(2,0);
 print '</td></tr>';
 
+/** Ditto : Show cost price */
+print '<tr><td>'.$langs->trans("CostPrice").'</td><td>';
+print price($product->pmp);
+print '</td></tr>';
+
+
 print "</table>\n";
 
 print "</div>\n";
@@ -421,6 +459,29 @@ if ($_GET["action"] == 'edit_price' && ($user->rights->produit->creer || $user->
 		}
 
 	}
+
+	/** Ditto : Input field for pmp. This should probably be if()'ed for manufactured products */
+	print '<form action="price.php?id='.$product->id.'" method="post">';
+	print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
+	print '<input type="hidden" name="action" value="update_price">';
+	print '<input type="hidden" name="id" value="'.$product->id.'">';
+	print '<table class="border" width="100%">';
+
+	// PMP
+	print '<tr><td width="20%">';
+	$text="Prix de revient";
+	print $html->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1);
+	print '</td><td>';
+	print '<input name="pmp" size="10" value="'.price($product->pmp).'">';
+	print '</td></tr>';
+
+
+	print '<tr><td colspan="2" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'">&nbsp;';
+	print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></td></tr>';
+	print '</table>';
+	print '</form>';
+
+	/** Ditto : end */
 }
 
 
diff --git a/product/stock/class/entrepot.class.php b/product/stock/class/entrepot.class.php
index 5fd25dc..71e35d7 100644
--- a/product/stock/class/entrepot.class.php
+++ b/product/stock/class/entrepot.class.php
@@ -356,6 +356,38 @@ class Entrepot extends CommonObject
 
 		$ret=array();
 
+		/** Ditto : correct value to take pmp from product if no warehouse pmp */
+		{
+			$ret['nb'] = 0;
+			$ret['value'] = 0;
+			
+			$sql = "SELECT ps.pmp as pspmp, ps.reel as psreel, p.pmp as ppmp";
+			$sql.= " FROM ".MAIN_DB_PREFIX."product_stock as ps";
+			$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product as p ON ps.fk_product = p.rowid";
+			$sql.= " WHERE ps.fk_entrepot = ".$this->id;
+			$sql.= " AND ps.reel <> 0";	// no need for stock is 0 (no product in this warehouse)
+			if (!$user->rights->produit->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 0)';
+			if (!$user->rights->service->hidden) $sql.=' AND (p.hidden=0 OR p.fk_product_type != 1)';
+
+			$pres = $this->db->query($sql) ;
+			if ($pres)
+			{
+				while($product = $this->db->fetch_array($pres))
+				{
+					$ret['nb'] += $product['psreel'];
+					$ret['value'] += $product['psreel'] * ($product['pspmp'] > 0 ? $product['pspmp'] : $product['ppmp']);
+				}
+				$this->db->free($pres);
+				return $ret;
+			}
+			else
+			{
+				$this->error=$this->db->lasterror();
+				return -1;
+			}
+		}
+		/** Ditto : end */
+
 		$sql = "SELECT sum(ps.reel) as nb, sum(ps.reel * ps.pmp) as value";
 		$sql .= " FROM ".MAIN_DB_PREFIX."product_stock as ps, ".MAIN_DB_PREFIX."product as p";
 		$sql .= " WHERE ps.fk_entrepot = ".$this->id." AND ps.fk_product=p.rowid";
@@ -369,8 +401,7 @@ class Entrepot extends CommonObject
 			$obj = $this->db->fetch_object($result);
 			$ret['nb']=$obj->nb;
 			$ret['value']=$obj->value;
-
-			$this->db->free();
+			$this->db->free($result);
 		}
 		else
 		{
diff --git a/product/stock/class/mouvementstock.class.php b/product/stock/class/mouvementstock.class.php
index 8b57981..ea7d367 100644
--- a/product/stock/class/mouvementstock.class.php
+++ b/product/stock/class/mouvementstock.class.php
@@ -286,7 +286,7 @@ class MouvementStock
 			{
 				if($item->etat_stock != 0) array_push($products_compo,$item);
 			}
-			$this->db->free($resql);
+			$this->db->free($all);
 		}
 		else
 		{
@@ -342,7 +342,6 @@ class MouvementStock
 			$obj=$this->db->fetch_object($resql);
 			$nbSP=$obj->nb;
 		}
-		$this->db->free($resql);
 		return $nbSP;
 	}
 
diff --git a/product/stock/fiche.php b/product/stock/fiche.php
index 5f9ea6a..8310b2d 100755
--- a/product/stock/fiche.php
+++ b/product/stock/fiche.php
@@ -348,7 +348,8 @@ else
 			$totalunit=0;
 			$totalvalue=0;
 
-			$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.fk_product_type as type,";
+			/** Ditto : add p.pmp as ppmp*/
+			$sql = "SELECT p.rowid as rowid, p.ref, p.label as produit, p.fk_product_type as type, p.pmp as ppmp,";
 			$sql.= " ps.pmp, ps.reel as value";
 			$sql.= " FROM ".MAIN_DB_PREFIX."product_stock ps, ".MAIN_DB_PREFIX."product p";
 			$sql.= " WHERE ps.fk_product = p.rowid";
@@ -407,6 +408,9 @@ else
 					print '<td align="right">'.$objp->value.'</td>';
 					$totalunit+=$objp->value;
 
+					/** Ditto : either ps.pmp or p.pmp */
+					$objp->pmp = ($objp->pmp <>0 ? $objp->pmp : $objp->ppmp);
+					
 					print '<td align="right">'.price(price2num($objp->pmp,'MU')).'</td>';
 
 					print '<td align="right">'.price(price2num($objp->pmp*$objp->value,'MT')).'</td>';
@@ -434,7 +438,7 @@ else
 				print '<tr class="liste_total"><td class="liste_total" colspan="2">'.$langs->trans("Total").'</td>';
 				print '<td class="liste_total" align="right">'.$totalunit.'</td>';
 				print '<td class="liste_total">&nbsp;</td>';
-				print '<td class="liste_total" align="right">'.$totalvalue.'</td>';
+				print '<td class="liste_total" align="right">'.price(price2num($totalvalue,'MT')).'</td>';
 				print '<td class="liste_total">&nbsp;</td>';
 				print '<td class="liste_total">&nbsp;</td>';
 				print '</tr>';
diff --git a/product/stock/product.php b/product/stock/product.php
index 14abf79..6bcb570 100755
--- a/product/stock/product.php
+++ b/product/stock/product.php
@@ -203,6 +203,13 @@ if ($_GET["id"] || $_GET["ref"])
 		print '</td>';
 		print '</tr>';
 
+		/** Ditto : show cost price */
+		// Cost Price
+		print '<tr><td>'.$langs->trans("CostPrice").'</td>';
+		print '<td>'.$product->pmp;
+		print '</td>';
+		print '</tr>';
+
 		// Calculating a theorical value of stock if stock increment is done on real sending
 		if ($conf->global->STOCK_CALCULATE_ON_SHIPMENT)
 		{
@@ -458,11 +465,11 @@ if ($resql)
 		print '<tr '.$bc[$var].'>';
 		print '<td>'.$entrepotstatic->getNomUrl(1).'</td>';
 		print '<td align="right">'.$obj->reel.($obj->reel<0?' '.img_warning():'').'</td>';
-		print '<td align="right">'.price2num($obj->pmp,'MU').'</td>';
-		print '<td align="right">'.price(price2num($obj->pmp*$obj->reel,'MT')).'</td>';
+		print '<td align="right">'.price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp),'MU').'</td>'; // Ditto : Show PMP from movement or from product
+		print '<td align="right">'.price(price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp)*$obj->reel,'MT')).'</td>'; // Ditto : Show PMP from movement or from product
 		print '</tr>'; ;
 		$total = $total + $obj->reel;
-		$totalvalue = $totalvalue + price2num($obj->pmp*$obj->reel,'MT');
+		$totalvalue = $totalvalue + price2num(($obj->pmp > 0 ? $obj->pmp : $product->pmp)*$obj->reel,'MT'); // Ditto : Show PMP from movement or from product
 		$i++;
 		$var=!$var;
 	}
diff --git a/product/stock/valo.php b/product/stock/valo.php
index 057872f..a1f969d 100755
--- a/product/stock/valo.php
+++ b/product/stock/valo.php
@@ -107,6 +107,13 @@ if ($result)
 			print '<td><a href="fiche.php?id='.$objp->ref.'">'.img_object($langs->trans("ShowWarehouse"),'stock').' '.$objp->label.'</a></td>';
 			print '<td>'.$objp->lieu.'</td>';
 			print '<td align="right">';
+			/** Ditto : correct estimatedvalue to take pmp from product if no warehouse pmp */
+			{
+				$entrepot->info($objp->ref);
+				$calcproducts=$entrepot->nb_products();
+				$objp->estimatedvalue = $calcproducts['value'];
+			}
+			/** Ditto : end */
 			print price(price2num($objp->estimatedvalue,'MT'));
 			print '</td>';
 			print '<td align="right">'.$entrepot->LibStatut($objp->statut,5).'</td>';
diff --git a/societe/societe.php b/societe/societe.php
index 4ae2482..1f0be40 100644
--- a/societe/societe.php
+++ b/societe/societe.php
@@ -313,7 +313,8 @@ if ($resql)
 		print "<tr $bc[$var]><td>";
 		$companystatic->id=$obj->rowid;
 		$companystatic->nom=$obj->nom;
-		print $companystatic->getNomUrl(1,'',24);
+		$companystatic->client=$obj->client; // Ditto : get the links right
+		print $companystatic->getNomUrl(1,($obj->fournisseur ? 'supplier' : 'customer'),24);
 		print "</td>\n";
 		print "<td>".$obj->ville."</td>\n";
 		print "<td>".$obj->idprof1."</td>\n";
