diff --git a/htdocs/accountancy/admin/journals_card.php b/htdocs/accountancy/admin/journals_card.php index c9c45f9a4e5..9e04d75ce9f 100644 --- a/htdocs/accountancy/admin/journals_card.php +++ b/htdocs/accountancy/admin/journals_card.php @@ -122,6 +122,15 @@ else if ($action == 'update') { $object->label = GETPOST('label', 'alpha'); $object->nature = GETPOST('nature', 'int'); + if (empty($object->code)) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Code")), null, 'errors'); + $error ++; + } + if (empty($object->label)) { + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Label")), null, 'errors'); + $error ++; + } + $result = $object->update($user); if ($result > 0) { @@ -161,15 +170,15 @@ if ($action == 'create') print '
| ' . $langs->trans("Code") . ' | ||
| ' . $langs->trans("Code") . ' | ||
| ' . $langs->trans("Label") . ' | ||
| ' . $langs->trans("Label") . ' | ||
| ' . $langs->trans("Status") . ' | '; + print '' . $langs->trans("Type") . ' | '; print ''; print $form->selectarray('nature', $type2label, GETPOST('nature')); print ' |