commande.class.php - move db->begin() into cloture

A DB begin request was sent before executing the status guard. If the guard fails, we exited the method without closing it. And it will occur a bug to any further database operation.
This commit is contained in:
LAURIER Alexis 2021-02-09 14:25:45 +01:00 committed by GitHub
parent a48c03923f
commit abf2875eba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -742,11 +742,11 @@ class Commande extends CommonOrder
if ($usercanclose) if ($usercanclose)
{ {
$this->db->begin();
if ($this->statut == self::STATUS_CLOSED) if ($this->statut == self::STATUS_CLOSED)
{ {
return 0; return 0;
} }
$this->db->begin();
$now = dol_now(); $now = dol_now();