X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fustva.pl;h=4ee7638816511f123b46e65cf96585da1fd3f3b3;hb=06b678305ce21a082d5c76d43cd9275969931156;hp=5bb85b1336e7e948fb246e9e175cbd0252cc04a4;hpb=f575aa99b38c34c64deff0abfb87d820eca923dd;p=kivitendo-erp.git diff --git a/bin/mozilla/ustva.pl b/bin/mozilla/ustva.pl index 5bb85b133..4ee763881 100644 --- a/bin/mozilla/ustva.pl +++ b/bin/mozilla/ustva.pl @@ -29,7 +29,7 @@ require "$form->{path}/arap.pl"; #use strict; #no strict 'refs'; #use diagnostics; -#use warnings FATAL=> 'all'; +#use warnings; # FATAL=> 'all'; #use vars qw($locale $form %myconfig); #our ($myconfig); #use CGI::Carp "fatalsToBrowser"; @@ -76,13 +76,11 @@ sub report { $form->{title} = $locale->text('UStVA'); $form->{kz10} = ''; #Berichtigte Anmeldung? Ja =1 - # $accrual = ($eur) ? "" : "checked"; - # $cash = ($eur) ? "checked" : ""; - my $year = ''; - my $null = ''; - ($null, $null, $null, $null, $null, $year, $null, $null, $null) = - localtime(); - $year += 1900; + my $year = substr( + $form->datetonum($form->current_date(\%myconfig), + \%myconfig + ), + 0, 4); my $department = ''; local $hide = ''; @@ -109,7 +107,7 @@ sub report { # Hier Aufruf von get_config aus bin/mozilla/fa.pl zum # Einlesen der Finanzamtdaten &get_config($userspath, 'finanzamt.ini'); - + # Hier Einlesen der user-config # steuernummer entfernt für prerelease my @a = qw(signature name company address businessnumber tel fax email @@ -140,7 +138,7 @@ sub report { | . $locale->text('Kein Firmenname hinterlegt!') . qq|
|; } - + # Anpassungen der Variablennamen auf pre 2.1.1 Namen # klären, ob $form->{company_street|_address} gesetzt sind # @@ -151,24 +149,24 @@ sub report { ($form->{co_street}, $form->{co_city}) = split("
", $temp); } - if ( $form->{co_street} ne '' - and ($form->{co_zip} ne '' - or $form->{co_city} ne '') ) { + if ($form->{co_street} ne '' + and ( $form->{co_zip} ne '' + or $form->{co_city} ne '') + ) { print qq| $form->{co_street}
$form->{co_street1}
$form->{co_zip} $form->{co_city}|; - } else { + } else { print qq| {path}&action=config&level=Programm--Preferences&login=$form->{login}&password=$form->{password}> | . $locale->text('Keine Firmenadresse hinterlegt!') . qq|\n|; } - $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}; - - + $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}; + print qq|

