ddc9539151156d92d68358beccd517afd9cd1666
[kivitendo-erp.git] / templates / webpages / am / edit_units.html
1 [%- USE T8 %][%- USE LxERP %]
2 [% USE HTML %]<body>
3
4  [% IF saved_message %]
5   <p>[% saved_message %]</p>
6
7   <hr>
8  [% END %]
9
10  <form method="post" action="[% HTML.escape(script) %]">
11
12  <input type="hidden" name="type" value="unit">
13
14  <table width="100%">
15   <tr>
16    <th class="listtop" colspan="2">[% title %]</th>
17   </tr>
18   <tr height="5"></tr>
19  </table>
20
21  <p>
22   [% LxERP.t8('All units have either no or exactly one base unit of which they are multiples.') %]
23   [% LxERP.t8('If you select a base unit then you also have to enter a factor.') %]
24   [% LxERP.t8('You have to define a unit as a multiple of a smaller unit.') %]
25   [% LxERP.t8('Therefore the definition of "kg" with the base unit "g" and a factor of 1000 is valid while defining "g" with a base unit of "kg" and a factor of "0.001" is not.') %]
26  </p>
27
28  <hr>
29
30  <table width="100%">
31   <tr><th class="listtop">[% 'Add unit' | $T8 %]</th></tr>
32  </table>
33
34  <table>
35   <tr>
36    <th align="right">[% 'Unit' | $T8 %]</th>
37    <td><input name="new_name" size="20" maxlength="20"></td>
38   </tr>
39   <tr>
40    <th align="right">[% 'Base unit' | $T8 %]</th>
41    <td>
42     <select name="new_base_unit">
43      [% FOREACH row = NEW_BASE_UNIT_DDBOX %]<option [% row.selected %]>[% row.name %]</option>[% END %]
44     </select>
45    </td>
46   </tr>
47   <tr>
48    <th align="right">[% 'Factor' | $T8 %]</th>
49    <td><input name="new_factor"></td>
50   </tr>
51
52   [% FOREACH language = LANGUAGES %]
53    <tr>
54     <th align="right">[% language.description %]</th>
55     <td><input name="new_localized_[% language.id %]" size="20" maxlength="20"></td>
56     <th align="right">[% 'Plural' | $T8 %]</th>
57     <td><input name="new_localized_plural_[% language.id %]" size="20" maxlength="20"></td>
58    </tr>
59   [% END %]
60  </table>
61
62  <input type="submit" class="submit" name="action" value="[% 'Add' | $T8 %]">
63
64  <hr>
65
66  <table width="100%">
67   <tr><th class="listtop">[% 'Edit units' | $T8 %]</th></tr>
68  </table>
69
70  <p>
71   [% 'Units that have already been used (e.g. for parts and services or in invoices or warehouse transactions) cannot be changed.' | $T8 %]
72  </p>
73
74  <p>
75   [% 'Units marked for deletion will be deleted upon saving.' | $T8 %]
76  </p>
77
78  <p>
79   [% 'You can declare different translations for singular and plural for each unit (e.g. &quot;day&quot; and &quot;days).' | $T8 %]
80  </p>
81
82  <table>
83   <tr class="listheading">
84    <th width="32" align="center" valign="center"><img alt="[% 'up' | $T8 %]" src="image/up.png"><img alt="[% 'down' | $T8 %]" src="image/down.png"></th>
85    <th>[% 'Delete' | $T8 %]</th>
86    <th>[% 'Unit' | $T8 %]</th>
87    <th>[% 'Base unit' | $T8 %]</th>
88    <th>[% 'Factor' | $T8 %]</th>
89    [% FOREACH language = LANGUAGES %]
90     <th>[% language.description %]</th>
91    [% END %]
92   </tr>
93
94   [% FOREACH row = UNITS %]
95    <tr class="listrow[% loop.count % 2 %]">
96     <td width="32" align="center" valign="center">[% IF loop.first %]<img src="image/transparent16x16.gif">[% ELSE %]<a href="[% updownlink %]&dir=up&name=[% HTML.url(row.name) %]"><img alt="[% 'up' | $T8 %]" src="image/up.png" border="0"></a>[% END %][% IF loop.last %]<img src="image/transparent16x16.gif">[% ELSE %]<a href="[% updownlink %]&dir=down&name=[% HTML.url(row.name) %]"><img alt="[% 'down' | $T8 %]" src="image/down.png" border="0"></a>[% END %]</td>
97     [% IF row.in_use %]
98      <td>
99       <input type="hidden" name="unchangeable_[% loop.count %]" value="1">
100       <input type="hidden" name="old_name_[% loop.count %]" value="[% HTML.escape(row.name) %]">
101      </td>
102
103      <td>[% HTML.escape(row.name) %]</td>
104      <td>[% IF row.base_unit %][% HTML.escape(row.base_unit) %][% ELSE %]---[% END %]</td>
105      <td>[% IF row.base_unit %][% HTML.escape(row.factor) %][% ELSE %]---[% END %]</td>
106
107      [% ELSE %]
108
109      <td align="center"><input type="checkbox" name="delete_[% loop.count %]"></td>
110      <td>
111       <input type="hidden" name="old_name_[% loop.count %]" value="[% HTML.escape(row.name) %]">
112       <input name="name_[% loop.count %]" size="10" maxlength="20" value="[% HTML.escape(row.name) %]">
113      </td>
114      <td>
115       <select name="base_unit_[% loop.count %]">
116        [% FOREACH option = row.BASE_UNIT_DDBOX %]<option [% option.selected %]>[% HTML.escape(option.name) %]</option>[% END %]
117       </select>
118      </td>
119      <td><input name="factor_[% loop.count %]" size="8" value="[% row.factor %]"></td>
120     [% END %]
121
122     [% FOREACH language = row.UNITLANGUAGES %]
123      <td>
124       [% 'singular first char' | $T8 %]:
125       <input name="localized_[% language.idx %]_[% language.language_id %]" value="[% HTML.escape(language.localized) %]" size="6" maxlength="20">
126       [% 'plural first char' | $T8 %]:
127       <input name="localized_plural_[% language.idx %]_[% language.language_id %]" value="[% HTML.escape(language.localized_plural) %]" size="6" maxlength="20">
128      </td>
129     [% END %]
130    </tr>
131
132    [% IF loop.last %]<input type="hidden" name="rowcount" value="[% loop.count %]">[% END %]
133   [% END %]
134  </table>
135
136  <input type="submit" class="submit" name="action" value="[% 'Save' | $T8 %]">
137
138  </form>
139
140 </body>
141 </html>