kivitendo/bin/mozilla/ustva.pl @ 7b818ddc
d319704a | Moritz Bunkus | #!/bin/perl
|
||
#=====================================================================
|
||||
# Lx-Office ERP
|
||||
# Copyright (c) 2004 by Udo Spallek, Aachen
|
||||
#
|
||||
# Author: Udo Spallek
|
||||
# Email: udono@gmx.net
|
||||
# Web: http://www.lx-office.org
|
||||
#
|
||||
#
|
||||
# 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 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
#======================================================================
|
||||
# German Tax authority Module and later ELSTER Interface
|
||||
#======================================================================
|
||||
require "$form->{path}/arap.pl";
|
||||
#use strict;
|
||||
#no strict 'refs';
|
||||
#use diagnostics;
|
||||
63a1c75d | Stephan Köhler | #use warnings; # FATAL=> 'all';
|
||
d319704a | Moritz Bunkus | #use vars qw($locale $form %myconfig);
|
||
#our ($myconfig);
|
||||
#use CGI::Carp "fatalsToBrowser";
|
||||
use SL::PE;
|
||||
use SL::RP;
|
||||
use SL::USTVA;
|
||||
use SL::User;
|
||||
1;
|
||||
# this is for our long dates
|
||||
# $locale->text('January')
|
||||
# $locale->text('February')
|
||||
# $locale->text('March')
|
||||
# $locale->text('April')
|
||||
# $locale->text('May ')
|
||||
# $locale->text('June')
|
||||
# $locale->text('July')
|
||||
# $locale->text('August')
|
||||
# $locale->text('September')
|
||||
# $locale->text('October')
|
||||
# $locale->text('November')
|
||||
# $locale->text('December')
|
||||
# this is for our short month
|
||||
# $locale->text('Jan')
|
||||
# $locale->text('Feb')
|
||||
# $locale->text('Mar')
|
||||
# $locale->text('Apr')
|
||||
# $locale->text('May')
|
||||
# $locale->text('Jun')
|
||||
# $locale->text('Jul')
|
||||
# $locale->text('Aug')
|
||||
# $locale->text('Sep')
|
||||
# $locale->text('Oct')
|
||||
# $locale->text('Nov')
|
||||
# $locale->text('Dec')
|
||||
#############################
|
||||
sub report {
|
||||
$lxdebug->enter_sub();
|
||||
my $myconfig = \%myconfig;
|
||||
use CGI;
|
||||
6c0e5cb7 | Moritz Bunkus | |||
d319704a | Moritz Bunkus | $form->{title} = $locale->text('UStVA');
|
||
6c0e5cb7 | Moritz Bunkus | $form->{kz10} = ''; #Berichtigte Anmeldung? Ja =1 Nein=0
|
||
d319704a | Moritz Bunkus | |||
6ab3da45 | Udo Spallek | my $year = substr($form->datetonum($form->current_date(\%myconfig), \%myconfig ),
|
||
0, 4);
|
||||
d319704a | Moritz Bunkus | |||
my $department = '';
|
||||
local $hide = '';
|
||||
$form->header;
|
||||
print qq|
|
||||
6ab3da45 | Udo Spallek | <body>
|
||
<form method=post action=$form->{script}>
|
||||
d319704a | Moritz Bunkus | |||
6ab3da45 | Udo Spallek | <input type=hidden name=title value="$form->{title}">
|
||
d319704a | Moritz Bunkus | |||
6ab3da45 | Udo Spallek | <table width=100%>
|
||
d319704a | Moritz Bunkus | <tr>
|
||
<th class=listtop>$form->{title}</th>
|
||||
</tr>
|
||||
<tr height="5"></tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table>
|
||||
$department
|
||||
6ab3da45 | Udo Spallek | |;
|
||
d319704a | Moritz Bunkus | |||
# Hier Aufruf von get_config aus bin/mozilla/fa.pl zum
|
||||
# Einlesen der Finanzamtdaten
|
||||
&get_config($userspath, 'finanzamt.ini');
|
||||
081a4f97 | Moritz Bunkus | |||
4dd73ccf | Stephan Köhler | # Hier Einlesen der user-config
|
||
# steuernummer entfernt f?r prerelease
|
||||
d319704a | Moritz Bunkus | my @a = qw(signature name company address businessnumber tel fax email
|
||
4dd73ccf | Stephan Köhler | co_chief co_department co_custom1 co_custom2 co_custom3 co_custom4 co_custom5
|
||
co_name1 co_name2
|
||||
co_street co_street1 co_zip co_city co_city1 co_country co_tel co_tel1 co_tel2
|
||||
co_fax co_fax1 co_email co_email1 co_url co_url1 ustid duns
|
||||
co_bankname co_bankname1 co_bankname2 co_bankname3 co_blz co_blz1
|
||||
co_blz2 co_blz3 co_accountnr co_accountnr1 co_accountnr2 co_accountnr3);
|
||||
d319704a | Moritz Bunkus | map { $form->{$_} = $myconfig->{$_} } @a;
|
||
my $oeffnungszeiten = $form->{FA_Oeffnungszeiten};
|
||||
$oeffnungszeiten =~ s/\\\\n/<br>/g;
|
||||
print qq|
|
||||
<tr >
|
||||
<td width="50%" align="left" valign="top">
|
||||
<fieldset>
|
||||
<legend>
|
||||
6c3f16ab | Udo Spallek | <b>| . $locale->text('Company') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
|;
|
||||
if ($form->{company} ne '') {
|
||||
print qq|<h3>$form->{company}</h3>\n|;
|
||||
} else {
|
||||
print qq|
|
||||
<a href=am.pl?path=$form->{path}&action=config&level=Programm--Preferences&login=$form->{login}&password=$form->{password}>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('No Company Name given') . qq|!</a><br>
|
||
d319704a | Moritz Bunkus | |;
|
||
}
|
||||
081a4f97 | Moritz Bunkus | |||
4dd73ccf | Stephan Köhler | # Anpassungen der Variablennamen auf pre 2.1.1 Namen
|
||
# kl?ren, ob $form->{company_street|_address} gesetzt sind
|
||||
#
|
||||
d319704a | Moritz Bunkus | |||
if ($form->{address} ne '') {
|
||||
my $temp = $form->{address};
|
||||
$temp =~ s/\\n/<br \/>/;
|
||||
4dd73ccf | Stephan Köhler | ($form->{co_street}, $form->{co_city}) = split("<br \/>", $temp);
|
||
b39c8ce9 | Moritz Bunkus | $form->{co_city} =~ s/\\n//g;
|
||
4dd73ccf | Stephan Köhler | }
|
||
081a4f97 | Moritz Bunkus | if ($form->{co_street} ne ''
|
||
and ( $form->{co_zip} ne ''
|
||||
or $form->{co_city} ne '')
|
||||
) {
|
||||
4dd73ccf | Stephan Köhler | print qq|
|
||
$form->{co_street}<br>
|
||||
$form->{co_street1}<br>
|
||||
$form->{co_zip} $form->{co_city}|;
|
||||
081a4f97 | Moritz Bunkus | } else {
|
||
d319704a | Moritz Bunkus | print qq|
|
||
<a href=am.pl?path=$form->{path}&action=config&level=Programm--Preferences&login=$form->{login}&password=$form->{password}>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('No Company Address given') . qq|!</a>\n|;
|
||
d319704a | Moritz Bunkus | }
|
||
081a4f97 | Moritz Bunkus | $form->{co_email} = $form->{email} unless $form->{co_email};
|
||
$form->{co_tel} = $form->{tel} unless $form->{co_tel};
|
||||
$form->{co_fax} = $form->{fax} unless $form->{co_fax};
|
||||
$form->{co_url} = $form->{urlx} unless $form->{co_url};
|
||||
d319704a | Moritz Bunkus | print qq|
|
||
<br>
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Tel') . qq|.:
|
||
4dd73ccf | Stephan Köhler | $form->{co_tel}
|
||
d319704a | Moritz Bunkus | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Fax') . qq|.:nbsp;
|
||
4dd73ccf | Stephan Köhler | $form->{co_fax}
|
||
d319704a | Moritz Bunkus | <br>
|
||
<br>
|
||||
4dd73ccf | Stephan Köhler | $form->{co_email}
|
||
d319704a | Moritz Bunkus | <br>
|
||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Tax Number') . qq|:
|
||
d319704a | Moritz Bunkus | |;
|
||
if ($form->{steuernummer} ne '') {
|
||||
print qq|$form->{steuernummer}|;
|
||||
} else {
|
||||
print qq|
|
||||
<a href="ustva.pl?path=$form->{path}&action=edit&level=Programm--Finanzamteinstellungen&login=$form->{login}&password=$form->{password}">
|
||||
Keine Steuernummer hinterlegt!</a><br>|;
|
||||
}
|
||||
print qq|
|
||||
02cef2f2 | Moritz Bunkus | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('ELSTER Tax Number') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{elstersteuernummer}
|
||
02cef2f2 | Moritz Bunkus | <br>
|
||
d319704a | Moritz Bunkus | <br>
|
||
</fieldset>
|
||||
<br>
|
||||
|;
|
||||
if ($form->{FA_steuerberater_name} ne '') {
|
||||
print qq|
|
||||
<fieldset>
|
||||
<legend>
|
||||
<input checked="checked" title="|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Assume Tax Consultant Data in Tax Computation?')
|
||
d319704a | Moritz Bunkus | . qq|" name="FA_steuerberater" id=steuerberater class=checkbox type=checkbox value="1">
|
||
6c3f16ab | Udo Spallek | <b>| . $locale->text('Tax Consultant') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
4dd73ccf | Stephan Köhler | |||
d319704a | Moritz Bunkus | $form->{FA_steuerberater_name}<br>
|
||
$form->{FA_steuerberater_street}<br>
|
||||
$form->{FA_steuerberater_city}<br>
|
||||
Tel: $form->{FA_steuerberater_tel}<br>
|
||||
</fieldset>
|
||||
<br>
|
||||
|;
|
||||
}
|
||||
print qq|
|
||||
<fieldset>
|
||||
<legend>
|
||||
6c3f16ab | Udo Spallek | <b>| . $locale->text('Tax Period') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
|;
|
||||
&ustva_vorauswahl();
|
||||
my @years = ();
|
||||
if (not defined $form->{all_years}) {
|
||||
# accounting years if SQL-Ledger Version < 2.4.1
|
||||
# $year = $form->{year} * 1;
|
||||
081a4f97 | Moritz Bunkus | @years = sort { $b <=> $a } (2003 .. ($year + 1));
|
||
d319704a | Moritz Bunkus | $form->{all_years} = \@years;
|
||
}
|
||||
map { $form->{selectaccountingyear} .= qq|<option>$_\n| }
|
||||
@{ $form->{all_years} };
|
||||
print qq|
|
||||
<select name=year title="| . $locale->text('Year') . qq|">
|
||||
|;
|
||||
my $key = '';
|
||||
foreach $key (@years) {
|
||||
print qq|<option |;
|
||||
print qq|selected| if ($key eq $form->{year});
|
||||
print qq| >$key</option>
|
||||
|;
|
||||
}
|
||||
my $voranmeld = $form->{FA_voranmeld};
|
||||
print qq| </select>|;
|
||||
my $checked = '';
|
||||
$checked = "checked" if ($form->{kz10} eq '1');
|
||||
print qq|
|
||||
<input name="FA_10" id=FA_10 class=checkbox type=checkbox value="1" $checked title = "|
|
||||
4dd73ccf | Stephan Köhler | . $locale->text(
|
||
6c3f16ab | Udo Spallek | 'Amended Advance Turnover Tax Return (Nr. 10)')
|
||
d319704a | Moritz Bunkus | . qq|">
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Amended Advance Turnover Tax Return') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
|;
|
||||
if ($voranmeld ne '') {
|
||||
print qq|
|
||||
<br>
|
||||
| . $locale->text($voranmeld) . qq|
|
||||
|;
|
||||
6c3f16ab | Udo Spallek | print $locale->text('With Extension Of Time') if ($form->{FA_dauerfrist} eq '1');
|
||
d319704a | Moritz Bunkus | print qq|
|
||
<br>
|
||||
|;
|
||||
}
|
||||
if ($form->{method} ne '') {
|
||||
print qq|| . $locale->text('Method') . qq|: |;
|
||||
print qq|| . $locale->text('accrual') . qq||
|
||||
if ($form->{method} eq 'accrual');
|
||||
print qq|| . $locale->text('cash') . qq|| if ($form->{method} eq 'cash');
|
||||
}
|
||||
print qq|
|
||||
</fieldset>
|
||||
</td>|;
|
||||
if ($form->{FA_Name} ne '') {
|
||||
print qq|
|
||||
4dd73ccf | Stephan Köhler | <td width="50%" valign="top">
|
||
d319704a | Moritz Bunkus | <fieldset>
|
||
<legend>
|
||||
6c3f16ab | Udo Spallek | <b>| . $locale->text('Tax Office') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
<h3>$form->{FA_Name}</h2>
|
||||
|;
|
||||
#if ($form->{FA_Ergaenzung_Name ne ''}){
|
||||
# print qq|
|
||||
# $form->{FA_Ergaenzung_Name} 
|
||||
# <br>
|
||||
# |;
|
||||
#}
|
||||
print qq|
|
||||
$form->{FA_Strasse}
|
||||
<br>
|
||||
$form->{FA_PLZ} $form->{FA_Ort}
|
||||
<br>
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Tel') . qq|.:
|
||
d319704a | Moritz Bunkus | $form->{FA_Telefon}
|
||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Fax') . qq|.:$nbsp;
|
||
d319704a | Moritz Bunkus | $form->{FA_Fax}
|
||
<br>
|
||||
<br>
|
||||
<a href="mailto:$form->{FA_Email}?subject=|
|
||||
. CGI::escape("Steuer Nr: $form->{steuernummer}:")
|
||||
. qq|&body=|
|
||||
. CGI::escape(
|
||||
"Sehr geehrte Damen und Herren,\n\n\nMit freundlichen Gr??en\n\n")
|
||||
. CGI::escape($form->{signature}) . qq|">
|
||||
$form->{FA_Email}
|
||||
</a>
|
||||
<br>
|
||||
<a href="$form->{FA_Internet}">
|
||||
$form->{FA_Internet}
|
||||
</a>
|
||||
<br>
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Openings') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
$oeffnungszeiten
|
||||
<br>
|
||||
|;
|
||||
my $FA_1 =
|
||||
( $form->{FA_BLZ_1} ne ''
|
||||
&& $form->{FA_Kontonummer_1} ne ''
|
||||
&& $form->{FA_Bankbezeichnung_1} ne '');
|
||||
my $FA_2 =
|
||||
( $form->{FA_BLZ_2} ne ''
|
||||
&& $form->{FA_Kontonummer_2} ne ''
|
||||
&& $form->{FA_Bankbezeichnung_oertlich} ne '');
|
||||
if ($FA_1 && $FA_2) {
|
||||
print qq|
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Connection') . qq|
|
||
d319704a | Moritz Bunkus | <table>
|
||
<tr>
|
||||
<td>
|
||||
$form->{FA_Bankbezeichnung_1}
|
||||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Account') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{FA_Kontonummer_1}
|
||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Code') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{FA_BLZ_1}
|
||
</td>
|
||||
<td>
|
||||
$form->{FA_Bankbezeichnung_oertlich}
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Account') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{FA_Kontonummer_2}
|
||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Code') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{FA_BLZ_2}
|
||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>|;
|
||||
} elsif ($FA_1) {
|
||||
print qq|
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Connection') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<br>
|
||||
$form->{FA_Bankbezeichnung_1}
|
||||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Account') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{FA_Kontonummer_1}
|
||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Code') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{FA_BLZ_1} <br>
|
||
<br>|;
|
||||
} elsif ($FA_2) {
|
||||
print qq|
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Connection') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<br>
|
||||
$form->{FA_Bankbezeichnung_oertlich}
|
||||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Account') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{FA_Kontonummer_2}
|
||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Code') . qq|:
|
||
d319704a | Moritz Bunkus | $form->{FA_BLZ_2}
|
||
|;
|
||||
}
|
||||
print qq|
|
||||
</fieldset>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>
|
||||
6c3f16ab | Udo Spallek | <b>| . $locale->text('Outputformat') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
|;
|
||||
&show_options;
|
||||
my $ausgabe = '1';
|
||||
print qq|
|
||||
</fieldset>
|
||||
|;
|
||||
} else {
|
||||
print qq|
|
||||
<td width="50%" valign="bottom">
|
||||
<fieldset>
|
||||
<legend>
|
||||
6c3f16ab | Udo Spallek | <b>| . $locale->text('Hints') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
081a4f97 | Moritz Bunkus | <h2 class="confirm">|
|
||
. $locale->text('Missing Preferences: Outputroutine disabled')
|
||||
. qq|</h2>
|
||||
6c3f16ab | Udo Spallek | <h3>| . $locale->text('Help') . qq|</h3>
|
||
d319704a | Moritz Bunkus | <ul>
|
||
46ca64fb | Stephan Köhler | <li>| . $locale->text('Hint-Missing-Preferences') . qq|</li>
|
||
d319704a | Moritz Bunkus | </ul>
|
||
</fieldset>
|
||||
|;
|
||||
my $ausgabe = '';
|
||||
$hide = q|disabled="disabled"|;
|
||||
}
|
||||
print qq|
|
||||
</td>
|
||||
</tr>
|
||||
|;
|
||||
#}# end if report = ustva
|
||||
print qq|
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><hr size="3" noshade></td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<input type="hidden" name="address" value="$form->{address}">
|
||||
<input type="hidden" name="reporttype" value="custom">
|
||||
4dd73ccf | Stephan Köhler | <input type="hidden" name="co_street" value="$form->{co_street}">
|
||
<input type="hidden" name="co_city" value="$form->{co_city}">
|
||||
d319704a | Moritz Bunkus | <input type="hidden" name="path" value="$form->{path}">
|
||
<input type="hidden" name="login" value="$form->{login}">
|
||||
<input type="hidden" name="password" value="$form->{password}">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<td align="left">
|
||||
<input type=hidden name=nextsub value=generate_ustva>
|
||||
<input $hide type=submit class=submit name=action value="|
|
||||
. $locale->text('Show') . qq|">
|
||||
</td>
|
||||
<td align="right">
|
||||
6c3f16ab | Udo Spallek | </form>
|
||
<!--
|
||||
d319704a | Moritz Bunkus | <form action="doc/ustva.html" method="get">
|
||
6c3f16ab | Udo Spallek | |||
d319704a | Moritz Bunkus | <input type=submit class=submit name=action value="|
|
||
. $locale->text('Help') . qq|">
|
||||
6c3f16ab | Udo Spallek | </form>-->
|
||
d319704a | Moritz Bunkus | </td>
|
||
</tr>
|
||||
</table>
|
||||
|;
|
||||
print qq|
|
||||
</body>
|
||||
</html>
|
||||
|;
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
#############################
|
||||
sub help {
|
||||
$lxdebug->enter_sub();
|
||||
081a4f97 | Moritz Bunkus | |||
d319704a | Moritz Bunkus | # parse help documents under doc
|
||
my $tmp = $form->{templates};
|
||||
$form->{templates} = 'doc';
|
||||
$form->{help} = 'ustva';
|
||||
$form->{type} = 'help';
|
||||
$form->{format} = 'html';
|
||||
&generate_ustva();
|
||||
#$form->{templates} = $tmp;
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub show {
|
||||
$lxdebug->enter_sub();
|
||||
081a4f97 | Moritz Bunkus | |||
d319704a | Moritz Bunkus | #&generate_ustva();
|
||
no strict 'refs';
|
||||
4dd73ccf | Stephan Köhler | $lxdebug->leave_sub();
|
||
d319704a | Moritz Bunkus | &{ $form->{nextsub} };
|
||
use strict 'refs';
|
||||
}
|
||||
sub ustva_vorauswahl {
|
||||
$lxdebug->enter_sub();
|
||||
081a4f97 | Moritz Bunkus | |||
d319704a | Moritz Bunkus | #Aktuelles Datum zerlegen:
|
||
63a1c75d | Stephan Köhler | my $date = $form->datetonum($form->current_date(\%myconfig), \%myconfig);
|
||
d319704a | Moritz Bunkus | |||
#$locale->date($myconfig, $form->current_date($myconfig), 0)=~ /(\d\d).(\d\d).(\d\d\d\d)/;
|
||||
63a1c75d | Stephan Köhler | $form->{day} = substr($date, 6, 2);
|
||
$form->{month} = substr($date, 4, 2);
|
||||
$form->{year} = substr($date, 0, 4);
|
||||
$lxdebug->message(LXDebug::DEBUG1, qq|
|
||||
Actual date from Database: $date\n
|
||||
Actual year from Database: $form->{year}\n
|
||||
Actual day from Database: $form->{day}\n
|
||||
Actual month from Database: $form->{month}\n|);
|
||||
081a4f97 | Moritz Bunkus | |||
d319704a | Moritz Bunkus | my $sel = '';
|
||
my $yymmdd = '';
|
||||
# Testdaten erzeugen:
|
||||
#$form->{day}= '11';
|
||||
#$form->{month}= '01';
|
||||
#$form->{year}= 2004;
|
||||
print qq|
|
||||
<input type=hidden name=day value=$form->{day}>
|
||||
<input type=hidden name=month value=$form->{month}>
|
||||
<input type=hidden name=yymmdd value=$yymmdd>
|
||||
<input type=hidden name=sel value=$sel>
|
||||
|;
|
||||
if ($form->{FA_voranmeld} eq 'month') {
|
||||
# Vorauswahl bei monatlichem Voranmeldungszeitraum
|
||||
6c0e5cb7 | Moritz Bunkus | my %liste = ('01' => $locale->text('January'),
|
||
'02' => $locale->text('February'),
|
||||
'03' => $locale->text('March'),
|
||||
'04' => $locale->text('April'),
|
||||
'05' => $locale->text('May'),
|
||||
'06' => $locale->text('June'),
|
||||
'07' => $locale->text('July'),
|
||||
'08' => $locale->text('August'),
|
||||
'09' => $locale->text('September'),
|
||||
'10' => $locale->text('October'),
|
||||
'11' => $locale->text('November'),
|
||||
'12' => $locale->text('December'),
|
||||
'13' => $locale->text('Yearly'),
|
||||
);
|
||||
081a4f97 | Moritz Bunkus | |||
d319704a | Moritz Bunkus | my $yy = $form->{year} * 10000;
|
||
$yymmdd = "$form->{year}$form->{month}$form->{day}" * 1;
|
||||
$sel = '';
|
||||
6c0e5cb7 | Moritz Bunkus | my $dfv = '';
|
||
081a4f97 | Moritz Bunkus | |||
63a1c75d | Stephan Köhler | # Offset f?r Dauerfristverl?ngerung
|
||
$dfv = '100' if ($form->{FA_dauerfrist} eq '1');
|
||||
d319704a | Moritz Bunkus | |||
SWITCH: {
|
||||
$yymmdd <= ($yy + 110 + $dfv) && do {
|
||||
$form->{year} = $form->{year} - 1;
|
||||
$sel = '12';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 210 + $dfv) && do {
|
||||
$sel = '01';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 310 + $dfv) && do {
|
||||
$sel = '02';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 410 + $dfv) && do {
|
||||
$sel = '03';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 510 + $dfv) && do {
|
||||
$sel = '04';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 610 + $dfv) && do {
|
||||
$sel = '05';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 710 + $dfv) && do {
|
||||
$sel = '06';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 810 + $dfv) && do {
|
||||
$sel = '07';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 910 + $dfv) && do {
|
||||
$sel = '08';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 1010 + $dfv) && do {
|
||||
$sel = '09';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 1110 + $dfv) && do {
|
||||
$sel = '10';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 1210) && do {
|
||||
$sel = '11';
|
||||
last SWITCH;
|
||||
};
|
||||
$yymmdd <= ($yy + 1231) && do {
|
||||
$sel = '12';
|
||||
last SWITCH;
|
||||
};
|
||||
}
|
||||
2e2e8ce6 | Udo Spallek | print qq|<select id="zeitraum" name="period" title="|
|
||
6c0e5cb7 | Moritz Bunkus | . $locale->text('Select a period') . qq|" >|;
|
||
d319704a | Moritz Bunkus | my $key = '';
|
||
foreach $key (sort keys %liste) {
|
||||
my $selected = '';
|
||||
$selected = 'selected' if ($sel eq $key);
|
||||
print qq|
|
||||
6c0e5cb7 | Moritz Bunkus | <option value="$key" $selected> $liste{$key}</option>
|
||
d319704a | Moritz Bunkus | |;
|
||
}
|
||||
print qq|</select>|;
|
||||
} elsif ($form->{FA_voranmeld} eq 'quarter') {
|
||||
# Vorauswahl bei quartalsweisem Voranmeldungszeitraum
|
||||
2e2e8ce6 | Udo Spallek | my %liste = ('41' => $locale->text('1. Quarter'),
|
||
'42' => $locale->text('2. Quarter'),
|
||||
'43' => $locale->text('3. Quarter'),
|
||||
'44' => $locale->text('4. Quarter'),
|
||||
081a4f97 | Moritz Bunkus | '13' => $locale->text('Yearly'),);
|
||
d319704a | Moritz Bunkus | |||
my $yy = $form->{year} * 10000;
|
||||
$yymmdd = "$form->{year}$form->{month}$form->{day}" * 1;
|
||||
$sel = '';
|
||||
my $dfv = ''; # Offset f?r Dauerfristverl?ngerung
|
||||
$dfv = '100' if ($form->{FA_dauerfrist} eq '1');
|
||||
SWITCH: {
|
||||
$yymmdd <= ($yy + 110 + $dfv) && do {
|
||||
$form->{year} = $form->{year} - 1;
|
||||
6ab3da45 | Udo Spallek | $sel = '44';
|
||
d319704a | Moritz Bunkus | last SWITCH;
|
||
};
|
||||
$yymmdd <= ($yy + 410 + $dfv) && do {
|
||||
6ab3da45 | Udo Spallek | $sel = '41';
|
||
d319704a | Moritz Bunkus | last SWITCH;
|
||
};
|
||||
$yymmdd <= ($yy + 710 + $dfv) && do {
|
||||
6ab3da45 | Udo Spallek | $sel = '42';
|
||
d319704a | Moritz Bunkus | last SWITCH;
|
||
};
|
||||
$yymmdd <= ($yy + 1010 + $dfv) && do {
|
||||
6ab3da45 | Udo Spallek | $sel = '43';
|
||
d319704a | Moritz Bunkus | last SWITCH;
|
||
};
|
||||
$yymmdd <= ($yy + 1231) && do {
|
||||
6ab3da45 | Udo Spallek | $sel = '44';
|
||
d319704a | Moritz Bunkus | };
|
||
}
|
||||
2e2e8ce6 | Udo Spallek | print qq|<select id="zeitraum" name="period" title="|
|
||
d319704a | Moritz Bunkus | . $locale->text('Select a period') . qq|" >|;
|
||
my $key = '';
|
||||
foreach $key (sort keys %liste) {
|
||||
my $selected = '';
|
||||
$selected = 'selected' if ($sel eq $key);
|
||||
print qq|
|
||||
f575aa99 | Stephan Köhler | <option value="$key" $selected>$liste{$key}</option>
|
||
d319704a | Moritz Bunkus | |;
|
||
}
|
||||
print qq|\n</select>
|
||||
|;
|
||||
} else {
|
||||
# keine Vorauswahl bei Voranmeldungszeitraum
|
||||
2e2e8ce6 | Udo Spallek | print qq|<select id="zeitraum" name="period" title="|
|
||
d319704a | Moritz Bunkus | . $locale->text('Select a period') . qq|" >|;
|
||
2e2e8ce6 | Udo Spallek | my %listea = ('41' => '1. Quarter',
|
||
'42' => '2. Quarter',
|
||||
'43' => '3. Quarter',
|
||||
'44' => '4. Quarter',);
|
||||
d319704a | Moritz Bunkus | |||
my %listeb = ('01' => 'January',
|
||||
'02' => 'February',
|
||||
'03' => 'March',
|
||||
'04' => 'April',
|
||||
'05' => 'May',
|
||||
'06' => 'June',
|
||||
'07' => 'July',
|
||||
'08' => 'August',
|
||||
'09' => 'September',
|
||||
'10' => 'October',
|
||||
'11' => 'November',
|
||||
f575aa99 | Stephan Köhler | '12' => 'December',
|
||
081a4f97 | Moritz Bunkus | '13' => 'Yearly',);
|
||
d319704a | Moritz Bunkus | my $key = '';
|
||
foreach $key (sort keys %listea) {
|
||||
print qq|
|
||||
081a4f97 | Moritz Bunkus | <option value="$key">|
|
||
. $locale->text("$listea{$key}")
|
||||
. qq|</option>\n|;
|
||||
d319704a | Moritz Bunkus | }
|
||
foreach $key (sort keys %listeb) {
|
||||
print qq|
|
||||
081a4f97 | Moritz Bunkus | <option value="$key">|
|
||
. $locale->text("$listeb{$key}")
|
||||
. qq|</option>\n|;
|
||||
d319704a | Moritz Bunkus | }
|
||
print qq|</select>|;
|
||||
}
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub config {
|
||||
$lxdebug->enter_sub();
|
||||
edit();
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub debug {
|
||||
4dd73ccf | Stephan Köhler | $lxdebug->enter_sub();
|
||
d319704a | Moritz Bunkus | $form->debug();
|
||
4dd73ccf | Stephan Köhler | $lxdebug->leave_sub();
|
||
d319704a | Moritz Bunkus | }
|
||
sub show_options {
|
||||
$lxdebug->enter_sub();
|
||||
# $form->{PD}{$form->{type}} = "selected";
|
||||
# $form->{DF}{$form->{format}} = "selected";
|
||||
# $form->{OP}{$form->{media}} = "selected";
|
||||
# $form->{SM}{$form->{sendmode}} = "selected";
|
||||
my $type = qq| <input type=hidden name="type" value="ustva">|;
|
||||
my $media = qq| <input type=hidden name="media" value="screen">|;
|
||||
my $format =
|
||||
qq| <option value=html selected>|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Preview')
|
||
d319704a | Moritz Bunkus | . qq|</option>|;
|
||
d1c335e9 | Moritz Bunkus | if ($latex_templates) {
|
||
d319704a | Moritz Bunkus | $format .=
|
||
qq| <option value=pdf>|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('UStVA (PDF-Dokument)')
|
||
d319704a | Moritz Bunkus | . qq|</option>|;
|
||
}
|
||||
#my $disabled= qq|disabled="disabled"|;
|
||||
#$disabled='' if ($form->{elster} eq '1' );
|
||||
if ($form->{elster} eq '1') {
|
||||
$format .=
|
||||
2e2e8ce6 | Udo Spallek | qq|<option value=elsterwinston>|
|
||
6c3f16ab | Udo Spallek | . $locale->text('ELSTER Export (Winston)')
|
||
2e2e8ce6 | Udo Spallek | . qq|</option>|
|
||
. qq|<option value=elstertaxbird>|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('ELSTER Export (Taxbird)')
|
||
2e2e8ce6 | Udo Spallek | . qq|</option>|;
|
||
d319704a | Moritz Bunkus | }
|
||
#$format .= qq|<option value=elster>|.$locale->text('ELSTER Export nach Winston').qq|</option>|;
|
||||
print qq|
|
||||
$type
|
||||
$media
|
||||
<select name=format title = "|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Choose Outputformat') . qq|">$format</select>
|
||
d319704a | Moritz Bunkus | |;
|
||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub generate_ustva {
|
||||
$lxdebug->enter_sub();
|
||||
# Aufruf von get_config aus bin/mozilla/ustva.pl zum
|
||||
# Einlesen der Finanzamtdaten aus finanzamt.ini
|
||||
get_config($userspath, 'finanzamt.ini');
|
||||
6ab3da45 | Udo Spallek | # init some form vars
|
||
d319704a | Moritz Bunkus | my @anmeldungszeitraum =
|
||
qw('0401' '0402' '0403' '0404' '0405' '0405' '0406' '0407' '0408' '0409' '0410' '0411' '0412' '0441' '0442' '0443' '0444');
|
||||
2e2e8ce6 | Udo Spallek | foreach my $item (@anmeldungszeitraum) {
|
||
d319704a | Moritz Bunkus | $form->{$item} = "";
|
||
}
|
||||
#forgotten the year --> thisyear
|
||||
if ($form->{year} !~ m/^\d\d\d\d$/) {
|
||||
081a4f97 | Moritz Bunkus | $form->{year} = substr(
|
||
$form->datetonum(
|
||||
$form->current_date(\%myconfig), \%myconfig
|
||||
),
|
||||
0, 4);
|
||||
$lxdebug->message(LXDebug::DEBUG1,
|
||||
qq|Actual year from Database: $form->{year}\n|);
|
||||
d319704a | Moritz Bunkus | }
|
||
6ab3da45 | Udo Spallek | #
|
||
# using dates in ISO-8601 format: yyyymmmdd for Postgres...
|
||||
#
|
||||
d319704a | Moritz Bunkus | #yearly report
|
||
2e2e8ce6 | Udo Spallek | if ($form->{period} eq "13") {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0101";
|
||
$form->{todate} = "$form->{year}1231";
|
||||
d319704a | Moritz Bunkus | }
|
||
#Quater reports
|
||||
2e2e8ce6 | Udo Spallek | if ($form->{period} eq "41") {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0101";
|
||
$form->{todate} = "$form->{year}0331";
|
||||
d319704a | Moritz Bunkus | $form->{'0441'} = "X";
|
||
}
|
||||
2e2e8ce6 | Udo Spallek | if ($form->{period} eq "42") {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0401";
|
||
$form->{todate} = "$form->{year}0630";
|
||||
d319704a | Moritz Bunkus | $form->{'0442'} = "X";
|
||
}
|
||||
2e2e8ce6 | Udo Spallek | if ($form->{period} eq "43") {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0701";
|
||
$form->{todate} = "$form->{year}0930";
|
||||
d319704a | Moritz Bunkus | $form->{'0443'} = "X";
|
||
}
|
||||
2e2e8ce6 | Udo Spallek | if ($form->{period} eq "44") {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}1001";
|
||
$form->{todate} = "$form->{year}1231";
|
||||
d319704a | Moritz Bunkus | $form->{'0444'} = "X";
|
||
}
|
||||
#Monthly reports
|
||||
SWITCH: {
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "01" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0101";
|
||
$form->{todate} = "$form->{year}0131";
|
||||
d319704a | Moritz Bunkus | $form->{'0401'} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "02" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0201";
|
||
d319704a | Moritz Bunkus | |||
#this works from 1901 to 2099, 1900 and 2100 fail.
|
||||
my $leap = ($form->{year} % 4 == 0) ? "29" : "28";
|
||||
63a1c75d | Stephan Köhler | $form->{todate} = "$form->{year}02$leap";
|
||
d319704a | Moritz Bunkus | $form->{"0402"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "03" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0301";
|
||
$form->{todate} = "$form->{year}0331";
|
||||
d319704a | Moritz Bunkus | $form->{"0403"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "04" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0401";
|
||
$form->{todate} = "$form->{year}0430";
|
||||
d319704a | Moritz Bunkus | $form->{"0404"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "05" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0501";
|
||
$form->{todate} = "$form->{year}0531";
|
||||
d319704a | Moritz Bunkus | $form->{"0405"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "06" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0601";
|
||
$form->{todate} = "$form->{year}0630";
|
||||
d319704a | Moritz Bunkus | $form->{"0406"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "07" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0701";
|
||
$form->{todate} = "$form->{year}0731";
|
||||
d319704a | Moritz Bunkus | $form->{"0407"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "08" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0801";
|
||
$form->{todate} = "$form->{year}0831";
|
||||
d319704a | Moritz Bunkus | $form->{"0408"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "09" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}0901";
|
||
$form->{todate} = "$form->{year}0930";
|
||||
d319704a | Moritz Bunkus | $form->{"0409"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "10" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}1001";
|
||
$form->{todate} = "$form->{year}1031";
|
||||
d319704a | Moritz Bunkus | $form->{"0410"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "11" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}1101";
|
||
$form->{todate} = "$form->{year}1130";
|
||||
d319704a | Moritz Bunkus | $form->{"0411"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
2e2e8ce6 | Udo Spallek | $form->{period} eq "12" && do {
|
||
63a1c75d | Stephan Köhler | $form->{fromdate} = "$form->{year}1201";
|
||
$form->{todate} = "$form->{year}1231";
|
||||
d319704a | Moritz Bunkus | $form->{"0412"} = "X";
|
||
last SWITCH;
|
||||
};
|
||||
}
|
||||
6ab3da45 | Udo Spallek | |||
# Get the USTVA
|
||||
82ee2234 | Stephan Köhler | USTVA->ustva(\%myconfig, \%$form);
|
||
081a4f97 | Moritz Bunkus | |||
63a1c75d | Stephan Köhler | # reformat Dates to dateformat
|
||
081a4f97 | Moritz Bunkus | $form->{fromdate} = $locale->date(\%myconfig, $form->{fromdate}, 0, 0, 0);
|
||
6ab3da45 | Udo Spallek | $form->{todate} = $form->current_date(\%myconfig) unless $form->{todate};
|
||
081a4f97 | Moritz Bunkus | $form->{todate} = $locale->date(\%myconfig, $form->{todate}, 0, 0, 0);
|
||
d319704a | Moritz Bunkus | |||
2e2e8ce6 | Udo Spallek | $form->{longperiod} =
|
||
d319704a | Moritz Bunkus | $locale->date(\%myconfig, $form->current_date(\%myconfig), 1, 0, 0);
|
||
63a1c75d | Stephan Köhler | |||
d319704a | Moritz Bunkus | # if there are any dates construct a where
|
||
if ($form->{fromdate} || $form->{todate}) {
|
||||
2e2e8ce6 | Udo Spallek | $form->{todate} = $form->current_date($myconfig) unless ($form->{todate});
|
||
d319704a | Moritz Bunkus | |||
my $longtodate = $locale->date($myconfig, $form->{todate}, 1, 0, 0);
|
||||
my $shorttodate = $locale->date($myconfig, $form->{todate}, 0, 0, 0);
|
||||
my $longfromdate = $locale->date($myconfig, $form->{fromdate}, 1, 0, 0);
|
||||
my $shortfromdate = $locale->date($myconfig, $form->{fromdate}, 0, 0, 0);
|
||||
$form->{this_period} = "$shortfromdate<br>\n$shorttodate";
|
||||
2e2e8ce6 | Udo Spallek | $form->{longperiod} =
|
||
d319704a | Moritz Bunkus | $locale->text('for Period')
|
||
. qq|<br>\n$longfromdate |
|
||||
6c3f16ab | Udo Spallek | . $locale->text('to (date)')
|
||
d319704a | Moritz Bunkus | . qq| $longtodate|;
|
||
}
|
||||
if ($form->{comparefromdate} || $form->{comparetodate}) {
|
||||
my $longcomparefromdate =
|
||||
$locale->date(\%myconfig, $form->{comparefromdate}, 1, 0, 0);
|
||||
my $shortcomparefromdate =
|
||||
$locale->date(\%myconfig, $form->{comparefromdate}, 0, 0, 0);
|
||||
my $longcomparetodate =
|
||||
$locale->date(\%myconfig, $form->{comparetodate}, 1, 0, 0);
|
||||
my $shortcomparetodate =
|
||||
$locale->date(\%myconfig, $form->{comparetodate}, 0, 0, 0);
|
||||
$form->{last_period} = "$shortcomparefromdate<br>\n$shortcomparetodate";
|
||||
2e2e8ce6 | Udo Spallek | $form->{longperiod} .=
|
||
d319704a | Moritz Bunkus | "<br>\n$longcomparefromdate "
|
||
6c3f16ab | Udo Spallek | . $locale->text('to (date)')
|
||
d319704a | Moritz Bunkus | . qq| $longcomparetodate|;
|
||
}
|
||||
$form->{Datum_heute} =
|
||||
$locale->date(\%myconfig, $form->current_date(\%myconfig), 0, 0, 0);
|
||||
# setup variables for the form
|
||||
4dd73ccf | Stephan Köhler | my @a = qw(company businessnumber tel fax email
|
||
co_chief co_department co_custom1 co_custom2 co_custom3 co_custom4 co_custom5
|
||||
co_name1 co_name2 co_street co_street1 co_zip co_city co_city1 co_country co_tel co_tel1 co_tel2
|
||||
co_fax co_fax1 co_email co_email1 co_url co_url1 ustid duns
|
||||
co_bankname co_bankname1 co_bankname2 co_bankname3 co_blz co_blz1
|
||||
co_blz2 co_blz3 co_accountnr co_accountnr1 co_accountnr2 co_accountnr3);
|
||||
d319704a | Moritz Bunkus | map { $form->{$_} = $myconfig{$_} } @a;
|
||
if ($form->{address} ne '') {
|
||||
my $temp = $form->{address};
|
||||
$temp =~ s/\\n/<br \/>/;
|
||||
4dd73ccf | Stephan Köhler | ($form->{co_street}, $form->{co_city}) = split("<br \/>", $temp);
|
||
b39c8ce9 | Moritz Bunkus | $form->{co_city} =~ s/\\n//g;
|
||
d319704a | Moritz Bunkus | }
|
||
6ab3da45 | Udo Spallek | #
|
||
# Outputformat specific customisation's
|
||||
#
|
||||
my @category_cent = qw(511 861 36 80 971 931 98 96 53 74
|
||||
85 65 66 61 62 67 63 64 59 69 39 83
|
||||
Z43 Z45 Z53 Z62 Z65 Z67);
|
||||
my @category_euro = qw(41 44 49 43 48 51 86 35 77 76 91 97 93
|
||||
95 94 42 60 45 52 73 84);
|
||||
2e2e8ce6 | Udo Spallek | if ( $form->{format} eq 'pdf' or $form->{format} eq 'postscript') {
|
||
$form->{IN} = "$form->{type}-$form->{year}.tex";
|
||||
d319704a | Moritz Bunkus | $form->{padding} = "~~";
|
||
$form->{bold} = "\textbf{";
|
||||
$form->{endbold} = "}";
|
||||
$form->{br} = '\\\\';
|
||||
4dd73ccf | Stephan Köhler | # Zahlenformatierung f?r Latex USTVA Formulare
|
||
6ab3da45 | Udo Spallek | |||
foreach my $number (@category_euro) {
|
||||
$form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '0', '');
|
||||
d319704a | Moritz Bunkus | }
|
||
6ab3da45 | Udo Spallek | |||
my ${decimal_comma} = ( $myconfig{numberformat} eq '1.000,00'
|
||||
or $myconfig{numberformat} eq '1000,00' ) ? ',':'.';
|
||||
foreach my $number (@category_cent) {
|
||||
$form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '2', '');
|
||||
$form->{$number} =~ s/${decimal_comma}/~~/g;
|
||||
2e2e8ce6 | Udo Spallek | }
|
||
6ab3da45 | Udo Spallek | |||
2e2e8ce6 | Udo Spallek | } elsif ( $form->{format} eq 'html') { # Formatierungen f?r HTML Ausgabe
|
||
081a4f97 | Moritz Bunkus | |||
2e2e8ce6 | Udo Spallek | $form->{IN} = $form->{type} . '.html';
|
||
d319704a | Moritz Bunkus | $form->{padding} = " ";
|
||
$form->{bold} = "<b>";
|
||||
$form->{endbold} = "</b>";
|
||||
$form->{br} = "<br>";
|
||||
22573a5b | Moritz Bunkus | $form->{address} =~ s/\\n/\n/g;
|
||
d319704a | Moritz Bunkus | |||
6ab3da45 | Udo Spallek | foreach $number (@category_cent) {
|
||
$form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '2', '0');
|
||||
}
|
||||
foreach $number (@category_euro) {
|
||||
$form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '0', '0');
|
||||
f575aa99 | Stephan Köhler | }
|
||
081a4f97 | Moritz Bunkus | |||
6ab3da45 | Udo Spallek | } elsif ( $form->{format} eq 'elsterwinston' ) {
|
||
$form->{IN} = 'winston.xml';
|
||||
#
|
||||
# Build Winston filename
|
||||
#
|
||||
my $file = 'U'; # 1. char 'U' = USTVA
|
||||
$file .= $form->{period};
|
||||
#4. and 5. char = year modulo 100
|
||||
$file .= sprintf("%02d", $form->{year} % 100);
|
||||
#6. to 18. char = Elstersteuernummer
|
||||
#Beispiel: Steuernummer in Bayern
|
||||
#111/222/33334 ergibt f?r UStVA Jan 2004: U01049111022233334
|
||||
$file .= $form->{elsterFFFF};
|
||||
$file .= $form->{elstersteuernummer};
|
||||
#file suffix
|
||||
$file .= '.xml';
|
||||
$form->{tmpfile} = "$userspath/$file";
|
||||
$form->{attachment_filename} = "$file";
|
||||
# Zahlenformatierung f?r Winston
|
||||
my $temp_numberformat = $myconfig{numberformat};
|
||||
# Numberformat must be '1000.00' for Winston
|
||||
$myconfig{numberformat} = '1000.00';
|
||||
foreach my $number (@category_cent) {
|
||||
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '2', '') : '';
|
||||
}
|
||||
foreach my $number (@category_euro) {
|
||||
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '0', '') : '';
|
||||
f575aa99 | Stephan Köhler | }
|
||
6ab3da45 | Udo Spallek | # Re-set Numberformat
|
||
$myconfig{numberformat} = $temp_numberformat;
|
||||
}
|
||||
elsif ( $form->{format} eq 'elstertaxbird' ) {
|
||||
$form->{IN} = 'taxbird.txb';
|
||||
$form->{attachment_filename} = "USTVA-" . $form->{period}
|
||||
. sprintf("%02d", $form->{year} % 100) . ".txb";
|
||||
$form->{tmpfile} = "$userspath/" . $form->{attachment_filename};
|
||||
if ($form->{period} =~ /^[4]\d$/ ){
|
||||
my %periods = ( # Lx => taxbird
|
||||
'41' => '12',
|
||||
'42' => '13',
|
||||
'43' => '14',
|
||||
'44' => '15',
|
||||
);
|
||||
foreach my $quarter ( keys %periods ) {
|
||||
$form->{taxbird_period} = $periods{$quarter} if ( $form->{period} eq $quarter);
|
||||
}
|
||||
my %lands = ( # Lx => taxbird # TODO: besser als array...
|
||||
'Baden W?rtemberg' => '0',
|
||||
'Bayern' => '1',
|
||||
'Berlin' => '2',
|
||||
'Brandenburg' => '3',
|
||||
'Bremen' => '4',
|
||||
'Hamburg' => '5',
|
||||
'Hessen' => '6',
|
||||
'Mecklenburg Vorpommern' => '7',
|
||||
'Niedersachsen' => '8',
|
||||
'Nordrhein Westfalen' => '9',
|
||||
'Rheinland Pfalz' => '10',
|
||||
'Saarland' => '11',
|
||||
'Sachsen' => '12',
|
||||
'Sachsen Anhalt' => '13',
|
||||
'Schleswig Holstein' => '14',
|
||||
'Th?ringen' => '15',
|
||||
);
|
||||
foreach my $land ( keys %lands ){
|
||||
$form->{taxbird_land_nr} = $lands{$land} if ($form->{elsterland} eq $land );
|
||||
}
|
||||
$form->{taxbird_steuernummer} = $form->{steuernummer};
|
||||
$form->{taxbird_steuernummer} =~ s/\D//g;
|
||||
$form->{co_zip} = $form->{co_city};
|
||||
$form->{co_zip} =~ s/\D//g;
|
||||
$form->{co_city} =~ s/\d//g;
|
||||
$form->{co_city} =~ s/^\s//g;
|
||||
($form->{co_phone_prefix}, $form->{co_phone}) = split("-", $form->{tel});
|
||||
# Numberformatting for Taxbird
|
||||
081a4f97 | Moritz Bunkus | |||
6ab3da45 | Udo Spallek | my $temp_numberformat = $myconfig{numberformat};
|
||
# Numberformat must be '1000.00' for Taxbird ?!
|
||||
2e2e8ce6 | Udo Spallek | |||
6ab3da45 | Udo Spallek | $myconfig{numberformat} = '1000.00';
|
||
2e2e8ce6 | Udo Spallek | |||
6ab3da45 | Udo Spallek | foreach my $number (@category_cent) {
|
||
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '2', '') : '';
|
||||
}
|
||||
2e2e8ce6 | Udo Spallek | |||
6ab3da45 | Udo Spallek | foreach my $number (@category_euro) {
|
||
$form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '0', '') : '';
|
||||
}
|
||||
# Re-set Numberformat
|
||||
$myconfig{numberformat} = $temp_numberformat;
|
||||
2e2e8ce6 | Udo Spallek | |||
6ab3da45 | Udo Spallek | } elsif ($form->{period} =~ /^\d+$/ ) {
|
||
$form->{period} =~ s/^0//g;
|
||||
my $period = $form->{period};
|
||||
$period * 1;
|
||||
$period--;
|
||||
$form->{period} = $period;
|
||||
} else {
|
||||
$form->header;
|
||||
USTVA::error( $locale->text('Wrong Period' ));
|
||||
exit(0);
|
||||
2e2e8ce6 | Udo Spallek | }
|
||
} elsif ( $form->{format} eq '' ){ # No format error.
|
||||
$form->header;
|
||||
6c3f16ab | Udo Spallek | USTVA::error( $locale->text('Application Error. No Format given' ) . "!");
|
||
2e2e8ce6 | Udo Spallek | exit(0);
|
||
} else { # All other Formats are wrong
|
||||
$form->header;
|
||||
6c3f16ab | Udo Spallek | USTVA::error( $locale->text('Application Error. Wrong Format') . ": " . $form->{format} );
|
||
2e2e8ce6 | Udo Spallek | exit(0);
|
||
}
|
||||
6ab3da45 | Udo Spallek | |||
if ( $form->{period} eq '13' and $form->{format} ne 'html') {
|
||||
$form->header;
|
||||
USTVA::info(
|
||||
$locale->text(
|
||||
'Yearly taxreport not yet implemented')
|
||||
. '!');
|
||||
}
|
||||
2e2e8ce6 | Udo Spallek | |||
$form->{templates} = $myconfig{templates};
|
||||
$form->{templates} = "doc" if ( $form->{type} eq 'help' );
|
||||
d319704a | Moritz Bunkus | |||
6ab3da45 | Udo Spallek | $form->parse_template(\%myconfig, $userspath);
|
||
d319704a | Moritz Bunkus | |||
d726f05a | Moritz Bunkus | $lxdebug->leave_sub();
|
||
d319704a | Moritz Bunkus | }
|
||
sub edit {
|
||||
$lxdebug->enter_sub();
|
||||
081a4f97 | Moritz Bunkus | |||
d319704a | Moritz Bunkus | # edit all taxauthority prefs
|
||
$form->header;
|
||||
&get_config($userspath, 'finanzamt.ini');
|
||||
#&create_steuernummer;
|
||||
my $land = $form->{elsterland};
|
||||
my $amt = $form->{elsterFFFF};
|
||||
4dd73ccf | Stephan Köhler | my $callback = '';
|
||
$callback =
|
||||
"$form->{cbscript}?action=edit&login=$form->{cblogin}&path=$form->{cbpath}&root=$form->{cbroot}&rpw=$form->{cbrpw}"
|
||||
if ($form->{cbscript} ne '' and $form->{cblogin} ne '');
|
||||
6c3f16ab | Udo Spallek | $form->{title} = $locale->text('Tax Office Preferences');
|
||
d319704a | Moritz Bunkus | print qq|
|
||
<body>
|
||||
<form name="verzeichnis" method=post action="$form->{script}">
|
||||
<table width=100%>
|
||||
<tr>
|
||||
<th class="listtop">|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Tax Office Preferences') . qq|</th>
|
||
d319704a | Moritz Bunkus | </tr>
|
||
<tr>
|
||||
<td>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend><b>|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Local Tax Office Preferences') . qq|</b></legend>
|
||
d319704a | Moritz Bunkus | |;
|
||
#print qq|$form->{terminal}|;
|
||||
USTVA::fa_auswahl($land, $amt, &elster_hash());
|
||||
print qq|
|
||||
</fieldset>
|
||||
<br>
|
||||
|;
|
||||
my $checked = '';
|
||||
$checked = "checked" if ($form->{method} eq 'accrual');
|
||||
print qq|
|
||||
<fieldset>
|
||||
6c3f16ab | Udo Spallek | <legend><b>| . $locale->text('Taxation') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
<input name=method id=accrual class=radio type=radio value="accrual" $checked>
|
||||
<label for="accrual">| . $locale->text('accrual') . qq|</label>
|
||||
<br>
|
||||
|;
|
||||
$checked = '';
|
||||
$checked = "checked" if ($form->{method} eq 'cash');
|
||||
print qq|
|
||||
<input name=method id=cash class=radio type=radio value="cash" $checked>
|
||||
<label for="cash">| . $locale->text('cash') . qq|</label>
|
||||
</fieldset>
|
||||
<br>
|
||||
<fieldset>
|
||||
6c3f16ab | Udo Spallek | <legend><b>| . $locale->text('Tax Period') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
|;
|
||||
$checked = '';
|
||||
$checked = "checked" if ($form->{FA_voranmeld} eq 'month');
|
||||
print qq|
|
||||
<input name=FA_voranmeld id=month class=radio type=radio value="month" $checked>
|
||||
<label for="month">| . $locale->text('month') . qq|</label>
|
||||
<br>
|
||||
|;
|
||||
$checked = '';
|
||||
$checked = "checked" if ($form->{FA_voranmeld} eq 'quarter');
|
||||
print qq|
|
||||
<input name="FA_voranmeld" id=quarter class=radio type=radio value="quarter" $checked>
|
||||
<label for="quarter">| . $locale->text('quarter') . qq|</label>
|
||||
<br>
|
||||
|;
|
||||
$checked = '';
|
||||
$checked = "checked" if ($form->{FA_dauerfrist} eq '1');
|
||||
print qq|
|
||||
<input name="FA_dauerfrist" id=FA_dauerfrist class=checkbox type=checkbox value="1" $checked>
|
||||
<label for="">|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Extension Of Time') . qq|</label>
|
||
4dd73ccf | Stephan Köhler | |||
d319704a | Moritz Bunkus | </fieldset>
|
||
<br>
|
||||
<fieldset>
|
||||
6c3f16ab | Udo Spallek | <legend><b>| . $locale->text('Tax Consultant') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
|;
|
||||
$checked = '';
|
||||
$checked = "checked" if ($form->{FA_71} eq 'X');
|
||||
print qq|
|
||||
<!-- <input name="FA_71" id=FA_71 class=checkbox type=checkbox value="X" $checked>
|
||||
<label for="FA_71">|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Clearing Tax Received (No 71)')
|
||
d319704a | Moritz Bunkus | . qq|</label>
|
||
<br>
|
||||
<br>-->
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
| . $locale->text('Name') . qq|
|
||||
</td>
|
||||
<td>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Street') . qq|
|
||
d319704a | Moritz Bunkus | </td>
|
||
<td>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Zip, City') . qq|
|
||
d319704a | Moritz Bunkus | </td>
|
||
<td>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Telephone') . qq|
|
||
d319704a | Moritz Bunkus | </td>
|
||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input name="FA_steuerberater_name" id=steuerberater size=25 value="$form->{FA_steuerberater_name}">
|
||||
</td>
|
||||
<td>
|
||||
<input name="FA_steuerberater_street" id=steuerberater size=25 value="$form->{FA_steuerberater_street}">
|
||||
</td>
|
||||
<td>
|
||||
<input name="FA_steuerberater_city" id=steuerberater size=25 value="$form->{FA_steuerberater_city}">
|
||||
</td>
|
||||
<td>
|
||||
<input name="FA_steuerberater_tel" id=steuerberater size=25 value="$form->{FA_steuerberater_tel}">
|
||||
</tr>
|
||||
</table>
|
||||
4dd73ccf | Stephan Köhler | |||
d319704a | Moritz Bunkus | </fieldset>
|
||
<br>
|
||||
<br>
|
||||
<hr>
|
||||
<!--<input type=submit class=submit name=action value="|
|
||||
081a4f97 | Moritz Bunkus | . $locale->text('debug') . qq|">-->
|
||
4dd73ccf | Stephan Köhler | |;
|
||
print qq|
|
||||
<input type="button" name="Verweis" value="|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('User Config') . qq|"
|
||
4dd73ccf | Stephan Köhler | onClick="self.location.href='$callback'">| if ($callback ne '');
|
||
print qq|
|
||||
|
||||
d319704a | Moritz Bunkus | <input type=submit class=submit name=action value="|
|
||
. $locale->text('continue') . qq|">
|
||||
4dd73ccf | Stephan Köhler | |||
d319704a | Moritz Bunkus | </td>
|
||
</tr>
|
||||
</table>
|
||||
|;
|
||||
my @variables = qw( steuernummer elsterland elstersteuernummer elsterFFFF);
|
||||
my $variable = '';
|
||||
foreach $variable (@variables) {
|
||||
4dd73ccf | Stephan Köhler | print qq|
|
||
d319704a | Moritz Bunkus | <input name=$variable type=hidden value="$form->{$variable}">|;
|
||
}
|
||||
my $steuernummer_new = '';
|
||||
#<input type=hidden name="steuernummer_new" value="$form->{$steuernummer_new}">
|
||||
print qq|
|
||||
4dd73ccf | Stephan Köhler | <input type=hidden name="callback" value="$callback">
|
||
d319704a | Moritz Bunkus | <input type=hidden name="nextsub" value="edit_form">
|
||
<input type=hidden name="warnung" value="1">
|
||||
<input type=hidden name="saved" value="|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Check Details') . qq|">
|
||
d319704a | Moritz Bunkus | <input type=hidden name="path" value=$form->{path}>
|
||
<input type=hidden name="login" value=$form->{login}>
|
||||
<input type=hidden name="password" value=$form->{password}>
|
||||
<input type=hidden name="warnung" value="0">
|
||||
|;
|
||||
@variables = qw(FA_Name FA_Strasse FA_PLZ
|
||||
FA_Ort FA_Telefon FA_Fax FA_PLZ_Grosskunden FA_PLZ_Postfach FA_Postfach
|
||||
FA_BLZ_1 FA_Kontonummer_1 FA_Bankbezeichnung_1 FA_BLZ_2
|
||||
FA_Kontonummer_2 FA_Bankbezeichnung_oertlich FA_Oeffnungszeiten
|
||||
FA_Email FA_Internet);
|
||||
foreach $variable (@variables) {
|
||||
4dd73ccf | Stephan Köhler | print qq|
|
||
d319704a | Moritz Bunkus | <input name=$variable type=hidden value="$form->{$variable}">|;
|
||
}
|
||||
print qq|
|
||||
</form>
|
||||
</body>
|
||||
|;
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub edit_form {
|
||||
$lxdebug->enter_sub();
|
||||
$form->header();
|
||||
print qq|
|
||||
<body>
|
||||
|;
|
||||
my $elsterland = '';
|
||||
my $elster_amt = '';
|
||||
my $elsterFFFF = '';
|
||||
my $elstersteuernummer = '';
|
||||
&get_config($userspath, 'finanzamt.ini')
|
||||
if ($form->{saved} eq $locale->text('saved'));
|
||||
# Auf ?bergabefehler checken
|
||||
081a4f97 | Moritz Bunkus | USTVA::info( $locale->text('Missing Tax Authoritys Preferences') . "\n"
|
||
. $locale->text('USTVA-Hint: Tax Authoritys'))
|
||||
d319704a | Moritz Bunkus | if ( $form->{elsterFFFF_new} eq 'Auswahl'
|
||
|| $form->{elsterland_new} eq 'Auswahl');
|
||||
081a4f97 | Moritz Bunkus | USTVA::info( $locale->text('Missing Method!') . "\n"
|
||
. $locale->text('USTVA-Hint: Method'))
|
||||
d319704a | Moritz Bunkus | if ($form->{method} eq '');
|
||
# Kl?ren, ob Variablen bereits bef?llt sind UND ob ver?derungen auf
|
||||
# der vorherigen Maske stattfanden: $change = 1(in der edit sub,
|
||||
# mittels get_config)
|
||||
081a4f97 | Moritz Bunkus | my $change = $form->{elsterland} eq $form->{elsterland_new}
|
||
d319704a | Moritz Bunkus | && $form->{elsterFFFF} eq $form->{elsterFFFF_new} ? '0' : '1';
|
||
$change = '0' if ($form->{saved} eq $locale->text('saved'));
|
||||
my $elster_init = &elster_hash();
|
||||
#my %elster_init = ();
|
||||
my %elster_init = %$elster_init;
|
||||
if ($change eq '1') {
|
||||
# Daten ?ndern
|
||||
$elsterland = $form->{elsterland_new};
|
||||
$elsterFFFF = $form->{elsterFFFF_new};
|
||||
$form->{elsterland} = $elsterland;
|
||||
$form->{elsterFFFF} = $elsterFFFF;
|
||||
$form->{steuernummer} = '';
|
||||
&create_steuernummer;
|
||||
# rebuild elster_amt
|
||||
my $amt = '';
|
||||
foreach $amt (keys %{ $elster_init{ $form->{elsterland} } }) {
|
||||
$elster_amt = $amt
|
||||
if ($elster_init{ $form->{elsterland}{$amt} eq $form->{elsterFFFF} });
|
||||
}
|
||||
# load the predefined hash data into the FA_* Vars
|
||||
my @variables = qw(FA_Name FA_Strasse FA_PLZ FA_Ort
|
||||
FA_Telefon FA_Fax FA_PLZ_Grosskunden FA_PLZ_Postfach
|
||||
FA_Postfach
|
||||
FA_BLZ_1 FA_Kontonummer_1 FA_Bankbezeichnung_1
|
||||
FA_BLZ_2 FA_Kontonummer_2 FA_Bankbezeichnung_oertlich
|
||||
FA_Oeffnungszeiten FA_Email FA_Internet);
|
||||
for (my $i = 0; $i <= 20; $i++) {
|
||||
$form->{ $variables[$i] } =
|
||||
$elster_init->{$elsterland}->{$elsterFFFF}->[$i];
|
||||
}
|
||||
} else {
|
||||
$elsterland = $form->{elsterland};
|
||||
$elsterFFFF = $form->{elsterFFFF};
|
||||
}
|
||||
my $stnr = $form->{steuernummer};
|
||||
$stnr =~ s/\D+//g;
|
||||
my $patterncount = $form->{patterncount};
|
||||
my $elster_pattern = $form->{elster_pattern};
|
||||
my $delimiter = $form->{delimiter};
|
||||
my $steuernummer = '';
|
||||
$steuernummer = $form->{steuernummer} if ($steuernummer eq '');
|
||||
#Warnung
|
||||
my $warnung = $form->{warnung};
|
||||
#printout form
|
||||
print qq|
|
||||
<form name="elsterform" method=post action="$form->{script}">
|
||||
<table width="100%">
|
||||
<tr>
|
||||
<th colspan="2" class="listtop">|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Tax Office Preferences') . qq|</th>
|
||
d319704a | Moritz Bunkus | </tr>
|
||
<tr>
|
||||
<td colspan=2>
|
||||
<br>
|
||||
|;
|
||||
&show_fa_daten;
|
||||
print qq|
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>
|
||||
6c3f16ab | Udo Spallek | <font size="+1">| . $locale->text('Tax Number') . qq|</font>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
<br>
|
||||
|;
|
||||
$steuernummer =
|
||||
USTVA::steuernummer_input($form->{elsterland}, $form->{elsterFFFF},
|
||||
$form->{steuernummer});
|
||||
print qq|
|
||||
</H2><br>
|
||||
</fieldset>
|
||||
<br>
|
||||
<br>
|
||||
<hr>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="left">
|
||||
<input type=hidden name=lastsub value="edit">
|
||||
4dd73ccf | Stephan Köhler | |;
|
||
print qq|<input type=submit class=submit name=action value="|
|
||||
. $locale->text('back') . qq|">|
|
||||
if ($form->{callback} eq '');
|
||||
print qq|
|
||||
<input type="button" name="Verweis" value="|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('User Config') . qq|"
|
||
4dd73ccf | Stephan Köhler | onClick="self.location.href='$form->{callback}'">|
|
||
if ($form->{callback} ne '');
|
||||
d319704a | Moritz Bunkus | |||
if ($form->{warnung} eq "1") {
|
||||
print qq|
|
||||
<input type=hidden name=nextsub value="edit_form">
|
||||
<input type=submit class=submit name=action value="|
|
||||
. $locale->text('continue') . qq|">
|
||||
<input type=hidden name="saved" value="|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Check Details') . qq|">
|
||
d319704a | Moritz Bunkus | |;
|
||
} else {
|
||||
print qq|
|
||||
<input type=hidden name="nextsub" value="save">
|
||||
<input type=hidden name="filename" value="finanzamt.ini">
|
||||
<input type=submit class=submit name=action value="|
|
||||
. $locale->text('save') . qq|">
|
||||
|;
|
||||
}
|
||||
print qq|
|
||||
</td>
|
||||
<td align="right">
|
||||
<H2 class=confirm>$form->{saved}</H2>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|;
|
||||
my @variables = qw(FA_steuerberater_name FA_steuerberater_street
|
||||
FA_steuerberater_city FA_steuerberater_tel
|
||||
FA_voranmeld method
|
||||
4dd73ccf | Stephan Köhler | FA_dauerfrist FA_71 elster
|
||
d319704a | Moritz Bunkus | path login password type elster_init saved
|
||
);
|
||||
my $variable = '';
|
||||
foreach $variable (@variables) {
|
||||
print qq|
|
||||
<input name="$variable" type="hidden" value="$form->{$variable}">|;
|
||||
}
|
||||
print qq|
|
||||
<input type=hidden name="elsterland" value="$elsterland">
|
||||
<input type=hidden name="elsterFFFF" value="$elsterFFFF">
|
||||
<input type=hidden name="warnung" value="$warnung">
|
||||
<input type=hidden name="elstersteuernummer" value="$elstersteuernummer">
|
||||
<input type=hidden name="steuernummer" value="$stnr">
|
||||
4dd73ccf | Stephan Köhler | <input type=hidden name="callback" value="$form->{callback}">
|
||
d319704a | Moritz Bunkus | </form>
|
||
|;
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub create_steuernummer {
|
||||
$lxdebug->enter_sub();
|
||||
my $part = $form->{part};
|
||||
my $patterncount = $form->{patterncount};
|
||||
my $delimiter = $form->{delimiter};
|
||||
my $elster_pattern = $form->{elster_pattern};
|
||||
# rebuild steuernummer and elstersteuernummer
|
||||
# es gibt eine gespeicherte steuernummer $form->{steuernummer}
|
||||
# und die parts und delimiter
|
||||
my $h = 0;
|
||||
my $i = 0;
|
||||
my $steuernummer_new = $part;
|
||||
my $elstersteuernummer_new = $form->{elster_FFFF};
|
||||
$elstersteuernummer_new .= '0';
|
||||
for ($h = 1; $h < $patterncount; $h++) {
|
||||
$steuernummer_new .= qq|$delimiter|;
|
||||
for (my $i = 1; $i <= length($elster_pattern); $i++) {
|
||||
$steuernummer_new .= $form->{"part_$h\_$i"};
|
||||
$elstersteuernummer_new .= $form->{"part_$h\_$i"};
|
||||
}
|
||||
}
|
||||
if ($form->{steuernummer} ne $steuernummer_new) {
|
||||
$form->{steuernummer} = $steuernummer_new;
|
||||
$form->{elstersteuernummer} = $elstersteuernummer_new;
|
||||
$form->{steuernummer_new} = $steuernummer_new;
|
||||
} else {
|
||||
$form->{steuernummer_new} = '';
|
||||
$form->{elstersteuernummer_new} = '';
|
||||
}
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub get_config {
|
||||
$lxdebug->enter_sub();
|
||||
my ($userpath, $filename) = @_;
|
||||
my ($key, $value) = '';
|
||||
4dd73ccf | Stephan Köhler | open(FACONF, "$userpath/$form->{login}_$filename")
|
||
or #falls Datei nicht vorhanden ist
|
||||
sub {
|
||||
open(FANEW, ">$userpath/$form->{login}_$filename")
|
||||
or $form->error("$userpath/$filename : $!");
|
||||
close FANEW;
|
||||
open(FACONF, "$userpath/$form->{login}_$filename")
|
||||
or $form->error("$userpath/$form->{username}_$filename : $!");
|
||||
};
|
||||
d319704a | Moritz Bunkus | while (<FACONF>) {
|
||
last if /^\[/;
|
||||
next if /^(#|\s)/;
|
||||
# remove comments
|
||||
s/\s#.*//g;
|
||||
# remove any trailing whitespace
|
||||
s/^\s*(.*?)\s*$/$1/;
|
||||
($key, $value) = split /=/, $_, 2;
|
||||
#if ($value eq ' '){
|
||||
# $form->{$key} = " " ;
|
||||
#} elsif ($value ne ' '){
|
||||
$form->{$key} = "$value";
|
||||
#}
|
||||
}
|
||||
close FACONF;
|
||||
# Textboxen formatieren: Linebreaks entfernen
|
||||
#
|
||||
#$form->{FA_Oeffnungszeiten} =~ s/\\\\n/<br>/g;
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub save {
|
||||
$lxdebug->enter_sub();
|
||||
4dd73ccf | Stephan Köhler | my $filename = "$form->{login}_$form->{filename}";
|
||
d319704a | Moritz Bunkus | |||
#zuerst die steuernummer aus den part, parts_X_Y und delimiter herstellen
|
||||
create_steuernummer;
|
||||
# Textboxen formatieren: Linebreaks entfernen
|
||||
#
|
||||
$form->{FA_Oeffnungszeiten} =~ s/\r\n/\\n/g;
|
||||
#URL mit http:// davor?
|
||||
$form->{FA_Internet} =~ s/^http:\/\///;
|
||||
$form->{FA_Internet} = 'http://' . $form->{FA_Internet};
|
||||
my @config = qw(elster elsterland elstersteuernummer steuernummer
|
||||
elsteramt elsterFFFF FA_Name FA_Strasse
|
||||
FA_PLZ FA_Ort FA_Telefon FA_Fax FA_PLZ_Grosskunden
|
||||
FA_PLZ_Postfach FA_Postfach FA_BLZ_1 FA_Kontonummer_1
|
||||
FA_Bankbezeichnung_1 FA_BLZ_2 FA_Kontonummer_2
|
||||
FA_Bankbezeichnung_oertlich FA_Oeffnungszeiten
|
||||
FA_Email FA_Internet FA_voranmeld method FA_steuerberater_name
|
||||
FA_steuerberater_street FA_steuerberater_city FA_steuerberater_tel
|
||||
FA_71 FA_dauerfrist);
|
||||
# Hier kommt dann die Plausibilit?tspr?fung der ELSTERSteuernummer
|
||||
if ($form->{elstersteuernummer} ne '000000000') {
|
||||
$form->{elster} = '1';
|
||||
open(CONF, ">$userspath/$filename") or $form->error("$filename : $!");
|
||||
# create the config file
|
||||
print CONF qq|# Configuration file for USTVA\n\n|;
|
||||
my $key = '';
|
||||
foreach $key (sort @config) {
|
||||
$form->{$key} =~ s/\\/\\\\/g;
|
||||
$form->{$key} =~ s/"/\\"/g;
|
||||
# strip M
|
||||
$form->{$key} =~ s/\r\n/\n/g;
|
||||
print CONF qq|$key=|;
|
||||
if ($form->{$key} ne 'Y') {
|
||||
print CONF qq|$form->{$key}\n|;
|
||||
}
|
||||
if ($form->{$key} eq 'Y') {
|
||||
print CONF qq|checked \n|;
|
||||
}
|
||||
}
|
||||
print CONF qq|\n\n|;
|
||||
close CONF;
|
||||
$form->{saved} = $locale->text('saved');
|
||||
} else {
|
||||
6c3f16ab | Udo Spallek | $form->{saved} = $locale->text('Choose a Tax Number');
|
||
d319704a | Moritz Bunkus | }
|
||
&edit_form;
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub show_fa_daten {
|
||||
$lxdebug->enter_sub();
|
||||
my $readonly = $_;
|
||||
my $oeffnungszeiten = $form->{FA_Oeffnungszeiten};
|
||||
$oeffnungszeiten =~ s/\\\\n/\n/g;
|
||||
print qq| <br>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<font size="+1">|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Tax Office') . qq| $form->{FA_Name}</font>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
|;
|
||||
#print qq|\n<h4>$form->{FA_Ergaenzung_Name} </h4>
|
||||
# | if ( $form->{FA_Ergaenzung_Name} );
|
||||
print qq|
|
||||
<table width="100%" valign="top">
|
||||
<tr>
|
||||
<td valign="top">
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>
|
||||
<b>| . $locale->text('Address') . qq|</b>
|
||||
</legend>
|
||||
<table width="100%">
|
||||
4dd73ccf | Stephan Köhler | <tr>
|
||
<td>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Tax Office') . qq|
|
||
4dd73ccf | Stephan Köhler | </td>
|
||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input name="FA_Name" size="40" title="FA_Name" value="$form->{FA_Name}" $readonly>
|
||||
<td>
|
||||
</tr>
|
||||
d319704a | Moritz Bunkus | <tr>
|
||
<td colspan="2">
|
||||
<input name="FA_Strasse" size="40" title="FA_Strasse" value="$form->{FA_Strasse}" $readonly>
|
||||
</td width="100%">
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="116px">
|
||||
<input name="FA_PLZ" size="10" title="FA_PLZ" value="$form->{FA_PLZ}" $readonly>
|
||||
</td>
|
||||
<td>
|
||||
<input name="FA_Ort" size="20" title="FA_Ort" value="$form->{FA_Ort}" $readonly>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>
|
||||
6c3f16ab | Udo Spallek | <b>| . $locale->text('Contact') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Telephone') . qq|<br>
|
||
d319704a | Moritz Bunkus | <input name="FA_Telefon" size="40" title="FA_Telefon" value="$form->{FA_Telefon}" $readonly>
|
||
<br>
|
||||
4dd73ccf | Stephan Köhler | <br>
|
||
d319704a | Moritz Bunkus | | . $locale->text('Fax') . qq|<br>
|
||
<input name="FA_Fax" size="40" title="FA_Fax" value="$form->{FA_Fax}" $readonly>
|
||||
<br>
|
||||
<br>
|
||||
| . $locale->text('Internet') . qq|<br>
|
||||
<input name="FA_Email" size="40" title="FA_Email" value="$form->{FA_Email}" $readonly>
|
||||
<br>
|
||||
<br>
|
||||
<input name="FA_Internet" size="40" title="" title="FA_Internet" value="$form->{FA_Internet}" $readonly>
|
||||
<br>
|
||||
</fieldset>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<br>
|
||||
<fieldset>
|
||||
<legend>
|
||||
6c3f16ab | Udo Spallek | <b>| . $locale->text('Openings') . qq|</b>
|
||
d319704a | Moritz Bunkus | </legend>
|
||
<textarea name="FA_Oeffnungszeiten" rows="4" cols="40" $readonly>$oeffnungszeiten</textarea>
|
||||
</fieldset>
|
||||
<br>
|
||||
|;
|
||||
my $FA_1 =
|
||||
( $form->{FA_BLZ_1} ne ''
|
||||
&& $form->{FA_Kontonummer_1} ne ''
|
||||
&& $form->{FA_Bankbezeichnung_1} ne '');
|
||||
my $FA_2 =
|
||||
( $form->{FA_BLZ_2} ne ''
|
||||
&& $form->{FA_Kontonummer_2} ne ''
|
||||
&& $form->{FA_Bankbezeichnung_oertlich} ne '');
|
||||
if ($FA_1 && $FA_2) {
|
||||
print qq|
|
||||
<fieldset>
|
||||
<legend>
|
||||
<b>|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Bank Connection Tax Office') . qq|</b>
|
||
d319704a | Moritz Bunkus | <legend>
|
||
4dd73ccf | Stephan Köhler | <table>
|
||
d319704a | Moritz Bunkus | <tr>
|
||
<td>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Bank') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_Bankbezeichnung_1" size="30" value="$form->{FA_Bankbezeichnung_1}" $readonly>
|
||||
<br>
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Account Nummer') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_Kontonummer_1" size="15" value="$form->{FA_Kontonummer_1}" $readonly>
|
||||
<br>
|
||||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Code (long)') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_BLZ_1" size="15" value="$form->{FA_BLZ_1}" $readonly>
|
||||
</td>
|
||||
<td>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Bank') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_Bankbezeichnung_oertlich" size="30" value="$form->{FA_Bankbezeichnung_oertlich}" $readonly>
|
||||
<br>
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Account Nummer') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_Kontonummer_2" size="15" value="$form->{FA_Kontonummer_2}" $readonly>
|
||||
<br>
|
||||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Code (long)') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_BLZ_2" size="15" value="$form->{FA_BLZ_2}" $readonly>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</fieldset>
|
||||
|;
|
||||
} elsif ($FA_1) {
|
||||
print qq|
|
||||
<fieldset>
|
||||
<legend>
|
||||
<b>|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Bank Connection Tax Office') . qq|</b>
|
||
d319704a | Moritz Bunkus | <legend>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Account Nummer') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_Kontonummer_1" size="30" value="$form->{FA_Kontonummer_1}" $readonly>
|
||||
<br>
|
||||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Code (long)') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_BLZ_1" size="15" value="$form->{FA_BLZ_1}" $readonly>
|
||||
<br>
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Bank') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_Bankbezeichnung_1" size="15" value="$form->{FA_Bankbezeichnung_1}" $readonly>
|
||||
<br>
|
||||
</fieldset>
|
||||
|;
|
||||
} else {
|
||||
print qq|
|
||||
<fieldset>
|
||||
<legend>
|
||||
<b>|
|
||||
6c3f16ab | Udo Spallek | . $locale->text('Bank Connection Tax Office') . qq|</b>
|
||
4dd73ccf | Stephan Köhler | <legend>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Account Nummer') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_Kontonummer_2" size="30" value="$form->{FA_Kontonummer_2}" $readonly>
|
||||
<br>
|
||||
4dd73ccf | Stephan Köhler | <br>
|
||
6c3f16ab | Udo Spallek | | . $locale->text('Bank Code (long)') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_BLZ_2" size="15" value="$form->{FA_BLZ_2}" $readonly>
|
||||
<br>
|
||||
<br>
|
||||
6c3f16ab | Udo Spallek | | . $locale->text('Bank') . qq|
|
||
d319704a | Moritz Bunkus | <br>
|
||
<input name="FA_Bankbezeichnung_oertlich" size="15" value="$form->{FA_Bankbezeichnung_oertlich}" $readonly>
|
||||
</fieldset>
|
||||
|;
|
||||
}
|
||||
print qq|
|
||||
</td>
|
||||
4dd73ccf | Stephan Köhler | </tr>
|
||
d319704a | Moritz Bunkus | </table>
|
||
</fieldset>
|
||||
|;
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
sub continue {
|
||||
$lxdebug->enter_sub();
|
||||
081a4f97 | Moritz Bunkus | |||
d319704a | Moritz Bunkus | # allow Symbolic references just here:
|
||
no strict 'refs';
|
||||
&{ $form->{nextsub} };
|
||||
use strict 'refs';
|
||||
$lxdebug->leave_sub();
|
||||
}
|
||||
081a4f97 | Moritz Bunkus | sub back {
|
||
4dd73ccf | Stephan Köhler | $lxdebug->enter_sub();
|
||
081a4f97 | Moritz Bunkus | &{ $form->{lastsub} };
|
||
4dd73ccf | Stephan Köhler | $lxdebug->leave_sub();
|
||
}
|
||||
d319704a | Moritz Bunkus | |||
sub elster_hash {
|
||||
$lxdebug->enter_sub();
|
||||
my $finanzamt = USTVA::query_finanzamt(\%myconfig, \%$form);
|
||||
$lxdebug->leave_sub();
|
||||
return $finanzamt;
|
||||
}
|
||||