$lxdebug->enter_sub();
my $myconfig = \%myconfig;
use CGI;
+
$form->{title} = $locale->text('UStVA');
- $form->{kz10} = ''; #Berichtigte Anmeldung? Ja =1
+ $form->{kz10} = ''; #Berichtigte Anmeldung? Ja =1 Nein=0
- my $year = substr(
- $form->datetonum($form->current_date(\%myconfig),
- \%myconfig
- ),
- 0, 4);
+ my $year = substr($form->datetonum($form->current_date(\%myconfig), \%myconfig ),
+ 0, 4);
my $department = '';
local $hide = '';
$form->header;
print qq|
-<body>
-
-<form method=post action=$form->{script}>
+ <body>
+ <form method=post action=$form->{script}>
-<input type=hidden name=title value="$form->{title}">
+ <input type=hidden name=title value="$form->{title}">
-<table width=100%>
+ <table width=100%>
<tr>
<th class=listtop>$form->{title}</th>
</tr>
<td>
<table>
$department
-|;
+ |;
# Hier Aufruf von get_config aus bin/mozilla/fa.pl zum
# Einlesen der Finanzamtdaten
<td width="50%" align="left" valign="top">
<fieldset>
<legend>
- <b>| . $locale->text('Firma') . qq|</b>
+ <b>| . $locale->text('Company') . qq|</b>
</legend>
|;
if ($form->{company} ne '') {
} else {
print qq|
<a href=am.pl?path=$form->{path}&action=config&level=Programm--Preferences&login=$form->{login}&password=$form->{password}>
- | . $locale->text('Kein Firmenname hinterlegt!') . qq|</a><br>
+ | . $locale->text('No Company Name given') . qq|!</a><br>
|;
}
} else {
print qq|
<a href=am.pl?path=$form->{path}&action=config&level=Programm--Preferences&login=$form->{login}&password=$form->{password}>
- | . $locale->text('Keine Firmenadresse hinterlegt!') . qq|</a>\n|;
+ | . $locale->text('No Company Address given') . qq|!</a>\n|;
}
$form->{co_email} = $form->{email} unless $form->{co_email};
$form->{co_tel} = $form->{tel} unless $form->{co_tel};
print qq|
<br>
<br>
- | . $locale->text('Tel.: ') . qq|
+ | . $locale->text('Tel') . qq|.:
$form->{co_tel}
<br>
- | . $locale->text('Fax.: ') . qq|
+ | . $locale->text('Fax') . qq|.:nbsp;
$form->{co_fax}
<br>
<br>
$form->{co_email}
<br>
<br>
- | . $locale->text('Steuernummer: ') . qq|
+ | . $locale->text('Tax Number') . qq|:
|;
if ($form->{steuernummer} ne '') {
}
print qq|
<br>
- | . $locale->text('ELSTER-Steuernummer: ') . qq|
+ | . $locale->text('ELSTER Tax Number') . qq|:
$form->{elstersteuernummer}
<br>
<br>
<fieldset>
<legend>
<input checked="checked" title="|
- . $locale->text('Beraterdaten in UStVA übernehmen?')
+ . $locale->text('Assume Tax Consultant Data in Tax Computation?')
. qq|" name="FA_steuerberater" id=steuerberater class=checkbox type=checkbox value="1">
- <b>| . $locale->text('Steuerberater/-in') . qq|</b>
+ <b>| . $locale->text('Tax Consultant') . qq|</b>
</legend>
$form->{FA_steuerberater_name}<br>
print qq|
<fieldset>
<legend>
- <b>| . $locale->text('Voranmeldezeitraum') . qq|</b>
+ <b>| . $locale->text('Tax Period') . qq|</b>
</legend>
|;
&ustva_vorauswahl();
print qq|
<input name="FA_10" id=FA_10 class=checkbox type=checkbox value="1" $checked title = "|
. $locale->text(
- 'Ist dies eine berichtigte Anmeldung? (Nr. 10/Zeile 15 Steuererklärung)')
+ 'Amended Advance Turnover Tax Return (Nr. 10)')
. qq|">
- | . $locale->text('Berichtigte Anmeldung') . qq|
+ | . $locale->text('Amended Advance Turnover Tax Return') . qq|
<br>
|;
<br>
| . $locale->text($voranmeld) . qq|
|;
- print qq| mit Dauerfristverlängerung| if ($form->{FA_dauerfrist} eq '1');
+ print $locale->text('With Extension Of Time') if ($form->{FA_dauerfrist} eq '1');
print qq|
<br>
<td width="50%" valign="top">
<fieldset>
<legend>
- <b>| . $locale->text('Finanzamt') . qq|</b>
+ <b>| . $locale->text('Tax Office') . qq|</b>
</legend>
<h3>$form->{FA_Name}</h2>
|;
$form->{FA_PLZ} $form->{FA_Ort}
<br>
<br>
- | . $locale->text('Tel. : ') . qq|
+ | . $locale->text('Tel') . qq|.:
$form->{FA_Telefon}
<br>
- | . $locale->text('Fax. : ') . qq|
+ | . $locale->text('Fax') . qq|.:$nbsp;
$form->{FA_Fax}
<br>
<br>
</a>
<br>
<br>
- | . $locale->text('Öffnungszeiten') . qq|
+ | . $locale->text('Openings') . qq|
<br>
$oeffnungszeiten
<br>
if ($FA_1 && $FA_2) {
print qq|
<br>
- | . $locale->text('Bankverbindungen') . qq|
+ | . $locale->text('Bank Connection') . qq|
<table>
<tr>
<td>
$form->{FA_Bankbezeichnung_1}
<br>
- | . $locale->text('Konto: ') . qq|
+ | . $locale->text('Account') . qq|:
$form->{FA_Kontonummer_1}
<br>
- | . $locale->text('BLZ: ') . qq|
+ | . $locale->text('Bank Code') . qq|:
$form->{FA_BLZ_1}
</td>
<td>
$form->{FA_Bankbezeichnung_oertlich}
<br>
- | . $locale->text('Konto: ') . qq|
+ | . $locale->text('Account') . qq|:
$form->{FA_Kontonummer_2}
<br>
- | . $locale->text('BLZ: ') . qq|
+ | . $locale->text('Bank Code') . qq|:
$form->{FA_BLZ_2}
</td>
</tr>
} elsif ($FA_1) {
print qq|
<br>
- | . $locale->text('Bankverbindung') . qq|
+ | . $locale->text('Bank Connection') . qq|
<br>
<br>
$form->{FA_Bankbezeichnung_1}
<br>
- | . $locale->text('Konto: ') . qq|
+ | . $locale->text('Account') . qq|:
$form->{FA_Kontonummer_1}
<br>
- | . $locale->text('BLZ: ') . qq|
+ | . $locale->text('Bank Code') . qq|:
$form->{FA_BLZ_1} <br>
<br>|;
} elsif ($FA_2) {
print qq|
<br>
- | . $locale->text('Bankverbindung') . qq|
+ | . $locale->text('Bank Connection') . qq|
<br>
<br>
$form->{FA_Bankbezeichnung_oertlich}
<br>
- | . $locale->text('Konto: ') . qq|
+ | . $locale->text('Account') . qq|:
$form->{FA_Kontonummer_2}
<br>
- | . $locale->text('BLZ: ') . qq|
+ | . $locale->text('Bank Code') . qq|:
$form->{FA_BLZ_2}
|;
}
<br>
<fieldset>
<legend>
- <b>| . $locale->text('Ausgabeformat') . qq|</b>
+ <b>| . $locale->text('Outputformat') . qq|</b>
</legend>
|;
<td width="50%" valign="bottom">
<fieldset>
<legend>
- <b>| . $locale->text('Hinweise') . qq|</b>
+ <b>| . $locale->text('Hints') . qq|</b>
</legend>
<h2 class="confirm">|
. $locale->text('Missing Preferences: Outputroutine disabled')
. qq|</h2>
- <h3>| . $locale->text('Help:') . qq|</h3>
+ <h3>| . $locale->text('Help') . qq|</h3>
<ul>
<li>| . $locale->text('Hint-Missing-Preferences') . qq|</li>
</ul>
</td>
<td align="right">
- <!--</form>
+ </form>
+ <!--
<form action="doc/ustva.html" method="get">
- -->
+
<input type=submit class=submit name=action value="|
. $locale->text('Help') . qq|">
- <!-- </form>-->
+ </form>-->
</td>
</tr>
</table>
if ($form->{FA_voranmeld} eq 'month') {
# Vorauswahl bei monatlichem Voranmeldungszeitraum
- print qq|
- <select name="duetyp" id=zeitraum title="|
- . $locale->text('Hier den Berechnungszeitraum auswählen...') . qq|">
- |;
- my %liste = ('01' => 'January',
- '02' => 'February',
- '03' => 'March',
- '04' => 'April',
- '05' => 'May',
- '06' => 'June',
- '07' => 'July',
- '08' => 'August',
- '09' => 'September',
- '10' => 'October',
- '11' => 'November',
- '12' => 'December',
- '13' => 'Yearly',);
+ 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'),
+ );
my $yy = $form->{year} * 10000;
$yymmdd = "$form->{year}$form->{month}$form->{day}" * 1;
- $yymmdd = 20060121;
$sel = '';
- my $dfv = '0';
+ my $dfv = '';
# Offset für Dauerfristverlängerung
$dfv = '100' if ($form->{FA_dauerfrist} eq '1');
};
}
+ print qq|<select id="zeitraum" name="period" title="|
+ . $locale->text('Select a period') . qq|" >|;
+
my $key = '';
foreach $key (sort keys %liste) {
my $selected = '';
$selected = 'selected' if ($sel eq $key);
print qq|
- <option value="$key" $selected>|
- . $locale->text("$liste{$key}") . qq|</option>
-
+ <option value="$key" $selected> $liste{$key}</option>
|;
}
print qq|</select>|;
} elsif ($form->{FA_voranmeld} eq 'quarter') {
# Vorauswahl bei quartalsweisem Voranmeldungszeitraum
- my %liste = ('A' => $locale->text('1. Quarter'),
- 'B' => $locale->text('2. Quarter'),
- 'C' => $locale->text('3. Quarter'),
- 'D' => $locale->text('4. Quarter'),
+ my %liste = ('41' => $locale->text('1. Quarter'),
+ '42' => $locale->text('2. Quarter'),
+ '43' => $locale->text('3. Quarter'),
+ '44' => $locale->text('4. Quarter'),
'13' => $locale->text('Yearly'),);
my $yy = $form->{year} * 10000;
SWITCH: {
$yymmdd <= ($yy + 110 + $dfv) && do {
$form->{year} = $form->{year} - 1;
- $sel = 'D';
+ $sel = '44';
last SWITCH;
};
$yymmdd <= ($yy + 410 + $dfv) && do {
- $sel = 'A';
+ $sel = '41';
last SWITCH;
};
$yymmdd <= ($yy + 710 + $dfv) && do {
- $sel = 'B';
+ $sel = '42';
last SWITCH;
};
$yymmdd <= ($yy + 1010 + $dfv) && do {
- $sel = 'C';
+ $sel = '43';
last SWITCH;
};
$yymmdd <= ($yy + 1231) && do {
- $sel = 'D';
+ $sel = '44';
};
}
- print qq|<select id="zeitraum" name="duetyp" title="|
+ print qq|<select id="zeitraum" name="period" title="|
. $locale->text('Select a period') . qq|" >|;
my $key = '';
foreach $key (sort keys %liste) {
} else {
# keine Vorauswahl bei Voranmeldungszeitraum
- print qq|<select id="zeitraum" name="duetyp" title="|
+ print qq|<select id="zeitraum" name="period" title="|
. $locale->text('Select a period') . qq|" >|;
- my %listea = ('A' => '1. Quarter',
- 'B' => '2. Quarter',
- 'C' => '3. Quarter',
- 'D' => '4. Quarter',);
+ my %listea = ('41' => '1. Quarter',
+ '42' => '2. Quarter',
+ '43' => '3. Quarter',
+ '44' => '4. Quarter',);
my %listeb = ('01' => 'January',
'02' => 'February',
my $media = qq| <input type=hidden name="media" value="screen">|;
my $format =
qq| <option value=html selected>|
- . $locale->text('Vorschau')
+ . $locale->text('Preview')
. qq|</option>|;
- if ($latex) {
+ if ($latex_templates) {
$format .=
qq| <option value=pdf>|
- . $locale->text('UStVA als PDF-Dokument')
+ . $locale->text('UStVA (PDF-Dokument)')
. qq|</option>|;
}
#$disabled='' if ($form->{elster} eq '1' );
if ($form->{elster} eq '1') {
$format .=
- qq|<option value=elster>|
- . $locale->text('ELSTER Export nach Winston')
- . qq|</option>|;
+ qq|<option value=elsterwinston>|
+ . $locale->text('ELSTER Export (Winston)')
+ . qq|</option>|
+ . qq|<option value=elstertaxbird>|
+ . $locale->text('ELSTER Export (Taxbird)')
+ . qq|</option>|;
}
#$format .= qq|<option value=elster>|.$locale->text('ELSTER Export nach Winston').qq|</option>|;
$type
$media
<select name=format title = "|
- . $locale->text('Ausgabeformat auswählen...') . qq|">$format</select>
+ . $locale->text('Choose Outputformat') . qq|">$format</select>
|;
$lxdebug->leave_sub();
}
get_config($userspath, 'finanzamt.ini');
- # form vars initialisieren
+ # init some form vars
my @anmeldungszeitraum =
qw('0401' '0402' '0403' '0404' '0405' '0405' '0406' '0407' '0408' '0409' '0410' '0411' '0412' '0441' '0442' '0443' '0444');
- my $item = '';
- foreach $item (@anmeldungszeitraum) {
+ foreach my $item (@anmeldungszeitraum) {
$form->{$item} = "";
}
- if ($form->{reporttype} eq "custom") {
#forgotten the year --> thisyear
if ($form->{year} !~ m/^\d\d\d\d$/) {
qq|Actual year from Database: $form->{year}\n|);
}
+ #
+ # using dates in ISO-8601 format: yyyymmmdd for Postgres...
+ #
+
#yearly report
- if ($form->{duetyp} eq "13") {
+ if ($form->{period} eq "13") {
$form->{fromdate} = "$form->{year}0101";
$form->{todate} = "$form->{year}1231";
}
#Quater reports
- if ($form->{duetyp} eq "A") {
+ if ($form->{period} eq "41") {
$form->{fromdate} = "$form->{year}0101";
$form->{todate} = "$form->{year}0331";
$form->{'0441'} = "X";
}
- if ($form->{duetyp} eq "B") {
+ if ($form->{period} eq "42") {
$form->{fromdate} = "$form->{year}0401";
$form->{todate} = "$form->{year}0630";
$form->{'0442'} = "X";
}
- if ($form->{duetyp} eq "C") {
+ if ($form->{period} eq "43") {
$form->{fromdate} = "$form->{year}0701";
$form->{todate} = "$form->{year}0930";
$form->{'0443'} = "X";
}
- if ($form->{duetyp} eq "D") {
+ if ($form->{period} eq "44") {
$form->{fromdate} = "$form->{year}1001";
$form->{todate} = "$form->{year}1231";
$form->{'0444'} = "X";
#Monthly reports
SWITCH: {
- $form->{duetyp} eq "01" && do {
+ $form->{period} eq "01" && do {
$form->{fromdate} = "$form->{year}0101";
$form->{todate} = "$form->{year}0131";
$form->{'0401'} = "X";
last SWITCH;
};
- $form->{duetyp} eq "02" && do {
+ $form->{period} eq "02" && do {
$form->{fromdate} = "$form->{year}0201";
#this works from 1901 to 2099, 1900 and 2100 fail.
$form->{"0402"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "03" && do {
+ $form->{period} eq "03" && do {
$form->{fromdate} = "$form->{year}0301";
$form->{todate} = "$form->{year}0331";
$form->{"0403"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "04" && do {
+ $form->{period} eq "04" && do {
$form->{fromdate} = "$form->{year}0401";
$form->{todate} = "$form->{year}0430";
$form->{"0404"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "05" && do {
+ $form->{period} eq "05" && do {
$form->{fromdate} = "$form->{year}0501";
$form->{todate} = "$form->{year}0531";
$form->{"0405"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "06" && do {
+ $form->{period} eq "06" && do {
$form->{fromdate} = "$form->{year}0601";
$form->{todate} = "$form->{year}0630";
$form->{"0406"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "07" && do {
+ $form->{period} eq "07" && do {
$form->{fromdate} = "$form->{year}0701";
$form->{todate} = "$form->{year}0731";
$form->{"0407"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "08" && do {
+ $form->{period} eq "08" && do {
$form->{fromdate} = "$form->{year}0801";
$form->{todate} = "$form->{year}0831";
$form->{"0408"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "09" && do {
+ $form->{period} eq "09" && do {
$form->{fromdate} = "$form->{year}0901";
$form->{todate} = "$form->{year}0930";
$form->{"0409"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "10" && do {
+ $form->{period} eq "10" && do {
$form->{fromdate} = "$form->{year}1001";
$form->{todate} = "$form->{year}1031";
$form->{"0410"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "11" && do {
+ $form->{period} eq "11" && do {
$form->{fromdate} = "$form->{year}1101";
$form->{todate} = "$form->{year}1130";
$form->{"0411"} = "X";
last SWITCH;
};
- $form->{duetyp} eq "12" && do {
+ $form->{period} eq "12" && do {
$form->{fromdate} = "$form->{year}1201";
$form->{todate} = "$form->{year}1231";
$form->{"0412"} = "X";
last SWITCH;
};
}
- }
- # using dates in ISO-8601 format: yyyymmmdd for Postgres...
+
+
+
+ # Get the USTVA
USTVA->ustva(\%myconfig, \%$form);
# reformat Dates to dateformat
$form->{fromdate} = $locale->date(\%myconfig, $form->{fromdate}, 0, 0, 0);
- $form->{todate} = $form->current_date($myconfig) unless $form->{todate};
+ $form->{todate} = $form->current_date(\%myconfig) unless $form->{todate};
$form->{todate} = $locale->date(\%myconfig, $form->{todate}, 0, 0, 0);
- $form->{period} =
+ $form->{longperiod} =
$locale->date(\%myconfig, $form->current_date(\%myconfig), 1, 0, 0);
# if there are any dates construct a where
if ($form->{fromdate} || $form->{todate}) {
- unless ($form->{todate}) {
- $form->{todate} = $form->current_date($myconfig);
- }
+ $form->{todate} = $form->current_date($myconfig) unless ($form->{todate});
my $longtodate = $locale->date($myconfig, $form->{todate}, 1, 0, 0);
my $shorttodate = $locale->date($myconfig, $form->{todate}, 0, 0, 0);
my $shortfromdate = $locale->date($myconfig, $form->{fromdate}, 0, 0, 0);
$form->{this_period} = "$shortfromdate<br>\n$shorttodate";
- $form->{period} =
+ $form->{longperiod} =
$locale->text('for Period')
. qq|<br>\n$longfromdate |
- . $locale->text('bis')
+ . $locale->text('to (date)')
. qq| $longtodate|;
}
$locale->date(\%myconfig, $form->{comparetodate}, 0, 0, 0);
$form->{last_period} = "$shortcomparefromdate<br>\n$shortcomparetodate";
- $form->{period} .=
+ $form->{longperiod} .=
"<br>\n$longcomparefromdate "
- . $locale->text('bis')
+ . $locale->text('to (date)')
. qq| $longcomparetodate|;
}
$locale->date(\%myconfig, $form->current_date(\%myconfig), 0, 0, 0);
# setup variables for the form
- # steuernummer für prerelease entfernt
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
$form->{co_city} =~ s/\\n//g;
}
- if ( $form->{format} eq 'pdf'
- or $form->{format} eq 'postscript') {
+ #
+ # 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);
+
+ if ( $form->{format} eq 'pdf' or $form->{format} eq 'postscript') {
+
+ $form->{IN} = "$form->{type}-$form->{year}.tex";
$form->{padding} = "~~";
$form->{bold} = "\textbf{";
$form->{endbold} = "}";
$form->{br} = '\\\\';
- my @numbers = qw(511 861 36 80 971 931 98 96 53 74
- 85 65 66 61 62 Z67 63 64 59 69 39 83
- Z43 Z45 Z53 Z62 Z65);
-
- my $number = '';
-
# Zahlenformatierung für Latex USTVA Formulare
- if ( $myconfig{numberformat} eq '1.000,00'
- or $myconfig{numberformat} eq '1000,00') {
- foreach $number (@numbers) {
- $form->{$number} =~ s/,/~~/g;
- }
+
+ foreach my $number (@category_euro) {
+ $form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '0', '');
}
- if ( $myconfig{numberformat} eq '1000.00'
- or $myconfig{numberformat} eq '1,000.00') {
- foreach $number (@numbers) {
- $form->{$number} =~ s/\./~~/g;
- }
+
+ 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;
}
- # Formatierungen für HTML Ausgabe
- } elsif ($form->{format} eq 'html') {
+ } elsif ( $form->{format} eq 'html') { # Formatierungen für HTML Ausgabe
+
+ $form->{IN} = $form->{type} . '.html';
$form->{padding} = " ";
$form->{bold} = "<b>";
$form->{endbold} = "</b>";
$form->{br} = "<br>";
- $form->{address} =~ s/\\n/<br \/>/g;
+ $form->{address} =~ s/\\n/\n/g;
- }
+ 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');
+ }
- if ($form->{format} eq 'elster') {
- if ($form->{duetyp} eq '13') {
- $form->header;
- USTVA::info(
- $locale->text(
- 'Impossible to create yearly Tax Report via Winston.<br \> Not yet implemented!'
- ));
- } else {
- &create_winston();
+ } 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', '') : '';
}
- } else {
- $form->{templates} = $myconfig{templates};
- $form->{templates} = "doc" if ($form->{type} eq 'help');
+
+ foreach my $number (@category_euro) {
+ $form->{$number} = ( $form->{$number} !=0 ) ? $form->format_amount(\%myconfig, $form->{$number}, '0', '') : '';
+ }
+ # Re-set Numberformat
+ $myconfig{numberformat} = $temp_numberformat;
- $form->{IN} = "$form->{type}";
- $form->{IN} = "$form->{help}" if ($form->{type} eq 'help');
- $form->{IN} = 'USTE'
- if ( $form->{duetyp} eq '13'
- && $form->{format} ne 'html');
+ }
- if ($form->{IN} eq 'USTE') {
+ 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
+
+ my $temp_numberformat = $myconfig{numberformat};
+ # Numberformat must be '1000.00' for Taxbird ?!
+
+ $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', '') : '';
+ }
+ # Re-set Numberformat
+ $myconfig{numberformat} = $temp_numberformat;
+
+ } elsif ($form->{period} =~ /^\d+$/ ) {
+ $form->{period} =~ s/^0//g;
+ my $period = $form->{period};
+ $period * 1;
+ $period--;
+ $form->{period} = $period;
+ } else {
$form->header;
- USTVA::info(
- $locale->text(
- 'Impossible to create yearly Tax Report as PDF or PS.<br \> Not yet implemented!'
- ));
+ USTVA::error( $locale->text('Wrong Period' ));
+ exit(0);
}
+
+ } elsif ( $form->{format} eq '' ){ # No format error.
+ $form->header;
+ USTVA::error( $locale->text('Application Error. No Format given' ) . "!");
+ exit(0);
+
+ } else { # All other Formats are wrong
+ $form->header;
+ USTVA::error( $locale->text('Application Error. Wrong Format') . ": " . $form->{format} );
+ exit(0);
+ }
- $form->{IN} .= "-$form->{year}"
- if ( $form->{format} eq 'pdf'
- or $form->{format} eq 'postscript');
-
- $form->{IN} .= '.tex'
- if ( $form->{format} eq 'pdf'
- or $form->{format} eq 'postscript');
+ if ( $form->{period} eq '13' and $form->{format} ne 'html') {
+ $form->header;
+ USTVA::info(
+ $locale->text(
+ 'Yearly taxreport not yet implemented')
+ . '!');
+ }
+
+ $form->{templates} = $myconfig{templates};
+ $form->{templates} = "doc" if ( $form->{type} eq 'help' );
- $form->{IN} .= '.html' if ($form->{format} eq 'html');
+ $form->parse_template(\%myconfig, $userspath);
- #$form->header;
- #print qq|$myconfig<br>$path|;
- $form->parse_template($myconfig, $userspath);
- }
$lxdebug->leave_sub();
}
"$form->{cbscript}?action=edit&login=$form->{cblogin}&path=$form->{cbpath}&root=$form->{cbroot}&rpw=$form->{cbrpw}"
if ($form->{cbscript} ne '' and $form->{cblogin} ne '');
- $form->{title} = $locale->text('Finanzamt - Einstellungen');
+ $form->{title} = $locale->text('Tax Office Preferences');
print qq|
<body>
<form name="verzeichnis" method=post action="$form->{script}">
<table width=100%>
<tr>
<th class="listtop">|
- . $locale->text('Finanzamt - Einstellungen') . qq|</th>
+ . $locale->text('Tax Office Preferences') . qq|</th>
</tr>
<tr>
<td>
<br>
<fieldset>
<legend><b>|
- . $locale->text('Angaben zum Finanzamt') . qq|</b></legend>
+ . $locale->text('Local Tax Office Preferences') . qq|</b></legend>
|;
#print qq|$form->{terminal}|;
$checked = "checked" if ($form->{method} eq 'accrual');
print qq|
<fieldset>
- <legend><b>| . $locale->text('Verfahren') . qq|</b>
+ <legend><b>| . $locale->text('Taxation') . qq|</b>
</legend>
<input name=method id=accrual class=radio type=radio value="accrual" $checked>
<label for="accrual">| . $locale->text('accrual') . qq|</label>
</fieldset>
<br>
<fieldset>
- <legend><b>| . $locale->text('Voranmeldungszeitraum') . qq|</b>
+ <legend><b>| . $locale->text('Tax Period') . qq|</b>
</legend>
|;
$checked = '';
print qq|
<input name="FA_dauerfrist" id=FA_dauerfrist class=checkbox type=checkbox value="1" $checked>
<label for="">|
- . $locale->text('Dauerfristverlängerung') . qq|</label>
+ . $locale->text('Extension Of Time') . qq|</label>
</fieldset>
<br>
<fieldset>
- <legend><b>| . $locale->text('Steuerberater/-in') . qq|</b>
+ <legend><b>| . $locale->text('Tax Consultant') . qq|</b>
</legend>
|;
$checked = '';
print qq|
<!-- <input name="FA_71" id=FA_71 class=checkbox type=checkbox value="X" $checked>
<label for="FA_71">|
- . $locale->text('Verrechnung des Erstattungsbetrages erwünscht (Zeile 71)')
+ . $locale->text('Clearing Tax Received (No 71)')
. qq|</label>
<br>
<br>-->
| . $locale->text('Name') . qq|
</td>
<td>
- | . $locale->text('Straße') . qq|
+ | . $locale->text('Street') . qq|
</td>
<td>
- | . $locale->text('PLZ, Ort') . qq|
+ | . $locale->text('Zip, City') . qq|
</td>
<td>
- | . $locale->text('Telefon') . qq|
+ | . $locale->text('Telephone') . qq|
</td>
</tr>
<tr>
|;
print qq|
<input type="button" name="Verweis" value="|
- . $locale->text('Back to user config...') . qq|"
+ . $locale->text('User Config') . qq|"
onClick="self.location.href='$callback'">| if ($callback ne '');
print qq|
<input type=hidden name="nextsub" value="edit_form">
<input type=hidden name="warnung" value="1">
<input type=hidden name="saved" value="|
- . $locale->text('Bitte Angaben überprüfen') . qq|">
+ . $locale->text('Check Details') . qq|">
<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>
<th colspan="2" class="listtop">|
- . $locale->text('Finanzamt - Einstellungen') . qq|</th>
+ . $locale->text('Tax Office Preferences') . qq|</th>
</tr>
<tr>
<td colspan=2>
<br>
<fieldset>
<legend>
- <font size="+1">| . $locale->text('Steuernummer') . qq|</font>
+ <font size="+1">| . $locale->text('Tax Number') . qq|</font>
</legend>
<br>
|;
print qq|
<input type="button" name="Verweis" value="|
- . $locale->text('Back to user config...') . qq|"
+ . $locale->text('User Config') . qq|"
onClick="self.location.href='$form->{callback}'">|
if ($form->{callback} ne '');
<input type=submit class=submit name=action value="|
. $locale->text('continue') . qq|">
<input type=hidden name="saved" value="|
- . $locale->text('Bitte alle Angaben überprüfen') . qq|">
+ . $locale->text('Check Details') . qq|">
|;
} else {
print qq|
} else {
- $form->{saved} = $locale->text('Bitte eine Steuernummer angeben');
+ $form->{saved} = $locale->text('Choose a Tax Number');
}
&edit_form;
<fieldset>
<legend>
<font size="+1">|
- . $locale->text('Finanzamt') . qq| $form->{FA_Name}</font>
+ . $locale->text('Tax Office') . qq| $form->{FA_Name}</font>
</legend>
|;
<table width="100%">
<tr>
<td>
- | . $locale->text('Finanzamt') . qq|
+ | . $locale->text('Tax Office') . qq|
</td>
</tr>
<tr>
<br>
<fieldset>
<legend>
- <b>| . $locale->text('Kontakt') . qq|</b>
+ <b>| . $locale->text('Contact') . qq|</b>
</legend>
- | . $locale->text('Telefon') . qq|<br>
+ | . $locale->text('Telephone') . qq|<br>
<input name="FA_Telefon" size="40" title="FA_Telefon" value="$form->{FA_Telefon}" $readonly>
<br>
<br>
<br>
<fieldset>
<legend>
- <b>| . $locale->text('Öffnungszeiten') . qq|</b>
+ <b>| . $locale->text('Openings') . qq|</b>
</legend>
<textarea name="FA_Oeffnungszeiten" rows="4" cols="40" $readonly>$oeffnungszeiten</textarea>
</fieldset>
<fieldset>
<legend>
<b>|
- . $locale->text('Bankverbindungen des Finanzamts') . qq|</b>
+ . $locale->text('Bank Connection Tax Office') . qq|</b>
<legend>
<table>
<tr>
<td>
- | . $locale->text('Kreditinstitut') . qq|
+ | . $locale->text('Bank') . qq|
<br>
<input name="FA_Bankbezeichnung_1" size="30" value="$form->{FA_Bankbezeichnung_1}" $readonly>
<br>
<br>
- | . $locale->text('Kontonummer') . qq|
+ | . $locale->text('Account Nummer') . qq|
<br>
<input name="FA_Kontonummer_1" size="15" value="$form->{FA_Kontonummer_1}" $readonly>
<br>
<br>
- | . $locale->text('Bankleitzahl') . qq|
+ | . $locale->text('Bank Code (long)') . qq|
<br>
<input name="FA_BLZ_1" size="15" value="$form->{FA_BLZ_1}" $readonly>
</td>
<td>
- | . $locale->text('Kreditinstitut') . qq|
+ | . $locale->text('Bank') . qq|
<br>
<input name="FA_Bankbezeichnung_oertlich" size="30" value="$form->{FA_Bankbezeichnung_oertlich}" $readonly>
<br>
<br>
- | . $locale->text('Kontonummer') . qq|
+ | . $locale->text('Account Nummer') . qq|
<br>
<input name="FA_Kontonummer_2" size="15" value="$form->{FA_Kontonummer_2}" $readonly>
<br>
<br>
- | . $locale->text('Bankleitzahl') . qq|
+ | . $locale->text('Bank Code (long)') . qq|
<br>
<input name="FA_BLZ_2" size="15" value="$form->{FA_BLZ_2}" $readonly>
</td>
<fieldset>
<legend>
<b>|
- . $locale->text('Bankverbindung des Finanzamts') . qq|</b>
+ . $locale->text('Bank Connection Tax Office') . qq|</b>
<legend>
- | . $locale->text('Kontonummer') . qq|
+ | . $locale->text('Account Nummer') . qq|
<br>
<input name="FA_Kontonummer_1" size="30" value="$form->{FA_Kontonummer_1}" $readonly>
<br>
<br>
- | . $locale->text('Bankleitzahl (BLZ)') . qq|
+ | . $locale->text('Bank Code (long)') . qq|
<br>
<input name="FA_BLZ_1" size="15" value="$form->{FA_BLZ_1}" $readonly>
<br>
<br>
- | . $locale->text('Kreditinstitut') . qq|
+ | . $locale->text('Bank') . qq|
<br>
<input name="FA_Bankbezeichnung_1" size="15" value="$form->{FA_Bankbezeichnung_1}" $readonly>
<br>
<fieldset>
<legend>
<b>|
- . $locale->text('Bankverbindung des Finanzamts') . qq|</b>
+ . $locale->text('Bank Connection Tax Office') . qq|</b>
<legend>
- | . $locale->text('Kontonummer') . qq|
+ | . $locale->text('Account Nummer') . qq|
<br>
<input name="FA_Kontonummer_2" size="30" value="$form->{FA_Kontonummer_2}" $readonly>
<br>
<br>
- | . $locale->text('Bankleitzahl (BLZ)') . qq|
+ | . $locale->text('Bank Code (long)') . qq|
<br>
<input name="FA_BLZ_2" size="15" value="$form->{FA_BLZ_2}" $readonly>
<br>
<br>
- | . $locale->text('Kreditinstitut') . qq|
+ | . $locale->text('Bank') . qq|
<br>
<input name="FA_Bankbezeichnung_oertlich" size="15" value="$form->{FA_Bankbezeichnung_oertlich}" $readonly>
</fieldset>
$lxdebug->leave_sub();
}
-sub create_winston {
- $lxdebug->enter_sub();
- &get_config($userspath, 'finanzamt.ini');
-
- # There is no generic Linux GNU/GPL solution out for using ELSTER.
- # In lack of availability linux users may use windows pendants. I choose
- # WINSTON, because it's free of coast, it has an API and its tested under
- # Linux using WINE.
- # The author of WINSTON developed some c-code to realize ELSTER under
- # WINDOWS and Linux (http://www.felfri.de/fa_xml/). Next year (2005) I start to
- # develop a server side solution for LX-Office ELSTER under Linux and
- # WINDOWS based on this c-code.
- #
- # You need to download WINSTON from http://www.felfri.de/winston/
- # There (http://www.felfri.de/winston/download.htm) you'll find instructions
- # about WINSTON under Linux WINE
- # More infos about Winstons API: http://www.felfri.de/winston/schnittstellen.htm
- my $azr = '';
- my $file = ''; # Filename for Winstonfile
- $file .= 'U'; # 1. char 'U' = USTVA
-
-SWITCH:
- { # 2. and 3. char 01-12= Month 41-44= Quarter (azr:Abrechnungszeitraum)
- $form->{duetyp} eq "01" && do {
- $azr = "01";
- last SWITCH;
- };
- $form->{duetyp} eq "02" && do {
- $azr = "02";
- last SWITCH;
- };
- $form->{duetyp} eq "03" && do {
- $azr = "03";
- last SWITCH;
- };
- $form->{duetyp} eq "04" && do {
- $azr = "04";
- last SWITCH;
- };
- $form->{duetyp} eq "05" && do {
- $azr = "05";
- last SWITCH;
- };
- $form->{duetyp} eq "06" && do {
- $azr = "06";
- last SWITCH;
- };
- $form->{duetyp} eq "07" && do {
- $azr = "07";
- last SWITCH;
- };
- $form->{duetyp} eq "08" && do {
- $azr = "08";
- last SWITCH;
- };
- $form->{duetyp} eq "09" && do {
- $azr = "09";
- last SWITCH;
- };
- $form->{duetyp} eq "10" && do {
- $azr = "10";
- last SWITCH;
- };
- $form->{duetyp} eq "11" && do {
- $azr = "11";
- last SWITCH;
- };
- $form->{duetyp} eq "12" && do {
- $azr = "12";
- last SWITCH;
- };
- $form->{duetyp} eq "A" && do {
- $azr = "41";
- last SWITCH;
- };
- $form->{duetyp} eq "B" && do {
- $azr = "42";
- last SWITCH;
- };
- $form->{duetyp} eq "C" && do {
- $azr = "43";
- last SWITCH;
- };
- $form->{duetyp} eq "D" && do {
- $azr = "44";
- last SWITCH;
- };
- do {
- $form->error(
- "Ungültiger Anmeldezeitraum.\n
- Sie können für ELSTER nur einen monatlichen oder
- quartalsweisen Anmeldezeitraum auswählen."
- );
- };
- }
-
- $file .= $azr;
-
- #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->{elsterfile} = $file;
-
- #Calculations
-
- my $k51 =
- sprintf("%d", $form->parse_amount(\%myconfig, $form->{"51"}))
- ; # Umsätze zu 16% USt
- my $k86 =
- sprintf("%d", $form->parse_amount(\%myconfig, $form->{"86"}))
- ; # Umsätze zu 7% USt
- my $k97 =
- sprintf("%d", $form->parse_amount(\%myconfig, $form->{"97"}))
- ; # 16% Steuerpflichtige innergemeinsachftliche Erwerbe
- my $k93 =
- sprintf("%d", $form->parse_amount(\%myconfig, $form->{"93"}))
- ; # 16% Steuerpflichtige innergemeinsachftliche Erwerbe
- my $k94 =
- sprintf("%d", $form->parse_amount(\%myconfig, $form->{"94"}))
- ; # neuer Fahrzeuge von Lieferern
- my $k66 =
- $form->parse_amount(\%myconfig, $form->{"66"}) *
- 100; # Vorsteuer 7% plus 16%
- my $k83 =
- $form->parse_amount(\%myconfig, $form->{"83"}) * 100 ; # Endbetrag
- my $k96 = $form->parse_amount(\%myconfig, $form->{"96"}) * 100; #
- #
- # Now build the xml content
- #
-
- $form->{elster} = qq|<?xml version="1.0" encoding="ISO-8859-1" ?>
-<!-- Diese Datei ist mit Lx-Office $form->{version} generiert -->
-<WinstonAusgang>
- <Formular Typ="UST"></Formular>
- <Ordnungsnummer>$form->{elsterFFFF}$form->{elstersteuernummer}</Ordnungsnummer>
- <AnmeldeJahr>$form->{year}</AnmeldeJahr>
- <AnmeldeZeitraum>$azr</AnmeldeZeitraum>
- |;
-
- $form->{elster} .= qq|<Kennzahl Nr="51">$k51</Kennzahl>\n| if ($k51 ne '0');
- $form->{elster} .= qq|<Kennzahl Nr="86">$k86</Kennzahl>\n| if ($k86 ne '0');
- $form->{elster} .= qq|<Kennzahl Nr="97">$k97</Kennzahl>\n| if ($k97 ne '0');
- $form->{elster} .= qq|<Kennzahl Nr="93">$k93</Kennzahl>\n| if ($k93 ne '0');
- $form->{elster} .= qq|<Kennzahl Nr="94">$k94</Kennzahl>\n| if ($k94 ne '0');
- $form->{elster} .= qq|<Kennzahl Nr="96">$k96</Kennzahl>\n| if ($k96 ne '0');
- $form->{elster} .= qq|<Kennzahl Nr="66">$k66</Kennzahl>\n| if ($k66 ne '0');
- $form->{elster} .= qq|<Kennzahl Nr="83">$k83</Kennzahl>\n| if ($k83 ne '0');
- $form->{elster} .= qq|\n</WinstonAusgang>\n\n|;
-
- #$form->header;
- #print qq|$form->{elsterfile}|;
- #print qq|$form->{elster}|;
- $SIG{INT} = 'IGNORE';
-
- &save_winston;
- $lxdebug->leave_sub();
-}
-
-sub save_winston {
- $lxdebug->enter_sub();
- my $elster = $form->{elster};
- my $elsterfile = $form->{elsterfile};
- open(OUT, ">-") or $form->error("STDOUT : $!");
- print OUT qq|Content-Type: application/file;
-Content-Disposition: attachment; filename="$elsterfile"\n\n|;
- print OUT $elster;
- close(OUT);
- $lxdebug->leave_sub();
-}
sub continue {
$lxdebug->enter_sub();
return $finanzamt;
}
-sub test {
- $lxdebug->enter_sub();
-
- # biegt nur den Testeintrag in Programm->Test auf eine Routine um
-
- $form->header;
- &elster_send;
- $lxdebug->leave_sub();
-}
-
-sub elster_send {
- $lxdebug->enter_sub();
-
- #read config
- my $elster_conf = &elster_conf();
- &elster_xml();
- use Cwd;
- $form->{cwd} = cwd();
- $form->{tmpdir} = $form->{cwd} . '/' . $elster_conf->{'path'};
- $form->{tmpfile} = $elster_conf->{'err'};
- my $caller = $elster_conf->{'call'}[0];
-
- chdir("$form->{tmpdir}") or $form->error($form->cleanup . "chdir : $!");
- my $send =
- "faxmlsend $caller -config etc/faxmlsend.cnf -xml faxmlsend.xml -tt faxmlsend.tt -debug";
-
- system("$send > $form->{tmpfile}");
- $form->{tmpdir} .= "$elster_conf->{'path'}/";
- $form->{tmpfile} = "faxmlsend.err";
- $form->error($form->cleanup
- . "faxmlsend : OFD meldet: Error 404 \n Internetseite nicht vorhanden")
- if ($? eq '1024');
- $form->error($form->cleanup
- . "faxmlsend : No such File: faxmlsend.xml \n Fehlernummer: $? \n Problem beim öffnen der faxmlsend.xml"
- )
- if ($?);
-
- # foreach my $line (&elster_feedback("$elster_conf->{'path'}")){
- # print qq|$line\n|;
- # }
- print qq|Log:<br>|;
-
- #for (my $i=0; $i<= )
- &elster_readlog();
- print qq|\n ende\n|;
- $lxdebug->leave_sub();
-}
-
-sub elster_readlog {
- $lxdebug->enter_sub();
- my $elster_conf = &elster_conf();
- open(LOG, "$elster_conf->{'logfile'}")
- or $form->error("$elster_conf->{'logfile'}: $!");
- print qq|<listing>|;
- my $log = '';
- my $xml = '';
- my $tmp = '';
- while (<LOG>) {
- my $i = 0;
-
- #$_ =~ s/</<\;/;
- #$_ =~ s/>/>\;/;
- $_ =~ s/\s+//mg;
-
- #$_ =~ s/\015\012//mg;
- $_ =~ s/</\n</mg;
-
- #$_ =~ s/\n\n+//mg;
- if ($_ =~ /^\d\d\d\d\d\d/g) {
- $log .= qq|$_<br>|;
-
- #} elsif ($_ =~ /(<([^\/]*?)>)/ ) {
- } elsif ($_ =~ /(<([^\/].*?)>(.*))/g) {
-
- #$xml .= qq|$2 = $3\n\n|;
- #$_ =~ s/\015\012//mg;
- $_ =~ s/\s+//;
- $xml .= qq|$_\n|;
-
- } else {
- $tmp .= qq|$_<br>|;
- }
- $i++;
- }
-
- #second parse
- #my $var='';
- #while (<$xml>){
- # $var .= qq|$2 = $3\n\n|;
- #}
- #print qq|$log|;
- print qq|$xml|;
- print qq|</listing>|;
-
- # $_=$log;
- # s{<(\w+)\b([^<>]*)>
- # ((?:.(?!</?\1\b))*.)
- # (<\1>) }
- # { print "markup=",$1," args=",$2," enclosed=",$3," final=",$4 ; "" }gsex;
- close LOG;
- $lxdebug->leave_sub();
-}
-
-sub elster_feedback {
- $lxdebug->enter_sub();
- my ($file) = @_;
- my @content = ();
- print qq|feedback:<br>|;
- if (-f "$file") {
- open(FH, "$file");
- @content = <FH>;
- close(FH);
- }
- $lxdebug->leave_sub();
- return (@content);
-}
-
-sub elster_conf {
- $lxdebug->enter_sub();
- my $elster_conf = { 'path' => 'elster',
- 'prg' => 'faxmlsend',
- 'err' => 'faxmlsend.err',
- 'ttfile' => 'faxmlsend.tt',
- 'xmlfile' => 'faxmlsend.xml',
- 'cline' => '-tt $ttfile -xml $xmlfile',
- 'call' => ['send', 'protokoll', 'anmeldesteuern'],
- 'logfile' => 'log/faxmlsend.log',
- 'conffile' => 'faxmlsend.cnf',
- 'debug' => '-debug' };
- $lxdebug->leave_sub();
- return $elster_conf;
-
-}
-
-sub elster_xml {
- $lxdebug->enter_sub();
- my $elster_conf = &elster_conf();
-
- # $k51 = sprintf("%d", $form->parse_amount(\%myconfig, $form->{"51"})); # Umsätze zu 16% USt
- # $k86 = sprintf("%d", $form->parse_amount(\%myconfig, $form->{"86"})); # Umsätze zu 7% USt
- # $k97 = sprintf("%d", $form->parse_amount(\%myconfig, $form->{"97"})); # 16% Steuerpflichtige innergemeinsachftliche Erwerbe
- # $k93 = sprintf("%d", $form->parse_amount(\%myconfig, $form->{"93"})); # 16% Steuerpflichtige innergemeinsachftliche Erwerbe
- # $k94 = sprintf("%d", $form->parse_amount(\%myconfig, $form->{"94"})); # neuer Fahrzeuge von Lieferern
- # $k66 = $form->parse_amount(\%myconfig, $form->{"66"}) * 100;# Vorsteuer 7% plus 16%
- # $k83 = $form->parse_amount(\%myconfig, $form->{"67"}) * 100;# Umsätze zu 7% USt
- # $k96 = $form->parse_amount(\%myconfig, $form->{"96"}) * 100;#
-
- my $TransferHeader = qq|<?xml version="1.0" encoding="ISO-8859-1"?>
-<?xml-stylesheet type="text/xsl" href="..\\Stylesheet\\ustva.xsl"?>
-<Elster xmlns="http://www.elster.de/2002/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.elster.de/2002/XMLSchema
-..\\Schemata\\elster_UStA_200501_extern.xsd">
- <TransferHeader version="7">
- <Verfahren>ElsterAnmeldung</Verfahren>
- <DatenArt>UStVA</DatenArt>
- <Vorgang>send-NoSig</Vorgang>
- <Testmerker>700000004</Testmerker>
- <HerstellerID>74931</HerstellerID>
- <DatenLieferant>Helmut</DatenLieferant>
- <Datei>
- <Verschluesselung>PKCS#7v1.5</Verschluesselung>
- <Kompression>GZIP</Kompression>
- <DatenGroesse>123456789012345678901234567890123456789012</DatenGroesse>
- <TransportSchluessel/>
- </Datei>
- <RC>
- <Rueckgabe>
- <Code>0</Code>
- <Text/>
- </Rueckgabe>
- <Stack>
- <Code>0</Code>
- <Text/>
- </Stack>
- </RC>
- <VersionClient/>
- <Zusatz>
- <Info>test</Info>
- </Zusatz>
- </TransferHeader>|;
-
- my $DatenTeil = qq|
- <DatenTeil>
- <Nutzdatenblock>
- <NutzdatenHeader version="9">
- <NutzdatenTicket>234234234</NutzdatenTicket>
- <Empfaenger id="F">9198</Empfaenger>
- <Hersteller>
- <ProduktName>ElsterAnmeldung</ProduktName>
- <ProduktVersion>V 1.4</ProduktVersion>
- </Hersteller>
- <DatenLieferant>String, der Lieferanteninfo enthaelt</DatenLieferant>
- <Zusatz>
- <Info>....</Info>
- </Zusatz>
- </NutzdatenHeader>
- <Nutzdaten>
- <!--die Version gibt Auskunft ueber das Jahr und die derzeit gueltige Versionsnummer-->
- <Anmeldungssteuern art="UStVA" version="200501">
- <DatenLieferant>
- <Name>OFD Muenchen</Name>
- <Strasse>Meiserstr. 6</Strasse>
- <PLZ>80335</PLZ>
- <Ort>München</Ort>
- </DatenLieferant>
- <Erstellungsdatum>20041127</Erstellungsdatum>
- <Steuerfall>
- <Umsatzsteuervoranmeldung>
- <Jahr>2005</Jahr>
- <Zeitraum>01</Zeitraum>
- <Steuernummer>9198011310134</Steuernummer>
- <Kz09>74931*NameSteuerber.*Berufsbez.*089*59958327*Mandantenname</Kz09>
- </Umsatzsteuervoranmeldung>
- </Steuerfall>
- </Anmeldungssteuern>
- </Nutzdaten>
- </Nutzdatenblock>
- </DatenTeil>
-</Elster>\n|;
-
- #$DatenTeil .= qq| <Kz51>$k51</Kz51>\n| if ($k51 ne '0');
- #$DatenTeil .= qq| <Kz86>$k86</Kz86>\n| if ($k86 ne '0');
- #$DatenTeil .= qq| <Kz97>$k97</Kz97>\n| if ($k97 ne '0');
- #$DatenTeil .= qq| <Kz93>$k93</Kz93>\n| if ($k93 ne '0');
- #$DatenTeil .= qq| <Kz94>$k94</Kz94>\n| if ($k94 ne '0');
- #$DatenTeil .= qq| <Kz96>$k96</Kz96>\n| if ($k96 ne '0');
- #$DatenTeil .= qq| <Kz66>$k66</Kz66>\n| if ($k66 ne '0');
- #$DatenTeil .= qq| <Kz83>$k83</Kz83>\n| if ($k83 ne '0');
-
- my $filename = "$elster_conf->{'path'}/$elster_conf->{'xmlfile'}";
- open(XML, ">$elster_conf->{'path'}/$elster_conf->{'xmlfile'}")
- or $form->error("$filename : $!");
- print XML qq|$TransferHeader $DatenTeil|;
- close XML;
- $lxdebug->leave_sub();
-}