Skip to content

Commit

Permalink
FIX : if we make a mistake with situation_percent, now we can correct…
Browse files Browse the repository at this point in the history
… it. before situation_final was always set to 1 and no way to go back
  • Loading branch information
atm-gauthier committed Feb 27, 2018
1 parent 9690e68 commit 4d05bff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions htdocs/compta/facture/class/facture.class.php
Expand Up @@ -2245,9 +2245,12 @@ function validate($user, $force_number='', $idwarehouse=0, $notrigger=0)
$final = ($this->lines[$i]->situation_percent == 100);
$i++;
}
if ($final) {
$this->setFinal($user);
}

if (empty($final)) $this->situation_final = 0;
else $this->situation_final = 1;

$this->setFinal($user);

}
}
}
Expand Down Expand Up @@ -4090,7 +4093,6 @@ function setFinal(User $user, $notrigger=0)

$this->db->begin();

$this->situation_final = 1;
$sql = 'UPDATE ' . MAIN_DB_PREFIX . 'facture SET situation_final = ' . $this->situation_final . ' where rowid = ' . $this->id;

dol_syslog(__METHOD__, LOG_DEBUG);
Expand Down

0 comments on commit 4d05bff

Please sign in to comment.