diff --git a/htdocs/product/stats/bom.php b/htdocs/product/stats/bom.php index a8e76a178bf..f423dd2ec6f 100644 --- a/htdocs/product/stats/bom.php +++ b/htdocs/product/stats/bom.php @@ -258,12 +258,11 @@ if ($id > 0 || !empty($ref)) { } $db->free($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php index 9f38f68ee33..6d13bb95f00 100644 --- a/htdocs/product/stats/commande.php +++ b/htdocs/product/stats/commande.php @@ -183,12 +183,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php index 5a236334b5e..222db432bdf 100644 --- a/htdocs/product/stats/commande_fournisseur.php +++ b/htdocs/product/stats/commande_fournisseur.php @@ -184,12 +184,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php index 03bb1828f66..f831d54d097 100644 --- a/htdocs/product/stats/contrat.php +++ b/htdocs/product/stats/contrat.php @@ -169,12 +169,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php index c62c421d6e4..a83472b4341 100644 --- a/htdocs/product/stats/facture.php +++ b/htdocs/product/stats/facture.php @@ -200,12 +200,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index 59ca77d5937..be6964a26be 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -183,12 +183,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/facturerec.php b/htdocs/product/stats/facturerec.php index b71c24d75cb..5a31e16c26a 100644 --- a/htdocs/product/stats/facturerec.php +++ b/htdocs/product/stats/facturerec.php @@ -201,12 +201,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/mo.php b/htdocs/product/stats/mo.php index 38bebc562ed..edd20a7ee64 100644 --- a/htdocs/product/stats/mo.php +++ b/htdocs/product/stats/mo.php @@ -162,12 +162,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php index 2f6faca07a7..d13b01c8bdc 100644 --- a/htdocs/product/stats/propal.php +++ b/htdocs/product/stats/propal.php @@ -185,12 +185,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); } diff --git a/htdocs/product/stats/supplier_proposal.php b/htdocs/product/stats/supplier_proposal.php index 2136b9b26cf..afde5fe27f8 100644 --- a/htdocs/product/stats/supplier_proposal.php +++ b/htdocs/product/stats/supplier_proposal.php @@ -184,12 +184,11 @@ if ($id > 0 || !empty($ref)) { if ($result) { $num = $db->num_rows($result); + $option .= '&id='.$product->id; + if ($limit > 0 && $limit != $conf->liste_limit) { $option .= '&limit='.urlencode($limit); } - if (!empty($id)) { - $option .= '&id='.$product->id; - } if (!empty($search_month)) { $option .= '&search_month='.urlencode($search_month); }