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