FIX : reopen supplier order after line delete if needed

This commit is contained in:
Christophe Battarel 2023-04-25 17:31:02 +02:00
parent 440a526b0a
commit d7b770bb74

View File

@ -857,8 +857,19 @@ if (empty($reshook)) {
}
if (!$error) {
$db->commit();
// reopen order if necessary
if ($object->status == CommandeFournisseur::STATUS_RECEIVED_COMPLETELY) {
if ($object->setStatus($user, CommandeFournisseur::STATUS_RECEIVED_PARTIALLY) < 0) {
$db->rollback();
setEventMessages($object->error, $object->errors, 'errors');
$error++;
$action = '';
}
}
}
if (!$error) {
$db->commit();
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
} else {