Date-Input-Felder durch 'L.date_tag's ersetzt
[kivitendo-erp.git] / templates / webpages / wh / warehouse_selection.html
1 [%- USE T8 %]
2 [%- USE HTML %]
3 [%- USE L %]
4 [% USE JavaScript %]<body onload="on_load();">
5
6  <script type="text/javascript" src="js/common.js"></script>
7  <script type="text/javascript" src="js/part_selection.js"></script>
8  <script type="text/javascript">
9    <!--
10       warehouses = new Array();
11       [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
12       warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
13       warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
14       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
15       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0] = new Array();
16       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['description'] = "---";
17       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['id'] = "";
18       [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
19       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]] = new Array();
20       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['description'] = "[% JavaScript.escape(bin.description) %]";
21       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['id'] = [% bin.id %];
22       [% END %]
23       [% END %]
24
25       function warehouse_selected(warehouse_id, bin_id) {
26         var control = document.getElementById("bin_id");
27
28         for (var i = control.options.length - 1; i >= 0; i--) {
29           control.options[i] = null;
30         }
31
32         var warehouse_index = 0;
33
34         for (i = 0; i < warehouses.length; i++)
35           if (warehouses[i]['id'] == warehouse_id) {
36             warehouse_index = i;
37             break;
38           }
39
40         var warehouse = warehouses[warehouse_index];
41         var bin_index = 0;
42
43         for (i = 0; i < warehouse['bins'].length; i++)
44           if (warehouse['bins'][i]['id'] == bin_id) {
45             bin_index = i;
46             break;
47           }
48
49         for (i = 0; i < warehouse['bins'].length; i++) {
50           control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
51         }
52
53
54         control.options[bin_index].selected = true;
55       }
56
57       function on_load() {
58         warehouse_selected(0, 0);
59         document.Form.partnumber.focus();
60       }
61      -->
62  </script>
63
64  <form name="Form" method="post" action="wh.pl">
65
66   <input type="hidden" name="nextsub" value="[% HTML.escape(nextsub) %]">
67
68   [% IF saved_message %]
69   <p>[% saved_message %]</p>
70   [% END %]
71
72   <div class="listtop">[% title %]</div>
73
74   <p>
75    [% 'If you enter values for the part number and / or part description then only those bins containing parts whose part number or part description match your input will be shown.' | $T8 %]
76   </p>
77
78   <p>
79    <table>
80     <tr>
81      <th align="right" nowrap>[% 'Transfer from warehouse' | $T8 %]:</th>
82      <td>
83       <select name="warehouse_id" id="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
84        [%- FOREACH warehouse = WAREHOUSES %]
85        <option value="[% HTML.escape(warehouse.id) %]">[% warehouse.description %]</option>
86        [%- END %]
87       </select>
88      </td>
89     </tr>
90
91     <tr>
92      <th align="right" nowrap>[% 'Bin' | $T8 %]:</th>
93      <td><select id="bin_id" name="bin_id"></select></td>
94     </tr>
95
96     <tr>
97      <th align="right" nowrap>[% 'Limit part selection' | $T8 %]:</th>
98      <td></td>
99     </tr>
100
101     <tr>
102      <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
103      <td>
104       <input type="hidden" name="parts_id" id="parts_id">
105       <input name="partnumber" id="partnumber" size="30">
106      </td>
107     </tr>
108
109     <tr>
110      <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
111      <td>
112       <input name="description" size="30">
113       <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', '')" value="?">
114      </td>
115     </tr>
116
117     <tr>
118      <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
119      <td><input name="chargenumber" size="30"></td>
120     </tr>
121
122     [% IF conf_show_best_before %]
123     <tr>
124      <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
125      <td>
126        [% L.date_tag('bestbefore') %]
127      </td>
128     </tr>
129     [% END %]
130
131     <tr>
132      <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
133      <td><input name="ean" size="30"></td>
134     </tr>
135    </table>
136   </p>
137
138   <p>
139    <input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]">
140   </p>
141  </form>
142
143 </body>
144 </html>