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