2
0
forked from Wavyzz/dolibarr

Fix regression

This commit is contained in:
Laurent Destailleur
2022-03-01 00:11:30 +01:00
parent 9cc79de31b
commit a08bbd6acd
2 changed files with 7 additions and 8 deletions

View File

@@ -475,15 +475,15 @@ class Productbatch extends CommonObject
$num = $dbs->num_rows($resql); $num = $dbs->num_rows($resql);
$i = 0; $i = 0;
while ($i < $num) { while ($i < $num) {
$obj = $db->fetch_object($resql); $obj = $dbs->fetch_object($resql);
$tmp = new Productbatch($db); $tmp = new Productbatch($dbs);
$tmp->id = $obj->rowid; $tmp->id = $obj->rowid;
$tmp->lotid = $obj->lotid; $tmp->lotid = $obj->lotid;
$tmp->tms = $db->jdate($obj->tms); $tmp->tms = $dbs->jdate($obj->tms);
$tmp->fk_product_stock = $obj->fk_product_stock; $tmp->fk_product_stock = $obj->fk_product_stock;
$tmp->sellby = $db->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby); $tmp->sellby = $dbs->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby);
$tmp->eatby = $db->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby); $tmp->eatby = $dbs->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby);
$tmp->batch = $obj->batch; $tmp->batch = $obj->batch;
$tmp->qty = $obj->qty; $tmp->qty = $obj->qty;
$tmp->import_key = $obj->import_key; $tmp->import_key = $obj->import_key;
@@ -491,11 +491,11 @@ class Productbatch extends CommonObject
$ret[$tmp->batch] = $tmp; // $ret is for a $fk_product_stock and unique key is on $fk_product_stock+batch $ret[$tmp->batch] = $tmp; // $ret is for a $fk_product_stock and unique key is on $fk_product_stock+batch
$i++; $i++;
} }
$db->free($resql); $dbs->free($resql);
return $ret; return $ret;
} else { } else {
$error = "Error ".$db->lasterror(); $error = "Error ".$dbs->lasterror();
return -1; return -1;
} }
} }

View File

@@ -211,7 +211,6 @@ class CodingPhpTest extends PHPUnit\Framework\TestCase
'modules_societe.class.php', 'modules_societe.class.php',
'TraceableDB.php', 'TraceableDB.php',
'multicurrency.class.php', 'multicurrency.class.php',
'productbatch.class.php',
'reception.class.php', 'reception.class.php',
'infobox.class.php' 'infobox.class.php'
))) { ))) {