164 lines
5.5 KiB
PHP
164 lines
5.5 KiB
PHP
<?php
|
|
/**
|
|
* Kontenplan Verwaltung
|
|
*
|
|
* @package steuer
|
|
*/
|
|
|
|
// Load Dolibarr environment
|
|
$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 && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) {
|
|
$res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php";
|
|
}
|
|
if (!$res && file_exists("../main.inc.php")) {
|
|
$res = @include "../main.inc.php";
|
|
}
|
|
if (!$res && file_exists("../../main.inc.php")) {
|
|
$res = @include "../../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.'/core/class/html.form.class.php';
|
|
|
|
$langs->loadLangs(array("steuer@steuer", "bills", "compta"));
|
|
|
|
$action = GETPOST('action', 'aZ09');
|
|
$kategorie = GETPOST('kategorie', 'alpha');
|
|
|
|
/*
|
|
* View
|
|
*/
|
|
|
|
$form = new Form($db);
|
|
|
|
llxHeader('', $langs->trans("Kontenplan"), '', '', 0, 0, '', '', '', 'mod-steuer page-konten');
|
|
|
|
print load_fiche_titre($langs->trans("Kontenplan").' (SKR03)', '', 'steuer.png@steuer');
|
|
|
|
// Filter
|
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
print '<div class="inline-block marginrightonly">';
|
|
print '<select name="kategorie" class="flat">';
|
|
print '<option value="">'.$langs->trans("All").'</option>';
|
|
print '<option value="einnahme"'.($kategorie == 'einnahme' ? ' selected' : '').'>'.$langs->trans("Einnahmen").'</option>';
|
|
print '<option value="ausgabe"'.($kategorie == 'ausgabe' ? ' selected' : '').'>'.$langs->trans("Ausgaben").'</option>';
|
|
print '</select>';
|
|
print ' <input type="submit" class="button" value="'.$langs->trans("Filter").'">';
|
|
print '</div>';
|
|
print '</form>';
|
|
|
|
print '<br>';
|
|
|
|
// Konten-Tabelle
|
|
print '<div class="div-table-responsive">';
|
|
print '<table class="noborder centpercent">';
|
|
print '<tr class="liste_titre">';
|
|
print '<th style="width: 100px;">'.$langs->trans("Kontonummer").'</th>';
|
|
print '<th>'.$langs->trans("Bezeichnung").'</th>';
|
|
print '<th style="width: 120px;">'.$langs->trans("Kategorie").'</th>';
|
|
print '<th style="width: 80px;">'.$langs->trans("EUeRZeile").'</th>';
|
|
print '<th style="width: 80px;">'.$langs->trans("UStKz").'</th>';
|
|
print '<th style="width: 80px;">'.$langs->trans("Status").'</th>';
|
|
print '</tr>';
|
|
|
|
$sql = "SELECT rowid, kontonummer, bezeichnung, kategorie, euer_zeile, ust_kennzeichen, aktiv";
|
|
$sql .= " FROM ".MAIN_DB_PREFIX."steuer_konto";
|
|
$sql .= " WHERE entity = ".((int) $conf->entity);
|
|
if ($kategorie) {
|
|
$sql .= " AND kategorie = '".$db->escape($kategorie)."'";
|
|
}
|
|
$sql .= " ORDER BY kontonummer";
|
|
|
|
$resql = $db->query($sql);
|
|
if ($resql) {
|
|
$num = $db->num_rows($resql);
|
|
|
|
if ($num > 0) {
|
|
$last_kategorie = '';
|
|
while ($obj = $db->fetch_object($resql)) {
|
|
// Zwischenüberschrift bei Kategoriewechsel
|
|
if ($obj->kategorie != $last_kategorie && empty($kategorie)) {
|
|
print '<tr class="liste_titre">';
|
|
print '<td colspan="6"><strong>'.($obj->kategorie == 'einnahme' ? $langs->trans("Einnahmekonten") : $langs->trans("Ausgabekonten")).'</strong></td>';
|
|
print '</tr>';
|
|
$last_kategorie = $obj->kategorie;
|
|
}
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td><strong>'.$obj->kontonummer.'</strong></td>';
|
|
print '<td>'.$obj->bezeichnung.'</td>';
|
|
print '<td>';
|
|
if ($obj->kategorie == 'einnahme') {
|
|
print '<span class="badge badge-status4">'.$langs->trans("Einnahme").'</span>';
|
|
} else {
|
|
print '<span class="badge badge-status1">'.$langs->trans("Ausgabe").'</span>';
|
|
}
|
|
print '</td>';
|
|
print '<td class="center">'.($obj->euer_zeile ? $obj->euer_zeile : '-').'</td>';
|
|
print '<td class="center">'.($obj->ust_kennzeichen ? 'Kz '.$obj->ust_kennzeichen : '-').'</td>';
|
|
print '<td class="center">';
|
|
if ($obj->aktiv) {
|
|
print '<span class="badge badge-status4">'.$langs->trans("Active").'</span>';
|
|
} else {
|
|
print '<span class="badge badge-status8">'.$langs->trans("Inactive").'</span>';
|
|
}
|
|
print '</td>';
|
|
print '</tr>';
|
|
}
|
|
} else {
|
|
print '<tr class="oddeven">';
|
|
print '<td colspan="6" class="center opacitymedium">'.$langs->trans("NoRecordFound").'</td>';
|
|
print '</tr>';
|
|
}
|
|
} else {
|
|
dol_print_error($db);
|
|
}
|
|
|
|
print '</table>';
|
|
print '</div>';
|
|
|
|
// Legende
|
|
print '<br>';
|
|
print '<div class="opacitymedium">';
|
|
print '<strong>'.$langs->trans("Legende").':</strong><br>';
|
|
print '<table class="nobordernopadding">';
|
|
print '<tr><td style="width:100px;"><strong>'.$langs->trans("EUeRZeile").':</strong></td><td>'.$langs->trans("EUeRZeileDesc").'</td></tr>';
|
|
print '<tr><td><strong>'.$langs->trans("UStKz").':</strong></td><td>'.$langs->trans("UStKzDesc").'</td></tr>';
|
|
print '</table>';
|
|
print '</div>';
|
|
|
|
// SKR03 Info
|
|
print '<br>';
|
|
print '<div class="info">';
|
|
print '<strong>'.$langs->trans("SKR03Info").':</strong><br>';
|
|
print $langs->trans("SKR03InfoText");
|
|
print '</div>';
|
|
|
|
// Zurück-Button
|
|
print '<br>';
|
|
print '<div class="tabsAction">';
|
|
print '<a class="butAction" href="'.dol_buildpath('/steuer/steuerindex.php', 1).'"><i class="fa fa-arrow-left paddingright"></i>'.$langs->trans("Back").'</a>';
|
|
print '</div>';
|
|
|
|
llxFooter();
|
|
$db->close();
|