Merge pull request #25227 from frederic34/patch-2
Fix cant do manual correct stock if reel is null in db
This commit is contained in:
commit
3bcdc54b0a
1 changed files with 1 additions and 1 deletions
|
|
@ -540,7 +540,7 @@ class MouvementStock extends CommonObject
|
|||
// Update stock quantity
|
||||
if (!$error) {
|
||||
if ($alreadyarecord > 0) {
|
||||
$sql = "UPDATE ".$this->db->prefix()."product_stock SET reel = reel + ".((float) $qty);
|
||||
$sql = "UPDATE ".$this->db->prefix()."product_stock SET reel = COALESCE(reel, 0) + ".((float) $qty);
|
||||
$sql .= " WHERE fk_entrepot = ".((int) $entrepot_id)." AND fk_product = ".((int) $fk_product);
|
||||
} else {
|
||||
$sql = "INSERT INTO ".$this->db->prefix()."product_stock";
|
||||
|
|
|
|||
Loading…
Reference in a new issue