Revision f8779cd3
Von Moritz Bunkus vor mehr als 15 Jahren hinzugefügt
bin/mozilla/ustva.pl | ||
---|---|---|
34 | 34 |
#our ($myconfig); |
35 | 35 |
#use CGI::Carp "fatalsToBrowser"; |
36 | 36 |
|
37 |
use List::Util qw(first); |
|
38 |
|
|
37 | 39 |
use SL::PE; |
38 | 40 |
use SL::RP; |
39 | 41 |
use SL::USTVA; |
... | ... | |
88 | 90 |
$form->header; |
89 | 91 |
|
90 | 92 |
# Einlesen der Finanzamtdaten |
91 |
USTVA->get_config($userspath, 'finanzamt.ini'); |
|
93 |
my $ustva = USTVA->new(); |
|
94 |
$ustva->get_config($userspath, 'finanzamt.ini'); |
|
92 | 95 |
|
93 | 96 |
# Hier Einlesen der user-config |
94 | 97 |
# steuernummer entfernt f?r prerelease |
... | ... | |
186 | 189 |
|
187 | 190 |
# Which COA is in use? |
188 | 191 |
|
189 |
USTVA->get_coa($form, $myconfig);
|
|
192 |
$ustva->get_coa($form, $myconfig);
|
|
190 | 193 |
|
191 | 194 |
my $template_ref = { |
192 | 195 |
openings => $openings, |
... | ... | |
533 | 536 |
|
534 | 537 |
# Aufruf von get_config zum Einlesen der Finanzamtdaten aus finanzamt.ini |
535 | 538 |
|
536 |
USTVA->get_config($userspath, 'finanzamt.ini'); |
|
539 |
my $ustva = USTVA->new(); |
|
540 |
$ustva->get_config($userspath, 'finanzamt.ini'); |
|
537 | 541 |
|
538 | 542 |
# init some form vars |
539 | 543 |
my @anmeldungszeitraum = |
... | ... | |
674 | 678 |
|
675 | 679 |
|
676 | 680 |
# Get the USTVA |
677 |
USTVA->ustva(\%myconfig, \%$form);
|
|
681 |
$ustva->ustva(\%myconfig, \%$form);
|
|
678 | 682 |
|
679 | 683 |
# reformat Dates to dateformat |
680 | 684 |
$form->{fromdate} = $locale->date(\%myconfig, $form->{fromdate}, 0, 0, 0); |
... | ... | |
756 | 760 |
# Outputformat specific customisation's |
757 | 761 |
# |
758 | 762 |
|
759 |
my @category_cent = USTVA->report_variables({
|
|
763 |
my @category_cent = $ustva->report_variables({
|
|
760 | 764 |
myconfig => \%myconfig, |
761 | 765 |
form => $form, |
762 | 766 |
type => '', |
... | ... | |
766 | 770 |
|
767 | 771 |
push @category_cent, qw(83 Z43 Z45 Z53 Z62 Z65 Z67); |
768 | 772 |
|
769 |
my @category_euro = USTVA->report_variables({
|
|
773 |
my @category_euro = $ustva->report_variables({
|
|
770 | 774 |
myconfig => \%myconfig, |
771 | 775 |
form => $form, |
772 | 776 |
type => '', |
... | ... | |
915 | 919 |
exit(0); |
916 | 920 |
} |
917 | 921 |
|
918 |
my %lands = ( # Lx => taxbird # TODO: besser als array... |
|
919 |
'Baden W?rttemberg' => '0', |
|
920 |
'Bayern' => '1', |
|
921 |
'Berlin' => '2', |
|
922 |
'Brandenburg' => '3', |
|
923 |
'Bremen' => '4', |
|
924 |
'Hamburg' => '5', |
|
925 |
'Hessen' => '6', |
|
926 |
'Mecklenburg Vorpommern' => '7', |
|
927 |
'Niedersachsen' => '8', |
|
928 |
'Nordrhein Westfalen' => '9', |
|
929 |
'Rheinland Pfalz' => '10', |
|
930 |
'Saarland' => '11', |
|
931 |
'Sachsen' => '12', |
|
932 |
'Sachsen Anhalt' => '13', |
|
933 |
'Schleswig Holstein' => '14', |
|
934 |
'Th?ringen' => '15', |
|
935 |
); |
|
936 |
foreach my $land ( keys %lands ){ |
|
937 |
$form->{taxbird_land_nr} = $lands{$land} if ($form->{elsterland} eq $land ); |
|
938 |
} |
|
922 |
my $tax_office = first { $_->{name} eq $form->{elsterland} } @{ $ustva->{tax_office_information} }; |
|
923 |
$form->{taxbird_land_nr} = $tax_office->{taxbird_nr} if $tax_office; |
|
939 | 924 |
|
940 | 925 |
$form->{co_zip} = $form->{co_city}; |
941 | 926 |
$form->{co_zip} =~ s/\D//g; |
... | ... | |
1011 | 996 |
} else # Outputformat for generic output |
1012 | 997 |
{ |
1013 | 998 |
|
1014 |
my @category_cent = USTVA->report_variables({
|
|
999 |
my @category_cent = $ustva->report_variables({
|
|
1015 | 1000 |
myconfig => \%myconfig, |
1016 | 1001 |
form => $form, |
1017 | 1002 |
type => '', |
... | ... | |
1019 | 1004 |
dec_places => '2', |
1020 | 1005 |
}); |
1021 | 1006 |
|
1022 |
my @category_euro = USTVA->report_variables({
|
|
1007 |
my @category_euro = $ustva->report_variables({
|
|
1023 | 1008 |
myconfig => \%myconfig, |
1024 | 1009 |
form => $form, |
1025 | 1010 |
type => '', |
... | ... | |
1085 | 1070 |
# edit all taxauthority prefs |
1086 | 1071 |
|
1087 | 1072 |
$form->header; |
1088 |
USTVA->get_config($userspath, 'finanzamt.ini'); |
|
1073 |
|
|
1074 |
my $ustva = USTVA->new(); |
|
1075 |
$ustva->get_config($userspath, 'finanzamt.ini'); |
|
1089 | 1076 |
|
1090 | 1077 |
my $land = $form->{elsterland}; |
1091 | 1078 |
my $amt = $form->{elsterFFFF}; |
... | ... | |
1094 | 1081 |
$form->{title} = $locale->text('Tax Office Preferences'); |
1095 | 1082 |
|
1096 | 1083 |
|
1097 |
my $select_tax_office = USTVA->fa_auswahl($land, $amt, &elster_hash());
|
|
1084 |
my $select_tax_office = $ustva->fa_auswahl($land, $amt, $ustva->query_finanzamt(\%myconfig, $form));
|
|
1098 | 1085 |
my $checked_accrual = q|checked="checked"| if ($form->{method} eq 'accrual'); |
1099 | 1086 |
my $checked_cash = q|checked="checked"| if ($form->{method} eq 'cash'); |
1100 | 1087 |
my $checked_monthly = "checked" if ($form->{FA_voranmeld} eq 'month'); |
... | ... | |
1133 | 1120 |
|
1134 | 1121 |
# Which COA is in use? |
1135 | 1122 |
|
1136 |
USTVA->get_coa($form, \%myconfig);
|
|
1123 |
$ustva->get_coa($form, \%myconfig);
|
|
1137 | 1124 |
|
1138 | 1125 |
# h?? kann die weg? |
1139 | 1126 |
my $steuernummer_new = ''; |
... | ... | |
1171 | 1158 |
my $elster_amt = ''; |
1172 | 1159 |
my $elsterFFFF = ''; |
1173 | 1160 |
my $elstersteuernummer = ''; |
1174 |
USTVA->get_config($userspath, 'finanzamt.ini') |
|
1161 |
|
|
1162 |
my $ustva = USTVA->new(); |
|
1163 |
$ustva->get_config($userspath, 'finanzamt.ini') |
|
1175 | 1164 |
if ($form->{saved} eq $locale->text('saved')); |
1176 | 1165 |
|
1177 | 1166 |
# Auf ?bergabefehler checken |
... | ... | |
1190 | 1179 |
my $change = $form->{elsterland} eq $form->{elsterland_new} |
1191 | 1180 |
&& $form->{elsterFFFF} eq $form->{elsterFFFF_new} ? '0' : '1'; |
1192 | 1181 |
$change = '0' if ($form->{saved} eq $locale->text('saved')); |
1193 |
my $elster_init = &elster_hash();
|
|
1182 |
my $elster_init = $ustva->query_finanzamt(\%myconfig, $form);
|
|
1194 | 1183 |
|
1195 | 1184 |
my %elster_init = %$elster_init; |
1196 | 1185 |
|
... | ... | |
1241 | 1230 |
$form->{FA_Oeffnungszeiten} =~ s/\\\\n/\n/g; |
1242 | 1231 |
|
1243 | 1232 |
|
1244 |
USTVA->get_coa($form, \%myconfig);
|
|
1233 |
$ustva->get_coa($form, \%myconfig);
|
|
1245 | 1234 |
|
1246 |
my $input_steuernummer = USTVA->steuernummer_input(
|
|
1235 |
my $input_steuernummer = $ustva->steuernummer_input(
|
|
1247 | 1236 |
$form->{elsterland}, |
1248 | 1237 |
$form->{elsterFFFF}, |
1249 | 1238 |
$form->{steuernummer} |
... | ... | |
1422 | 1411 |
$lxdebug->leave_sub(); |
1423 | 1412 |
} |
1424 | 1413 |
|
1425 |
sub elster_hash { |
|
1426 |
$lxdebug->enter_sub(); |
|
1427 |
|
|
1428 |
$auth->assert('advance_turnover_tax_return'); |
|
1429 |
|
|
1430 |
my $finanzamt = USTVA->query_finanzamt(\%myconfig, \%$form); |
|
1431 |
$lxdebug->leave_sub(); |
|
1432 |
return $finanzamt; |
|
1433 |
} |
Auch abrufbar als: Unified diff
Codecleanup UStVA & Bugfixes bei Verwendung von UTF-8
Das UStVA-Modul enthält hardgecodet die Namen der Bundesländer.
Diese enthalten Umlaute, die in ISO-8859-1 codiert sind. Wird hingegen
ein anderes Datenbank-Charset wie UTF-8 verwendet, so klappt die
UStVA-Konfiguration nicht. Das wurde behoben, indem die Ländernamen
nun zentral an einer Stelle verwaltet und in das Datenbankcharset
konvertiert werden, bevor sie benutzt werden.
Fix für Bug 952.