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
Branches
Tags
No related merge requests found
...@@ -1763,16 +1763,6 @@ class Facture extends CommonInvoice ...@@ -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 // Trigger calls
if (! $error) if (! $error)
{ {
...@@ -1782,6 +1772,16 @@ class Facture extends CommonInvoice ...@@ -1782,6 +1772,16 @@ class Facture extends CommonInvoice
//TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail //TODO: Restoring ref, facnumber, statut, brouillon to previous value if trigger fail
// End call triggers // 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 else
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment