Skip to content
Snippets Groups Projects
Commit cd099bf3 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix bad update of prices

parent 72ff353e
No related branches found
No related tags found
No related merge requests found
......@@ -42,8 +42,6 @@ $oldvatrate=GETPOST('oldvatrate');
$newvatrate=GETPOST('newvatrate');
//$price_base_type=GETPOST('price_base_type');
$objectstatic = new Product($db);
$objectstatic2 = new ProductFournisseur($db);
/*
......@@ -87,6 +85,7 @@ if ($action == 'convert')
{
$obj = $db->fetch_object($resql);
$objectstatic = new Product($db); // Object init must be into loop to avoid to get value of previous step
$ret=$objectstatic->fetch($obj->rowid);
if ($ret > 0)
{
......@@ -150,7 +149,8 @@ if ($action == 'convert')
if ($ret < 0 || $retm < 0) $error++;
else $nbrecordsmodified++;
}
unset($objectstatic);
$i++;
}
}
......@@ -176,6 +176,7 @@ if ($action == 'convert')
{
$obj = $db->fetch_object($resql);
$objectstatic2 = new ProductFournisseur($db); // Object init must be into loop to avoid to get value of previous step
$ret=$objectstatic2->fetch_product_fournisseur_price($obj->rowid);
if ($ret > 0)
{
......@@ -207,6 +208,8 @@ if ($action == 'convert')
if ($ret < 0 || $retm < 0) $error++;
else $nbrecordsmodified++;
}
unset($objectstatic2);
$i++;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment