diff --git a/htdocs/admin/system/gendata.php b/htdocs/admin/system/gendata.php
index e9eb5a3e15e..9d6cbc0d89b 100644
--- a/htdocs/admin/system/gendata.php
+++ b/htdocs/admin/system/gendata.php
@@ -59,8 +59,15 @@ if ($action == 'facture')
$facture->note = '';
$facture->cond_reglement = 1;
$facture->remise_percent = rand(0,50);
-
- $facture->add_product($productsid[rand(1, sizeof($productsid)-1)],rand(1,11));
+
+ $prand = rand(1,20);
+ for ($p = 0 ; $p < $prand ; $p++)
+ {
+ $pidrand = rand(1, sizeof($productsid)-1);
+ $facture->add_product($productsid[rand(1, sizeof($productsid)-1)],rand(1,11));
+ print "Ajout produit ".$productsid[$pidrand]."
";
+
+ }
$id = $facture->create($user);
if ($id)
@@ -105,13 +112,7 @@ else
$contact->nom = "Nom aléa ".time();
if ( $contact->create($user) )
{
- $prand = rand(1,20);
- print "-- génère $prand contact
";
- for ($p = 0 ; $p < $rand ; $p++)
- {
- $pidrand = rand(1, sizeof($productsid)-1);
- print "Ajout produit ".$productsid[$pidrand]."
";
- }
+
}
}
}