285 lines
9.8 KiB
PHP
285 lines
9.8 KiB
PHP
<?php
|
|
/**
|
|
* Gewerbesteuer-Berechnung
|
|
*
|
|
* @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';
|
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
|
|
dol_include_once('/steuer/class/euer.class.php');
|
|
|
|
$langs->loadLangs(array("steuer@steuer", "bills", "compta"));
|
|
|
|
$jahr = GETPOSTINT('jahr');
|
|
if (empty($jahr)) {
|
|
$jahr = date('Y');
|
|
}
|
|
|
|
$action = GETPOST('action', 'aZ09');
|
|
|
|
// Einstellbare Parameter
|
|
$hebesatz = GETPOSTFLOAT('hebesatz');
|
|
if (empty($hebesatz)) {
|
|
$hebesatz = getDolGlobalString('STEUER_GEWERBE_HEBESATZ', 400);
|
|
}
|
|
$hinzurechnungen = GETPOSTFLOAT('hinzurechnungen');
|
|
$kuerzungen = GETPOSTFLOAT('kuerzungen');
|
|
|
|
/*
|
|
* View
|
|
*/
|
|
|
|
$form = new Form($db);
|
|
$euer = new EUeR($db);
|
|
$euer->berechneAusDolibarr($jahr);
|
|
|
|
// Gewerbesteuer-Berechnung
|
|
$gewinn_euer = $euer->gewinn;
|
|
$freibetrag = 24500; // Freibetrag für Einzelunternehmen/Personengesellschaften
|
|
|
|
// Gewerbeertrag berechnen
|
|
$gewerbeertrag_vor_freibetrag = $gewinn_euer + $hinzurechnungen - $kuerzungen;
|
|
$gewerbeertrag = max(0, $gewerbeertrag_vor_freibetrag - $freibetrag);
|
|
|
|
// Steuermessbetrag (3,5% vom Gewerbeertrag)
|
|
$steuermesszahl = 3.5;
|
|
$steuermessbetrag = $gewerbeertrag * $steuermesszahl / 100;
|
|
|
|
// Gewerbesteuer
|
|
$gewerbesteuer = $steuermessbetrag * $hebesatz / 100;
|
|
|
|
// Anrechnung auf ESt (max. das 4-fache des Steuermessbetrags, § 35 EStG)
|
|
$anrechnung_est = min($gewerbesteuer, $steuermessbetrag * 4);
|
|
|
|
// Effektive Gewerbesteuer nach Anrechnung
|
|
$gewerbesteuer_effektiv = $gewerbesteuer - $anrechnung_est;
|
|
|
|
llxHeader('', $langs->trans("Gewerbesteuer"), '', '', 0, 0, '', '', '', 'mod-steuer page-gewerbesteuer');
|
|
|
|
print load_fiche_titre($langs->trans("Gewerbesteuer")." ".$jahr, '', 'steuer.png@steuer');
|
|
|
|
// Formular
|
|
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
|
print '<input type="hidden" name="token" value="'.newToken().'">';
|
|
print '<input type="hidden" name="action" value="calculate">';
|
|
|
|
print '<div class="div-table-responsive-no-min">';
|
|
print '<table class="noborder centpercent">';
|
|
print '<tr class="liste_titre">';
|
|
print '<th colspan="2">'.$langs->trans("Parameter").'</th>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td style="width: 300px;">'.$langs->trans("Year").'</td>';
|
|
print '<td>';
|
|
print '<select name="jahr" class="flat minwidth100">';
|
|
for ($y = date('Y'); $y >= date('Y') - 5; $y--) {
|
|
print '<option value="'.$y.'"'.($y == $jahr ? ' selected' : '').'>'.$y.'</option>';
|
|
}
|
|
print '</select>';
|
|
print '</td>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td>'.$langs->trans("Hebesatz").' (%)</td>';
|
|
print '<td>';
|
|
print '<input type="text" name="hebesatz" class="minwidth100" value="'.dol_escape_htmltag($hebesatz).'">';
|
|
print ' <small class="opacitymedium">'.$langs->trans("HebesatzHinweis").'</small>';
|
|
print '</td>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td>'.$langs->trans("Hinzurechnungen").' (§ 8 GewStG)</td>';
|
|
print '<td>';
|
|
print '<input type="text" name="hinzurechnungen" class="minwidth100" value="'.dol_escape_htmltag($hinzurechnungen).'">';
|
|
print ' EUR <small class="opacitymedium">'.$langs->trans("HinzurechnungenHinweis").'</small>';
|
|
print '</td>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td>'.$langs->trans("Kuerzungen").' (§ 9 GewStG)</td>';
|
|
print '<td>';
|
|
print '<input type="text" name="kuerzungen" class="minwidth100" value="'.dol_escape_htmltag($kuerzungen).'">';
|
|
print ' EUR <small class="opacitymedium">'.$langs->trans("KuerzungenHinweis").'</small>';
|
|
print '</td>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td colspan="2">';
|
|
print '<input type="submit" class="button" value="'.$langs->trans("Calculate").'">';
|
|
print '</td>';
|
|
print '</tr>';
|
|
|
|
print '</table>';
|
|
print '</div>';
|
|
|
|
print '</form>';
|
|
|
|
print '<br>';
|
|
|
|
// Berechnungstabelle
|
|
print '<div class="div-table-responsive">';
|
|
print '<table class="noborder centpercent">';
|
|
print '<tr class="liste_titre">';
|
|
print '<th colspan="2">'.$langs->trans("GewerbesteuerBerechnung").' '.$jahr.'</th>';
|
|
print '<th class="right" style="width: 150px;">'.$langs->trans("Betrag").' EUR</th>';
|
|
print '</tr>';
|
|
|
|
// Gewinn aus EÜR
|
|
print '<tr class="oddeven">';
|
|
print '<td>1.</td>';
|
|
print '<td>'.$langs->trans("GewinnAusEUeR").'</td>';
|
|
$color = $gewinn_euer >= 0 ? '' : 'amountremaintopay';
|
|
print '<td class="right amount '.$color.'">'.price($gewinn_euer, 0, $langs, 1, 2, 2).'</td>';
|
|
print '</tr>';
|
|
|
|
// Hinzurechnungen
|
|
print '<tr class="oddeven">';
|
|
print '<td>2.</td>';
|
|
print '<td>'.$langs->trans("Hinzurechnungen").' (§ 8 GewStG)<br><small class="opacitymedium">z.B. Zinsen, Mieten, Pachten, Lizenzen (anteilig)</small></td>';
|
|
print '<td class="right amount">+ '.price($hinzurechnungen, 0, $langs, 1, 2, 2).'</td>';
|
|
print '</tr>';
|
|
|
|
// Kürzungen
|
|
print '<tr class="oddeven">';
|
|
print '<td>3.</td>';
|
|
print '<td>'.$langs->trans("Kuerzungen").' (§ 9 GewStG)<br><small class="opacitymedium">z.B. 1,2% des Einheitswerts bei Grundstücken</small></td>';
|
|
print '<td class="right amount">- '.price($kuerzungen, 0, $langs, 1, 2, 2).'</td>';
|
|
print '</tr>';
|
|
|
|
// Gewerbeertrag vor Freibetrag
|
|
print '<tr class="oddeven">';
|
|
print '<td>4.</td>';
|
|
print '<td><strong>'.$langs->trans("GewerbeertragVorFreibetrag").'</strong></td>';
|
|
print '<td class="right amount"><strong>'.price($gewerbeertrag_vor_freibetrag, 0, $langs, 1, 2, 2).'</strong></td>';
|
|
print '</tr>';
|
|
|
|
// Freibetrag
|
|
print '<tr class="oddeven">';
|
|
print '<td>5.</td>';
|
|
print '<td>'.$langs->trans("Freibetrag").'<br><small class="opacitymedium">'.$langs->trans("FreibetragHinweis").'</small></td>';
|
|
print '<td class="right amount">- '.price($freibetrag, 0, $langs, 1, 2, 2).'</td>';
|
|
print '</tr>';
|
|
|
|
// Gewerbeertrag
|
|
print '<tr class="liste_total">';
|
|
print '<td>6.</td>';
|
|
print '<td><strong>'.$langs->trans("Gewerbeertrag").'</strong></td>';
|
|
print '<td class="right amount"><strong>'.price($gewerbeertrag, 0, $langs, 1, 2, 2).'</strong></td>';
|
|
print '</tr>';
|
|
|
|
// Steuermessbetrag
|
|
print '<tr class="oddeven">';
|
|
print '<td>7.</td>';
|
|
print '<td>'.$langs->trans("Steuermessbetrag").' ('.$steuermesszahl.'%)</td>';
|
|
print '<td class="right amount">'.price($steuermessbetrag, 0, $langs, 1, 2, 2).'</td>';
|
|
print '</tr>';
|
|
|
|
// Hebesatz
|
|
print '<tr class="oddeven">';
|
|
print '<td>8.</td>';
|
|
print '<td>'.$langs->trans("Hebesatz").' der Gemeinde</td>';
|
|
print '<td class="right">'.$hebesatz.' %</td>';
|
|
print '</tr>';
|
|
|
|
// Gewerbesteuer
|
|
print '<tr class="liste_total">';
|
|
print '<td>9.</td>';
|
|
print '<td><strong>'.$langs->trans("Gewerbesteuer").'</strong> (Zeile 7 x Zeile 8 / 100)</td>';
|
|
print '<td class="right amount"><strong>'.price($gewerbesteuer, 0, $langs, 1, 2, 2).'</strong></td>';
|
|
print '</tr>';
|
|
|
|
print '</table>';
|
|
print '</div>';
|
|
|
|
print '<br>';
|
|
|
|
// Anrechnung auf Einkommensteuer
|
|
print '<div class="div-table-responsive-no-min">';
|
|
print '<table class="noborder centpercent">';
|
|
print '<tr class="liste_titre">';
|
|
print '<th colspan="2">'.$langs->trans("AnrechnungESt").' (§ 35 EStG)</th>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td>'.$langs->trans("Steuermessbetrag").' x 4 (maximale Anrechnung)</td>';
|
|
print '<td class="right amount">'.price($steuermessbetrag * 4, 0, $langs, 1, 2, 2).' EUR</td>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td>'.$langs->trans("TatsaechlicheGewerbesteuer").'</td>';
|
|
print '<td class="right amount">'.price($gewerbesteuer, 0, $langs, 1, 2, 2).' EUR</td>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="liste_total">';
|
|
print '<td><strong>'.$langs->trans("AnrechenbareGewerbesteuer").'</strong><br><small class="opacitymedium">(der niedrigere Betrag)</small></td>';
|
|
print '<td class="right amount amountpaymentcomplete"><strong>'.price($anrechnung_est, 0, $langs, 1, 2, 2).' EUR</strong></td>';
|
|
print '</tr>';
|
|
|
|
print '<tr class="oddeven">';
|
|
print '<td><strong>'.$langs->trans("EffektiveGewerbesteuer").'</strong><br><small class="opacitymedium">(Gewerbesteuer - Anrechnung)</small></td>';
|
|
$effektiv_color = $gewerbesteuer_effektiv > 0 ? '' : 'amountpaymentcomplete';
|
|
print '<td class="right amount '.$effektiv_color.'"><strong>'.price($gewerbesteuer_effektiv, 0, $langs, 1, 2, 2).' EUR</strong></td>';
|
|
print '</tr>';
|
|
|
|
print '</table>';
|
|
print '</div>';
|
|
|
|
// Hinweise
|
|
print '<br>';
|
|
print '<div class="opacitymedium">';
|
|
print '<strong>'.$langs->trans("Hinweise").':</strong><br>';
|
|
print '- '.$langs->trans("GewerbesteuerHinweis1").'<br>';
|
|
print '- '.$langs->trans("GewerbesteuerHinweis2").'<br>';
|
|
print '- '.$langs->trans("GewerbesteuerHinweis3").'<br>';
|
|
print '- '.$langs->trans("GewerbesteuerHinweis4").'<br>';
|
|
print '</div>';
|
|
|
|
// Info-Box Hebesätze
|
|
print '<br>';
|
|
print '<div class="info">';
|
|
print '<strong>'.$langs->trans("HebesaetzeInfo").':</strong><br>';
|
|
print $langs->trans("HebesaetzeInfoText");
|
|
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();
|