0f5d2f50a49f0c9ba177f02caba7dcda1e0144e8
[kivitendo-erp.git] / templates / webpages / wh / transfer_parts_selection.html
1 [%- USE T8 %]
2 [%- USE HTML %][%- USE JavaScript %]
3 <h1>[% title %]</h1>
4
5  <script type="text/javascript">
6   <!--
7       warehouses = new Array();
8       [% USE WAREHOUSES_it = Iterator(WAREHOUSES) %][% FOREACH wh = WAREHOUSES_it %]
9       warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
10       [% USE BINS_it = Iterator(wh.BINS) %][% FOREACH bin = BINS_it %]warehouses[[% WAREHOUSES_it.count - 1 %]][[% BINS_it.count - 1 %]] = ["[% JavaScript.escape(bin.description) %]", "[% JavaScript.escape(bin.id) %]"];
11       [% END %]
12       [% END %]
13
14       function warehouse_selected(row, index) {
15         var cname = "dst_bin_id_" + row;
16         var control = document.getElementById(cname);
17
18         for (var i = control.options.length - 1; i >= 0; i--) {
19           control.options[i] = null;
20         }
21
22         for (i = 0; i < warehouses[index].length; i++) {
23           control.options[i] = new Option(warehouses[index][i][0], warehouses[index][i][1]);
24         }
25
26         control.options[0].selected = true;
27       }
28
29       $(function() {
30         [% FOREACH row = CONTENTS %]
31         warehouse_selected([% loop.count %], [% initial_warehouse_idx %]);
32         [% END %]
33       });
34     -->
35  </script>
36
37  <form method="post" action="wh.pl">
38
39   <input type="hidden" name="nextsub" value="transfer_parts">
40   <input type="hidden" name="warehouse_id" value="[% HTML.escape(warehouse_id) %]">
41
42   <p>[% 'Transfer from warehouse' | $T8 %]: [% warehouse_description %]</p>
43
44   <p>
45    <table>
46     <tr>
47      <td>[% 'Select type of transfer' | $T8 %]:</td>
48      <td>
49       <select name="transfer_type_id">
50        [%- FOREACH type = TRANSFER_TYPES %]<option value="[% HTML.escape(type.id) %]">[% type.description %]</option>[% END %]
51       </select>
52      </td>
53     </tr>
54
55     <tr>
56      <td>[% 'Optional comment' | $T8 %]:</td>
57      <td><input name="comment" size="20"></td>
58     </tr>
59     <tr>
60      <td>[% 'Change default bin for this parts' | $T8 %]:</td>
61     <td><input type="checkbox" name="change_default_bin"<td>
62     </tr>
63    </table>
64   </p>
65
66   <p>
67    <table>
68     <tr>
69      <th class="listheading">[% 'Source bin' | $T8 %]</th>
70      <th class="listheading">[% 'Part Number' | $T8 %]</th>
71      <th class="listheading">[% 'Part Description' | $T8 %]</th>
72      <th class="listheading">[% 'Charge Number' | $T8 %]</th>
73      [% IF INSTANCE_CONF.get_show_bestbefore %]
74      <th class="listheading">[% 'Best Before' | $T8 %]</th>
75      [% END %]
76      <th class="listheading">[% 'EAN' | $T8 %]</th>
77      <th class="listheading">[% 'Available qty' | $T8 %]</th>
78      <th class="listheading" colspan="2">[% 'Transfer qty' | $T8 %]</th>
79      <th class="listheading" colspan="2">[% 'Destination warehouse and bin' | $T8 %]</th>
80     </tr>
81
82     [% FOREACH row = CONTENTS %]
83     <tr class="listrow[% loop.count % 2 %]">
84      <input type="hidden" name="src_bin_id_[% loop.count %]" value="[% HTML.escape(row.binid) %]">
85      <input type="hidden" name="parts_id_[% loop.count %]" value="[% HTML.escape(row.parts_id) %]">
86      <input type="hidden" name="partnumber_[% loop.count %]" value="[% HTML.escape(row.partnumber) %]">
87      <input type="hidden" name="partdescription_[% loop.count %]" value="[% HTML.escape(row.partdescription) %]">
88      <input type="hidden" name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]">
89      [% IF INSTANCE_CONF.get_show_bestbefore %]
90      <input type="hidden" name="bestbefore_[% loop.count %]" value="[% HTML.escape(row.bestbefore) %]">
91      [% END %]
92      <input type="hidden" name="ean_[% loop.count %]" value="[% HTML.escape(row.ean) %]">
93      <td>[% HTML.escape(row.bindescription) %]</td>
94      <td>[% HTML.escape(row.partnumber) %]</td>
95      <td>[% HTML.escape(row.partdescription) %]</td>
96      <td>[% HTML.escape(row.chargenumber) %]</td>
97      [% IF INSTANCE_CONF.get_show_bestbefore %]
98      <td>[% HTML.escape(row.bestbefore) %]</td>
99      [% END %]
100      <td>[% HTML.escape(row.ean) %]</td>
101      <td>[% HTML.escape(row.qty) %]</td>
102      <td><input name="qty_[% loop.count %]" size="8" style="text-align: right"></td>
103      <td>
104       <select name="unit_[% loop.count %]">
105        [% FOREACH unit = row.UNITS %]<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>[% END %]
106       </select>
107      </td>
108
109      <td>
110       <select name="dst_warehouse_id_[% loop.count %]" onchange="warehouse_selected([% loop.count %], this.selectedIndex)">
111        [% FOREACH wh = WAREHOUSES %]<option value="[% HTML.escape(wh.id) %]"[% IF wh.selected %] selected[% END %]>[% HTML.escape(wh.description) %]</option>[% END %]
112       </select>
113      </td>
114      <td><select id="dst_bin_id_[% loop.count %]" name="dst_bin_id_[% loop.count %]"></select></td>
115     </tr>
116
117     [% END %]
118
119     <input type="hidden" name="rowcount" value="[% CONTENTS.size %]">
120
121    </table>
122   </p>
123
124   <hr size="3" noshade>
125
126   <p>
127    <input type="submit" class="submit" name="action" value="[% 'Continue' | $T8 %]">
128   </p>
129  </form>
130