Option für Mindesthaltbarkeitsdatum in Mandantenkonfiguration verschoben.
[kivitendo-erp.git] / templates / webpages / do / stock_in_form.html
1 [%- USE T8 %]
2 [%- USE L %]
3 [%- USE HTML %][%- USE LxERP %][%- USE JavaScript %]
4  [%- UNLESS delivered %]
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, initial_bin_index) {
15         var cname = "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         if (!initial_bin_index)
27           initial_bin_index = 0;
28         control.options[initial_bin_index].selected = true;
29       }
30
31       $(function(){
32         [%- USE STOCK_INFO_it = Iterator(STOCK_INFO) %][%- FOREACH si = STOCK_INFO_it %]
33           // new si for wh [% si.warehouse_id %] bin [% si.bin_id %]
34           [%- SET warehouse_selected = '0' %]
35           [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH wh = WAREHOUSES_it %]
36             // wh [% wh.id %]
37             [%- USE BINS_it = Iterator(wh.BINS) %][%- FOREACH bin = BINS_it %]
38               // bin [% bin.id %]
39               [%- IF bin.id == si.bin_id %]
40                 warehouse_selected([% STOCK_INFO_it.count %], [% WAREHOUSES_it.count - 1 %], [% BINS_it.count - 1%]);
41                 [%- SET warehouse_selected = '1' %]
42               [%- END %]
43             [%- END %]
44           [%- END %]
45           [%- UNLESS warehouse_selected %]
46           warehouse_selected([% STOCK_INFO_it.count %], 0);
47           [%- END %]
48         [%- END %]
49       });
50     -->
51  </script>
52  [%- END %]
53
54  <form method="post" action="do.pl" name="Form">
55
56   <div class="listtop">[% title %]</div>
57
58   [%- IF ERRORS && ERRORS.size %]
59   <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
60   [%- END %]
61
62   <p>
63    <table>
64     <tr>
65      <td>[% 'Part Number' | $T8 %]</td>
66      <td>[% HTML.escape(PART_INFO.partnumber) %]</td>
67     </tr>
68     <tr>
69      <td>[% 'Description' | $T8 %]</td>
70      <td>[% HTML.escape(PART_INFO.description) %]</td>
71     </tr>
72     <tr>
73      <td>[% 'Qty according to delivery order' | $T8 %]</td>
74      <td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td>
75     </tr>
76    </table>
77   </p>
78
79   <input type="hidden" name="nextsub"        value="set_stock_in">
80   <input type="hidden" name="update_nextsub" value="update_stock_in">
81   <input type="hidden" name="rowcount"       value="[% HTML.escape(STOCK_INFO.size) %]">
82   <input type="hidden" name="in_out"         value="in">
83   <input type="hidden" name="parts_id"       value="[% HTML.escape(parts_id) %]">
84   <input type="hidden" name="partunit"       value="[% HTML.escape(PART_INFO.unit) %]">
85   <input type="hidden" name="do_qty"         value="[% HTML.escape(do_qty) %]">
86   <input type="hidden" name="do_unit"        value="[% HTML.escape(do_unit) %]">
87   <input type="hidden" name="row"            value="[% HTML.escape(row) %]">
88
89   <p>
90    <table>
91     <tr class="listheading">
92      <th class="listheading">&nbsp;</th>
93      <th class="listheading">[% 'Warehouse' | $T8 %]</th>
94      <th class="listheading">[% 'Bin' | $T8 %]</th>
95      <th class="listheading">[% 'Charge Number' | $T8 %]</th>
96      [% IF INSTANCE_CONF.get_show_bestbefore %]
97      <th class="listheading">[% 'Best Before' | $T8 %]</th>
98      [% END %]
99      <th align="right" class="listheading">[% 'Qty' | $T8 %]</th>
100      <th align="right" class="listheading">[% 'Unit' | $T8 %]</th>
101     </tr>
102
103     [%- FOREACH row = STOCK_INFO %]
104     <tr [% IF row.stock_error %] class="tr_error"[% ELSE %]class="listrow[% loop.count % 2 %]"[% END %]>
105      <td>[% loop.count %]</td>
106
107      [%- IF delivered %]
108
109      <td>[% HTML.escape(row.warehouse_description) %]</td>
110      <td>[% HTML.escape(row.bin_description) %]</td>
111      <td>[% HTML.escape(row.chargenumber) %]</td>
112      [% IF INSTANCE_CONF.get_show_bestbefore %]
113      <td>[% HTML.escape(row.bestbefore) %]</td>
114      [% END %]
115      <td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td>
116      <td>[% HTML.escape(row.unit) %]</td>
117
118      [%- ELSE %]
119
120      <td>
121       <select name="warehouse_id_[% loop.count %]" onchange="warehouse_selected([% loop.count %], this.selectedIndex)">
122        [%- FOREACH wh = WAREHOUSES %]
123        <option value="[% HTML.escape(wh.id) %]"[% IF wh.id == row.warehouse_id %] selected[% END %]>[% HTML.escape(wh.description) %]</option>
124        [%- END %]
125       </select>
126      </td>
127
128      <td><select name="bin_id_[% loop.count %]" id="bin_id_[% loop.count %]"></select></td>
129      <td><input name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]"></td>
130      [% IF INSTANCE_CONF.get_show_bestbefore %]
131      <td>
132        [% L.date_tag('bestbefore_'_ loop.count, row.bestbefore) %]
133      </td>
134      [% END %]
135      <td><input name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td>
136
137      <td>
138       <select name="unit_[% loop.count %]">
139        [%- FOREACH unit = UNITS %]
140        <option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
141        [%- END %]
142       </select>
143      </td>
144
145      [%- END %]
146     </tr>
147
148     [%- END %]
149    </table>
150   </p>
151
152   <hr size="3" noshade>
153
154   <p>
155    [%- IF delivered %]
156    <button type="button" class="submit" name="action" onclick="window.close()">[% 'Close Window' | $T8 %]</button>
157    [%- ELSE %]
158    <input class="submit" type="submit" name="action" value="[% 'Update' | $T8 %]">
159    <input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]">
160    [%- END %]
161   </p>
162  </form>
163