* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. */ /** * \file mahnung/card.php * \ingroup mahnung * \brief Detailansicht eines einzelnen Mahnvorgangs. */ $res = 0; if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; } $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; } if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; } if (!$res && file_exists("../main.inc.php")) { $res = @include "../main.inc.php"; } if (!$res) { die("Include of main fails"); } require_once DOL_DOCUMENT_ROOT.'/custom/mahnung/class/mahnung.class.php'; require_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; global $langs, $user, $db; $langs->loadLangs(array('mahnung@mahnung', 'companies', 'bills')); if (!$user->hasRight('mahnung', 'read')) { accessforbidden(); } $id = GETPOSTINT('id'); $action = GETPOST('action', 'aZ09'); $mahnung = new Mahnung($db); if ($mahnung->fetch($id) <= 0) { dol_print_error($db, 'Mahnung nicht gefunden'); exit; } // Stornieren if ($action === 'storno' && $user->hasRight('mahnung', 'delete')) { if (!verifCsrf($_POST['token'] ?? '', 'mahnung_storno')) { setEventMessages($langs->trans('ErrorBadValueForToken'), null, 'errors'); } else { $mahnung->status = Mahnung::STATUS_STORNIERT; if ($mahnung->update($user) > 0) { setEventMessages($langs->trans('MahnungStornieren').' OK', null, 'mesgs'); header('Location: '.$_SERVER['PHP_SELF'].'?id='.((int) $mahnung->id)); exit; } setEventMessages($mahnung->error, null, 'errors'); } } llxHeader('', $langs->trans('MahnungRef').' '.$mahnung->ref); print load_fiche_titre($langs->trans('MahnungRef').' '.$mahnung->ref, '', 'fa-envelope-open-text'); print '
| '.$langs->trans('MahnungRef').' | '.dol_escape_htmltag($mahnung->ref).' |
| '.$langs->trans('MahnungStufe').' | '.((int) $mahnung->stufe).' |
| '.$langs->trans('MahnungDatum').' | '.dol_print_date($mahnung->date_mahnung, 'day').' |
| '.$langs->trans('MahnungFaelligkeitAlt').' | '.dol_print_date($mahnung->date_lim_reglement_alt, 'day').' |
| '.$langs->trans('MahnungFaelligkeitNeu').' | '.dol_print_date($mahnung->date_lim_reglement_neu, 'day').' |
| '.$langs->trans('MahnungRechnung').' | '; print ''.dol_escape_htmltag($facture->ref).' |
| '.$langs->trans('MahnungKunde').' | '; print ''.dol_escape_htmltag($societe->name).' ('.dol_escape_htmltag((string) $mahnung->customertype).') |
| '.$langs->trans('MahnungBetragOffen').' | '.price($mahnung->betrag_offen).' |
| '.$langs->trans('MahnungGebuehr').' | '.price($mahnung->mahngebuehr).' |
| '.$langs->trans('MahnungPauschaleB2B').' | '.price($mahnung->pauschale_b2b).' |
| '.$langs->trans('MahnungVerzugszinsen').' | '.price($mahnung->verzugszinsen).' (Basiszins '.number_format((float) $mahnung->basiszins_snapshot, 2, ',', '.').' %) |
| '.$langs->trans('MahnungSumme').' | '.price($mahnung->summe_mahnung).' |
| Status | '.dol_escape_htmltag($mahnung->getStatusLabel()).' |
| PDF herunterladen |