Merge pull request #8251 from atm-gauthier/5.0_fix_last_situation

FIX : if we make a mistake with situation_percent, now we can correct…
This commit is contained in:
Laurent Destailleur 2018-03-02 17:54:20 +01:00 committed by GitHub
commit aab0a33f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2245,9 +2245,12 @@ class Facture extends CommonInvoice
$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);
}
}
}
@ -4090,7 +4093,6 @@ class Facture extends CommonInvoice
$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);