Fix: bad sql result name

This commit is contained in:
Regis Houssin 2012-05-22 19:11:41 +02:00
parent e8fd068cb0
commit d7d26b9375
4 changed files with 145 additions and 142 deletions

View File

@ -61,11 +61,13 @@ if ($action == 'convert')
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($resql);
$object = new Product($db); $object = new Product($db);
$object->fetch($obj->rowid);
$ret=$object->fetch($obj->rowid);
if ($ret)
{
if ($price_base_type == 'TTC') if ($price_base_type == 'TTC')
{ {
$newprice=price2num($object->price_ttc,'MU'); $newprice=price2num($object->price_ttc,'MU');
@ -79,6 +81,7 @@ if ($action == 'convert')
$ret=$object->updatePrice($object->id, $newprice, $price_base_type, $user, $newvat); $ret=$object->updatePrice($object->id, $newprice, $price_base_type, $user, $newvat);
if ($ret < 0) $error++; if ($ret < 0) $error++;
}
$i++; $i++;
} }