Fix error management.
This commit is contained in:
parent
e948db69f2
commit
73b04deb19
@ -1944,7 +1944,7 @@ if ($action == 'create') {
|
||||
|
||||
// We verify whether the object is provisionally numbering
|
||||
$ref = substr($object->ref, 1, 4);
|
||||
if ($ref == 'PROV') {
|
||||
if ($ref == 'PROV' || $ref == '') {
|
||||
$numref = $object->getNextNumRef($soc);
|
||||
if (empty($numref)) {
|
||||
$error++;
|
||||
|
||||
@ -1877,8 +1877,12 @@ if ($action == 'create' && $usercancreate) {
|
||||
if ($action == 'validate') {
|
||||
// We check that object has a temporary ref
|
||||
$ref = substr($object->ref, 1, 4);
|
||||
if ($ref == 'PROV') {
|
||||
if ($ref == 'PROV' || $ref == '') {
|
||||
$numref = $object->getNextNumRef($soc);
|
||||
if (empty($numref)) {
|
||||
$error++;
|
||||
setEventMessages($object->error, $object->errors, 'errors');
|
||||
}
|
||||
} else {
|
||||
$numref = $object->ref;
|
||||
}
|
||||
@ -1915,7 +1919,9 @@ if ($action == 'create' && $usercancreate) {
|
||||
);
|
||||
}
|
||||
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
|
||||
if (!$error) {
|
||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateOrder'), $text, 'confirm_validate', $formquestion, 0, 1, 220);
|
||||
}
|
||||
}
|
||||
|
||||
// Confirm back to draft status
|
||||
|
||||
Loading…
Reference in New Issue
Block a user