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

Fix bugs reported by scrutinizer

parent 1838670e
No related branches found
No related tags found
No related merge requests found
...@@ -153,6 +153,7 @@ class Invoices extends DolibarrApi ...@@ -153,6 +153,7 @@ class Invoices extends DolibarrApi
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$i=0;
$num = $db->num_rows($result); $num = $db->num_rows($result);
while ($i < min($num, ($limit <= 0 ? $num : $limit))) while ($i < min($num, ($limit <= 0 ? $num : $limit)))
{ {
...@@ -177,7 +178,7 @@ class Invoices extends DolibarrApi ...@@ -177,7 +178,7 @@ class Invoices extends DolibarrApi
* Create invoice object * Create invoice object
* *
* @param array $request_data Request datas * @param array $request_data Request datas
* @return int ID of invoice * @return int ID of invoice
*/ */
function post($request_data = NULL) function post($request_data = NULL)
{ {
...@@ -278,7 +279,7 @@ class Invoices extends DolibarrApi ...@@ -278,7 +279,7 @@ class Invoices extends DolibarrApi
/** /**
* Validate fields before create or update object * Validate fields before create or update object
* *
* @param array $data Datas to validate * @param array|null $data Datas to validate
* @return array * @return array
* *
* @throws RestException * @throws RestException
...@@ -293,4 +294,5 @@ class Invoices extends DolibarrApi ...@@ -293,4 +294,5 @@ class Invoices extends DolibarrApi
} }
return $invoice; return $invoice;
} }
} }
...@@ -16,9 +16,9 @@ ...@@ -16,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
use Luracast\Restler\RestException; use Luracast\Restler\RestException;
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
/** /**
* API class for supplier invoices * API class for supplier invoices
...@@ -153,6 +153,7 @@ class SupplierInvoices extends DolibarrApi ...@@ -153,6 +153,7 @@ class SupplierInvoices extends DolibarrApi
$result = $db->query($sql); $result = $db->query($sql);
if ($result) if ($result)
{ {
$i = 0;
$num = $db->num_rows($result); $num = $db->num_rows($result);
while ($i < min($num, ($limit <= 0 ? $num : $limit))) while ($i < min($num, ($limit <= 0 ? $num : $limit)))
{ {
......
...@@ -326,7 +326,6 @@ class FactureFournisseur extends CommonInvoice ...@@ -326,7 +326,6 @@ class FactureFournisseur extends CommonInvoice
{ {
$idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det'); $idligne = $this->db->last_insert_id(MAIN_DB_PREFIX.'facture_fourn_det');
var_dump($this->lines[$i]);exit;
$this->updateline( $this->updateline(
$idligne, $idligne,
$this->lines[$i]->description, $this->lines[$i]->description,
......
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