Fix: The error not correctly collected on insertation line failure
This commit is contained in:
parent
7af883abc1
commit
db975bbcc2
@ -9,7 +9,7 @@
|
||||
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
|
||||
* Copyright (C) 2014-2017 Francis Appels <francis.appels@yahoo.com>
|
||||
* Copyright (C) 2015 Claudio Aschieri <c.aschieri@19.coop>
|
||||
* Copyright (C) 2016 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2016-2021 Ferran Marcet <fmarcet@2byte.es>
|
||||
* Copyright (C) 2018 Nicolas ZABOURI <info@inovea-conseil.com>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2020 Lenin Rivas <lenin@leninrivas.com>
|
||||
@ -364,14 +364,14 @@ class Expedition extends CommonObject
|
||||
{
|
||||
if (!isset($this->lines[$i]->detail_batch))
|
||||
{ // no batch management
|
||||
if (!$this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) > 0)
|
||||
if ($this->create_line($this->lines[$i]->entrepot_id, $this->lines[$i]->origin_line_id, $this->lines[$i]->qty, $this->lines[$i]->rang, $this->lines[$i]->array_options) < 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // with batch management
|
||||
if (!$this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) > 0)
|
||||
if ($this->create_line_batch($this->lines[$i], $this->lines[$i]->array_options) < 0)
|
||||
{
|
||||
$error++;
|
||||
}
|
||||
@ -423,7 +423,6 @@ class Expedition extends CommonObject
|
||||
else
|
||||
{
|
||||
$error++;
|
||||
$this->error = $this->db->lasterror()." - sql=$sql";
|
||||
$this->db->rollback();
|
||||
return -3;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user