$result = $object->recalculer($id); header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit; } else { setEventMessages($object->error, $object->errors, 'errors'); } } } /* * Generate or regenerate the PDF document */ if ($action == 'builddoc') { $depl = new ExpenseReport($db, 0, $_GET['id']); $depl->fetch($id); if ($_REQUEST['model']) { $depl->setDocModel($user, $_REQUEST['model']); } $outputlangs = $langs; if (!empty($_REQUEST['lang_id'])) { $outputlangs = new Translate("", $conf); $outputlangs->setDefaultLang($_REQUEST['lang_id']); } $result = expensereport_pdf_create($db, $depl, '', $depl->modelpdf, $outputlangs); if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); $action = ''; } } else { if ($action == 'remove_file') { $object = new ExpenseReport($db, 0, $_GET['id']); if ($object->fetch($id)) {