Skip to content

Commit

Permalink
Fix: Setting new property of object must be done only after all database
Browse files Browse the repository at this point in the history
actions are ok (and if ok).
  • Loading branch information
eldy committed Aug 19, 2014
1 parent a220634 commit 86d91ff
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -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)
{
Expand All @@ -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
{
Expand Down

0 comments on commit 86d91ff

Please sign in to comment.