diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 9b0e236af3590..c46f48ed1c6ce 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1763,16 +1763,6 @@ function validate($user, $force_number='', $idwarehouse=0) } } - // Set new ref and define current statut - if (! $error) - { - $this->ref = $num; - $this->facnumber=$num; - $this->statut=1; - $this->brouillon=0; - $this->date_validation=$now; - } - // Trigger calls if (! $error) { @@ -1782,6 +1772,16 @@ function validate($user, $force_number='', $idwarehouse=0) //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail // End call triggers } + + // Set new ref and define current statut + if (! $error) + { + $this->ref = $num; + $this->facnumber=$num; + $this->statut=1; + $this->brouillon=0; + $this->date_validation=$now; + } } else {