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,24 +61,27 @@ 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);
if ($price_base_type == 'TTC') $ret=$object->fetch($obj->rowid);
if ($ret)
{ {
$newprice=price2num($object->price_ttc,'MU'); if ($price_base_type == 'TTC')
} {
else $newprice=price2num($object->price_ttc,'MU');
{ }
$newprice=price2num($object->price,'MU'); else
} {
$newprice=price2num($object->price,'MU');
}
$newvat=str_replace('*','',$newvatrate); $newvat=str_replace('*','',$newvatrate);
$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++;
} }