@@ -233,7 +231,7 @@ sub report { # accounting years if SQL-Ledger Version < 2.4.1 # $year = $form->{year} * 1; - @years = sort { $b <=> $a } (2000 .. ($year+1)); + @years = sort { $b <=> $a } (2003 .. ($year + 1)); $form->{all_years} = \@years; } map { $form->{selectaccountingyear} .= qq| + . $locale->text("$liste{$key}") . qq| |; } @@ -661,12 +643,11 @@ sub ustva_vorauswahl { } 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'), - '13' => $locale->text('Yearly'), - ); + my %liste = ('A' => $locale->text('1. Quarter'), + 'B' => $locale->text('2. Quarter'), + 'C' => $locale->text('3. Quarter'), + 'D' => $locale->text('4. Quarter'), + '13' => $locale->text('Yearly'),); my $yy = $form->{year} * 10000; $yymmdd = "$form->{year}$form->{month}$form->{day}" * 1; @@ -733,20 +714,20 @@ sub ustva_vorauswahl { '10' => 'October', '11' => 'November', '12' => 'December', - '13' => 'Yearly', - ); + '13' => 'Yearly',); my $key = ''; foreach $key (sort keys %listea) { print qq| - - |; + \n|; } foreach $key (sort keys %listeb) { print qq| - - - |; + \n|; } print qq||; } @@ -799,8 +780,7 @@ sub show_options { $type $media + . $locale->text('Ausgabeformat auswählen...') . qq|">$format |; $lxdebug->leave_sub(); } @@ -824,127 +804,134 @@ sub generate_ustva { #forgotten the year --> thisyear if ($form->{year} !~ m/^\d\d\d\d$/) { - $locale->date(\$myconfig, $form->current_date(\$myconfig), 0) =~ - /(\d\d\d\d)/; - $form->{year} = $1; + $form->{year} = substr( + $form->datetonum( + $form->current_date(\%myconfig), \%myconfig + ), + 0, 4); + $lxdebug->message(LXDebug::DEBUG1, + qq|Actual year from Database: $form->{year}\n|); } #yearly report if ($form->{duetyp} eq "13") { - $form->{fromdate} = "1.1.$form->{year}"; - $form->{todate} = "31.12.$form->{year}"; + $form->{fromdate} = "$form->{year}0101"; + $form->{todate} = "$form->{year}1231"; } #Quater reports if ($form->{duetyp} eq "A") { - $form->{fromdate} = "1.1.$form->{year}"; - $form->{todate} = "31.3.$form->{year}"; + $form->{fromdate} = "$form->{year}0101"; + $form->{todate} = "$form->{year}0331"; $form->{'0441'} = "X"; } if ($form->{duetyp} eq "B") { - $form->{fromdate} = "1.4.$form->{year}"; - $form->{todate} = "30.6.$form->{year}"; + $form->{fromdate} = "$form->{year}0401"; + $form->{todate} = "$form->{year}0630"; $form->{'0442'} = "X"; } if ($form->{duetyp} eq "C") { - $form->{fromdate} = "1.7.$form->{year}"; - $form->{todate} = "30.9.$form->{year}"; + $form->{fromdate} = "$form->{year}0701"; + $form->{todate} = "$form->{year}0930"; $form->{'0443'} = "X"; } if ($form->{duetyp} eq "D") { - $form->{fromdate} = "1.10.$form->{year}"; - $form->{todate} = "31.12.$form->{year}"; + $form->{fromdate} = "$form->{year}1001"; + $form->{todate} = "$form->{year}1231"; $form->{'0444'} = "X"; } #Monthly reports SWITCH: { $form->{duetyp} eq "01" && do { - $form->{fromdate} = "1.1.$form->{year}"; - $form->{todate} = "31.1.$form->{year}"; + $form->{fromdate} = "$form->{year}0101"; + $form->{todate} = "$form->{year}0131"; $form->{'0401'} = "X"; last SWITCH; }; $form->{duetyp} eq "02" && do { - $form->{fromdate} = "1.2.$form->{year}"; + $form->{fromdate} = "$form->{year}0201"; #this works from 1901 to 2099, 1900 and 2100 fail. my $leap = ($form->{year} % 4 == 0) ? "29" : "28"; - $form->{todate} = "$leap.2.$form->{year}"; + $form->{todate} = "$form->{year}02$leap"; $form->{"0402"} = "X"; last SWITCH; }; $form->{duetyp} eq "03" && do { - $form->{fromdate} = "1.3.$form->{year}"; - $form->{todate} = "31.3.$form->{year}"; + $form->{fromdate} = "$form->{year}0301"; + $form->{todate} = "$form->{year}0331"; $form->{"0403"} = "X"; last SWITCH; }; $form->{duetyp} eq "04" && do { - $form->{fromdate} = "1.4.$form->{year}"; - $form->{todate} = "30.4.$form->{year}"; + $form->{fromdate} = "$form->{year}0401"; + $form->{todate} = "$form->{year}0430"; $form->{"0404"} = "X"; last SWITCH; }; $form->{duetyp} eq "05" && do { - $form->{fromdate} = "1.5.$form->{year}"; - $form->{todate} = "31.5.$form->{year}"; + $form->{fromdate} = "$form->{year}0501"; + $form->{todate} = "$form->{year}0531"; $form->{"0405"} = "X"; last SWITCH; }; $form->{duetyp} eq "06" && do { - $form->{fromdate} = "1.6.$form->{year}"; - $form->{todate} = "30.6.$form->{year}"; + $form->{fromdate} = "$form->{year}0601"; + $form->{todate} = "$form->{year}0630"; $form->{"0406"} = "X"; last SWITCH; }; $form->{duetyp} eq "07" && do { - $form->{fromdate} = "1.7.$form->{year}"; - $form->{todate} = "31.7.$form->{year}"; + $form->{fromdate} = "$form->{year}0701"; + $form->{todate} = "$form->{year}0731"; $form->{"0407"} = "X"; last SWITCH; }; $form->{duetyp} eq "08" && do { - $form->{fromdate} = "1.8.$form->{year}"; - $form->{todate} = "31.8.$form->{year}"; + $form->{fromdate} = "$form->{year}0801"; + $form->{todate} = "$form->{year}0831"; $form->{"0408"} = "X"; last SWITCH; }; $form->{duetyp} eq "09" && do { - $form->{fromdate} = "1.9.$form->{year}"; - $form->{todate} = "30.9.$form->{year}"; + $form->{fromdate} = "$form->{year}0901"; + $form->{todate} = "$form->{year}0930"; $form->{"0409"} = "X"; last SWITCH; }; $form->{duetyp} eq "10" && do { - $form->{fromdate} = "1.10.$form->{year}"; - $form->{todate} = "31.10.$form->{year}"; + $form->{fromdate} = "$form->{year}1001"; + $form->{todate} = "$form->{year}1031"; $form->{"0410"} = "X"; last SWITCH; }; $form->{duetyp} eq "11" && do { - $form->{fromdate} = "1.11.$form->{year}"; - $form->{todate} = "30.11.$form->{year}"; + $form->{fromdate} = "$form->{year}1101"; + $form->{todate} = "$form->{year}1130"; $form->{"0411"} = "X"; last SWITCH; }; $form->{duetyp} eq "12" && do { - $form->{fromdate} = "1.12.$form->{year}"; - $form->{todate} = "31.12.$form->{year}"; + $form->{fromdate} = "$form->{year}1201"; + $form->{todate} = "$form->{year}1231"; $form->{"0412"} = "X"; last SWITCH; }; } } - #$myconfig = \%myconfig; - RP->ustva(\%myconfig, \%$form); + # using dates in ISO-8601 format: yyyymmmdd for Postgres... + USTVA->ustva(\%myconfig, \%$form); + + # reformat Dates to dateformat + $form->{fromdate} = $locale->date(\%myconfig, $form->{fromdate}, 0, 0, 0); - #??($form->{department}) = split /--/, $form->{department}; + $form->{todate} = $form->current_date($myconfig) unless $form->{todate}; + $form->{todate} = $locale->date(\%myconfig, $form->{todate}, 0, 0, 0); $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1, 0, 0); - $form->{todate} = $form->current_date($myconfig) unless $form->{todate}; # if there are any dates construct a where if ($form->{fromdate} || $form->{todate}) { @@ -1012,25 +999,28 @@ sub generate_ustva { $form->{endbold} = "}"; $form->{br} = '\\\\'; - - my @numbers = qw(51r 86r 97r 93r 96 43 45 - 66 62 67); + 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') { + if ( $myconfig{numberformat} eq '1.000,00' + or $myconfig{numberformat} eq '1000,00') { foreach $number (@numbers) { $form->{$number} =~ s/,/~~/g; } - } - if ($myconfig{numberformat} eq '1000.00' or - $myconfig{numberformat} eq '1,000.00') { + } + if ( $myconfig{numberformat} eq '1000.00' + or $myconfig{numberformat} eq '1,000.00') { foreach $number (@numbers) { $form->{$number} =~ s/\./~~/g; } } - # Formatierungen für HTML Ausgabe - } elsif ($form->{format} eq 'html') { + + # Formatierungen für HTML Ausgabe + } elsif ($form->{format} eq 'html') { $form->{padding} = "  "; $form->{bold} = ""; $form->{endbold} = ""; @@ -1040,9 +1030,12 @@ sub generate_ustva { } if ($form->{format} eq 'elster') { - if ($form->{duetyp} eq '13'){ + if ($form->{duetyp} eq '13') { $form->header; - USTVA::info($locale->text('Impossible to create yearly Tax Report via Winston.
Not yet implemented!')); + USTVA::info( + $locale->text( + 'Impossible to create yearly Tax Report via Winston.
Not yet implemented!' + )); } else { &create_winston(); } @@ -1052,14 +1045,18 @@ sub generate_ustva { $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'){ + $form->{IN} = 'USTE' + if ( $form->{duetyp} eq '13' + && $form->{format} ne 'html'); + + if ($form->{IN} eq 'USTE') { $form->header; - USTVA::info($locale->text('Impossible to create yearly Tax Report as PDF or PS.
Not yet implemented!')); + USTVA::info( + $locale->text( + 'Impossible to create yearly Tax Report as PDF or PS.
Not yet implemented!' + )); } - + $form->{IN} .= "-$form->{year}" if ( $form->{format} eq 'pdf' or $form->{format} eq 'postscript'); @@ -1079,6 +1076,7 @@ sub generate_ustva { sub edit { $lxdebug->enter_sub(); + # edit all taxauthority prefs $form->header; @@ -1101,16 +1099,14 @@ sub edit { + . $locale->text('Finanzamt - Einstellungen') . qq|
| - . $locale->text('Finanzamt - Einstellungen') - . qq|

| - . $locale->text('Angaben zum Finanzamt') - . qq| + . $locale->text('Angaben zum Finanzamt') . qq| |; #print qq|$form->{terminal}|; @@ -1160,8 +1156,7 @@ sub edit { print qq| + . $locale->text('Dauerfristverlängerung') . qq|

@@ -1214,8 +1209,7 @@ sub edit {

+ . $locale->text('debug') . qq|">--> |; print qq| text('USTVA-Hint: Tax Authoritys')) if ( $form->{elsterFFFF_new} eq 'Auswahl' || $form->{elsterland_new} eq 'Auswahl'); - USTVA::info( - $locale->text( - 'Es fehlen Angaben zur Versteuerung. - Wenn Sie Ist Versteuert sind, wählen Sie die Einnahmen/Überschuß-Rechnung aus. - Sind Sie Soll-Versteuert und Bilanzverpflichtet, dann wählen Sie Bilanz aus.' - )) + USTVA::info( $locale->text('Missing Method!') . "\n" + . $locale->text('USTVA-Hint: Method')) 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) - my $change = - $form->{elsterland} eq $form->{elsterland_new} + my $change = $form->{elsterland} eq $form->{elsterland_new} && $form->{elsterFFFF} eq $form->{elsterFFFF_new} ? '0' : '1'; $change = '0' if ($form->{saved} eq $locale->text('saved')); my $elster_init = &elster_hash(); @@ -1364,8 +1351,7 @@ sub edit_form { + . $locale->text('Finanzamt - Einstellungen') . qq|
| - . $locale->text('Finanzamt - Einstellungen') - . qq|
@@ -1604,8 +1590,7 @@ sub show_fa_daten {
| - . $locale->text('Finanzamt') - . qq| $form->{FA_Name} + . $locale->text('Finanzamt') . qq| $form->{FA_Name} |; @@ -1967,6 +1952,7 @@ Content-Disposition: attachment; filename="$elsterfile"\n\n|; sub continue { $lxdebug->enter_sub(); + # allow Symbolic references just here: no strict 'refs'; &{ $form->{nextsub} }; @@ -1974,9 +1960,9 @@ sub continue { $lxdebug->leave_sub(); } -sub back { +sub back { $lxdebug->enter_sub(); - &{ $form->{lastsub} }; + &{ $form->{lastsub} }; $lxdebug->leave_sub(); }