diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 8604f3ed130..9abfc070471 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -278,10 +278,11 @@ class Commande extends CommonObject } } - // Set new ref + // Set new ref and current status if (! $error) { $this->ref = $num; + $this->statut = 1; } if (! $error) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 4122565ac4b..debb20daebd 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1576,11 +1576,12 @@ class Facture extends CommonObject } } - // Set new ref + // Set new ref and define current statut if (! $error) { $this->ref = $num; $this->facnumber=$num; + $this->statut=1; } $this->use_webcal=($conf->global->PHPWEBCALENDAR_BILLSTATUS=='always'?1:0);