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