diff --git a/htdocs/langs/en_US/main.lang b/htdocs/langs/en_US/main.lang index 4e20989870f..355393c2891 100644 --- a/htdocs/langs/en_US/main.lang +++ b/htdocs/langs/en_US/main.lang @@ -262,6 +262,10 @@ NoExample=No example FindBug=Report a bug NbOfCustomers=Number of customers NbOfLines=Number of lines +NbOfObjects=Number of objects +NbOfReferers=Number of referers +Referers=Referers +TotalQuantity=Total quantity # Countries CountryFR=France CountryBE=Belgium diff --git a/htdocs/langs/fr_FR/main.lang b/htdocs/langs/fr_FR/main.lang index 2ab8b8c0f9c..79465a030b6 100644 --- a/htdocs/langs/fr_FR/main.lang +++ b/htdocs/langs/fr_FR/main.lang @@ -262,6 +262,10 @@ NoExample=Pas d'exemple FindBug=Signaler un bug NbOfCustomers=Nombre de clients NbOfLines=Nombre de lignes +NbOfObjects=Nombre d'objets +NbOfReferers=Nombre de référents +Referers=Référents +TotalQuantity=Quantité totale # Countries CountryFR=France CountryBE=Belgique diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index acb961b6422..f14bde9c518 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -348,7 +348,7 @@ if ($_GET["id"]) $h++; $head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id; - $head[$h][1] = $langs->trans('Bills'); + $head[$h][1] = $langs->trans('Referers'); $h++; dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 817706d33d6..2dee8a2a40d 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -20,7 +20,6 @@ * * $Id$ * $Source$ - * */ /** @@ -221,7 +220,7 @@ if ($_GET["id"]) $h++; $head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id; - $head[$h][1] = $langs->trans('Bills'); + $head[$h][1] = $langs->trans('Referers'); $h++; dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php index f1e6ebc8178..43576f4088b 100644 --- a/htdocs/product/photos.php +++ b/htdocs/product/photos.php @@ -147,7 +147,7 @@ if ($_GET["id"]) $h++; $head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id; - $head[$h][1] = $langs->trans('Bills'); + $head[$h][1] = $langs->trans('Referers'); $h++; dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); diff --git a/htdocs/product/price.php b/htdocs/product/price.php index a191ce4a398..19c10582d20 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -20,7 +20,6 @@ * * $Id$ * $Source$ - * */ /** @@ -138,7 +137,7 @@ $head[$h][1] = $langs->trans('Packs'); $h++; $head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id; -$head[$h][1] = $langs->trans("Bills"); +$head[$h][1] = $langs->trans("Referers"); $h++; dolibarr_fiche_head($head, $hselected, $langs->trans("CardProduct".$product->type).' : '.$product->ref); diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index e8bac873f4f..b4f80e032e2 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -45,21 +45,21 @@ if ($page == -1) $page = 0; $limit = $conf->liste_limit; $offset = $limit * $page ; - if ($user->societe_id > 0) { $action = ''; $socid = $user->societe_id; } -llxHeader(); - /* * Affiche fiche * */ +llxHeader(); + + if ($_GET["id"]) { $product = new Product($db); @@ -126,7 +126,7 @@ if ($_GET["id"]) $h++; $head[$h][0] = DOL_URL_ROOT."/product/stats/facture.php?id=".$product->id; - $head[$h][1] = $langs->trans('Bills'); + $head[$h][1] = $langs->trans('Referers'); $hselected=$h; $h++; @@ -137,20 +137,95 @@ if ($_GET["id"]) print '
| '.$langs->trans("Ref").' | '.$product->ref.' | '; + print ''.$langs->trans("Ref").' | '.$product->ref.' | '; print '|||
| '.$langs->trans("Label").' | '.$product->libelle.' | '; + print '|||||
| '.$langs->trans("Label").' | '.$product->libelle.' | '; print '|||||
| '.$langs->trans("SellingPrice").' | '.price($product->price).' | |||||
| '.$langs->trans("SellingPrice").' | '.price($product->price).' | |||||
| '.$langs->trans("Status").' | '; + print ' | |||||
| '.$langs->trans("Status").' | '; if ($product->envente) print $langs->trans("OnSell"); else print $langs->trans("NotOnSell"); print ' | |||||
| '.$langs->trans("Referers").' | '; + print ''.$langs->trans("NbOfCustomers").' | '; + print ''.$langs->trans("NbOfReferers").' | '; + print ''.$langs->trans("TotalQuantity").' | '; + print '|||
| '; + print ''.$langs->trans("Proposals").''; + print ' | '; + print $product->stats_propale['customers']; + print ' | '; + print $product->stats_propale['nb']; + print ' | '; + print $product->stats_propale['qty']; + print ' | '; + print '|||
| '; + print ''.$langs->trans("Orders").''; + print ' | '; + print $product->stats_commande['customers']; + print ' | '; + print $product->stats_commande['nb']; + print ' | '; + print $product->stats_commande['qty']; + print ' | '; + print '|||
| '; + print ''.$langs->trans("Contracts").''; + print ' | '; + print $product->stats_contrat['customers']; + print ' | '; + print $product->stats_contrat['nb']; + print ' | '; + print $product->stats_contrat['qty']; + print ' | '; + print '|||
| '; + print ''.$langs->trans("Bills").''; + print ' | '; + print $product->stats_facture['customers']; + print ' | '; + print $product->stats_facture['nb']; + print ' | '; + print $product->stats_facture['qty']; + print ' | '; + print '|||
| '.$langs->trans("Ref").' | '.$product->ref.' | '; + print ''.$langs->trans("Ref").' | '.$product->ref.' | '; print '|||
| '.$langs->trans("Label").' | '.$product->libelle.' | |||||
| '.$langs->trans("Label").' | '.$product->libelle.' | |||||
| '.$langs->trans("SellingPrice").' | '.price($product->price).' | '; - print '';
- // Propals
- if ($conf->propal->enabled)
- {
- $langs->load("propal");
- print ''.$langs->trans("Proposals").' : '.$product->count_propale($socid);
- print " (Proposé à ".$product->count_propale_client($socid)." clients) "; - } - // Commande - if ($conf->commande->enabled) - { - $langs->load("orders"); - print ''.$langs->trans("Orders").' : '.$product->count_facture($socid)." "; - } - // Factures - if ($conf->facture->enabled) - { - $langs->load("bills"); - print ''.$langs->trans("Bills").' : '.$product->count_facture($socid); - } - print ' | ||||
| '.$langs->trans("SellingPrice").' | '.price($product->price).' | '; // Statut - print '|||||
| '.$langs->trans("Status").' | '; + print ' | |||||
| '.$langs->trans("Status").' | '; if ($product->envente) print $langs->trans("OnSell"); else print $langs->trans("NotOnSell"); print ' | |||||
| Nombre de ventes sur les 12 derniers mois | ';
- print 'Nombre de pièces vendues | ||
| ';
- $file=$product->id.'/vente12mois.png';
- print ' | ';
- $file=$product->id.'/vendu12mois.png';
- print ' | ||
| '.$langs->trans("GeneratedOn",dolibarr_print_date(filemtime($filenbvente),"%d %b %Y %H:%M:%S")).' | '; + $ret=$product->load_stats_propale($socid); + if ($ret < 0) dolibarr_print_error($db); + $langs->load("propal"); + print '|||
| '; + print ''.$langs->trans("Proposals").''; + print ' | '; + print $product->stats_propale['customers']; + print ' | '; + print $product->stats_propale['nb']; + print ' | '; + print $product->stats_propale['qty']; + print ' | '; + print ''.$langs->trans("ChartNotGenerated").' | '; + $ret=$product->load_stats_commande($socid); + if ($ret < 0) dolibarr_print_error($db); + $langs->load("orders"); + print '
| '; + print ''.$langs->trans("Orders").''; + print ' | '; + print $product->stats_commande['customers']; + print ' | '; + print $product->stats_commande['nb']; + print ' | '; + print $product->stats_commande['qty']; + print ' | '; + print '['.$langs->trans("ReCalculate").'] | '; - if (file_exists($filenbpiece) && filemtime($filenbpiece)) + // Contrats + if ($conf->contrat->enabled) { - print ''.$langs->trans("GeneratedOn",dolibarr_print_date(filemtime($filenbpiece),"%d %b %Y %H:%M:%S")).' | '; + $ret=$product->load_stats_contrat($socid); + if ($ret < 0) dolibarr_print_error($db); + $langs->load("contracts"); + print '
| '; + print ''.$langs->trans("Contracts").''; + print ' | '; + print $product->stats_contrat['customers']; + print ' | '; + print $product->stats_contrat['nb']; + print ' | '; + print $product->stats_contrat['qty']; + print ' | '; + print ''.$langs->trans("ChartNotGenerated").' | '; + $ret=$product->load_stats_facture($socid); + if ($ret < 0) dolibarr_print_error($db); + $langs->load("bills"); + print '
| '; + print ''.$langs->trans("Bills").''; + print ' | '; + print $product->stats_facture['customers']; + print ' | '; + print $product->stats_facture['nb']; + print ' | '; + print $product->stats_facture['qty']; + print ' | '; + print '['.$langs->trans("ReCalculate").'] | '; - print '
| Statistiques effectuées sur les factures payées uniquement | |||
| Nombre de propositions commerciales sur les 12 derniers mois | ';
print '- | ||||
| ';
$file=$product->id.'/'.$img_propal_name;
print ' | '; - - // Place pour autre graphique - - print ' | ||||
| '.$langs->trans("GeneratedOn",dolibarr_print_date(filemtime($filenbpropal),"%d %b %Y %H:%M:%S")).' | '; @@ -284,10 +305,41 @@ if ($_GET["id"]) print ''.$langs->trans("ChartNotGenerated").' | '; } print '['.$langs->trans("ReCalculate").'] | |||
| Nombre de ventes sur les 12 derniers mois | ';
+ print 'Nombre de pièces vendues | ||||
| ';
+ $file=$product->id.'/vente12mois.png';
+ print ' | ';
+ $file=$product->id.'/vendu12mois.png';
+ print ' | ||||
| '.$langs->trans("GeneratedOn",dolibarr_print_date(filemtime($filenbvente),"%d %b %Y %H:%M:%S")).' | '; + } + else + { + print ''.$langs->trans("ChartNotGenerated").' | '; + } + print '['.$langs->trans("ReCalculate").'] | '; + if (file_exists($filenbpiece) && filemtime($filenbpiece)) + { + print ''.$langs->trans("GeneratedOn",dolibarr_print_date(filemtime($filenbpiece),"%d %b %Y %H:%M:%S")).' | '; + } + else + { + print ''.$langs->trans("ChartNotGenerated").' | '; + } + print '['.$langs->trans("ReCalculate").'] |
| '.$langs->trans("Ref").' | '.$product->ref.' | '; - print ''.$langs->trans("Statistics").' |
| '.$langs->trans("Label").' | '.$product->libelle.' | '; - print '';
- // Propals
- if ($conf->propal->enabled) {
- $langs->load("propal");
- print ''.$langs->trans("Proposals").' : '.$product->count_propale($socid);
- print " (Proposé à ".$product->count_propale_client($socid)." clients) "; - } - // Commande - if ($conf->commande->enabled) { - $langs->load("orders"); - print ''.$langs->trans("Orders").' : '.$product->count_facture($socid)." "; - } - // Factures - if ($conf->facture->enabled) { - $langs->load("bills"); - print ''.$langs->trans("Bills").' : '.$product->count_facture($socid); - } - print ' |
| '.$langs->trans("CurrentPrice").' | '.price($product->price).' |
| '.$langs->trans("Ref").' | '.$product->ref.' | '; + print '||
| '.$langs->trans("Label").' | '.$product->libelle.' | ||
| '.$langs->trans("SellingPrice").' | '.price($product->price).' | ||
| '; - print img_object($langs->trans("ShowPropal"),"propal").' '; - print $objp->ref; - print " | \n"; - print ''.img_object($langs->trans("ShowCompany"),"company").' '.$objp->nom.' | '; - print ""; - print strftime("%d %B %Y",$objp->df)." | "; - print "
| '; + print img_object($langs->trans("ShowPropal"),"propal").' '; + print $objp->ref; + print " | \n"; + print ''.img_object($langs->trans("ShowCompany"),"company").' '.$objp->nom.' | '; + print ""; + print strftime("%d %B %Y",$objp->df)." | "; + print "