X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fustva.pl;h=99210941cc879ed23e202e57bcaec1acd25625e5;hb=f2c923a10719d3a9e26448b7d83f38051466bf2c;hp=2151c4ab12eed6f97683e0655971251fab9bc8ae;hpb=c2ed42c3f435937925ef825de61f2520196d1de6;p=kivitendo-erp.git diff --git a/bin/mozilla/ustva.pl b/bin/mozilla/ustva.pl index 2151c4ab1..99210941c 100644 --- a/bin/mozilla/ustva.pl +++ b/bin/mozilla/ustva.pl @@ -76,7 +76,11 @@ sub report { $form->{title} = $locale->text('UStVA'); $form->{kz10} = ''; #Berichtigte Anmeldung? Ja =1 - 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 = ''; @@ -103,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 @@ -134,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 # @@ -143,26 +147,27 @@ sub report { my $temp = $form->{address}; $temp =~ s/\\n//; ($form->{co_street}, $form->{co_city}) = split("", $temp); + $form->{co_city} =~ s/\\n//g; } - 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| @@ -187,10 +192,10 @@ sub report { Keine Steuernummer hinterlegt!|; } print qq| - + @@ -227,7 +232,7 @@ sub report { # accounting years if SQL-Ledger Version < 2.4.1 # $year = $form->{year} * 1; - @years = sort { $b <=> $a } (2003 .. ($year+1)); + @years = sort { $b <=> $a } (2003 .. ($year + 1)); $form->{all_years} = \@years; } map { $form->{selectaccountingyear} .= qq|$_\n| } @@ -408,31 +413,6 @@ sub report { |; - # Stichtag der nächsten USTVA berechnen - # - # ($stichtag, $tage_bis, $ical) = FA->stichtag($today[dd.mm.yyyy], - # $FA_dauerfrist[1,0], - # $FA_voranmeld[month, quarter]) - #$tmpdateform= $myconfig{dateformat}; - # $myconfig{dateformat}= "dd.mm.yyyy"; - # $form->{today} = $form->datetonum($form->current_date(\%myconfig), \%myconfig); - # ($stichtag, $description, $tage_bis, $ical) = FA::stichtag($form->{today}, $form->{FA_dauerfrist},$form->{FA_voranmeld}); - # $form->{today} = $form->date($stichtag, \%myconfig ); - #$myconfig{dateformat}= $tmpdateform; - - #print qq| - # - # - # - # - # |.$locale->text('Anstehende Voranmeldungen').qq| - # - # $stichtag - # $description - # $form->{today} - # - # |; - } else { print qq| @@ -440,12 +420,12 @@ sub report { | . $locale->text('Hinweise') . qq| - Die Ausgabefunktionen sind wegen unzureichender Voreinstellungen deaktiviert. - Hilfe: + | + . $locale->text('Missing Preferences: Outputroutine disabled') + . qq| + | . $locale->text('Help:') . qq| - Wählen Sie im Administrationsmenü den momentanen Benutzer aus - (siehe Kopfzeile). Dort können Sie fehlende Firmenangaben bzw. - die Steuernummer ergänzen. + | . $locale->text('Hint-Missing-Preferences') . qq| |; @@ -509,6 +489,7 @@ sub report { sub help { $lxdebug->enter_sub(); + # parse help documents under doc my $tmp = $form->{templates}; $form->{templates} = 'doc'; @@ -523,6 +504,7 @@ sub help { sub show { $lxdebug->enter_sub(); + #&generate_ustva(); no strict 'refs'; $lxdebug->leave_sub(); @@ -532,6 +514,7 @@ sub show { sub ustva_vorauswahl { $lxdebug->enter_sub(); + #Aktuelles Datum zerlegen: my $date = $form->datetonum($form->current_date(\%myconfig), \%myconfig); @@ -544,7 +527,7 @@ sub ustva_vorauswahl { Actual year from Database: $form->{year}\n Actual day from Database: $form->{day}\n Actual month from Database: $form->{month}\n|); - + my $sel = ''; my $yymmdd = ''; @@ -579,15 +562,14 @@ sub ustva_vorauswahl { '10' => 'October', '11' => 'November', '12' => 'December', - '13' => 'Yearly', - ); - + '13' => 'Yearly',); + my $yy = $form->{year} * 10000; $yymmdd = "$form->{year}$form->{month}$form->{day}" * 1; $yymmdd = 20060121; $sel = ''; - my $dfv = '0'; - + my $dfv = '0'; + # Offset für Dauerfristverlängerung $dfv = '100' if ($form->{FA_dauerfrist} eq '1'); @@ -653,8 +635,7 @@ sub ustva_vorauswahl { $selected = 'selected' if ($sel eq $key); print qq| | - . $locale->text("$liste{$key}") - . qq| + . $locale->text("$liste{$key}") . qq| |; } @@ -663,12 +644,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; @@ -735,20 +715,20 @@ sub ustva_vorauswahl { '10' => 'October', '11' => 'November', '12' => 'December', - '13' => 'Yearly', - ); + '13' => 'Yearly',); my $key = ''; foreach $key (sort keys %listea) { print qq| - $listea{$key} - |; + | + . $locale->text("$listea{$key}") + . qq|\n|; } foreach $key (sort keys %listeb) { print qq| - | . $locale->text("$listeb{$key}") . qq| - - |; + | + . $locale->text("$listeb{$key}") + . qq|\n|; } print qq||; } @@ -780,7 +760,7 @@ sub show_options { qq| | . $locale->text('Vorschau') . qq||; - if ($latex) { + if ($latex_templates) { $format .= qq| | . $locale->text('UStVA als PDF-Dokument') @@ -801,8 +781,7 @@ sub show_options { $type $media $format + . $locale->text('Ausgabeformat auswählen...') . qq|">$format |; $lxdebug->leave_sub(); } @@ -826,8 +805,13 @@ sub generate_ustva { #forgotten the year --> thisyear if ($form->{year} !~ m/^\d\d\d\d$/) { - $form->{year} = substr($form->datetonum($form->current_date(\%myconfig), \%myconfig),0,4); - $lxdebug->message(LXDebug::DEBUG1, qq|Actual year from Database: $form->{year}\n|); + $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 @@ -940,17 +924,16 @@ sub generate_ustva { # 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->{fromdate} = $locale->date(\%myconfig, $form->{fromdate}, 0, 0, 0); + $form->{todate} = $form->current_date($myconfig) unless $form->{todate}; - $form->{todate}= $locale->date(\%myconfig, $form->{todate}, 0, 0, 0); + $form->{todate} = $locale->date(\%myconfig, $form->{todate}, 0, 0, 0); $form->{period} = $locale->date(\%myconfig, $form->current_date(\%myconfig), 1, 0, 0); - # if there are any dates construct a where if ($form->{fromdate} || $form->{todate}) { @@ -1008,6 +991,7 @@ sub generate_ustva { my $temp = $form->{address}; $temp =~ s/\\n//; ($form->{co_street}, $form->{co_city}) = split("", $temp); + $form->{co_city} =~ s/\\n//g; } if ( $form->{format} eq 'pdf' @@ -1017,39 +1001,43 @@ sub generate_ustva { $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); - + 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} = ""; $form->{br} = ""; - $form->{address} =~ s/\\n//; + $form->{address} =~ s/\\n//g; } 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(); } @@ -1059,14 +1047,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'); @@ -1086,6 +1078,7 @@ sub generate_ustva { sub edit { $lxdebug->enter_sub(); + # edit all taxauthority prefs $form->header; @@ -1108,16 +1101,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}|; @@ -1167,8 +1158,7 @@ sub edit { print qq| | - . $locale->text('Dauerfristverlängerung') - . qq| + . $locale->text('Dauerfristverlängerung') . qq| @@ -1221,8 +1211,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(); @@ -1371,8 +1353,7 @@ sub edit_form { | - . $locale->text('Finanzamt - Einstellungen') - . qq| + . $locale->text('Finanzamt - Einstellungen') . qq| @@ -1611,8 +1592,7 @@ sub show_fa_daten { | - . $locale->text('Finanzamt') - . qq| $form->{FA_Name} + . $locale->text('Finanzamt') . qq| $form->{FA_Name} |; @@ -1926,7 +1906,7 @@ SWITCH: $form->parse_amount(\%myconfig, $form->{"66"}) * 100; # Vorsteuer 7% plus 16% my $k83 = - $form->parse_amount(\%myconfig, $form->{"67"}) * 100; # Umsätze zu 7% USt + $form->parse_amount(\%myconfig, $form->{"83"}) * 100 ; # Endbetrag my $k96 = $form->parse_amount(\%myconfig, $form->{"96"}) * 100; # # # Now build the xml content @@ -1936,7 +1916,7 @@ SWITCH: - $form->{elstersteuernummer} + $form->{elsterFFFF}$form->{elstersteuernummer} $form->{year} $azr |; @@ -1974,6 +1954,7 @@ Content-Disposition: attachment; filename="$elsterfile"\n\n|; sub continue { $lxdebug->enter_sub(); + # allow Symbolic references just here: no strict 'refs'; &{ $form->{nextsub} }; @@ -1981,9 +1962,9 @@ sub continue { $lxdebug->leave_sub(); } -sub back { +sub back { $lxdebug->enter_sub(); - &{ $form->{lastsub} }; + &{ $form->{lastsub} }; $lxdebug->leave_sub(); }