diff --git a/admin/setup.php b/admin/setup.php
index b8a2516..04644cb 100644
--- a/admin/setup.php
+++ b/admin/setup.php
@@ -167,6 +167,12 @@ function loadStufeById($db, $id, $entity)
return $s;
}
+// ---------------------------------------------------------------
+// ODT-Upload / Template-Loeschen (actions_setmoduleoptions.inc.php)
+// Muss vor llxHeader() stehen, da es header()-Redirects macht.
+// ---------------------------------------------------------------
+include_once DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
+
// ---------------------------------------------------------------
// Dokumentenmodell-Aktionen (vor View, da header()-Redirect)
// ---------------------------------------------------------------
@@ -313,9 +319,6 @@ print '';
print '
';
print load_fiche_titre($langs->trans('MahnungDokumentModelle'), 'Verfuegbare Template-Variablen', '');
-// Aktionen fuer Dokumentenmodelle (Upload, Loeschen, setModuleOptions)
-include_once DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
-
// Dokumentenmodelle auflisten
$def = array();
$sql = "SELECT nom FROM ".MAIN_DB_PREFIX."document_model WHERE type = 'mahnung' AND entity = ".((int) $conf->entity);
diff --git a/core/boxes/box_mahnung_offen.php b/core/boxes/box_mahnung_offen.php
index 6b9e1a2..3e49950 100644
--- a/core/boxes/box_mahnung_offen.php
+++ b/core/boxes/box_mahnung_offen.php
@@ -14,6 +14,7 @@
require_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
+require_once DOL_DOCUMENT_ROOT.'/custom/mahnung/class/mahnung.class.php';
/**
* Widget: Offene Kundenrechnungen mit aktueller Mahnstufe.
@@ -97,8 +98,6 @@ class box_mahnung_offen extends ModeleBoxes
$sql .= " ORDER BY f.date_lim_reglement ASC, f.ref ASC";
$sql .= $this->db->plimit($this->max + 1, 0);
- require_once DOL_DOCUMENT_ROOT.'/custom/mahnung/class/mahnung.class.php';
-
$result = $this->db->query($sql);
if (!$result) {
$this->info_box_contents[0][0] = array(