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