Lagerbewegungen auch für Dienstleistungen friegeben.
[kivitendo-erp.git] / templates / webpages / wh / warehouse_selection_stock.html
1 [%- USE T8 %]
2 [% USE HTML %][% USE JavaScript %][% USE LxERP %]<body onload="on_load(); [% onload %]">
3
4  <script type="text/javascript" src="js/common.js"></script>
5  <script type="text/javascript" src="js/part_selection.js"></script>
6  <script type="text/javascript">
7   <!--
8       warehouses = new Array();
9       [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
10       warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
11       warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
12       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
13       [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
14       warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]] = new Array();
15       warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
16       warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
17       [% END %]
18       [% END %]
19
20       function warehouse_selected(warehouse_id, bin_id) {
21         var control = document.getElementById("bin_id");
22
23         for (var i = control.options.length - 1; i >= 0; i--) {
24           control.options[i] = null;
25         }
26
27         var warehouse_index = 0;
28
29         for (i = 0; i < warehouses.length; i++)
30           if (warehouses[i]['id'] == warehouse_id) {
31             warehouse_index = i;
32             break;
33           }
34
35         var warehouse = warehouses[warehouse_index];
36         var bin_index = 0;
37
38         for (i = 0; i < warehouse['bins'].length; i++)
39           if (warehouse['bins'][i]['id'] == bin_id) {
40             bin_index = i;
41             break;
42           }
43
44         for (i = 0; i < warehouse['bins'].length; i++) {
45           control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
46         }
47
48
49         control.options[bin_index].selected = true;
50       }
51
52       function on_load() {
53         warehouse_selected([% warehouse_id %], [% bin_id %]);
54       }
55     -->
56  </script>
57
58  <form name="Form" method="post" action="wh.pl">
59
60   <input type="hidden" name="nextsub" value="transfer_stock">
61   <input type="hidden" name="update_nextsub" value="transfer_stock_update_part">
62
63   [% IF saved_message %]
64   <p>[% saved_message %]</p>
65   [% END %]
66
67   <div class="listtop">[% title %]</div>
68
69   <p>
70    <table>
71     <tr>
72      <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
73      <td>
74       <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
75        [%- FOREACH warehouse = WAREHOUSES %]
76        <option value="[% HTML.escape(warehouse.id) %]"[% IF warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
77        [%- END %]
78       </select>
79      </td>
80     </tr>
81
82     <tr>
83      <th align="right" nowrap>[% 'Destination bin' | $T8 %]:</th>
84      <td><select id="bin_id" name="bin_id"></select></td>
85     </tr>
86
87     <tr>
88      <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
89      <td>
90       <input type="hidden" name="parts_id" id="parts_id" value="[% HTML.escape(parts_id) %]">
91       <input type="hidden" name="old_partnumber" id="old_partnumber" value="[% HTML.escape(partnumber) %]">
92       <input name="partnumber" size="30" value="[% HTML.escape(partnumber) %]">
93      </td>
94     </tr>
95
96     <tr>
97      <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
98      <td>
99       <input name="description" size="30" value="[% HTML.escape(description) %]">
100       <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'click_button=update_button')" value="?">
101      </td>
102     </tr>
103
104     <tr>
105      <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
106      <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
107     </tr>
108
109     [% IF conf_show_best_before %]
110     <tr>
111      <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
112      <td>
113        <input name="bestbefore" id="bestbefore" size="11" value="[% HTML.escape(bestbefore) %]" title="[% myconfig_dateformat %]">
114        <input type="button" name="b_bestbefore" id="bestbefore_trigger" value="?">
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  [% IF conf_show_best_before %]
151  <script type="text/javascript">
152    <!--
153      Calendar.setup( {
154      inputField : "bestbefore",
155      ifFormat :"[% myconfig_jsc_dateformat %]",
156      align : "BR",
157      button : "bestbefore_trigger"
158      });
159    //-->
160  </script>
161   [% END %]
162
163 </body>
164 </html>