';
// Generation des graphs
@@ -141,16 +152,16 @@ if ($_GET["id"] || $_GET["ref"])
$graphfiles=array(
'propal' =>array('modulepart'=>'productstats_proposals',
'file' => $product->id.'/propal12m.png',
- 'label' => $langs->trans("Nombre propal sur les 12 derniers mois")),
+ 'label' => ($mode=='byunit'?$langs->trans("NumberOfUnitsProposals"):$langs->trans("NumberOfProposals"))),
'orders' =>array('modulepart'=>'productstats_orders',
'file' => $product->id.'/orders12m.png',
- 'label' => $langs->trans("Nombre commande clients sur les 12 derniers mois")),
+ 'label' => ($mode=='byunit'?$langs->trans("NumberOfUnitsCustomerOrders"):$langs->trans("NumberOfCustomerOrders"))),
'invoices' =>array('modulepart'=>'productstats_invoices',
'file' => $product->id.'/invoices12m.png',
- 'label' => $langs->trans("Nombre facture clients sur les 12 derniers mois")),
+ 'label' => ($mode=='byunit'?$langs->trans("NumberOfUnitsCustomerInvoices"):$langs->trans("NumberOfCustomerInvoices"))),
'invoicessuppliers'=>array('modulepart'=>'productstats_invoicessuppliers',
'file' => $product->id.'/invoicessuppliers12m.png',
- 'label' => $langs->trans("Nombre facture fournisseurs sur les 12 derniers mois")),
+ 'label' => ($mode=='byunit'?$langs->trans("NumberOfUnitsSupplierInvoices"):$langs->trans("NumberOfSupplierInvoices"))),
// 'orderssuppliers' =>array('modulepart'=>'productstats_orderssuppliers', 'file' => $product->id.'/orderssuppliers12m.png', 'label' => $langs->trans("Nombre commande fournisseurs sur les 12 derniers mois")),
// 'contracts' =>array('modulepart'=>'productstats_contracts', 'file' => $product->id.'/contracts12m.png', 'label' => $langs->trans("Nombre contrats sur les 12 derniers mois")),
@@ -168,10 +179,10 @@ if ($_GET["id"] || $_GET["ref"])
$graph_data = array();
// \todo Test si deja existant et recent, on ne genere pas
- if ($key == 'propal') $graph_data = $product->get_nb_propal($socid);
- if ($key == 'orders') $graph_data = $product->get_nb_order($socid);
- if ($key == 'invoices') $graph_data = $product->get_nb_vente($socid);
- if ($key == 'invoicessuppliers') $graph_data = $product->get_nb_achat($socid);
+ if ($key == 'propal') $graph_data = $product->get_nb_propal($socid,$mode);
+ if ($key == 'orders') $graph_data = $product->get_nb_order($socid,$mode);
+ if ($key == 'invoices') $graph_data = $product->get_nb_vente($socid,$mode);
+ if ($key == 'invoicessuppliers') $graph_data = $product->get_nb_achat($socid,$mode);
if (is_array($graph_data))
{
$px->SetData($graph_data);
@@ -234,7 +245,7 @@ if ($_GET["id"] || $_GET["ref"])
{
print '| '.($mesg?''.$mesg.'':$langs->trans("ChartNotGenerated")).' | ';
}
- print ''.img_picto($langs->trans("ReCalculate"),'refresh').' | ';
+ print ''.img_picto($langs->trans("ReCalculate"),'refresh').' | ';
print '';
print '
';