Skip to content

Commit

Permalink
Merge pull request #11038 from atm-john/FIX_error_messages_not_displayed
Browse files Browse the repository at this point in the history
FIX error messages not displayed
  • Loading branch information
eldy committed Apr 19, 2019
2 parents 6cd24ab + 0855d84 commit c9445ee
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions htdocs/compta/facture/card.php
Expand Up @@ -1537,14 +1537,16 @@
$datefacture = dol_mktime(12, 0, 0, $_POST['remonth'], $_POST['reday'], $_POST['reyear']);
if (empty($datefacture)) {
$error++;
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->trans("Date")) . '</div>';
$mesg = $langs->trans("ErrorFieldRequired", $langs->trans("Date"));
setEventMessages($mesg, null, 'errors');
}

$date_pointoftax = dol_mktime(12, 0, 0, $_POST['date_pointoftaxmonth'], $_POST['date_pointoftaxday'], $_POST['date_pointoftaxyear']);

if (!($_POST['situations'] > 0)) {
$error++;
$mesg = '<div class="error">' . $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation")) . '</div>';
$mesg = $langs->trans("ErrorFieldRequired", $langs->trans("InvoiceSituation"));
setEventMessages($mesg, null, 'errors');
}

if (!$error) {
Expand Down Expand Up @@ -2270,11 +2272,13 @@
if (!$object->fetch($id) > 0) dol_print_error($db);
if (!is_null(GETPOST('all_progress')) && GETPOST('all_progress') != "")
{
$all_progress = GETPOST('all_progress', 'int');
foreach ($object->lines as $line)
{
$percent = $line->get_prev_progress($object->id);
if (GETPOST('all_progress') < $percent) {
$mesg = '<div class="warning">' . $langs->trans("CantBeLessThanMinPercent") . '</div>';
if (floatval($all_progress) < floatval($percent)) {
$mesg = $langs->trans("Line") . ' ' . $i . ' '. $line->ref .' : ' . $langs->trans("CantBeLessThanMinPercent");
setEventMessages($mesg, null, 'warnings');
$result = -1;
} else
$object->update_percent($line, $_POST['all_progress']);
Expand Down

0 comments on commit c9445ee

Please sign in to comment.