From 1fb37db6f6005cd7c76abefcd7560eb05c671ca2 Mon Sep 17 00:00:00 2001 From: hermans Date: Fri, 15 Aug 2025 22:26:39 +0700 Subject: [PATCH] Bug Fix for issue 34898, default warehause and obj->endbrowid not exist on receipt.class (#34959) * bug fix for: https://github.com/Dolibarr/dolibarr/issues/34939 * Bug fix for: Dolibarr Issue #34939 * Revert "bug fix for: https://github.com/Dolibarr/dolibarr/issues/34939" This reverts commit bd4c1ccc41319a37ef9e70cec61c80a5efbbd4e8. * Revert "Bug fix for: Dolibarr Issue #34939" This reverts commit 8e46f863b943095b06ab3ae7dea248f12ea2c6e6. * Bug fix for issue https://github.com/Dolibarr/dolibarr/issues/34898 * fix bug on reception setClosed: ->edbrowid is not exist * Fix missing variable for obj->endbrowid in etDraft,valid,setClosed * fix white space * remove white space --- htdocs/commande/class/commande.class.php | 1 + htdocs/reception/class/reception.class.php | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index a1af5aa5897..06467ac3855 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3422,6 +3422,7 @@ class Commande extends CommonOrder $sql .= " note_private=".(isset($this->note_private) ? "'".$this->db->escape($this->note_private)."'" : "null").","; $sql .= " note_public=".(isset($this->note_public) ? "'".$this->db->escape($this->note_public)."'" : "null").","; $sql .= " model_pdf=".(isset($this->model_pdf) ? "'".$this->db->escape($this->model_pdf)."'" : "null").","; + $sql .= " fk_warehouse=".($this->warehouse_id > 0 ? $this->warehouse_id : "null").","; $sql .= " import_key=".(isset($this->import_key) ? "'".$this->db->escape($this->import_key)."'" : "null"); $sql .= " WHERE rowid=".((int) $this->id); diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index fda0c0a4cec..d032ce057bc 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -631,6 +631,7 @@ class Reception extends CommonObject if ($qty == 0 || ($qty < 0 && !getDolGlobalInt('RECEPTION_ALLOW_NEGATIVE_QTY'))) { continue; } + dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid); //var_dump($this->lines[$i]); @@ -1748,7 +1749,8 @@ class Reception extends CommonObject if ($qty <= 0) { continue; } - dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid." edb.rowid=".$obj->edbrowid); + + dol_syslog(get_class($this)."::valid movement index ".$i." ed.rowid=".$obj->rowid); $mouvS = new MouvementStock($this->db); $mouvS->origin = &$this; @@ -1905,7 +1907,6 @@ class Reception extends CommonObject if ($qty <= 0) { continue; } - dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid); //var_dump($this->lines[$i]); @@ -2038,6 +2039,10 @@ class Reception extends CommonObject $qty = $obj->qty; + if ($qty <= 0) { + continue; + } + dol_syslog(get_class($this)."::reopen reception movement index ".$i." ed.rowid=".$obj->rowid); //var_dump($this->lines[$i]);