Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision a205ed21

Von Udo Spallek vor fast 18 Jahren hinzugefügt

  • ID a205ed210bf303bff2af7abcedf128c61d957f3a
  • Vorgänger 7b818ddc
  • Nachfolger 3d2c0212

- USTVA Screens in HTML-Templates verlagert
- USTVA Taxbird kleinere Anpassungen zur Kompatibilitaet
- quoting
- changelog angepasst

Unterschiede anzeigen:

SL/USTVA.pm
63 63
sub steuernummer_input {
64 64
  $main::lxdebug->enter_sub();
65 65

  
66
  ($elsterland, $elsterFFFF, $steuernummer) = @_;
66
  my ($self, $elsterland, $elsterFFFF, $steuernummer) = @_;
67 67

  
68
  my $steuernummer_input = '';
69
  
68 70
  $elster_land  = $elsterland;
69 71
  $elster_FFFF  = $elsterFFFF;
70 72
  $steuernummer = '0000000000' if ($steuernummer eq '');
71 73

  
72 74
  # $steuernummer formatieren (nur Zahlen) -> $stnr
73
  $stnr = $steuernummer;
75
  my $stnr = $steuernummer;
74 76
  $stnr =~ s/\D+//g;
75 77

  
76 78
  #Pattern description Elstersteuernummer
77 79
  my %elster_STNRformat = (
78
                        'Mecklenburg Vorpommern' => 'FFF/BBB/UUUUP',    # '/' 3
79
                        'Hessen'                 => '0FF BBB UUUUP',    # ' ' 3
80
                        'Nordrhein Westfalen'    => 'FFF/BBBB/UUUP',    # '/' 3
81
                        'Schleswig Holstein'     => 'FF BBB UUUUP',     # ' ' 2
82
                        'Berlin'                 => 'FF/BBB/UUUUP',     # '/' 3
83
                        'Th?ringen'              => 'FFF/BBB/UUUUP',    # '/' 3
84
                        'Sachsen'                => 'FFF/BBB/UUUUP',    # '/' 3
85
                        'Hamburg'                => 'FF/BBB/UUUUP',     # '/' 3
86
                        'Baden W?rtemberg'       => 'FF/BBB/UUUUP',     # '/' 2
87
                        'Sachsen Anhalt'         => 'FFF/BBB/UUUUP',    # '/' 3
88
                        'Saarland'               => 'FFF/BBB/UUUUP',    # '/' 3
89
                        'Bremen'                 => 'FF BBB UUUUP',     # ' ' 3
90
                        'Bayern'                 => 'FFF/BBB/UUUUP',    # '/' 3
91
                        'Rheinland Pfalz'        => 'FF/BBB/UUUU/P',    # '/' 4
92
                        'Niedersachsen'          => 'FF/BBB/UUUUP',     # '/' 3
93
                        'Brandenburg'            => 'FFF/BBB/UUUUP',    # '/' 3
80
      'Mecklenburg Vorpommern' => 'FFF/BBB/UUUUP',    # '/' 3
81
      'Hessen'                 => '0FF BBB UUUUP',    # ' ' 3
82
      'Nordrhein Westfalen'    => 'FFF/BBBB/UUUP',    # '/' 3
83
      'Schleswig Holstein'     => 'FF BBB UUUUP',     # ' ' 2
84
      'Berlin'                 => 'FF/BBB/UUUUP',     # '/' 3
85
      'Th?ringen'              => 'FFF/BBB/UUUUP',    # '/' 3
86
      'Sachsen'                => 'FFF/BBB/UUUUP',    # '/' 3
87
      'Hamburg'                => 'FF/BBB/UUUUP',     # '/' 3
88
      'Baden W?rtemberg'       => 'FF/BBB/UUUUP',     # '/' 2
89
      'Sachsen Anhalt'         => 'FFF/BBB/UUUUP',    # '/' 3
90
      'Saarland'               => 'FFF/BBB/UUUUP',    # '/' 3
91
      'Bremen'                 => 'FF BBB UUUUP',     # ' ' 3
92
      'Bayern'                 => 'FFF/BBB/UUUUP',    # '/' 3
93
      'Rheinland Pfalz'        => 'FF/BBB/UUUU/P',    # '/' 4
94
      'Niedersachsen'          => 'FF/BBB/UUUUP',     # '/' 3
95
      'Brandenburg'            => 'FFF/BBB/UUUUP',    # '/' 3
94 96
  );
95 97

  
96 98
  #split the pattern
97
  $elster_pattern = $elster_STNRformat{$elster_land};
99
  my $elster_pattern = $elster_STNRformat{$elster_land};
98 100
  my @elster_pattern = split(' ', $elster_pattern);
99 101
  my $delimiter      = ' ';
100 102
  my $patterncount   = @elster_pattern;
......
108 110
  # no we have an array of patternparts and a delimiter
109 111
  # create the first automated and fixed part and delimiter
110 112

  
111
  print qq|<b><font size="+1">|;
112
  $part = '';
113
  $steuernummer_input .= qq|<b><font size="+1">|;
114
  my $part = '';
113 115
SWITCH: {
114 116
    $elster_pattern[0] eq 'FFF' && do {
115 117
      $part = substr($elster_FFFF, 1, 4);
116
      print qq|$part|;
118
      $steuernummer_input .= qq|$part|;
117 119
      last SWITCH;
118 120
    };
119 121
    $elster_pattern[0] eq '0FF' && do {
120 122
      $part = '0' . substr($elster_FFFF, 2, 4);
121
      print qq|$part|;
123
      $steuernummer_input .= qq|$part|;
122 124
      last SWITCH;
123 125
    };
124 126
    $elster_pattern[0] eq 'FF' && do {
125 127
      $part = substr($elster_FFFF, 2, 4);
126
      print qq|$part|;
128
      $steuernummer_input .= qq|$part|;
127 129
      last SWITCH;
128 130
    };
129 131
    1 == 1 && do {
130
      print qq|Fehler!|;
132
      $steuernummer_input .= qq|Fehler!|;
131 133
      last SWITCH;
132 134
    };
133 135
  }
134 136

  
135 137
  #now the rest of the Steuernummer ...
136
  print qq|</b></font>|;
137
  print qq|\n
138
  $steuernummer_input .= qq|</b></font>|;
139
  $steuernummer_input .= qq|\n
138 140
           <input type=hidden name="elster_pattern" value="$elster_pattern">
139 141
           <input type=hidden name="patterncount" value="$patterncount">
140 142
           <input type=hidden name="patternlength" value="$patterncount">
141 143
           <input type=hidden name="delimiter" value="$delimiter">
142 144
           <input type=hidden name="part" value="$part">
143 145
  |;
144
  my $h = 0;
145
  my $i = 0;
146
  my $j = 0;
147
  $k = 0;
148 146

  
149
  for ($h = 1; $h < $patterncount; $h++) {
150
    print qq|&nbsp;$delimiter&nbsp;\n|;
151
    for ($i = 1; $i <= length($elster_pattern[$h]); $i++) {
152
      print qq|<select name="part_$h\_$i">\n|;
147
  my $k = 0;
153 148

  
154
      for ($j = 0; $j <= 9; $j++) {
155
        print qq|      <option value="$j"|;
149
  for (my $h = 1; $h < $patterncount; $h++) {
150
    $steuernummer_input .= qq|&nbsp;$delimiter&nbsp;\n|;
151
    for (my $i = 1; $i <= length($elster_pattern[$h]); $i++) {
152
      $steuernummer_input .= qq|<select name="part_$h\_$i">\n|;
153

  
154
      for (my $j = 0; $j <= 9; $j++) {
155
        $steuernummer_input .= qq|      <option value="$j"|;
156 156
        if ($steuernummer ne '') {
157 157
          if ($j eq substr($stnr, length($part) + $k, 1)) {
158
            print qq| selected|;
158
            $steuernummer_input .= qq| selected|;
159 159
          }
160 160
        }
161
        print qq|>$j</option>\n|;
161
        $steuernummer_input .= qq|>$j</option>\n|;
162 162
      }
163 163
      $k++;
164
      print qq|</select>\n|;
164
      $steuernummer_input .= qq|</select>\n|;
165 165
    }
166 166
  }
167
  
167 168
  $main::lxdebug->leave_sub();
169
  
170
  return $steuernummer_input;
168 171
}
169 172

  
170 173
sub fa_auswahl {
171 174
  $main::lxdebug->enter_sub();
172 175

  
173
  use SL::Form;
176
#  use SL::Form;
174 177

  
175 178
  # Referenz wird ?bergeben, hash of hash wird nicht
176 179
  # in neues  Hash kopiert, sondern direkt ?ber die Referenz ver?ndert
177 180
  # Prototyp f?r diese Konstruktion
178 181

  
179
  my ($land, $elsterFFFF, $elster_init) =
180
    @_;    #Referenz auf Hash von Hash ?bergeben
182
  my ($self, $land, $elsterFFFF, $elster_init) = @_;
183
  
181 184
  my $terminal = '';
182 185
  my $FFFF     = $elsterFFFF;
183 186
  my $ffff     = '';
......
191 194
  #}
192 195

  
193 196
  #if ( $terminal eq 'mozilla' or $terminal eq 'js' ) {
194
  print qq|
195
        <br>
197
  my $fa_auswahl = qq|
196 198
        <script language="Javascript">
197 199
        function update_auswahl()
198 200
        {
......
203 205
                |;
204 206

  
205 207
  foreach $elster_land (sort keys %$elster_init) {
206
    print qq|
208
    $fa_auswahl .= qq|
207 209
               if (elsterBLAuswahl.options[elsterBLAuswahl.selectedIndex].
208 210
               value == "$elster_land")
209 211
               {
......
217 219
    foreach $ffff (sort { $elster_land_fa{$a} cmp $elster_land_fa{$b} }
218 220
                   keys(%elster_land_fa)
219 221
      ) {
220
      print qq|
222
      $fa_auswahl .= qq|
221 223
                   elsterFAAuswahl.options[$j] = new Option("$elster_land_fa{$ffff} ($ffff)","$ffff");|;
222 224
      $j++;
223 225
    }
224
    print qq|
226
    $fa_auswahl .= qq|
225 227
               }|;
226 228
  }
227
  print qq|
229
  $fa_auswahl .= qq|
228 230
        }
229 231
        </script>
230 232

  
......
236 238
            <td>
237 239
              <select size="1" name="elsterland_new" onchange="update_auswahl()">|;
238 240
  if ($land eq '') {
239
    print qq|<option value="Auswahl" $checked>hier ausw?hlen...</option>\n|;
241
    $fa_auswahl .= qq|<option value="Auswahl" $checked>hier ausw?hlen...</option>\n|;
240 242
  }
241 243
  foreach $elster_land (sort keys %$elster_init) {
242
    print qq|
244
    $fa_auswahl .= qq|
243 245
                  <option value="$elster_land"|;
244 246
    if ($elster_land eq $land and $checked eq '') {
245
      print qq| selected|;
247
      $fa_auswahl .= qq| selected|;
246 248
    }
247
    print qq|>$elster_land</option>
249
    $fa_auswahl .= qq|>$elster_land</option>
248 250
             |;
249 251
  }
250
  print qq|
252
  $fa_auswahl .= qq|
251 253
            </td>
252 254
          </tr>
253 255
          |;
......
259 261
    $elster_land_fa{$FFFF} = $elster_init->{$elster_land}->{$FFFF}->[0];
260 262
  }
261 263

  
262
  print qq|
264
  $fa_auswahl .= qq|
263 265
           <tr>
264 266
              <td>Finanzamt
265 267
              </td>
266 268
              <td>
267 269
                 <select size="1" name="elsterFFFF_new">|;
268 270
  if ($elsterFFFF eq '') {
269
    print qq|<option value="Auswahl" $checked>hier ausw?hlen...</option>|;
271
    $fa_auswahl .= qq|<option value="Auswahl" $checked>hier ausw?hlen...</option>|;
270 272
  } else {
271 273
    foreach $ffff (sort { $elster_land_fa{$a} cmp $elster_land_fa{$b} }
272 274
                   keys(%elster_land_fa)
273 275
      ) {
274 276

  
275
      print qq|
277
      $fa_auswahl .= qq|
276 278
                        <option value="$ffff"|;
277 279
      if ($ffff eq $elsterFFFF and $checked eq '') {
278
        print qq| selected|;
280
        $fa_auswahl .= qq| selected|;
279 281
      }
280
      print qq|>$elster_land_fa{$ffff} ($ffff)</option>|;
282
      $fa_auswahl .= qq|>$elster_land_fa{$ffff} ($ffff)</option>|;
281 283
    }
282 284
  }
283
  print qq|
285
  $fa_auswahl .= qq|
284 286
                 </td>
285 287
              </tr>
286 288
            </table>
287 289
            </select>|;
288 290

  
289 291
  $main::lxdebug->leave_sub();
292
  return $fa_auswahl;
290 293
}
291 294

  
292 295
sub info {
......
400 403
sub query_finanzamt {
401 404
  $main::lxdebug->enter_sub();
402 405

  
403
  my ($myconfig, $form) = @_;
406
  my ($self, $myconfig, $form) = @_;
407

  
404 408
  my $dbh = $form->dbconnect($myconfig) or $self->error(DBI->errstr);
405 409

  
406 410
  #Test, if table finanzamt exist
......
568 572

  
569 573
  my $last_period     = 0;
570 574
  my $category        = "pos_ustva";
571
  my @category_cent = qw(511 861 36 80 971 931 98 96 53 74
572
    85 65 66 61 62 67 63 64 59 69 39 83
573
    Z43 Z45 Z53 Z62 Z65 Z67);
575
  my @category_cent = qw(
576
     511 861 36  80  971 931 98  96 53 74
577
     85  65  66  61  62  67  63  64 59 69 
578
     39  83  Z43 Z45 Z53 Z62 Z65 Z67
579
  );
574 580

  
575
  my @category_euro = qw(41 44 49 43 48 51 86 35 77 76 91 97 93
576
    95 94 42 60 45 52 73 84);
581
  my @category_euro = qw(
582
     41 44 49 43 48 51 
583
     86 35 77 76 91 97 
584
     93 95 94 42 60 45 
585
     52 73 84
586
  );
577 587

  
578 588
  $form->{decimalplaces} *= 1;
579 589

  
......
792 802
  $main::lxdebug->leave_sub();
793 803
}
794 804

  
805

  
806

  
795 807
1;
bin/mozilla/ustva.pl
67 67
# $locale->text('Oct')
68 68
# $locale->text('Nov')
69 69
# $locale->text('Dec')
70

  
71
# $form->parse_html_template('generic/util_hidden_variables');
72

  
70 73
#############################
71 74

  
72 75
sub report {
73 76
  $lxdebug->enter_sub();
77

  
74 78
  my $myconfig = \%myconfig;
75
  use CGI;
76 79

  
77 80
  $form->{title} = $locale->text('UStVA');
78 81
  $form->{kz10}  = '';                       #Berichtigte Anmeldung? Ja =1 Nein=0
......
84 87
  local $hide = '';
85 88
  $form->header;
86 89

  
87
  print qq|
88
 <body>
89
 <form method=post action=$form->{script}>
90

  
91
 <input type=hidden name=title value="$form->{title}">
92

  
93
 <table width=100%>
94
  <tr>
95
    <th class=listtop>$form->{title}</th>
96
  </tr>
97
  <tr height="5"></tr>
98
  <tr>
99
    <td>
100
      <table>
101
      $department
102
 |;
103

  
104
  # Hier Aufruf von get_config aus bin/mozilla/fa.pl zum
105 90
  # Einlesen der Finanzamtdaten
106 91
  &get_config($userspath, 'finanzamt.ini');
107 92

  
108 93
  # Hier Einlesen der user-config
109 94
  # steuernummer entfernt f?r prerelease
110
  my @a = qw(signature name company address businessnumber tel fax email
111
    co_chief co_department co_custom1 co_custom2 co_custom3 co_custom4 co_custom5
112
    co_name1 co_name2
113
    co_street co_street1 co_zip co_city co_city1 co_country co_tel co_tel1 co_tel2
114
    co_fax co_fax1 co_email co_email1 co_url co_url1 ustid duns
115
    co_bankname co_bankname1 co_bankname2 co_bankname3 co_blz co_blz1
116
    co_blz2 co_blz3 co_accountnr co_accountnr1 co_accountnr2 co_accountnr3);
95
  my @a = qw(
96
    signature      name          company       address        businessnumber 
97
    tel            fax           email         co_chief       co_department 
98
    co_custom1     co_custom2    co_custom3    co_custom4     co_custom5
99
    co_name1       co_name2      co_street     co_street1     co_zip 
100
    co_city        co_city1      co_country    co_tel         co_tel1 
101
    co_tel2        co_fax        co_fax1       co_email       co_email1
102
    co_url         co_url1       ustid         duns           co_bankname 
103
    co_bankname1   co_bankname2  co_bankname3  co_blz         co_blz1
104
    co_blz2        co_blz3       co_accountnr  co_accountnr1  co_accountnr2 
105
    co_accountnr3
106
  );
117 107

  
118 108
  map { $form->{$_} = $myconfig->{$_} } @a;
119 109

  
120
  my $oeffnungszeiten = $form->{FA_Oeffnungszeiten};
121
  $oeffnungszeiten =~ s/\\\\n/<br>/g;
122
  print qq|
123
	<tr >
124
	  <td width="50%" align="left" valign="top">
125
	  <fieldset>
126
	  <legend>
127
	  <b>| . $locale->text('Company') . qq|</b>
128
	  </legend>
129
  |;
130
  if ($form->{company} ne '') {
131
    print qq|<h3>$form->{company}</h3>\n|;
132
  } else {
133
    print qq|
134
	    <a href=am.pl?path=$form->{path}&action=config&level=Programm--Preferences&login=$form->{login}&password=$form->{password}>
135
	    | . $locale->text('No Company Name given') . qq|!</a><br>
136
    |;
137
  }
110
  my $openings = $form->{FA_Oeffnungszeiten};
111
  $openings =~ s/\\\\n/<br>/g;
112

  
113
  my $company_given = ($form->{company} ne '') 
114
    ? qq|<h3>$form->{company}</h3>\n|
115
    : qq|<a href=am.pl?path=$form->{path}&action=config|
116
      . qq|&level=Programm--Preferences&login=$form->{login}|
117
      . qq|&password=$form->{password}>| 
118
      . $locale->text('No Company Name given') . qq|!</a><br>|;
119

  
138 120

  
139 121
  # Anpassungen der Variablennamen auf pre 2.1.1 Namen
140 122
  # kl?ren, ob $form->{company_street|_address} gesetzt sind
141
  #
142

  
143 123
  if ($form->{address} ne '') {
144 124
    my $temp = $form->{address};
145 125
    $temp =~ s/\\n/<br \/>/;
......
147 127
    $form->{co_city} =~ s/\\n//g;
148 128
  }
149 129

  
150
  if ($form->{co_street} ne ''
151
      and (   $form->{co_zip} ne ''
152
           or $form->{co_city} ne '')
153
    ) {
154
    print qq|
155
    $form->{co_street}<br>
156
    $form->{co_street1}<br>
157
    $form->{co_zip} $form->{co_city}|;
158
    } else {
159
    print qq|
160
	  <a href=am.pl?path=$form->{path}&action=config&level=Programm--Preferences&login=$form->{login}&password=$form->{password}>
161
	  | . $locale->text('No Company Address given') . qq|!</a>\n|;
162
  }
130

  
131
  my $address_given = 
132
    ($form->{co_street} ne '' 
133
      and ( 
134
        $form->{co_zip} ne ''
135
          or $form->{co_city} ne ''
136
      )
137
    ) 
138
    ? qq|$form->{co_street}<br>|
139
        . qq|$form->{co_street1}<br>|
140
        . qq|$form->{co_zip} $form->{co_city}|
141
    : qq|<a href=am.pl?path=$form->{path}&action=config|
142
        . qq|&level=Programm--Preferences&login=$form->{login}|
143
        . qq|&password=$form->{password}>| 
144
        . $locale->text('No Company Address given') 
145
        . qq|!</a>\n|;
146

  
163 147
  $form->{co_email} = $form->{email} unless $form->{co_email};
164 148
  $form->{co_tel}   = $form->{tel}   unless $form->{co_tel};
165 149
  $form->{co_fax}   = $form->{fax}   unless $form->{co_fax};
166 150
  $form->{co_url}   = $form->{urlx}  unless $form->{co_url};
167 151

  
168
  print qq|
169
	  <br>
170
	  <br>
171
	  | . $locale->text('Tel') . qq|.:&nbsp;
172
	  $form->{co_tel}
173
	  <br>
174
	  | . $locale->text('Fax') . qq|.:nbsp;
175
	  $form->{co_fax}	  
176
	  <br>
177
	  <br>
178
	  $form->{co_email}	  
179
	  <br>
180
	  <br>
181
	  | . $locale->text('Tax Number') . qq|:&nbsp;
182
  |;
152
  my $taxnumber_given = ($form->{steuernummer} ne '')
153
    ? qq|$form->{steuernummer}|
154
    : qq|<a href="ustva.pl?path=$form->{path}&action="config_step1"|
155
      . qq|&level=Programm--Finanzamteinstellungen&login=$form->{login}|
156
      . qq|&password=$form->{password}">Keine Steuernummer hinterlegt!|
157
      . qq|</a><br>|;
183 158

  
184
  if ($form->{steuernummer} ne '') {
185
    print qq|$form->{steuernummer}|;
186
  } else {
187
    print qq|
188
	  <a href="ustva.pl?path=$form->{path}&action=edit&level=Programm--Finanzamteinstellungen&login=$form->{login}&password=$form->{password}">
189
	  Keine Steuernummer hinterlegt!</a><br>|;
190
  }
191
  print qq|
192
	  <br>
193
	  | . $locale->text('ELSTER Tax Number') . qq|:&nbsp;
194
	  $form->{elstersteuernummer}
195
          <br>
196
          <br>
197

  
198
	  </fieldset>
199
	  <br>
200
  |;
201
  if ($form->{FA_steuerberater_name} ne '') {
202
    print qq|
203
	  <fieldset>
204
	  <legend>
205
            <input checked="checked" title="|
206
      . $locale->text('Assume Tax Consultant Data in Tax Computation?')
207
      . qq|" name="FA_steuerberater" id=steuerberater class=checkbox type=checkbox value="1">&nbsp;
208
            <b>| . $locale->text('Tax Consultant') . qq|</b>
209
            </legend>
210
            
211
            $form->{FA_steuerberater_name}<br>
212
            $form->{FA_steuerberater_street}<br>
213
            $form->{FA_steuerberater_city}<br>
214
            Tel: $form->{FA_steuerberater_tel}<br>
215
	  </fieldset>
216
	  <br>
217
    |;
218
  }
219
  print qq|
220
	  <fieldset>
221
	  <legend>
222
          <b>| . $locale->text('Tax Period') . qq|</b>
223
	  </legend>
224
  |;
225
  &ustva_vorauswahl();
159
  my $ustva_vorauswahl = &ustva_vorauswahl();
226 160

  
227
  my @years = ();
228
  if (not defined $form->{all_years}) {
161
  my @all_years = $form->all_years(\%myconfig);
229 162

  
230
    # accounting years if SQL-Ledger Version < 2.4.1
231
    #    $year = $form->{year} * 1;
232
    @years = sort { $b <=> $a } (2003 .. ($year + 1));
233
    $form->{all_years} = \@years;
163
  my $select_year = qq|<select name=year title="| 
164
    . $locale->text('Year') . qq|">|;
165
  foreach my $key (@all_years) {
166
    $select_year .= qq|<option |;
167
    $select_year .= qq|selected| if ($key eq $form->{year});
168
    $select_year .= qq| >$key</option>|;
234 169
  }
235
  map { $form->{selectaccountingyear} .= qq|<option>$_\n| }
236
    @{ $form->{all_years} };
237
  print qq|
238
          <select name=year title="| . $locale->text('Year') . qq|">
239
  |;
240
  my $key = '';
241
  foreach $key (@years) {
242
    print qq|<option |;
243
    print qq|selected| if ($key eq $form->{year});
244
    print qq| >$key</option>
245
    |;
246
  }
247

  
248
  my $voranmeld = $form->{FA_voranmeld};
249
  print qq|             </select>|;
250
  my $checked = '';
251
  $checked = "checked" if ($form->{kz10} eq '1');
252
  print qq|
253
           <input name="FA_10" id=FA_10 class=checkbox type=checkbox value="1" $checked title = "|
254
    . $locale->text(
255
      'Amended Advance Turnover Tax Return (Nr. 10)')
256
    . qq|">
257
            | . $locale->text('Amended Advance Turnover Tax Return') . qq|
258
          <br>
259
  |;
260

  
261
  if ($voranmeld ne '') {
262
    print qq|
263
          <br>
264
          | . $locale->text($voranmeld) . qq|
265
  |;
266
    print $locale->text('With Extension Of Time') if ($form->{FA_dauerfrist} eq '1');
267
    print qq|
268

  
269
      <br>
270
  |;
271
  }
272
  if ($form->{method} ne '') {
273
    print qq|| . $locale->text('Method') . qq|: |;
274
    print qq|| . $locale->text('accrual') . qq||
275
      if ($form->{method} eq 'accrual');
276
    print qq|| . $locale->text('cash') . qq|| if ($form->{method} eq 'cash');
277
  }
278
  print qq|
279
	  </fieldset>
280

  
281
    </td>|;
282

  
283
  if ($form->{FA_Name} ne '') {
284
    print qq|
285
    <td width="50%" valign="top">	  
286
	  <fieldset>
287
	  <legend>
288
	  <b>| . $locale->text('Tax Office') . qq|</b>
289
	  </legend>
290
          <h3>$form->{FA_Name}</h2>
291
    |;
292

  
293
    #if ($form->{FA_Ergaenzung_Name ne ''}){
294
    #  print qq|
295
    #          $form->{FA_Ergaenzung_Name}&nbsp
296
    #          <br>
297
    #  |;
298
    #}
299
    print qq|
300
          $form->{FA_Strasse}
301
          <br>
302
          $form->{FA_PLZ}&nbsp; &nbsp;$form->{FA_Ort}
303
          <br>
304
          <br>
305
          | . $locale->text('Tel') . qq|.:&nbsp;
306
          $form->{FA_Telefon}
307
          <br> 
308
          | . $locale->text('Fax') . qq|.:$nbsp;
309
          $form->{FA_Fax}
310
          <br>
311
          <br>
312
          <a href="mailto:$form->{FA_Email}?subject=|
313
      . CGI::escape("Steuer Nr: $form->{steuernummer}:")
314
      . qq|&amp;body=|
315
      . CGI::escape(
316
             "Sehr geehrte Damen und Herren,\n\n\nMit freundlichen Gr??en\n\n")
317
      . CGI::escape($form->{signature}) . qq|">
318
            $form->{FA_Email}
319
          </a>
320
          <br>
321
          <a href="$form->{FA_Internet}">
322
            $form->{FA_Internet}
323
          </a>
324
          <br>
325
          <br>
326
          | . $locale->text('Openings') . qq|
327
          <br>
328
          $oeffnungszeiten
329
          <br>
330
   |;
331

  
332
    my $FA_1 =
333
      (   $form->{FA_BLZ_1} ne ''
334
       && $form->{FA_Kontonummer_1}     ne ''
335
       && $form->{FA_Bankbezeichnung_1} ne '');
336
    my $FA_2 =
337
      (   $form->{FA_BLZ_2} ne ''
338
       && $form->{FA_Kontonummer_2}            ne ''
339
       && $form->{FA_Bankbezeichnung_oertlich} ne '');
340

  
341
    if ($FA_1 && $FA_2) {
342
      print qq|
343
          <br>
344
          | . $locale->text('Bank Connection') . qq|
345
          <table>
346
          <tr>
347
          <td>
348
          $form->{FA_Bankbezeichnung_1}
349
          <br>                  
350
          | . $locale->text('Account') . qq|:&nbsp;
351
          $form->{FA_Kontonummer_1}
352
          <br>
353
          | . $locale->text('Bank Code') . qq|:&nbsp;
354
          $form->{FA_BLZ_1}
355
          </td>
356
          <td>
357
          $form->{FA_Bankbezeichnung_oertlich}
358
          <br>
359
          | . $locale->text('Account') . qq|:&nbsp;
360
          $form->{FA_Kontonummer_2}
361
          <br> 
362
          | . $locale->text('Bank Code') . qq|:&nbsp;
363
          $form->{FA_BLZ_2}
364
          </td>
365
          </tr>
366
          </table>
367
          <br>|;
368
    } elsif ($FA_1) {
369
      print qq|
370
          <br>
371
          | . $locale->text('Bank Connection') . qq|
372
          <br>
373
          <br>
374
          $form->{FA_Bankbezeichnung_1}
375
          <br>                  
376
          | . $locale->text('Account') . qq|:&nbsp;
377
          $form->{FA_Kontonummer_1}
378
          <br> 
379
          | . $locale->text('Bank Code') . qq|:&nbsp;
380
          $form->{FA_BLZ_1}          <br>
381
          <br>|;
382
    } elsif ($FA_2) {
383
      print qq|
384
          <br>
385
          | . $locale->text('Bank Connection') . qq|
386
          <br>
387
          <br>
388
          $form->{FA_Bankbezeichnung_oertlich}
389
          <br>                  
390
          | . $locale->text('Account') . qq|:&nbsp;
391
          $form->{FA_Kontonummer_2}
392
          <br> 
393
          | . $locale->text('Bank Code') . qq|:&nbsp;
394
          $form->{FA_BLZ_2}
395
     |;
170
  $select_year   .=  qq|</select>|;
171

  
172
  my $_checked = '';
173
  $_checked = "checked" if ($form->{kz10} eq '1');
174
  my $checkbox_kz_10 = qq|<input name="FA_10" id=FA_10 class=checkbox|
175
    . qq| type=checkbox value="1" $_checked title = "|
176
    . $locale->text('Amended Advance Turnover Tax Return (Nr. 10)')
177
    . qq|">| 
178
    . $locale->text('Amended Advance Turnover Tax Return'); 
179

  
180
  my $method_local = ($form->{method} eq 'accrual') ? $locale->text('accrual') 
181
                   : ($form->{method} eq 'cash')    ? $locale->text('cash')
182
                   : '';
183

  
184
  my $period_local = ( $form->{FA_voranmeld} eq 'month')   ? $locale->text('month')
185
                   : ( $form->{FA_voranmeld} eq 'quarter') ? $locale->text('quarter')
186
                   : '';  
187

  
188
  my $tax_office_banks_ref = [
189
    { BLZ             => $form->{FA_BLZ_1},
190
      Kontonummer     => $form->{FA_Kontonummer_1},
191
      Bankbezeichnung => $form->{FA_Bankbezeichnung_1}
192
    },
193
    { BLZ             => $form->{FA_BLZ_2},
194
      Kontonummer     => $form->{FA_Kontonummer_2},
195
      Bankbezeichnung => $form->{FA_Bankbezeichnung_oertlich}
396 196
    }
397
    print qq|
398

  
399
      </fieldset>
400
      <br>
401
      <fieldset>
402
      <legend>
403
      <b>| . $locale->text('Outputformat') . qq|</b>
404
      </legend>
405
  |;
406

  
407
    &show_options;
408
    my $ausgabe = '1';
409
    print qq|
410
	  </fieldset>
411
      |;
412

  
413
  } else {
414
    print qq|
415
     <td width="50%" valign="bottom">
416
     <fieldset>
417
     <legend>
418
     <b>| . $locale->text('Hints') . qq|</b>
419
     </legend>
420
      <h2 class="confirm">|
421
      . $locale->text('Missing Preferences: Outputroutine disabled')
422
      . qq|</h2>
423
      <h3>| . $locale->text('Help') . qq|</h3>
424
      <ul>
425
      <li>| . $locale->text('Hint-Missing-Preferences') . qq|</li>
426
      </ul>
427
      </fieldset>
428
     |;
429
    my $ausgabe = '';
430
    $hide = q|disabled="disabled"|;
431
  }
432

  
433
  print qq|
434
      </td>
435
    </tr>
436
  |;
197
  ];
198
 
199
  
200
  my $template_ref = {
201
    openings         => $openings,  
202
    company_given    => $company_given,
203
    address_given    => $address_given,     
204
    taxnumber_given  => $taxnumber_given,
205
    select_year      => $select_year,      
206
    period_local     => $period_local,
207
    method_local     => $method_local,
208
    ustva_vorauswahl => $ustva_vorauswahl,
209
    checkbox_kz_10   => $checkbox_kz_10,
210
    tax_office_banks => $tax_office_banks_ref,    
211
    select_options   => &show_options,    
212
  };
213
  
214
  print($form->parse_html_template('ustva/report', $template_ref));
437 215

  
438
  #}# end if report = ustva
439

  
440
  print qq|
441
      </table>
442
     </td>
443
    </tr>
444
    <tr>
445
     <td><hr size="3" noshade></td>
446
    </tr>
447
  </table>
448

  
449
  <br>
450
  <input type="hidden" name="address" value="$form->{address}">
451
  <input type="hidden" name="reporttype" value="custom">
452
  <input type="hidden" name="co_street" value="$form->{co_street}">
453
  <input type="hidden" name="co_city" value="$form->{co_city}">
454
  <input type="hidden" name="path" value="$form->{path}">
455
  <input type="hidden" name="login" value="$form->{login}">
456
  <input type="hidden" name="password" value="$form->{password}">
457
  <table width="100%">
458
  <tr>
459
   <td align="left">
460
     <input type=hidden name=nextsub value=generate_ustva>
461
     <input $hide type=submit class=submit name=action value="|
462
    . $locale->text('Show') . qq|">
463
   </td>
464
   <td align="right">
465

  
466
    </form>
467
    <!--
468
    <form action="doc/ustva.html" method="get">
469
    
470
       <input type=submit class=submit name=action value="|
471
    . $locale->text('Help') . qq|">
472
   </form>-->
473
   </td>
474
  </tr>
475
  </table>
476
  |;
477 216

  
478
  print qq|
479 217

  
480
  </body>
481
  </html>
482
  |;
483 218
  $lxdebug->leave_sub();
484 219
}
485 220

  
486
#############################
221

  
487 222

  
488 223
sub help {
489 224
  $lxdebug->enter_sub();
......
513 248
sub ustva_vorauswahl {
514 249
  $lxdebug->enter_sub();
515 250

  
251
  my $select_vorauswahl;
252

  
516 253
  #Aktuelles Datum zerlegen:
517 254
  my $date = $form->datetonum($form->current_date(\%myconfig), \%myconfig);
518 255

  
......
533 270
  #$form->{day}= '11';
534 271
  #$form->{month}= '01';
535 272
  #$form->{year}= 2004;
536
  print qq|
273
  $select_vorauswahl = qq|
537 274
     <input type=hidden name=day value=$form->{day}>
538 275
     <input type=hidden name=month value=$form->{month}>
539 276
     <input type=hidden name=yymmdd value=$yymmdd>
540 277
     <input type=hidden name=sel value=$sel>
541
 |;
278
  |;
542 279

  
543 280
  if ($form->{FA_voranmeld} eq 'month') {
544 281

  
......
623 360
      };
624 361

  
625 362
    }
626
    print qq|<select id="zeitraum" name="period" title="|
363
    $select_vorauswahl .= qq|<select id="zeitraum" name="period" title="|
627 364
  . $locale->text('Select a period') . qq|" >|;
628 365

  
629 366
    my $key = '';
630 367
    foreach $key (sort keys %liste) {
631 368
      my $selected = '';
632 369
      $selected = 'selected' if ($sel eq $key);
633
      print qq|
370
      $select_vorauswahl .= qq|
634 371
         <option value="$key" $selected> $liste{$key}</option>
635
   |;
372
      |;
636 373
    }
637
    print qq|</select>|;
374
    $select_vorauswahl .= qq|</select>|;
638 375

  
639 376
  } elsif ($form->{FA_voranmeld} eq 'quarter') {
640 377

  
......
674 411
      };
675 412
    }
676 413

  
677
    print qq|<select id="zeitraum" name="period" title="|
414
    $select_vorauswahl .= qq|<select id="zeitraum" name="period" title="|
678 415
      . $locale->text('Select a period') . qq|" >|;
679 416
    my $key = '';
680 417
    foreach $key (sort keys %liste) {
681 418
      my $selected = '';
682 419
      $selected = 'selected' if ($sel eq $key);
683
      print qq|
420
      $select_vorauswahl .= qq|
684 421
         <option value="$key" $selected>$liste{$key}</option>
685 422
     |;
686 423
    }
687
    print qq|\n</select>
424
    $select_vorauswahl .= qq|\n</select>
688 425
   |;
689 426

  
690 427
  } else {
691 428

  
692 429
    # keine Vorauswahl bei Voranmeldungszeitraum
693
    print qq|<select id="zeitraum" name="period" title="|
430
    $select_vorauswahl .= qq|<select id="zeitraum" name="period" title="|
694 431
      . $locale->text('Select a period') . qq|" >|;
695 432

  
696 433
    my %listea = ('41' => '1. Quarter',
......
713 450
                  '13' => 'Yearly',);
714 451
    my $key = '';
715 452
    foreach $key (sort keys %listea) {
716
      print qq|
453
      $select_vorauswahl .= qq|
717 454
         <option value="$key">|
718 455
        . $locale->text("$listea{$key}")
719 456
        . qq|</option>\n|;
720 457
    }
721 458

  
722 459
    foreach $key (sort keys %listeb) {
723
      print qq|
460
      $select_vorauswahl .= qq|
724 461
         <option value="$key">|
725 462
        . $locale->text("$listeb{$key}")
726 463
        . qq|</option>\n|;
727 464
    }
728
    print qq|</select>|;
465
    $select_vorauswahl .= qq|</select>|;
729 466
  }
730 467
  $lxdebug->leave_sub();
468
  
469
  return $select_vorauswahl;
731 470
}
732 471

  
733
sub config {
734
  $lxdebug->enter_sub();
735
  edit();
736
  $lxdebug->leave_sub();
737
}
472
#sub config {
473
#  $lxdebug->enter_sub();
474
#  config_step1();
475
#  $lxdebug->leave_sub();
476
#}
738 477

  
739 478
sub debug {
740 479
  $lxdebug->enter_sub();
......
775 514
  }
776 515

  
777 516
  #$format .= qq|<option value=elster>|.$locale->text('ELSTER Export nach Winston').qq|</option>|;
778
  print qq|
517
  my $show_options = qq|
779 518
    $type
780 519
    $media
781 520
    <select name=format title = "|
782 521
    . $locale->text('Choose Outputformat') . qq|">$format</select>
783 522
  |;
784 523
  $lxdebug->leave_sub();
524
  
525
  return $show_options;
785 526
}
786 527

  
787 528
sub generate_ustva {
......
1130 871
        $form->{taxbird_land_nr} = $lands{$land} if ($form->{elsterland} eq $land );
1131 872
      }
1132 873
      
1133
      $form->{taxbird_steuernummer} = $form->{steuernummer};
1134
      $form->{taxbird_steuernummer} =~ s/\D//g;
874

  
1135 875
      
1136 876
      $form->{co_zip} = $form->{co_city};
1137 877
      $form->{co_zip} =~ s/\D//g;
......
1139 879
      $form->{co_city} =~ s/^\s//g;
1140 880
      
1141 881
      ($form->{co_phone_prefix}, $form->{co_phone}) = split("-", $form->{tel});
882
      $form->{co_phone_prefix} =~ s/\s//g;
883
      $form->{co_phone} =~ s/\s//g;
884
      
885
       $form->{taxbird_steuernummer} = $form->{steuernummer};
886
#      $form->{taxbird_steuernummer} =~ s/\D//g;
887
      $form->{taxbird_steuernummer} =~ s/\///; # ersten Querstrich ersetzen
1142 888
      
1143 889
      # Numberformatting for Taxbird
1144 890

  
......
1196 942
  $lxdebug->leave_sub();
1197 943
}
1198 944

  
1199
sub edit {
945
sub config_step1 {
1200 946
  $lxdebug->enter_sub();
1201 947

  
1202 948
  # edit all taxauthority prefs
......
1204 950
  $form->header;
1205 951
  &get_config($userspath, 'finanzamt.ini');
1206 952

  
1207
  #&create_steuernummer;
1208

  
1209 953
  my $land = $form->{elsterland};
1210 954
  my $amt  = $form->{elsterFFFF};
1211 955

  
1212
  my $callback = '';
1213
  $callback =
1214
    "$form->{cbscript}?action=edit&login=$form->{cblogin}&path=$form->{cbpath}&root=$form->{cbroot}&rpw=$form->{cbrpw}"
1215
    if ($form->{cbscript} ne '' and $form->{cblogin} ne '');
956

  
957
  if ($form->{cbscript} ne '' and $form->{cblogin} ne '') {
958
    $callback =  qq|$form->{cbscript}|
959
                .qq|?action="config_step1"|
960
                .qq|&login="$form->{cblogin}"|
961
                .qq|&path="$form->{cbpath}"|
962
                .qq|&root="$form->{cbroot}"|
963
                .qq|&rpw="$form->{cbrpw}"|;
964
  }
1216 965

  
1217 966
  $form->{title} = $locale->text('Tax Office Preferences');
1218
  print qq|
1219
    <body>
1220
    <form name="verzeichnis" method=post action="$form->{script}">
1221
     <table width=100%>
1222
	<tr>
1223
	  <th class="listtop">|
1224
    . $locale->text('Tax Office Preferences') . qq|</th>
1225
	</tr>
1226
        <tr>
1227
         <td>
1228
           <br>
1229
           <fieldset>
1230
           <legend><b>|
1231
    . $locale->text('Local Tax Office Preferences') . qq|</b></legend>
1232
  |;
1233 967

  
1234
  #print qq|$form->{terminal}|;
1235 968

  
1236
  USTVA::fa_auswahl($land, $amt, &elster_hash());
1237
  print qq|
1238
           </fieldset>
1239
           <br>
1240
  |;
1241
  my $checked = '';
1242
  $checked = "checked" if ($form->{method} eq 'accrual');
1243
  print qq|
1244
           <fieldset>
1245
           <legend><b>| . $locale->text('Taxation') . qq|</b>
1246
           </legend>
1247
           <input name=method id=accrual class=radio type=radio value="accrual" $checked>
1248
           <label for="accrual">| . $locale->text('accrual') . qq|</label>
1249
           <br>
1250
  |;
1251
  $checked = '';
1252
  $checked = "checked" if ($form->{method} eq 'cash');
1253
  print qq|
1254
           <input name=method id=cash class=radio type=radio value="cash" $checked>
1255
           <label for="cash">| . $locale->text('cash') . qq|</label>
1256
           </fieldset>
1257
           <br>
1258
           <fieldset>
1259
           <legend><b>| . $locale->text('Tax Period') . qq|</b>
1260
           </legend>
1261
  |;
1262
  $checked = '';
1263
  $checked = "checked" if ($form->{FA_voranmeld} eq 'month');
1264
  print qq|
1265
           <input name=FA_voranmeld id=month class=radio type=radio value="month" $checked>
1266
           <label for="month">| . $locale->text('month') . qq|</label>
1267
           <br>
1268
  |;
1269
  $checked = '';
1270
  $checked = "checked" if ($form->{FA_voranmeld} eq 'quarter');
1271
  print qq|
1272
           <input name="FA_voranmeld" id=quarter class=radio type=radio value="quarter" $checked>
1273
           <label for="quarter">| . $locale->text('quarter') . qq|</label>
1274
           <br>
1275
  |;
1276
  $checked = '';
1277
  $checked = "checked" if ($form->{FA_dauerfrist} eq '1');
1278
  print qq|
1279
           <input name="FA_dauerfrist" id=FA_dauerfrist class=checkbox type=checkbox value="1" $checked>
1280
           <label for="">|
1281
    . $locale->text('Extension Of Time') . qq|</label>
1282
           
1283
           </fieldset>
1284
           <br>
1285
           <fieldset>
1286
           <legend><b>| . $locale->text('Tax Consultant') . qq|</b>
1287
           </legend>
1288
  |;
1289
  $checked = '';
1290
  $checked = "checked" if ($form->{FA_71} eq 'X');
1291
  print qq|
1292
          <!-- <input name="FA_71" id=FA_71 class=checkbox type=checkbox value="X" $checked>
1293
           <label for="FA_71">|
1294
    . $locale->text('Clearing Tax Received (No 71)')
1295
    . qq|</label>
1296
           <br>
1297
           <br>-->
1298
           <table>
1299
           <tr>
1300
           <td>
1301
           | . $locale->text('Name') . qq|
1302
           </td>
1303
           <td>
1304
           | . $locale->text('Street') . qq|
1305
           </td>
1306
           <td>
1307
           | . $locale->text('Zip, City') . qq|
1308
           </td>
1309
           <td>
1310
           | . $locale->text('Telephone') . qq|
1311
           </td>
1312
           </tr>
1313
           <tr>
1314
           <td>
1315
           <input name="FA_steuerberater_name" id=steuerberater size=25 value="$form->{FA_steuerberater_name}">
1316
           </td>
1317
           <td>
1318
           <input name="FA_steuerberater_street" id=steuerberater size=25 value="$form->{FA_steuerberater_street}">
1319
           </td>
1320
           <td>
1321
           <input name="FA_steuerberater_city" id=steuerberater size=25 value="$form->{FA_steuerberater_city}">
1322
           </td>
1323
           <td>
1324
           <input name="FA_steuerberater_tel" id=steuerberater size=25 value="$form->{FA_steuerberater_tel}">
1325
           </tr>
1326
           </table>
1327
           
1328
           </fieldset>
1329

  
1330
           <br>
1331
           <br>
1332
           <hr>
1333
           <!--<input type=submit class=submit name=action value="|
1334
    . $locale->text('debug') . qq|">-->
1335
           |;
1336
  print qq|
1337
           <input type="button" name="Verweis" value="|
1338
    . $locale->text('User Config') . qq|" 
1339
            onClick="self.location.href='$callback'">| if ($callback ne '');
1340
  print qq|
1341
           &nbsp; &nbsp;
1342
           <input type=submit class=submit name=action value="|
1343
    . $locale->text('continue') . qq|">
1344

  
1345
         </td>
1346
       </tr>
1347
     </table>
1348
  |;
969
  my $select_tax_office = USTVA->fa_auswahl($land, $amt, &elster_hash());
970
  my $checked_accrual = q|checked="checked"| if ($form->{method} eq 'accrual');
971
  my $checked_cash = q|checked="checked"| if ($form->{method} eq 'cash');
972
  my $checked_monthly = "checked" if ($form->{FA_voranmeld} eq 'month');
973
  my $checked_quarterly = "checked" if ($form->{FA_voranmeld} eq 'quarter');
974
  my $checked_dauerfristverlaengerung = "checked" if ($form->{FA_dauerfrist} eq '1');
975
  my $checked_kz_71 = "checked" if ($form->{FA_71} eq 'X');
1349 976

  
1350
  my @variables = qw( steuernummer elsterland elstersteuernummer elsterFFFF);
1351
  my $variable  = '';
1352
  foreach $variable (@variables) {
1353
    print qq|	
1354
          <input name=$variable type=hidden value="$form->{$variable}">|;
1355
  }
1356
  my $steuernummer_new = '';
977
  my $_hidden_variables_ref;
1357 978

  
1358
  #<input type=hidden name="steuernummer_new" value="$form->{$steuernummer_new}">
1359
  print qq|
1360
          <input type=hidden name="callback" value="$callback">
1361
          <input type=hidden name="nextsub" value="edit_form">
1362
          <input type=hidden name="warnung" value="1">
1363
          <input type=hidden name="saved" value="|
1364
    . $locale->text('Check Details') . qq|">
1365
          <input type=hidden name="path" value=$form->{path}>
1366
          <input type=hidden name="login" value=$form->{login}>
1367
          <input type=hidden name="password" value=$form->{password}>
1368
          <input type=hidden name="warnung" value="0">
1369
  |;
979
  my %_hidden_local_variables = (    
980
    'saved'       => $locale->text('Check Details'),
981
    'nextsub'     => 'config_step2',
982
    'warnung'     => '0',
983
  );
984

  
985
  foreach my $variable (keys %_hidden_local_variables) {
986
    push @{ $_hidden_variables_ref }, 
987
        { 'variable' => $variable, 'value' => $_hidden_local_variables{$variable} };
988
  }
1370 989

  
1371
  @variables = qw(FA_Name FA_Strasse FA_PLZ
1372
    FA_Ort FA_Telefon FA_Fax FA_PLZ_Grosskunden FA_PLZ_Postfach FA_Postfach
1373
    FA_BLZ_1 FA_Kontonummer_1 FA_Bankbezeichnung_1 FA_BLZ_2
1374
    FA_Kontonummer_2 FA_Bankbezeichnung_oertlich FA_Oeffnungszeiten
1375
    FA_Email FA_Internet);
990
  my @_hidden_form_variables = qw(
991
    FA_Name             FA_Strasse        FA_PLZ             
992
    FA_Ort              FA_Telefon        FA_Fax           
993
    FA_PLZ_Grosskunden  FA_PLZ_Postfach   FA_Postfach 
994
    FA_BLZ_1            FA_Kontonummer_1  FA_Bankbezeichnung_1  
995
    FA_BLZ_2            FA_Kontonummer_2  FA_Bankbezeichnung_oertlich
996
    FA_Oeffnungszeiten  FA_Email          FA_Internet
997
    steuernummer        elsterland        elstersteuernummer
998
    elsterFFFF          path              login
999
    password
1000
  );
1376 1001

  
1377
  foreach $variable (@variables) {
1378
    print qq|	
1379
          <input name=$variable type=hidden value="$form->{$variable}">|;
1002
  foreach my $variable (@_hidden_form_variables) {
1003
    push @{ $_hidden_variables_ref}, 
1004
        { 'variable' => $variable, 'value' => $form->{$variable} };
1380 1005
  }
1381 1006

  
1382
  print qq|
1383
   </form>
1384
   </body>
1385
|;
1007
  # h?? kann die weg?
1008
  my $steuernummer_new = '';
1009

  
1010
  # Variablen f?r das Template zur Verf?gung stellen
1011
  my $template_ref = {
1012
     select_tax_office               => $select_tax_office,
1013
     checked_accrual                 => $checked_accrual,
1014
     checked_cash                    => $checked_cash,
1015
     checked_monthly                 => $checked_monthly,
1016
     checked_quarterly               => $checked_quarterly,
1017
     checked_dauerfristverlaengerung => $checked_dauerfristverlaengerung,
1018
     hidden_variables                => $_hidden_variables_ref,
1019
     
1020
  };
1021
  
1022
  # Ausgabe des Templates
1023
  print($form->parse_html_template('ustva/config_step1', $template_ref));
1024

  
1386 1025
  $lxdebug->leave_sub();
1387 1026
}
1388 1027

  
1389
sub edit_form {
1028
sub config_step2 {
1390 1029
  $lxdebug->enter_sub();
1391 1030
  $form->header();
1392
  print qq|
1393
    <body>
1394
  |;
1031

  
1032
#  print qq|
1033
#    <body>
1034
#  |;
1035

  
1395 1036
  my $elsterland         = '';
1396 1037
  my $elster_amt         = '';
1397 1038
  my $elsterFFFF         = '';
......
1417 1058
  $change = '0' if ($form->{saved} eq $locale->text('saved'));
1418 1059
  my $elster_init = &elster_hash();
1419 1060

  
1420
  #my %elster_init = ();
1421 1061
  my %elster_init = %$elster_init;
1422 1062

  
1423 1063
  if ($change eq '1') {
......
1428 1068
    $form->{elsterland}   = $elsterland;
1429 1069
    $form->{elsterFFFF}   = $elsterFFFF;
1430 1070
    $form->{steuernummer} = '';
1431
    &create_steuernummer;
1071
    
1072
    create_steuernummer();
1432 1073

  
1433 1074
    # rebuild elster_amt
1434 1075
    my $amt = '';
......
1461 1102
  my $patterncount   = $form->{patterncount};
1462 1103
  my $elster_pattern = $form->{elster_pattern};
1463 1104
  my $delimiter      = $form->{delimiter};
1464
  my $steuernummer   = '';
1465
  $steuernummer = $form->{steuernummer} if ($steuernummer eq '');
1466

  
1467
  #Warnung
1468
  my $warnung = $form->{warnung};
1469

  
1470
  #printout form
1471
  print qq|
1472
   <form name="elsterform" method=post action="$form->{script}">
1473
   <table width="100%">
1474
       <tr>
1475
        <th colspan="2" class="listtop">|
1476
    . $locale->text('Tax Office Preferences') . qq|</th>
1477
       </tr>
1478
       <tr>
1479
         <td colspan=2>
1480
         <br>
1481
  |;
1482
  &show_fa_daten;
1483
  print qq|
1484
         </td>
1485
       </tr>
1486
       <tr>
1487
         <td colspan="2">
1488
           <br>
1489
           <fieldset>
1490
           <legend>
1491
           <font size="+1">| . $locale->text('Tax Number') . qq|</font>
1492
           </legend>
1493
           <br>
1494
  |;
1495
  $steuernummer =
1496
    USTVA::steuernummer_input($form->{elsterland}, $form->{elsterFFFF},
1497
                              $form->{steuernummer});
1498
  print qq|
1499
           </H2><br>
1500
           </fieldset>
1501
           <br>
1502
           <br>
1503
           <hr>
1504
         </td>
1505
      </tr>
1506
      <tr>
1507
         <td align="left">
1508

  
1509
          <input type=hidden name=lastsub value="edit">
1510
          |;
1511
  print qq|<input type=submit class=submit name=action value="|
1512
    . $locale->text('back') . qq|">|
1513
    if ($form->{callback} eq '');
1514

  
1515
  print qq|
1516
           <input type="button" name="Verweis" value="|
1517
    . $locale->text('User Config') . qq|" 
1518
            onClick="self.location.href='$form->{callback}'">|
1519
    if ($form->{callback} ne '');
1520

  
1521
  if ($form->{warnung} eq "1") {
1522
    print qq|
1523
          <input type=hidden name=nextsub value="edit_form">
1524
          <input type=submit class=submit name=action value="|
1525
      . $locale->text('continue') . qq|">
1526
          <input type=hidden name="saved" value="|
1527
      . $locale->text('Check Details') . qq|">
1528
    |;
1529
  } else {
1530
    print qq|
1531
          <input type=hidden name="nextsub" value="save">
1532
          <input type=hidden name="filename" value="finanzamt.ini">
1533
          <input type=submit class=submit name=action value="|
1534
      . $locale->text('save') . qq|">
1535
         |;
1536
  }
1105
  my $steuernummer = $form->{steuernummer} if ($steuernummer eq '');
1537 1106

  
1538
  print qq|
1539
         </td>
1540
         <td align="right">
1541
           <H2 class=confirm>$form->{saved}</H2>
1542
         </td>
1543
      </tr>
1544
  </table>
1545
  |;
1107
  $form->{FA_Oeffnungszeiten} =~ s/\\\\n/\n/g;
1108
  
1109
  
1110

  
1111
  my $input_steuernummer = USTVA->steuernummer_input(
1112
                             $form->{elsterland}, 
1113
                             $form->{elsterFFFF},
1114
                             $form->{steuernummer}
1115
  );
1116

  
1117
  $lxdebug->message(LXDebug::DEBUG1, qq|$input_steuernummer|);
1118
 
1119

  
1120
  my $_hidden_variables_ref;
1546 1121

  
1547
  my @variables = qw(FA_steuerberater_name FA_steuerberater_street
1548
    FA_steuerberater_city FA_steuerberater_tel
1549
    FA_voranmeld method
1550
    FA_dauerfrist FA_71 elster
1551
    path login password type elster_init saved
1122
  my %_hidden_local_variables = (
1123
      'elsterland'          => $elsterland,
1124
      'elsterFFFF'          => $elsterFFFF,
1125
      'warnung'             => $warnung,
1126
      'elstersteuernummer'  => $elstersteuernummer,
1127
      'steuernummer'        => $stnr,
1128
      'lastsub'             => 'config_step1',
1129
      'nextsub'             => 'save',
1130
      
1552 1131
  );
1553
  my $variable = '';
1554
  foreach $variable (@variables) {
1555
    print qq|
1556
        <input name="$variable" type="hidden" value="$form->{$variable}">|;
1132
  
1133
  foreach my $variable (keys %_hidden_local_variables) {
1134
    push @{ $_hidden_variables_ref }, 
1135
        { 'variable' => $variable, 'value' => $_hidden_local_variables{$variable} };
1557 1136
  }
1558
  print qq|
1559
          <input type=hidden name="elsterland" value="$elsterland">
1560
          <input type=hidden name="elsterFFFF" value="$elsterFFFF">
1561
          <input type=hidden name="warnung" value="$warnung">
1562
          <input type=hidden name="elstersteuernummer" value="$elstersteuernummer">
1563
          <input type=hidden name="steuernummer" value="$stnr">
1564
          <input type=hidden name="callback" value="$form->{callback}">
1565
  </form>
1566
  |;
1137
 
1138
  my @_hidden_form_variables = qw(
1139
    FA_steuerberater_name   FA_steuerberater_street 
1140
    FA_steuerberater_city   FA_steuerberater_tel
1141
    FA_voranmeld            method
1142
    FA_dauerfrist           FA_71 
1143
    elster                  path 
1144
    login                   password 
1145
    type                    elster_init 
1146
    saved                   callback
1147
  );
1148

  
1149

  
1150

  
1151
  foreach my $variable (@_hidden_form_variables) {
1152
    push @{ $_hidden_variables_ref}, 
1153
        { 'variable' => $variable, 'value' => $form->{$variable} };
1154
  }
1155

  
1156
  my $template_ref = {
1157
     tax_office_data                 => $tax_office_data,
1158
     input_steuernummer              => $input_steuernummer,
1159
     readonly                        => '', #q|disabled="disabled"|,
1160
     callback                        => $callback,
1161
     hidden_variables                => $_hidden_variables_ref,
1162
  };
1163
  
1164
  # Ausgabe des Templates
1165
  print($form->parse_html_template('ustva/config_step2', $template_ref));
1166

  
1167

  
1567 1168
  $lxdebug->leave_sub();
1568 1169
}
1569 1170

  
......
1628 1229
    s/^\s*(.*?)\s*$/$1/;
1629 1230
    ($key, $value) = split /=/, $_, 2;
1630 1231

  
1631
    #if ($value eq ' '){
1632
    #   $form->{$key} = " " ;
1633
    #} elsif ($value ne ' '){
1634 1232
    $form->{$key} = "$value";
1635 1233

  
1636
    #}
1637 1234
  }
1638 1235
  close FACONF;
1639 1236

  
1640
  # Textboxen formatieren: Linebreaks entfernen
1641
  #
1642
  #$form->{FA_Oeffnungszeiten} =~ s/\\\\n/<br>/g;
1643 1237
  $lxdebug->leave_sub();
1644 1238
}
1645 1239

  
......
1648 1242
  my $filename = "$form->{login}_$form->{filename}";
1649 1243

  
1650 1244
  #zuerst die steuernummer aus den part, parts_X_Y und delimiter herstellen
1651
  create_steuernummer;
1245
  create_steuernummer();
1652 1246

  
1653 1247
  # Textboxen formatieren: Linebreaks entfernen
1654 1248
  #
......
1678 1272
    my $key = '';
1679 1273
    foreach $key (sort @config) {
1680 1274
      $form->{$key} =~ s/\\/\\\\/g;
1681
      $form->{$key} =~ s/"/\\"/g;
1682

  
1683 1275
      # strip M
1684 1276
      $form->{$key} =~ s/\r\n/\n/g;
1277

  
1685 1278
      print CONF qq|$key=|;
1686 1279
      if ($form->{$key} ne 'Y') {
1687 1280
        print CONF qq|$form->{$key}\n|;
......
1699 1292
    $form->{saved} = $locale->text('Choose a Tax Number');
1700 1293
  }
1701 1294

  
1702
  &edit_form;
1703
  $lxdebug->leave_sub();
... Dieser Diff wurde abgeschnitten, weil er die maximale Anzahl anzuzeigender Zeilen überschreitet.

Auch abrufbar als: Unified diff