Fix: Setting new property of object must be done only after all database
actions are ok (and if ok).
This commit is contained in:
parent
a220634d30
commit
86d91ff698
@ -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
|
|||||||
//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
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user