Update card.php

This commit is contained in:
Frédéric FRANCE 2020-10-25 23:29:51 +01:00 committed by GitHub
parent 10ff359889
commit f2c0e3765d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2304,20 +2304,17 @@ if ($action == 'create')
if ($action == 'valid') if ($action == 'valid')
{ {
// We check if number is temporary number // We check if number is temporary number
if (preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) // empty should not happened, but when it occurs, the test save life if (preg_match('/^[\(]?PROV/i', $object->ref) || empty($object->ref)) {
{ // empty should not happened, but when it occurs, the test save life
$numref = $object->getNextNumRef($societe); $numref = $object->getNextNumRef($societe);
} else { } else {
$numref = $object->ref; $numref = $object->ref;
} }
if ($numref < 0) if ($numref < 0) {
{
setEventMessages($object->error, $object->errors, 'errors'); setEventMessages($object->error, $object->errors, 'errors');
$action = ''; $action = '';
} } else {
else
{
$text = $langs->trans('ConfirmValidateBill', $numref); $text = $langs->trans('ConfirmValidateBill', $numref);
/*if (! empty($conf->notification->enabled)) /*if (! empty($conf->notification->enabled))
{ {