X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fustva.pl;h=6fa1ed75ee2ba2c3459cfc90c48a8cb3fc091e87;hb=82ee22347be2f2ee96d09a9fd0b45710f9552582;hp=1bab65166c1977e08f75ce20aea99125f88a2170;hpb=0576299f2aa98125991c4ffcd2f75073ea583d7d;p=kivitendo-erp.git diff --git a/bin/mozilla/ustva.pl b/bin/mozilla/ustva.pl index 1bab65166..6fa1ed75e 100644 --- a/bin/mozilla/ustva.pl +++ b/bin/mozilla/ustva.pl @@ -109,9 +109,17 @@ 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 - company_street company_city company_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 + co_fax co_fax1 co_email co_email1 co_url co_url1 ustid duns + co_bankname co_bankname1 co_bankname2 co_bankname3 co_blz co_blz1 + co_blz2 co_blz3 co_accountnr co_accountnr1 co_accountnr2 co_accountnr3); + map { $form->{$_} = $myconfig->{$_} } @a; my $oeffnungszeiten = $form->{FA_Oeffnungszeiten}; @@ -132,35 +140,46 @@ 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 + # - #klären, ob $form->{company_street|_address} gesetzt sind - ### if ($form->{address} ne '') { my $temp = $form->{address}; $temp =~ s/\\n/
/; - print qq|$temp|; - ($form->{company_street}, $form->{company_city}) = split("
{address} eq '' - and ($form->{company_street} ne '' and $form->{company_city} ne '')) { - print qq|$form->{company_street}
\n| if ($form->{company_street} ne ''); - print qq|$form->{company_city}\n| if ($form->{company_city} ne ''); - } elsif ($form->{company_street} eq '' or $form->{company_city} eq '') { + ($form->{co_street}, $form->{co_city}) = split("
", $temp); + } + + 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 { 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}; + + print qq|

| . $locale->text('Tel.: ') . qq| - $form->{tel} + $form->{co_tel}
| . $locale->text('Fax.: ') . qq| - $form->{fax} + $form->{co_fax}

- $form->{email} + $form->{co_email}

| . $locale->text('Steuernummer: ') . qq| @@ -192,7 +211,7 @@ sub report { . qq|" name="FA_steuerberater" id=steuerberater class=checkbox type=checkbox value="1">  | . $locale->text('Steuerberater/-in') . qq| - + $form->{FA_steuerberater_name}
$form->{FA_steuerberater_street}
$form->{FA_steuerberater_city}
@@ -214,7 +233,7 @@ sub report { # accounting years if SQL-Ledger Version < 2.4.1 # $year = $form->{year} * 1; - @years = sort { $b <=> $a } (2000 .. ($year)); + @years = sort { $b <=> $a } (2000 .. ($year+1)); $form->{all_years} = \@years; } map { $form->{selectaccountingyear} .= qq| - + |; } print qq||; @@ -648,10 +661,12 @@ sub ustva_vorauswahl { } elsif ($form->{FA_voranmeld} eq 'quarter') { # Vorauswahl bei quartalsweisem Voranmeldungszeitraum - my %liste = ('A' => '1.', - 'B' => '2.', - 'C' => '3.', - 'D' => '4.',); + 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; @@ -689,9 +704,7 @@ sub ustva_vorauswahl { my $selected = ''; $selected = 'selected' if ($sel eq $key); print qq| - + |; } print qq|\n @@ -703,10 +716,10 @@ sub ustva_vorauswahl { print qq||; @@ -748,7 +760,9 @@ sub config { } sub debug { + $lxdebug->enter_sub(); $form->debug(); + $lxdebug->leave_sub(); } sub show_options { @@ -817,106 +831,106 @@ sub generate_ustva { #yearly report if ($form->{duetyp} eq "13") { - $form->{fromdate} = "1.1.$form->{year}"; - $form->{todate} = "31.12.$form->{year}"; + $form->{fromdate} = "$form->{year}-01-01"; + $form->{todate} = "$form->{year}-12-31"; } #Quater reports if ($form->{duetyp} eq "A") { - $form->{fromdate} = "1.1.$form->{year}"; - $form->{todate} = "31.3.$form->{year}"; + $form->{fromdate} = "$form->{year}-01-01"; + $form->{todate} = "$form->{year}-03-31"; $form->{'0441'} = "X"; } if ($form->{duetyp} eq "B") { - $form->{fromdate} = "1.4.$form->{year}"; - $form->{todate} = "30.6.$form->{year}"; + $form->{fromdate} = "$form->{year}-04-01"; + $form->{todate} = "$form->{year}-06-30"; $form->{'0442'} = "X"; } if ($form->{duetyp} eq "C") { - $form->{fromdate} = "1.7.$form->{year}"; - $form->{todate} = "30.9.$form->{year}"; + $form->{fromdate} = "$form->{year}-07-01"; + $form->{todate} = "$form->{year}-09-30"; $form->{'0443'} = "X"; } if ($form->{duetyp} eq "D") { - $form->{fromdate} = "1.10.$form->{year}"; - $form->{todate} = "31.12.$form->{year}"; + $form->{fromdate} = "$form->{year}-10-01"; + $form->{todate} = "$form->{year}-12-31"; $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}-01-01"; + $form->{todate} = "$form->{year}-01-31"; $form->{'0401'} = "X"; last SWITCH; }; $form->{duetyp} eq "02" && do { - $form->{fromdate} = "1.2.$form->{year}"; + $form->{fromdate} = "$form->{year}-02-01"; #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}-03-01"; + $form->{todate} = "$form->{year}-03-31"; $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}-04-01"; + $form->{todate} = "$form->{year}-04-30"; $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}-05-01"; + $form->{todate} = "$form->{year}-05-31"; $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}-06-01"; + $form->{todate} = "$form->{year}-06-30"; $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}-07-01"; + $form->{todate} = "$form->{year}-07-31"; $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}-08-01"; + $form->{todate} = "$form->{year}-08-31"; $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}-09-01"; + $form->{todate} = "$form->{year}-09-30"; $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}-10-01"; + $form->{todate} = "$form->{year}-10-31"; $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}-11-01"; + $form->{todate} = "$form->{year}-11-30"; $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}-12-01"; + $form->{todate} = "$form->{year}-12-31"; $form->{"0412"} = "X"; last SWITCH; }; @@ -924,7 +938,10 @@ sub generate_ustva { } #$myconfig = \%myconfig; - RP->ustva(\%myconfig, \%$form); + #$myconfig->{dateformat} = 'yyyy-mm-dd'; + #$form->{fromdate}= $locale->date(\%myconfig, $form->{fromdate}, 0, 0, 0); + #$form->{todate}= $locale->date(\%myconfig, $form->{todate}, 0, 0, 0); + USTVA->ustva(\%myconfig, \%$form); #??($form->{department}) = split /--/, $form->{department}; @@ -975,14 +992,20 @@ sub generate_ustva { $locale->date(\%myconfig, $form->current_date(\%myconfig), 0, 0, 0); # setup variables for the form - my @a = (); - @a = qw(company businessnumber tel fax email company_email); + # 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 + co_fax co_fax1 co_email co_email1 co_url co_url1 ustid duns + co_bankname co_bankname1 co_bankname2 co_bankname3 co_blz co_blz1 + co_blz2 co_blz3 co_accountnr co_accountnr1 co_accountnr2 co_accountnr3); + map { $form->{$_} = $myconfig{$_} } @a; if ($form->{address} ne '') { my $temp = $form->{address}; $temp =~ s/\\n/
/; - ($form->{company_street}, $form->{company_city}) = split("
", $temp); + ($form->{co_street}, $form->{co_city}) = split("
", $temp); } if ( $form->{format} eq 'pdf' @@ -992,13 +1015,27 @@ 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 = ''; - foreach $number (@numbers) { - $form->{$number} =~ s/,/~~/g; + # 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; + } + } + if ($myconfig{numberformat} eq '1000.00' or + $myconfig{numberformat} eq '1,000.00') { + foreach $number (@numbers) { + $form->{$number} =~ s/\./~~/g; + } } - } elsif ($form->{format} eq 'html') { + # Formatierungen für HTML Ausgabe + } elsif ($form->{format} eq 'html') { $form->{padding} = "  "; $form->{bold} = ""; $form->{endbold} = ""; @@ -1008,13 +1045,26 @@ sub generate_ustva { } if ($form->{format} eq 'elster') { - &create_winston(); + if ($form->{duetyp} eq '13'){ + $form->header; + USTVA::info($locale->text('Impossible to create yearly Tax Report via Winston.
Not yet implemented!')); + } else { + &create_winston(); + } } else { $form->{templates} = $myconfig{templates}; $form->{templates} = "doc" if ($form->{type} eq 'help'); $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->header; + 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'); @@ -1034,7 +1084,6 @@ sub generate_ustva { sub edit { $lxdebug->enter_sub(); - # edit all taxauthority prefs $form->header; @@ -1045,6 +1094,11 @@ sub edit { my $land = $form->{elsterland}; my $amt = $form->{elsterFFFF}; + my $callback = ''; + $callback = + "$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'); print qq| @@ -1113,7 +1167,7 @@ sub edit { - +
@@ -1158,7 +1212,7 @@ sub edit { - +

@@ -1167,8 +1221,16 @@ sub edit { + |; + print qq| + | if ($callback ne ''); + print qq| +     + @@ -1177,14 +1239,14 @@ sub edit { my @variables = qw( steuernummer elsterland elstersteuernummer elsterFFFF); my $variable = ''; foreach $variable (@variables) { - print qq| + print qq| |; } my $steuernummer_new = ''; # print qq| - + {$variable}">|; } @@ -1235,8 +1297,8 @@ sub edit_form { || $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. + '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.' )) if ($form->{method} eq ''); @@ -1341,18 +1403,17 @@ sub edit_form { - - - - |; + |; + print qq|| + if ($form->{callback} eq ''); + + print qq| + | + if ($form->{callback} ne ''); if ($form->{warnung} eq "1") { print qq| @@ -1383,7 +1444,7 @@ sub edit_form { my @variables = qw(FA_steuerberater_name FA_steuerberater_street FA_steuerberater_city FA_steuerberater_tel FA_voranmeld method - FA_dauerfrist FA_71 FA_Name elster + FA_dauerfrist FA_71 elster path login password type elster_init saved ); my $variable = ''; @@ -1397,6 +1458,7 @@ sub edit_form { + |; $lxdebug->leave_sub(); @@ -1443,8 +1505,15 @@ sub get_config { my ($userpath, $filename) = @_; my ($key, $value) = ''; - open(FACONF, "$userpath/$filename") - or $form->error("$userpath/$filename : $!"); + open(FACONF, "$userpath/$form->{login}_$filename") + or #falls Datei nicht vorhanden ist + sub { + open(FANEW, ">$userpath/$form->{login}_$filename") + or $form->error("$userpath/$filename : $!"); + close FANEW; + open(FACONF, "$userpath/$form->{login}_$filename") + or $form->error("$userpath/$form->{username}_$filename : $!"); + }; while () { last if /^\[/; next if /^(#|\s)/; @@ -1473,7 +1542,7 @@ sub get_config { sub save { $lxdebug->enter_sub(); - my $filename = $form->{filename}; + my $filename = "$form->{login}_$form->{filename}"; #zuerst die steuernummer aus den part, parts_X_Y und delimiter herstellen create_steuernummer; @@ -1558,6 +1627,16 @@ sub show_fa_daten { + + + + +
+ | . $locale->text('Finanzamt') . qq| +
+ + +
@@ -1581,7 +1660,7 @@ sub show_fa_daten { | . $locale->text('Telefon') . qq|

-
+
| . $locale->text('Fax') . qq|

@@ -1620,7 +1699,7 @@ sub show_fa_daten { | . $locale->text('Bankverbindungen des Finanzamts') . qq| - +
- +
| . $locale->text('Kreditinstitut') . qq| @@ -1632,7 +1711,7 @@ sub show_fa_daten {

-
+
| . $locale->text('Bankleitzahl') . qq|
@@ -1647,7 +1726,7 @@ sub show_fa_daten {

-
+
| . $locale->text('Bankleitzahl') . qq|
@@ -1667,7 +1746,7 @@ sub show_fa_daten {

-
+
| . $locale->text('Bankleitzahl (BLZ)') . qq|
@@ -1685,12 +1764,12 @@ sub show_fa_daten { | . $locale->text('Bankverbindung des Finanzamts') . qq| - + | . $locale->text('Kontonummer') . qq|

-
+
| . $locale->text('Bankleitzahl (BLZ)') . qq|
@@ -1704,7 +1783,7 @@ sub show_fa_daten { } print qq|
|; @@ -1801,7 +1880,7 @@ SWITCH: do { $form->error( "Ungültiger Anmeldezeitraum.\n - Sie können für ELSTER nur einen monatlichen oder + Sie können für ELSTER nur einen monatlichen oder quartalsweisen Anmeldezeitraum auswählen." ); }; @@ -1893,7 +1972,6 @@ Content-Disposition: attachment; filename="$elsterfile"\n\n|; sub continue { $lxdebug->enter_sub(); - # allow Symbolic references just here: no strict 'refs'; &{ $form->{nextsub} }; @@ -1901,7 +1979,11 @@ sub continue { $lxdebug->leave_sub(); } -sub back { &{ $form->{lastsub} } } +sub back { + $lxdebug->enter_sub(); + &{ $form->{lastsub} }; + $lxdebug->leave_sub(); +} sub elster_hash { $lxdebug->enter_sub(); @@ -2039,15 +2121,13 @@ sub elster_conf { '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 @@ -2147,3 +2227,4 @@ sub elster_xml { close XML; $lxdebug->leave_sub(); } +