Skip to content
Snippets Groups Projects
Commit 86d91ff6 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Fix: Setting new property of object must be done only after all database

actions are ok (and if ok).
parent a220634d
No related branches found
No related tags found
No related merge requests found
......@@ -1763,16 +1763,6 @@ class Facture extends CommonInvoice
}
}
// 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 @@ class Facture extends CommonInvoice
//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
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment