diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php
index 687ae393186..5267d6245c8 100644
--- a/htdocs/product/fiche.php
+++ b/htdocs/product/fiche.php
@@ -279,8 +279,6 @@ else
print '';
print '
';
- print($mesg);
-
$head[0][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id;
$head[0][1] = 'Fiche';
@@ -290,9 +288,8 @@ else
$head[2][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id;
$head[2][1] = 'Statistiques';
-
dolibarr_fiche_head($head, 0, 'Fiche '.$types[$product->type].' : '.$product->ref);
-
+ print($mesg);
print '
';
print "";
print '| Référence | '.$product->ref.' | ';
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 393c791d1ae..046bbabb9f4 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -42,12 +42,25 @@ llxHeader("","","Prix");
$product = new Product($db);
$result = $product->fetch($_GET["id"]);
+ // Zone recherche
+ print '';
+ print '
';
+
$head[0][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id;
$head[0][1] = 'Fiche';
$head[1][0] = DOL_URL_ROOT."/product/price.php?id=".$product->id;
$head[1][1] = 'Prix';
+$head[2][0] = DOL_URL_ROOT."/product/stats/fiche.php?id=".$product->id;
+$head[2][1] = 'Statistiques';
+
dolibarr_fiche_head($head, 1, 'Fiche '.$types[$product->type].' : '.$product->ref);
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index 3566f31c143..df371d7448b 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2003-2004 Rodolphe Quiedeville
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -31,10 +31,10 @@ $mesg = '';
*
*/
-if ($id)
+if ($_GET["id"])
{
$product = new Product($db);
- $result = $product->fetch($id);
+ $result = $product->fetch($_GET["id"]);
if ( $result )
{
@@ -42,14 +42,14 @@ if ($id)
print '';
print '| Référence | '.$product->ref.' | ';
- print 'Statistiques |
';
+ print 'Statistiques | ';
print "| Libellé | $product->libelle | ";
print '';
print "Propositions commerciales : ".$product->count_propale();
print " Proposé à ".$product->count_propale_client()." clients";
print " Factures : ".$product->count_facture();
print ' |
';
- print '| Prix de vente | '.price($product->price).' |
';
+ print '| Prix de vente | '.price($product->price).' |
';
print "
";
if ($page == -1)
@@ -68,11 +68,11 @@ if ($id)
$sortfield="f.datef";
}
- print_barre_liste("Factures",$page,$PHP_SELF,"&id=$id",$sortfield,$sortorder);
+ print_barre_liste("Factures",$page,$PHP_SELF,"&id=$product->id",$sortfield,$sortorder);
$sql = "SELECT distinct(f.rowid), s.nom,s.idp,f.facnumber,f.amount,".$db->pdate("f.datef")." as df,f.paye,f.rowid as facid";
$sql .= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f, ".MAIN_DB_PREFIX."facturedet as d WHERE f.fk_soc = s.idp";
- $sql .= " AND d.fk_facture = f.rowid AND d.fk_product =".$id;
+ $sql .= " AND d.fk_facture = f.rowid AND d.fk_product =".$product->id;
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit( $limit ,$offset);
diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php
index a3b01cea660..9febbcbc11e 100644
--- a/htdocs/product/stats/fiche.php
+++ b/htdocs/product/stats/fiche.php
@@ -73,7 +73,17 @@ if ($_GET["id"])
$mesg = "Graphiques générés";
}
}
-
+
+ // Zone recherche
+ print '';
+ print '
';
+
$head[0][0] = DOL_URL_ROOT."/product/fiche.php?id=".$product->id;
$head[0][1] = 'Fiche';
diff --git a/htdocs/product/stats/pre.inc.php b/htdocs/product/stats/pre.inc.php
index 26e59ac4cd6..1f2c954c29f 100644
--- a/htdocs/product/stats/pre.inc.php
+++ b/htdocs/product/stats/pre.inc.php
@@ -22,6 +22,10 @@
require("../../main.inc.php");
require(DOL_DOCUMENT_ROOT."/bargraph.class.php");
+$types[0] = "produit";
+$types[1] = "service";
+
+
function llxHeader($head = "", $urlp = "")
{
global $user, $conf;