FIX: reception reopening lacks of message when an error occurs (#36752)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Jyhere
2026-01-05 17:46:45 +01:00
committed by Laurent Destailleur
parent 21f4769c6c
commit 05f010a655
2 changed files with 8 additions and 1 deletions

View File

@@ -2191,7 +2191,7 @@ class Reception extends CommonObject
*/
public function reOpen()
{
global $conf, $langs, $user;
global $langs, $user;
$error = 0;
@@ -2201,6 +2201,8 @@ class Reception extends CommonObject
$sql .= " WHERE rowid = ".((int) $this->id).' AND fk_statut > 0';
$resql = $this->db->query($sql);
$rollbackStatus = $this->status;
$rollbackBilled = $this->billed;
if ($resql) {
$this->statut = self::STATUS_VALIDATED;
$this->status = self::STATUS_VALIDATED;
@@ -2304,6 +2306,8 @@ class Reception extends CommonObject
$this->db->commit();
return 1;
} else {
$this->statut = $this->status = $rollbackStatus;
$this->billed = $rollbackBilled;
$this->db->rollback();
return -1;
}