Merge pull request #24593 from altairisfr/deldispatchline

FIX : reopen supplier order after line delete if needed
This commit is contained in:
Laurent Destailleur 2023-05-05 01:10:58 +02:00 committed by GitHub
commit 53736f5bfb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -916,8 +916,18 @@ 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) {
setEventMessages($object->error, $object->errors, 'errors');
$error++;
$action = '';
}
}
}
if (!$error) {
$db->commit();
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
} else {