瀏覽代碼

Fix regression

Laurent Destailleur 3 年之前
父節點
當前提交
a08bbd6acd
共有 2 個文件被更改,包括 7 次插入8 次删除
  1. 7 7
      htdocs/product/class/productbatch.class.php
  2. 0 1
      test/phpunit/CodingPhpTest.php

+ 7 - 7
htdocs/product/class/productbatch.class.php

@@ -475,15 +475,15 @@ class Productbatch extends CommonObject
 			$num = $dbs->num_rows($resql);
 			$i = 0;
 			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->lotid = $obj->lotid;
-				$tmp->tms = $db->jdate($obj->tms);
+				$tmp->tms = $dbs->jdate($obj->tms);
 				$tmp->fk_product_stock = $obj->fk_product_stock;
-				$tmp->sellby = $db->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby);
-				$tmp->eatby = $db->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby);
+				$tmp->sellby = $dbs->jdate($obj->sellby ? $obj->sellby : $obj->oldsellby);
+				$tmp->eatby = $dbs->jdate($obj->eatby ? $obj->eatby : $obj->oldeatby);
 				$tmp->batch = $obj->batch;
 				$tmp->qty = $obj->qty;
 				$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
 				$i++;
 			}
-			$db->free($resql);
+			$dbs->free($resql);
 
 			return $ret;
 		} else {
-			$error = "Error ".$db->lasterror();
+			$error = "Error ".$dbs->lasterror();
 			return -1;
 		}
 	}

+ 0 - 1
test/phpunit/CodingPhpTest.php

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