Revision 1672583a
Von Niclas Zimmermann vor mehr als 11 Jahren hinzugefügt
SL/AM.pm | ||
---|---|---|
1779 | 1779 |
taxkey, |
1780 | 1780 |
taxdescription, |
1781 | 1781 |
round(rate * 100, 2) AS rate, |
1782 |
chart_id |
|
1782 |
chart_id, |
|
1783 |
(id IN (SELECT tax_id |
|
1784 |
FROM acc_trans)) AS tax_already_used |
|
1783 | 1785 |
FROM tax |
1784 | 1786 |
WHERE id = ? |; |
1785 | 1787 |
|
bin/mozilla/am.pl | ||
---|---|---|
1491 | 1491 |
|
1492 | 1492 |
$form->header(); |
1493 | 1493 |
|
1494 |
#set readonly if the there are entries in acc_trans with the tax |
|
1495 |
my $readonly = $form->{tax_already_used} ? 'readonly' : ''; |
|
1496 |
|
|
1494 | 1497 |
my $parameters_ref = { |
1498 |
readonly => $readonly, |
|
1495 | 1499 |
}; |
1496 | 1500 |
|
1497 | 1501 |
# Ausgabe des Templates |
... | ... | |
1552 | 1556 |
|
1553 | 1557 |
$main::auth->assert('config'); |
1554 | 1558 |
|
1555 |
$form->isblank("rate", $locale->text('Taxrate missing!'));
|
|
1556 |
$form->isblank("taxdescription", $locale->text('Taxdescription missing!'));
|
|
1557 |
$form->isblank("taxkey", $locale->text('Taxkey missing!'));
|
|
1559 |
$form->error($locale->text('Taxkey missing!')) unless length($form->{taxkey}) != 0;
|
|
1560 |
$form->error($locale->text('Taxdescription missing!')) unless length($form->{taxdescription}) != 0;
|
|
1561 |
$form->error($locale->text('Taxrate missing!')) unless length($form->{rate}) != 0;
|
|
1558 | 1562 |
|
1559 | 1563 |
$form->{rate} = $form->parse_amount(\%myconfig, $form->{rate}); |
1560 | 1564 |
|
1565 |
if ($form->{taxkey} == 0 and $form->{rate} > 0) { |
|
1566 |
$form->error($locale->text('Taxkey 0 is reserved for rate 0')); |
|
1567 |
} |
|
1568 |
|
|
1561 | 1569 |
if ( $form->{rate} < 0 || $form->{rate} >= 100 ) { |
1562 | 1570 |
$form->error($locale->text('Tax Percent is a number between 0 and 100')); |
1563 | 1571 |
} |
locale/de/all | ||
---|---|---|
1858 | 1858 |
'Taxes' => 'Steuern', |
1859 | 1859 |
'Taxkey' => 'Steuerschlüssel', |
1860 | 1860 |
'Taxkey missing!' => 'Steuerschlüssel fehlt!', |
1861 |
'Taxkey 0 is reserved for rate 0' => 'Der Steuerschlüssel 0 darf keinen Steuersatz über 0 haben.', |
|
1861 | 1862 |
'Taxkey_coa' => 'Steuerschlüssel', |
1862 | 1863 |
'Taxkeys and Taxreport Preferences' => 'Steuerautomatik und UStVA', |
1863 | 1864 |
'Taxlink_coa' => 'Steuerautomatik', |
locale/en/all | ||
---|---|---|
1814 | 1814 |
'Taxes' => '', |
1815 | 1815 |
'Taxkey' => '', |
1816 | 1816 |
'Taxkey missing!' => '', |
1817 |
'Taxkey 0 is reserved for rate 0' => '', |
|
1817 | 1818 |
'Taxkey_coa' => '', |
1818 | 1819 |
'Taxkeys and Taxreport Preferences' => '', |
1819 | 1820 |
'Taxlink_coa' => '', |
templates/webpages/am/edit_tax.html | ||
---|---|---|
9 | 9 |
<table width="100%"> |
10 | 10 |
<tr> |
11 | 11 |
<td>[% 'tax_taxkey' | $T8 %]</td> |
12 |
<td><input name="taxkey" size="2" value="[% HTML.escape(taxkey) %]"></td> |
|
12 |
<td><input name="taxkey" size="2" value="[% HTML.escape(taxkey) %]" [% readonly %]></td>
|
|
13 | 13 |
</tr> |
14 | 14 |
|
15 | 15 |
<tr> |
... | ... | |
19 | 19 |
|
20 | 20 |
<tr> |
21 | 21 |
<td>[% 'tax_percent' | $T8 %]</td> |
22 |
<td><input name="rate" size="10" value="[% HTML.escape(rate) %]"> %</td> |
|
22 |
<td><input name="rate" size="10" value="[% HTML.escape(rate) %]" [% readonly %]> %</td>
|
|
23 | 23 |
</tr> |
24 | 24 |
|
25 | 25 |
<tr> |
... | ... | |
42 | 42 |
|
43 | 43 |
<input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]"> |
44 | 44 |
|
45 |
[% IF orphaned %] |
|
45 |
[% IF orphaned AND NOT tax_already_used %]
|
|
46 | 46 |
<input type="submit" class="submit" name="action" value="[% 'Delete' | $T8 %]"> |
47 | 47 |
[% END %] |
48 | 48 |
|
Auch abrufbar als: Unified diff
Steuern festsetzen
Dieser Commit macht Steuern unveränderbar, wenn mit diesen schon
gebucht wurde, d.h. ein Eintrag in der acc_trans steht. Man kann nur
noch Namen und Automatikkonten verändern. Weiterhin findet eine
Prüfung statt, ob Steuerschlüssel 0 ohne Steuern gespeichert wird.
Die Abfrage isblank war leider fehlerhaft und wurde ebenfalls ersetzt.
Bisher lieferte kivitendo auch Fehler, wenn man Namen von Konten
mit Steuerschlüssel 0 ändert. Das sollte nicht so sein.