From ccd0b365250f57021a756203f65a4d153709b45d Mon Sep 17 00:00:00 2001 From: Udo Spallek Date: Wed, 18 Jul 2007 09:12:11 +0000 Subject: [PATCH] =?utf8?q?Generischer=20USTVA=20Report=20f=C3=BCr=20alle?= =?utf8?q?=20Kontenrahmen=20ausser=20Germany?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/USTVA.pm | 27 +++++- bin/mozilla/ustva.pl | 86 ++++++++++++------- locale/de/all | 8 +- templates/webpages/ustva/config_step1_de.html | 3 +- .../webpages/ustva/config_step1_master.html | 3 +- templates/webpages/ustva/config_step2_de.html | 7 ++ .../webpages/ustva/config_step2_master.html | 7 ++ .../webpages/ustva/generic_taxreport_de.html | 26 ++++++ .../ustva/generic_taxreport_master.html | 26 ++++++ templates/webpages/ustva/report_de.html | 44 ++++------ templates/webpages/ustva/report_master.html | 45 ++++------ 11 files changed, 191 insertions(+), 91 deletions(-) create mode 100644 templates/webpages/ustva/generic_taxreport_de.html create mode 100644 templates/webpages/ustva/generic_taxreport_master.html diff --git a/SL/USTVA.pm b/SL/USTVA.pm index 365520874..658e2c766 100644 --- a/SL/USTVA.pm +++ b/SL/USTVA.pm @@ -25,6 +25,31 @@ package USTVA; +use SL::DBUtils; + +sub get_coa { + + my ( $self, $form, $myconfig) = @_; + + my $query = q{ SELECT coa FROM defaults }; + + my $dbh = $form->dbconnect($myconfig); + my $sth = $dbh->prepare($query); + $sth->execute() || $form->dberror($query); + + my ($coa) = selectrow_query($form, $dbh, $query); + + $sth->finish; + $dbh->disconnect; + + $form->{coa} = $coa; + $form->{"COA_$coa"} = '1'; + $form->{COA_Germany} = '1' if ( $coa eq 'Germany-DATEV-SKR03EU' or $coa eq 'Germany-DATEV-SKR04EU'); + + return; +} + + sub report_variables { # Get all positions for taxreport out of the database # Needs Databaseupdate Pg-upgrade2/USTVA_abstraction.pl @@ -53,8 +78,6 @@ sub report_variables { $where_dcp |; - $main::lxdebug->message(LXDebug::QUERY, "\$query= \n $query\n"); - my $dbh = $form->dbconnect($myconfig); my $sth = $dbh->prepare($query); diff --git a/bin/mozilla/ustva.pl b/bin/mozilla/ustva.pl index b7b66fbbc..4229d24c3 100644 --- a/bin/mozilla/ustva.pl +++ b/bin/mozilla/ustva.pl @@ -197,12 +197,16 @@ sub report { } ]; + # Which COA is in use? + USTVA->get_coa($form, $myconfig); + my $template_ref = { openings => $openings, company_given => $company_given, address_given => $address_given, taxnumber_given => $taxnumber_given, + taxnumber => $myconfig->{taxnumber}, select_year => $select_year, period_local => $period_local, method_local => $method_local, @@ -210,6 +214,7 @@ sub report { checkbox_kz_10 => $checkbox_kz_10, tax_office_banks => $tax_office_banks_ref, select_options => &show_options, + }; print($form->parse_html_template('ustva/report', $template_ref)); @@ -1005,39 +1010,45 @@ sub generate_ustva { exit(0); } - # Austria - } elsif ($form->{coa} eq 'Austria') { - - # - # Outputformat specific customisation's - # + + } else # Outputformat for generic output + { - my @category_euro = qw( - 511 861 36 80 971 931 98 96 53 74 - 85 65 66 61 62 67 63 64 59 69 - 39 83 811 891 Z43 Z45 Z53 Z62 Z65 Z67 - 41 44 49 43 48 51 86 35 77 76 91 89 - 97 93 95 94 42 60 45 52 73 84 81 - ); - + my @category_cent = USTVA->report_variables({ + myconfig => \%myconfig, + form => $form, + type => '', + attribute => 'position', + dec_places => '2', + }); - if ( $form->{format} eq 'html') { # Formatierungen für HTML Ausgabe + my @category_euro = USTVA->report_variables({ + myconfig => \%myconfig, + form => $form, + type => '', + attribute => 'position', + dec_places => '0', + }); - $form->{IN} = $form->{type} . '.html'; - $form->{padding} = "  "; - $form->{bold} = ""; - $form->{endbold} = ""; - $form->{br} = "
"; - $form->{address} =~ s/\\n/\n/g; + $form->{"Watchdog::USTVA"} = 1; + $form->{USTVA} = []; - foreach $number (@category_euro) { - $form->{$number} = $form->format_amount(\%myconfig, $form->{$number}, '2', '0'); + if ( $form->{format} eq 'generic') { # Formatierungen für HTML Ausgabe + + my $rec_ref = {}; + for my $kennziffer (@category_cent, @category_euro) { + $rec_ref = {}; + $rec_ref->{id} = $kennziffer; + $rec_ref->{amount} = $form->format_amount(\%myconfig, $form->{$kennziffer}, 2, '0'); + + $lxdebug->message($LXDebug::DEBUG, "Kennziffer $kennziffer: '$form->{$kennziffer}'" ); + $lxdebug->dump($LXDebug::DEBUG, $rec_ref ); + push @ { $form->{USTVA} }, $rec_ref; } + } - - } - # end nation specific customisations + } if ( $form->{period} eq '13' and $form->{format} ne 'html') { $form->header; @@ -1050,7 +1061,22 @@ sub generate_ustva { $form->{templates} = $myconfig{templates}; $form->{templates} = "doc" if ( $form->{type} eq 'help' ); - $form->parse_template(\%myconfig, $userspath); + if ($form->{format} eq 'generic'){ + + $form->header(); + + $template_ref = { + taxnumber => $myconfig{taxnumber}, + }; + + print($form->parse_html_template2('ustva/generic_taxreport', $template_ref)); + + } else + { + + $form->parse_template(\%myconfig, $userspath); + + } $lxdebug->leave_sub(); } @@ -1115,6 +1141,10 @@ sub config_step1 { { 'variable' => $variable, 'value' => $form->{$variable} }; } +# Which COA is in use? + + USTVA->get_coa($form, \%myconfig); + # hä? kann die weg? my $steuernummer_new = ''; @@ -1257,8 +1287,6 @@ sub config_step2 { saved callback ); - - foreach my $variable (@_hidden_form_variables) { push @{ $_hidden_variables_ref}, { 'variable' => $variable, 'value' => $form->{$variable} }; diff --git a/locale/de/all b/locale/de/all index 6103e469f..c970c9e71 100644 --- a/locale/de/all +++ b/locale/de/all @@ -527,6 +527,7 @@ aktualisieren wollen?', 'From' => 'Von', 'GL Transaction' => 'Dialogbuchung', 'General Ledger' => 'Finanzbuchhaltung', + 'Generic Tax Report' => 'USTVA Bericht', 'Given Name' => 'Vorname', 'Greeting' => 'Anrede', 'Group' => 'Warengruppe', @@ -543,8 +544,6 @@ aktualisieren wollen?', 'Help' => 'Hilfe', 'Here\'s an example command line:' => 'Hier ist eine Kommandozeile, die als Beispiel dient:', 'Hide by default' => 'Standardmäßig verstecken', - 'Hint-Missing-Preferences' => 'Bitte fehlende USTVA Einstellungen ergänzen (Menüpunkt: System-> UStVA Einstellungen)', - 'Hints' => 'Hinweise', 'History' => 'Historie', 'History Search' => 'Historien Suche', 'History Search Engine' => 'Historien Suchmaschine', @@ -710,7 +709,6 @@ aktualisieren wollen?', 'Missing \'description\' field.' => 'Fehlendes Feld \'description\'.', 'Missing \'tag\' field.' => 'Fehlendes Feld \'tag\'.', 'Missing Method!' => 'Fehlender Voranmeldungszeitraum', - 'Missing Preferences: Outputroutine disabled' => 'Die Ausgabefunktionen sind wegen unzureichender Voreinstellungen deaktiviert!', 'Missing Tax Authoritys Preferences' => 'Fehlende Angaben zum Finanzamt!', 'Missing amount' => 'Fehlbetrag', 'Mitarbeiter' => 'Mitarbeiter', @@ -851,6 +849,8 @@ aktualisieren wollen?', 'Please enter a license key.' => 'Bitte geben Sie einen Lizenzschlüssel an.', 'Please enter a number of licenses.' => 'Bitte geben Sie die Anzahl Lizenzschlüssel an.', 'Please enter the name of the dataset you want to restore the backup in.' => 'Bitte geben Sie den Namen der Datenbank ein, in der Sie die Sicherung wiederherstellen wollen.', + 'Please enter the taxnumber in the administration menu userpreferences' => 'Bitte bei den Einstellungen des aktuellen Benutzers im Administrationsmodul + angeben.', 'Please enter values' => 'Bitte Werte eingeben', 'Please insert object dimensions below.' => 'Bitte geben Sie die Abmessungen unten ein', 'Please insert your language values below' => 'Bitte die Übersetzungen unten eintragen', @@ -1079,6 +1079,7 @@ aktualisieren wollen?', 'Tax Percent is a number between 0 and 100' => 'Prozentsatz muss zwischen 1% und 100% liegen', 'Tax Period' => 'Voranmeldungszeitraum', + 'Tax Position' => 'Position', 'Tax collected' => 'vereinnahmte Steuer', 'Tax deleted!' => 'Steuer gelöscht!', 'Tax number' => 'Steuernummer', @@ -1096,6 +1097,7 @@ aktualisieren wollen?', 'Taxkey_coa' => 'Steuerschlüssel', 'Taxkeys and Taxreport Preferences' => 'Steuerautomatik und UStVA', 'Taxlink_coa' => 'Steuerautomatik', + 'Taxnumber' => 'Steuernummer', 'Taxrate missing!' => 'Prozentsatz fehlt!', 'Tel' => 'Tel', 'Tel.' => 'Telefon', diff --git a/templates/webpages/ustva/config_step1_de.html b/templates/webpages/ustva/config_step1_de.html index 3ff7b9b62..9b05b7ce4 100644 --- a/templates/webpages/ustva/config_step1_de.html +++ b/templates/webpages/ustva/config_step1_de.html @@ -11,13 +11,14 @@
+
Angaben zum Finanzamt

- +
Versteuerungs Verfahren diff --git a/templates/webpages/ustva/config_step1_master.html b/templates/webpages/ustva/config_step1_master.html index ab985b4ef..4f5421fbe 100644 --- a/templates/webpages/ustva/config_step1_master.html +++ b/templates/webpages/ustva/config_step1_master.html @@ -11,13 +11,14 @@
+
Local Tax Office Preferences

- +
Taxation diff --git a/templates/webpages/ustva/config_step2_de.html b/templates/webpages/ustva/config_step2_de.html index 6f1290bdb..07c0d2682 100644 --- a/templates/webpages/ustva/config_step2_de.html +++ b/templates/webpages/ustva/config_step2_de.html @@ -155,7 +155,14 @@ Steuernummer
+ + +Bitte bei den Einstellungen des aktuellen Benutzers im Administrationsmodul + angeben. + + +

diff --git a/templates/webpages/ustva/config_step2_master.html b/templates/webpages/ustva/config_step2_master.html index 1ec0294fd..616a292dd 100644 --- a/templates/webpages/ustva/config_step2_master.html +++ b/templates/webpages/ustva/config_step2_master.html @@ -155,7 +155,14 @@ Tax Number
+ + +Please enter the taxnumber in the administration menu user +preferences + + +

diff --git a/templates/webpages/ustva/generic_taxreport_de.html b/templates/webpages/ustva/generic_taxreport_de.html new file mode 100644 index 000000000..cf5a021ac --- /dev/null +++ b/templates/webpages/ustva/generic_taxreport_de.html @@ -0,0 +1,26 @@ +[% USE HTML %] + +

USTVA Bericht

+

Steuernummer: [% taxnumber %]

+

Jahr: [% year %]

+

Zeitraum: [% period %]

+
+ + + + + +[% SET row_odd = '1' %] +[% FOREACH row = USTVA %] + + + + + +[% END %] + +
PositionBetrag
[% HTML.escape(row.id) %][% HTML.escape(row.amount) %]
+ + + diff --git a/templates/webpages/ustva/generic_taxreport_master.html b/templates/webpages/ustva/generic_taxreport_master.html new file mode 100644 index 000000000..c93a95565 --- /dev/null +++ b/templates/webpages/ustva/generic_taxreport_master.html @@ -0,0 +1,26 @@ +[% USE HTML %] + +

Generic Tax Report

+

Taxnumber: [% taxnumber %]

+

Year: [% year %]

+

Period: [% period %]

+
+ + + + + +[% SET row_odd = '1' %] +[% FOREACH row = USTVA %] + + + + + +[% END %] + +
Tax PositionAmount
[% HTML.escape(row.id) %][% HTML.escape(row.amount) %]
+ + + \ No newline at end of file diff --git a/templates/webpages/ustva/report_de.html b/templates/webpages/ustva/report_de.html index 2411b4dde..dd4b75d0b 100644 --- a/templates/webpages/ustva/report_de.html +++ b/templates/webpages/ustva/report_de.html @@ -37,14 +37,18 @@

+ Steuernummer:  +
ELSTER-Steuernummer: 

- + + +

@@ -52,12 +56,12 @@
+ title="Beraterdaten in UStVA übernehmen?" + name="FA_steuerberater" + id="steuerberater" + class="checkbox" + type="checkbox" + value="1" >  Steuerberater/-in @@ -91,9 +95,6 @@
- - -
Finanzamt @@ -160,26 +161,15 @@ Ausgabeformat + -
- - + + + - -
- - Hinweise - -

- Die Ausgabefunktionen sind wegen unzureichender Voreinstellungen deaktiviert! -

-

Hilfe

-
    -
  • Bitte fehlende USTVA Einstellungen ergänzen (Menüpunkt: System-> UStVA Einstellungen)
  • -
- - diff --git a/templates/webpages/ustva/report_master.html b/templates/webpages/ustva/report_master.html index 9f195539e..09ae195a0 100644 --- a/templates/webpages/ustva/report_master.html +++ b/templates/webpages/ustva/report_master.html @@ -37,14 +37,18 @@

+ Tax Number:  +
ELSTER Tax Number

- + + +

@@ -52,12 +56,12 @@
+ title="Assume Tax Consultant Data in Tax Computation?" + name="FA_steuerberater" + id="steuerberater" + class="checkbox" + type="checkbox" + value="1" >  Tax Consultant @@ -91,9 +95,6 @@
- - -
Tax Office @@ -160,27 +161,15 @@ Outputformat + -
- - + + + - -
- - Hints - -

- Missing Preferences: Outputroutine - disabled -

-

Help

-
    -
  • Hint-Missing-Preferences
  • -
- - -- 2.20.1