mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
FIX pb of duplicate event on command with eldy's recommendations
This commit is contained in:
@@ -745,6 +745,10 @@ class Commande extends CommonOrder
|
||||
if ($usercanclose)
|
||||
{
|
||||
$this->db->begin();
|
||||
if ($this->statut == self::STATUS_CLOSED)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
$now = dol_now();
|
||||
|
||||
@@ -2882,6 +2886,10 @@ class Commande extends CommonOrder
|
||||
$error = 0;
|
||||
|
||||
$this->db->begin();
|
||||
if ($this->billed)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET facture = 1';
|
||||
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT;
|
||||
|
||||
Reference in New Issue
Block a user