2
0
forked from Wavyzz/dolibarr

Replace function rand with mt_rand (prepare php 8)

This commit is contained in:
Laurent Destailleur
2016-03-05 15:01:25 +01:00
parent d8045e33bb
commit d1777a6783
15 changed files with 36 additions and 36 deletions

View File

@@ -165,7 +165,7 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
$com = new Commande($db);
$com->socid = 4;
$com->date_commande = $dates[rand(1, count($dates)-1)];
$com->date_commande = $dates[mt_rand(1, count($dates)-1)];
$com->note = 'A comment';
$com->source = 1;
$com->fk_project = 0;
@@ -179,14 +179,14 @@ for ($s = 0 ; $s < GEN_NUMBER_COMMANDE ; $s++)
$result=$com->valid($user);
if ($result > 0)
{
$nbp = rand(2, 5);
$nbp = mt_rand(2, 5);
$xnbp = 0;
while ($xnbp < $nbp)
{
$prodid = rand(1, $num_prods);
$prodid = mt_rand(1, $num_prods);
$product=new Product($db);
$result=$product->fetch($prodids[$prodid]);
$result=$com->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
$result=$com->addline($product->description, $product->price, mt_rand(1,5), 0, 0, 0, $prodids[$prodid], 0, 0, 0, $product->price_base_type, $product->price_ttc, '', '', $product->type);
if ($result < 0)
{
dol_print_error($db,$propal->error);