X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fustva.pl;h=1ebd6ac9cac10e08eaf774736bb03f52593bc218;hb=eadefca5b4f50d7ec0d109efde75b6ee4c0f5e12;hp=1bab65166c1977e08f75ce20aea99125f88a2170;hpb=ee072e4f077213bf6f8792ca8f0a1afebbb6282f;p=kivitendo-erp.git diff --git a/bin/mozilla/ustva.pl b/bin/mozilla/ustva.pl index 1bab65166..1ebd6ac9c 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||; @@ -726,14 +737,14 @@ sub ustva_vorauswahl { - + |; } foreach $key (sort keys %listeb) { print qq| - + |; } print qq||; @@ -748,7 +759,9 @@ sub config { } sub debug { + $lxdebug->enter_sub(); $form->debug(); + $lxdebug->leave_sub(); } sub show_options { @@ -975,14 +988,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 +1011,25 @@ sub generate_ustva { $form->{endbold} = "}"; $form->{br} = '\\\\'; + my @numbers = qw(51r 86r 97r 93r 96 43 45 66 62 67); 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} = ""; @@ -1034,7 +1065,6 @@ sub generate_ustva { sub edit { $lxdebug->enter_sub(); - # edit all taxauthority prefs $form->header; @@ -1045,6 +1075,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 +1148,7 @@ sub edit { - +
@@ -1158,7 +1193,7 @@ sub edit { - +

@@ -1167,8 +1202,16 @@ sub edit { + |; + print qq| + | if ($callback ne ''); + print qq| +     + @@ -1177,14 +1220,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 +1278,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 +1384,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 +1425,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 +1439,7 @@ sub edit_form { + |; $lxdebug->leave_sub(); @@ -1443,8 +1486,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 +1523,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 +1608,16 @@ sub show_fa_daten { + + + + +
+ | . $locale->text('Finanzamt') . qq| +
+ + +
@@ -1581,7 +1641,7 @@ sub show_fa_daten { | . $locale->text('Telefon') . qq|

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

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

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

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

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

-
+
| . $locale->text('Bankleitzahl (BLZ)') . qq|
@@ -1704,7 +1764,7 @@ sub show_fa_daten { } print qq|
|; @@ -1801,7 +1861,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 +1953,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 +1960,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 +2102,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 +2208,4 @@ sub elster_xml { close XML; $lxdebug->leave_sub(); } +