FIX error managent and db transaction balance

This commit is contained in:
Laurent Destailleur 2021-01-14 19:15:54 +01:00
parent 0d704b0714
commit bcfe03216a

View File

@ -2903,13 +2903,12 @@ class Commande extends CommonOrder
{ {
$error = 0; $error = 0;
$this->db->begin();
if ($this->billed) if ($this->billed)
{ {
return 0; return 0;
} }
$this->db->begin();
$sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET facture = 1'; $sql = 'UPDATE '.MAIN_DB_PREFIX.'commande SET facture = 1';
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > '.self::STATUS_DRAFT;