Browse Source

FIX check $id is already check before

Regis Houssin 2 years ago
parent
commit
9b37754b85

+ 2 - 3
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);
 		}

+ 2 - 3
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);
 				}

+ 2 - 3
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);
 				}

+ 2 - 3
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);
 			}

+ 0 - 1
htdocs/product/stats/facture.php

@@ -200,7 +200,6 @@ if ($id > 0 || !empty($ref)) {
 			if ($result) {
 				$num = $db->num_rows($result);
 
-				// Fetch of product is mandatory
 				$option .= '&id='.$product->id;
 
 				if ($limit > 0 && $limit != $conf->liste_limit) {

+ 2 - 3
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);
 				}

+ 2 - 3
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);
 				}

+ 2 - 3
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);
 			}

+ 2 - 3
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);
 				}

+ 2 - 3
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);
 				}