if ($form->{charttype} eq 'A'){
$form->isblank("category", $locale->text('Account Type missing!'));
+
+ my $found_valid_taxkey = 0;
+ foreach my $i (0 .. 10) { # 10 is maximum count of taxkeys in form
+ if ($form->{"taxkey_startdate_$i"} and !$form->{"taxkey_del_$i"}) {
+ $found_valid_taxkey = 1;
+ last;
+ }
+ }
+ if ($found_valid_taxkey == 0) {
+ $form->error($locale->text('A valid taxkey is missing!'));
+ }
}
$form->redirect($locale->text('Account saved!'))
'A temporary file could not be created. Please verify that the directory "#1" is writeable by the webserver.' => 'Eine temporäre Datei konnte nicht angelegt werden. Bitte stellen Sie sicher, dass das Verzeichnis "#1" vom Webserver beschrieben werden darf.',
'A temporary file could not be created:' => 'Eine temporäre Datei konnte nicht erstellt werden:',
'A unit with this name does already exist.' => 'Eine Einheit mit diesem Namen existiert bereits.',
+ 'A valid taxkey is missing!' => 'Einen gültiger Steuerschlüssel fehlt!',
'A variable marked as \'editable\' can be changed in each quotation, order, invoice etc.' => 'Eine als \'editierbar\' markierte Variable kann in jedem Angebot, Auftrag, jeder Rechnung etc für jede Position geändert werden.',
'ADDED' => 'Hinzugefügt',
'AP' => 'Einkauf',
'A temporary file could not be created. Please verify that the directory "#1" is writeable by the webserver.' => '',
'A temporary file could not be created:' => '',
'A unit with this name does already exist.' => '',
+ 'A valid taxkey is missing!' => '',
'A variable marked as \'editable\' can be changed in each quotation, order, invoice etc.' => '',
'ADDED' => '',
'AP' => 'Purchases',
<p style='font-weight:normal'>[% 'Note: Taxkeys must have a "valid from" date, and will not behave correctly without.' | $T8 %]</p>
<table>
-[% IF account_exists %]
<tr>
<th align="left">[% 'Taxkey' | $T8 %]</th>
<th align="left">[% 'valid from' | $T8 %]</th>
<th align="left">[% 'delete' | $T8 %] ? </th>
</tr>
[% FOREACH tk = ACCOUNT_TAXKEYS %]
+
<tr>
[% IF tk.id %]
<input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="[% tk.id %]">
[% ELSE %]
<input type="hidden" name="taxkey_id_[% tk.runningnumber %]" value="NEW">
<td><select name="taxkey_tax_[% tk.runningnumber %]">[% tk.selecttaxkey %]</select></td>
+ [% IF account_exists %]
<td><input name="taxkey_startdate_[% tk.runningnumber %]" value="[% HTML.escape(tk.startdate) %]"></td>
+ [% ELSE %]
+ <td><input name="taxkey_startdate_[% tk.runningnumber %]" value="01.01.1970"></td>
+ [% END %]
<td><select name="taxkey_pos_ustva_[% tk.runningnumber %]">[% tk.select_tax %]</select></td>
<td> </td>
[% END %]
</tr>
+
[% END %]
-[% ELSE %]
-<tr>
- <td align="center" colspan="4"><p>[% 'Save account first to insert taxkeys' | $T8 %]</p>
- </td>
-</tr>
-[% END %]
- </table>
+ </table>
</fieldset>
<fieldset class="DEPENDS ON charttype BEING A">