Revision 76c486e3
Von Sven Schöling vor etwa 15 Jahren hinzugefügt
SL/USTVA.pm | ||
---|---|---|
29 | 29 |
|
30 | 30 |
use SL::DBUtils; |
31 | 31 |
|
32 |
use strict; |
|
33 |
|
|
32 | 34 |
my @tax_office_information = ( |
33 | 35 |
{ 'id' => 8, 'name' => 'Baden W?rttemberg', 'taxbird_nr' => '0', 'elster_format' => 'FF/BBB/UUUUP', }, |
34 | 36 |
{ 'id' => 9, 'name' => 'Bayern', 'taxbird_nr' => '1', 'elster_format' => 'FFF/BBB/UUUUP', }, |
... | ... | |
145 | 147 |
sub create_steuernummer { |
146 | 148 |
$main::lxdebug->enter_sub(); |
147 | 149 |
|
148 |
$part = $form->{part}; |
|
149 |
$patterncount = $form->{patterncount}; |
|
150 |
$delimiter = $form->{delimiter}; |
|
151 |
$elster_pattern = $form->{elster_pattern}; |
|
150 |
my $form = $main::form; |
|
151 |
|
|
152 |
our ($elster_FFFF); |
|
153 |
|
|
154 |
my $part = $form->{part}; |
|
155 |
my $patterncount = $form->{patterncount}; |
|
156 |
my $delimiter = $form->{delimiter}; |
|
157 |
my $elster_pattern = $form->{elster_pattern}; |
|
152 | 158 |
|
153 | 159 |
# rebuild steuernummer and elstersteuernummer |
154 | 160 |
# es gibt eine gespeicherte steuernummer $form->{steuernummer} |
... | ... | |
157 | 163 |
my $h = 0; |
158 | 164 |
my $i = 0; |
159 | 165 |
|
160 |
$steuernummer_new = $part; |
|
161 |
$elstersteuernummer_new = $elster_FFFF; |
|
162 |
$elstersteuernummer_new .= '0'; |
|
166 |
my $steuernummer_new = $part;
|
|
167 |
my $elstersteuernummer_new = $elster_FFFF;
|
|
168 |
$elstersteuernummer_new .= '0';
|
|
163 | 169 |
|
164 | 170 |
for ($h = 1; $h < $patterncount; $h++) { |
165 | 171 |
$steuernummer_new .= qq|$delimiter|; |
... | ... | |
181 | 187 |
$main::lxdebug->enter_sub(); |
182 | 188 |
|
183 | 189 |
my ($self, $elsterland, $elsterFFFF, $steuernummer) = @_; |
190 |
our ($elster_FFFF, $elster_land); |
|
184 | 191 |
|
185 | 192 |
my $steuernummer_input = ''; |
186 | 193 |
|
... | ... | |
286 | 293 |
my $ffff = ''; |
287 | 294 |
my $checked = ''; |
288 | 295 |
$checked = 'checked' if ($elsterFFFF eq '' and $land eq ''); |
296 |
my %elster_land_fa; |
|
289 | 297 |
|
290 | 298 |
my $fa_auswahl = qq| |
291 | 299 |
<script language="Javascript"> |
... | ... | |
297 | 305 |
elsterFAAuswahl.options.length = 0; // dropdown aufr?umen |
298 | 306 |
|; |
299 | 307 |
|
300 |
foreach $elster_land (sort keys %$elster_init) { |
|
308 |
foreach my $elster_land (sort keys %$elster_init) {
|
|
301 | 309 |
$fa_auswahl .= qq| |
302 | 310 |
if (elsterBLAuswahl.options[elsterBLAuswahl.selectedIndex]. |
303 | 311 |
value == "$elster_land") |
304 | 312 |
{ |
305 | 313 |
|; |
306 | 314 |
my $j = 0; |
307 |
my %elster_land_fa = ();
|
|
315 |
%elster_land_fa = (); |
|
308 | 316 |
$FFFF = ''; |
309 | 317 |
for $FFFF (keys %{ $elster_init->{$elster_land} }) { |
310 | 318 |
$elster_land_fa{$FFFF} = $elster_init->{$elster_land}->{$FFFF}->[0]; |
... | ... | |
333 | 341 |
if ($land eq '') { |
334 | 342 |
$fa_auswahl .= qq|<option value="Auswahl" $checked>| . $main::locale->text('Select federal state...') . qq|</option>\n|; |
335 | 343 |
} |
336 |
foreach $elster_land (sort keys %$elster_init) { |
|
344 |
foreach my $elster_land (sort keys %$elster_init) {
|
|
337 | 345 |
$fa_auswahl .= qq| |
338 | 346 |
<option value="$elster_land"|; |
339 | 347 |
if ($elster_land eq $land and $checked eq '') { |
... | ... | |
414 | 422 |
$main::lxdebug->leave_sub(); |
415 | 423 |
} |
416 | 424 |
|
425 |
# 20.10.2009 sschoeling: this sub seems to be orphaned. |
|
417 | 426 |
sub stichtag { |
418 | 427 |
$main::lxdebug->enter_sub(); |
419 | 428 |
|
... | ... | |
428 | 437 |
|
429 | 438 |
#$today =today * 1; |
430 | 439 |
$today =~ /(\d\d\d\d)(\d\d)(\d\d)/; |
431 |
$year = $1; |
|
432 |
$month = $2; |
|
433 |
$day = $3; |
|
434 |
$yy = $year; |
|
435 |
$mm = $month; |
|
436 |
$yymmdd = "$year$month$day" * 1; |
|
437 |
$mmdd = "$month$day" * 1; |
|
438 |
$stichtag = ''; |
|
440 |
my $year = $1;
|
|
441 |
my $month = $2;
|
|
442 |
my $day = $3;
|
|
443 |
my $yy = $year;
|
|
444 |
my $mm = $month;
|
|
445 |
my $yymmdd = "$year$month$day" * 1;
|
|
446 |
my $mmdd = "$month$day" * 1;
|
|
447 |
my $stichtag = '';
|
|
439 | 448 |
|
440 | 449 |
#$tage_bis = '1234'; |
441 | 450 |
#$ical = '...vcal format'; |
442 | 451 |
|
443 | 452 |
#if ($FA_voranmeld eq 'month'){ |
444 | 453 |
|
445 |
%liste = ("0110" => 'December', |
|
446 |
"0210" => 'January', |
|
447 |
"0310" => 'February', |
|
448 |
"0410" => 'March', |
|
449 |
"0510" => 'April', |
|
450 |
"0610" => 'May', |
|
451 |
"0710" => 'June', |
|
452 |
"0810" => 'July', |
|
453 |
"0910" => 'August', |
|
454 |
"1010" => 'September', |
|
455 |
"1110" => 'October', |
|
456 |
"1210" => 'November'); |
|
454 |
my %liste = ( |
|
455 |
"0110" => 'December', |
|
456 |
"0210" => 'January', |
|
457 |
"0310" => 'February', |
|
458 |
"0410" => 'March', |
|
459 |
"0510" => 'April', |
|
460 |
"0610" => 'May', |
|
461 |
"0710" => 'June', |
|
462 |
"0810" => 'July', |
|
463 |
"0910" => 'August', |
|
464 |
"1010" => 'September', |
|
465 |
"1110" => 'October', |
|
466 |
"1210" => 'November', |
|
467 |
); |
|
457 | 468 |
|
458 | 469 |
#$mm += $dauerfrist |
459 | 470 |
#$month *= 1; |
460 | 471 |
$month += 1 if ($day > 10); |
461 | 472 |
$month = sprintf("%02d", $month); |
462 | 473 |
$stichtag = $year . $month . "10"; |
463 |
$ust_va = $month . "10"; |
|
474 |
my $ust_va = $month . "10";
|
|
464 | 475 |
|
465 |
foreach $date (%liste) { |
|
476 |
foreach my $date (%liste) {
|
|
466 | 477 |
$ust_va = $liste{$date} if ($date eq $stichtag); |
467 | 478 |
} |
468 | 479 |
|
... | ... | |
486 | 497 |
#$stichtag =~ /([\d]\d)(\d\d)$/ |
487 | 498 |
#$stichtag = "$1.$2.$yy" |
488 | 499 |
#$stichtag=$1; |
500 |
our $description; # most probably not existant. |
|
501 |
our $tage_bis; # most probably not existant. |
|
502 |
our $ical; # most probably not existant. |
|
503 |
|
|
489 | 504 |
$main::lxdebug->leave_sub(); |
490 | 505 |
return ($stichtag, $description, $tage_bis, $ical); |
491 | 506 |
} |
... | ... | |
557 | 572 |
$sth->execute || $form->dberror($query); |
558 | 573 |
my $array_ref = $sth->fetchall_arrayref(); |
559 | 574 |
my $land = ''; |
575 |
my %finanzamt; |
|
560 | 576 |
foreach my $row (@$array_ref) { |
561 | 577 |
my $FA_finanzamt = $row; |
562 | 578 |
my $tax_office = first { $_->{id} == $FA_finanzamt->[0] } @{ $self->{tax_office_information} }; |
... | ... | |
679 | 695 |
|
680 | 696 |
$form->{decimalplaces} *= 1; |
681 | 697 |
|
682 |
foreach $item (@category_cent) { |
|
698 |
foreach my $item (@category_cent) {
|
|
683 | 699 |
$form->{"$item"} = 0; |
684 | 700 |
} |
685 |
foreach $item (@category_euro) { |
|
701 |
foreach my $item (@category_euro) {
|
|
686 | 702 |
$form->{"$item"} = 0; |
687 | 703 |
} |
688 | 704 |
my $coa_name = coa_get($dbh); |
... | ... | |
691 | 707 |
# Controlvariable for templates |
692 | 708 |
$form->{"$coa_name"} = '1'; |
693 | 709 |
|
694 |
$main::lxdebug->message(LXDebug::DEBUG2, "COA: '$form->{coa}', \$form->{$coa_name} = 1");
|
|
710 |
$main::lxdebug->message(LXDebug->DEBUG2(), "COA: '$form->{coa}', \$form->{$coa_name} = 1");
|
|
695 | 711 |
|
696 | 712 |
&get_accounts_ustva($dbh, $last_period, $form->{fromdate}, $form->{todate}, |
697 | 713 |
$form, $category); |
... | ... | |
762 | 778 |
sub coa_get { |
763 | 779 |
|
764 | 780 |
my ($dbh) = @_; |
781 |
my $form = $main::form; |
|
765 | 782 |
|
766 | 783 |
my $query= qq|SELECT coa FROM defaults|; |
767 | 784 |
|
... | ... | |
769 | 786 |
|
770 | 787 |
$sth->execute || $form->dberror($query); |
771 | 788 |
|
772 |
($ref) = $sth->fetchrow_array; |
|
789 |
my ($ref) = $sth->fetchrow_array;
|
|
773 | 790 |
|
774 | 791 |
return $ref; |
775 | 792 |
|
... | ... | |
779 | 796 |
$main::lxdebug->enter_sub(); |
780 | 797 |
|
781 | 798 |
my ($dbh, $last_period, $fromdate, $todate, $form, $category) = @_; |
799 |
our ($dpt_join); |
|
782 | 800 |
|
783 | 801 |
my $query; |
784 | 802 |
my $where = ""; |
... | ... | |
987 | 1005 |
my $ref; |
988 | 1006 |
|
989 | 1007 |
# Show all $query in Debuglevel LXDebug::QUERY |
990 |
$callingdetails = (caller (0))[3]; |
|
991 |
$main::lxdebug->message(LXDebug::QUERY, "$callingdetails \$query=\n $query");
|
|
1008 |
my $callingdetails = (caller (0))[3];
|
|
1009 |
$main::lxdebug->message(LXDebug->QUERY(), "$callingdetails \$query=\n $query");
|
|
992 | 1010 |
|
993 | 1011 |
my $sth = $dbh->prepare($query); |
994 | 1012 |
|
995 | 1013 |
$sth->execute || $form->dberror($query); |
996 | 1014 |
|
997 |
while (my $ref = $sth->fetchrow_hashref(NAME_lc)) {
|
|
1015 |
while (my $ref = $sth->fetchrow_hashref("NAME_lc")) {
|
|
998 | 1016 |
# Bug 365 solved?! |
999 | 1017 |
$ref->{amount} *= -1; |
1000 | 1018 |
$form->{ $ref->{$category} } += $ref->{amount}; |
... | ... | |
1011 | 1029 |
|
1012 | 1030 |
my ($self, $userspath, $filename) = @_; |
1013 | 1031 |
|
1014 |
$form->error("Missing Parameter: @_") if !$userspath || !$filename; |
|
1015 |
|
|
1016 | 1032 |
my $form = $main::form; |
1017 | 1033 |
|
1034 |
$form->error("Missing Parameter: @_") if !$userspath || !$filename; |
|
1035 |
|
|
1018 | 1036 |
$filename = "$form->{login}_$filename"; |
1019 | 1037 |
$filename =~ s|.*/||; |
1020 | 1038 |
$filename = "$userspath/$filename"; |
1021 |
open my $FACONF, "<", $filename or sub {# Annon Sub
|
|
1039 |
open my $FACONF, "<", $filename or do {# Annon Sub
|
|
1022 | 1040 |
# catch open error |
1023 | 1041 |
# create file if file does not exist |
1024 | 1042 |
open my $FANEW, ">", $filename or $form->error("CREATE: $filename : $!"); |
Auch abrufbar als: Unified diff
Und wieder ein Schwung strict.