+ my $address_given =
+ ($form->{co_street} && ($form->{co_zip} || $form->{co_city}))
+ ? qq|$form->{co_street}<br>|
+ . qq|$form->{co_street1}<br>|
+ . qq|$form->{co_zip} $form->{co_city}|
+ : qq|<a href="controller.pl?action=ClientConfig/edit">|
+ . $locale->text('No Company Address given')
+ . qq|!</a>\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};
+
+ my $taxnumber_given = ($form->{taxnumber} ne '') ? $form->{taxnumber} : qq|<a href="ustva.pl?action=config_step1">Keine Steuernummer hinterlegt!</a><br>|;
+ my $fa_name_given = ($form->{fa_name} ne '') ? $form->{fa_name} : qq|<a href="ustva.pl?action=config_step1">Kein Finanzamt hinterlegt!</a><br>|;
+ my $ustva_vorauswahl = &ustva_vorauswahl();
+
+ my @all_years = $form->all_years(\%myconfig);
+
+ my $select_year = qq|<select name=year title="|
+ . $locale->text('Year') . qq|">|;
+ foreach my $key (@all_years) {
+ $select_year .= qq|<option |;
+ $select_year .= qq|selected| if ($key eq $form->{year});
+ $select_year .= qq| >$key</option>|;
+ }
+ $select_year .= qq|</select>|;
+
+ my $_checked = '';
+ $_checked = "checked" if ($form->{kz10} eq '1');
+ my $checkbox_kz_10 = qq|<input name="FA_10" id=FA_10 class=checkbox|
+ . qq| type=checkbox value="1" $_checked title = "|
+ . $locale->text('Amended Advance Turnover Tax Return').'(Nr. 10)'
+ . qq|">|
+ . $locale->text('Amended Advance Turnover Tax Return');
+
+ $_checked = "checked" if ($form->{kz22} eq '1');
+ my $checkbox_kz_22 = qq|<input name="FA_22" id=FA_22 class=checkbox|
+ . qq| type=checkbox value="1" $_checked title = "|
+ . $locale->text('Receipts attached/extra').'(Nr. 22)'
+ . qq|">|
+ . $locale->text('Receipts attached/extra');
+
+ $_checked = "checked" if ($form->{kz29} eq '1');
+ my $checkbox_kz_29 = qq|<input name="FA_29" id=FA_29 class=checkbox|
+ . qq| type=checkbox value="1" $_checked title = "|
+ . $locale->text('Accounting desired').'(Nr. 29)'
+ . qq|">|
+ . $locale->text('Accounting desired');
+
+ $_checked = "checked" if ($form->{kz26} eq '1');
+ my $checkbox_kz_26 = qq|<input name="FA_26" id=FA_26 class=checkbox|
+ . qq| type=checkbox value="1" $_checked title = "|
+ . $locale->text('Direct debit revoked').'(Nr. 26)'
+ . qq|">|
+ . $locale->text('Direct debit revoked');
+
+ my $method_local = ($form->{accounting_method} eq 'accrual') ? $locale->text('accrual')
+ : ($form->{accounting_method} eq 'cash') ? $locale->text('cash')
+ : '';
+
+ my $period_local = ( $form->{fa_voranmeld} eq 'month') ? $locale->text('month')
+ : ( $form->{fa_voranmeld} eq 'quarter') ? $locale->text('quarter')
+ : '';
+
+ my @tax_office_banks_ref = (
+ { BLZ => $form->{fa_blz_1},
+ Kontonummer => $form->{fa_kontonummer_1},
+ Bankbezeichnung => $form->{fa_bankbezeichnung_1}
+ },
+ { BLZ => $form->{fa_blz_2},
+ Kontonummer => $form->{fa_kontonummer_2},
+ Bankbezeichnung => $form->{fa_bankbezeichnung_2}
+ }
+ );
+
+ $ustva->get_coa($form); # fetches coa and modifies some form variables
+
+ my $template_ref = {
+ openings => $openings,
+ company_given => $company_given,
+ address_given => $address_given,
+ taxnumber_given => $taxnumber_given,
+ fa_name_given => $fa_name_given,
+ taxnumber => $defaults->taxnumber,
+ select_year => $select_year,
+ period_local => $period_local,
+ method_local => $method_local,
+ ustva_vorauswahl => $ustva_vorauswahl,
+ checkbox_kz_10 => $checkbox_kz_10,
+ checkbox_kz_22 => $checkbox_kz_22,
+ checkbox_kz_29 => $checkbox_kz_29,
+ checkbox_kz_26 => $checkbox_kz_26,
+ tax_office_banks => \@tax_office_banks_ref,
+ select_options => &show_options,