Buchungsgruppe anlegen/bearbeiten/anzeigen - Logik umgestellt
[kivitendo-erp.git] / templates / webpages / buchungsgruppen / form.html
1 [%- USE HTML -%][%- USE LxERP -%][%- USE L -%][%- USE T8 -%]
2
3 <h1>[% HTML.escape(title) %]</h1>
4
5 <form action="controller.pl" method="post">
6 [%- L.hidden_tag("id", SELF.config.id) %]
7
8 <table>
9   <tr>
10     <th align="right">[% 'Description' | $T8 %]</th>
11     <td>[%- L.input_tag("config.description", SELF.config.description) %]</td>
12   </tr>
13   <tr>
14     <th align="right">[% 'Inventory account' | $T8 %]</th>
15     [%- IF NOT SELF.config.id %]
16       <td>[%- L.select_tag("config.inventory_accno_id", ACCOUNTS.ic, title_sub=\account_label, default=SELF.defaults.inventory_accno_id) %]</td>
17     [%- ELSIF SELF.config.id AND SELF.config.orphaned %]
18       <td>[%- L.select_tag("config.inventory_accno_id", ACCOUNTS.ic, title_sub=\account_label, default=SELF.config.inventory_accno_id) %]</td>
19     [%- ELSE %]
20       <td>[%- CHARTLIST.inventory_accno %] -- [%- CHARTLIST.inventory_accno_description %]</td>
21     [%- END %]
22   </tr>
23 [%- FOREACH tz = TAXZONES %]
24   <tr>
25     <th align="right">[% 'Revenue' | $T8 %] [% HTML.escape(tz.description) %]</th>
26     [%- IF NOT SELF.config.id %]
27       <td>[%- L.select_tag('income_accno_id_' _ tz.id, ACCOUNTS.ic_income, title_sub=\account_label, default=SELF.defaults.income_accno_id) %]</td>
28     [%- ELSIF SELF.config.id AND SELF.config.orphaned %]
29       <td>[%- L.select_tag('income_accno_id_' _ tz.id, ACCOUNTS.ic_income, title_sub=\account_label, default=CHARTLIST.${tz.id}.income_accno_id) %]</td>
30     [%- ELSE %]
31       <td>[% CHARTLIST.${tz.id}.income_accno %] -- [% CHARTLIST.${tz.id}.income_accno_description %]</td>
32     [%- END %]
33   </tr>
34   <tr>
35     <th align="right">[% 'Expense' | $T8 %] [% HTML.escape(tz.description) %]</th>
36     [%- IF NOT SELF.config.id %]
37       <td>[%- L.select_tag('expense_accno_id_' _ tz.id, ACCOUNTS.ic_expense, title_sub=\account_label, default=SELF.defaults.expense_accno_id) %]</td>
38     [%- ELSIF SELF.config.id AND SELF.config.orphaned %]
39       <td>[%- L.select_tag('expense_accno_id_' _ tz.id, ACCOUNTS.ic_expense, title_sub=\account_label, default=CHARTLIST.${tz.id}.expense_accno_id) %]</td>
40     [%- ELSE %]
41       <td>[% CHARTLIST.${tz.id}.expense_accno %] -- [% CHARTLIST.${tz.id}.expense_accno_description %]</td>
42     [%- END %]
43   </tr>
44 [%- END %]
45 </table>
46
47  <p>
48   [% L.hidden_tag("action", "Buchungsgruppen/dispatch") %]
49   [% L.submit_tag("action_" _  (SELF.config.id ? "update" : "create"), LxERP.t8('Save'), onclick="return check_prerequisites();") %]
50   [%- IF SELF.config.id AND SELF.config.orphaned %]
51     [% L.submit_tag("action_delete", LxERP.t8('Delete'), confirm=LxERP.t8('Are you sure?')) %]
52   [%- END %]
53  </p>
54
55  <hr>
56
57 <script type="text/javascript">
58 <!--
59 function check_prerequisites() {
60   if ($('#config_description').val() === "") {
61     alert(kivi.t8('The description is missing.'));
62     return false;
63   }
64
65   return true;
66 }
67 -->
68 </script>
69 </form>