--- /dev/null
+[%- USE T8 %]
+[% USE HTML %][% USE LxERP %][% USE JavaScript %]<body[% UNLESS delivered %] onload="on_load();"[% END %]>
+
+ [%- UNLESS delivered %]
+ <script type="text/javascript">
+ <!--
+ warehouses = new Array();
+ [% USE WAREHOUSES_it = Iterator(WAREHOUSES) %][% FOREACH wh = WAREHOUSES_it %]
+ warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
+ [% 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) %]"];
+ [% END %]
+ [% END %]
+
+ function warehouse_selected(row, index, initial_bin_index) {
+ var cname = "bin_id_" + row;
+ var control = document.getElementById(cname);
+
+ for (var i = control.options.length - 1; i >= 0; i--) {
+ control.options[i] = null;
+ }
+
+ for (i = 0; i < warehouses[index].length; i++) {
+ control.options[i] = new Option(warehouses[index][i][0], warehouses[index][i][1]);
+ }
+
+ if (!initial_bin_index)
+ initial_bin_index = 0;
+ control.options[initial_bin_index].selected = true;
+ }
+
+ function on_load() {
+ [%- USE STOCK_INFO_it = Iterator(STOCK_INFO) %][%- FOREACH si = STOCK_INFO_it %]
+ // new si for wh [% si.warehouse_id %] bin [% si.bin_id %]
+ [%- SET warehouse_selected = '0' %]
+ [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH wh = WAREHOUSES_it %]
+ // wh [% wh.id %]
+ [%- USE BINS_it = Iterator(wh.BINS) %][%- FOREACH bin = BINS_it %]
+ // bin [% bin.id %]
+ [%- IF bin.id == si.bin_id %]
+ warehouse_selected([% STOCK_INFO_it.count %], [% WAREHOUSES_it.count - 1 %], [% BINS_it.count - 1%]);
+ [%- SET warehouse_selected = '1' %]
+ [%- END %]
+ [%- END %]
+ [%- END %]
+ [%- UNLESS warehouse_selected %]
+ warehouse_selected([% STOCK_INFO_it.count %], 0);
+ [%- END %]
+ [%- END %]
+ }
+ -->
+ </script>
+ [%- END %]
+
+ <form method="post" action="do.pl" name="Form">
+
+ <div class="listtop">[% title %]</div>
+
+ [%- IF ERRORS && ERRORS.size %]
+ <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
+ [%- END %]
+
+ <p>
+ <table>
+ <tr>
+ <td>[% 'Part Number' | $T8 %]</td>
+ <td>[% HTML.escape(PART_INFO.partnumber) %]</td>
+ </tr>
+ <tr>
+ <td>[% 'Description' | $T8 %]</td>
+ <td>[% HTML.escape(PART_INFO.description) %]</td>
+ </tr>
+ <tr>
+ <td>[% 'Qty according to delivery order' | $T8 %]</td>
+ <td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td>
+ </tr>
+ </table>
+ </p>
+
+ <input type="hidden" name="nextsub" value="set_stock_in">
+ <input type="hidden" name="update_nextsub" value="update_stock_in">
+ <input type="hidden" name="rowcount" value="[% HTML.escape(STOCK_INFO.size) %]">
+ <input type="hidden" name="in_out" value="in">
+ <input type="hidden" name="parts_id" value="[% HTML.escape(parts_id) %]">
+ <input type="hidden" name="partunit" value="[% HTML.escape(PART_INFO.unit) %]">
+ <input type="hidden" name="do_qty" value="[% HTML.escape(do_qty) %]">
+ <input type="hidden" name="do_unit" value="[% HTML.escape(do_unit) %]">
+ <input type="hidden" name="row" value="[% HTML.escape(row) %]">
+
+ <p>
+ <table>
+ <tr class="listheading">
+ <th class="listheading"> </th>
+ <th class="listheading">[% 'Warehouse' | $T8 %]</th>
+ <th class="listheading">[% 'Bin' | $T8 %]</th>
+ <th class="listheading">[% 'Charge Number' | $T8 %]</th>
+ [% IF conf_show_best_before %]
+ <th class="listheading">[% 'Best Before' | $T8 %]</th>
+ [% END %]
+ <th align="right" class="listheading">[% 'Qty' | $T8 %]</th>
+ <th align="right" class="listheading">[% 'Unit' | $T8 %]</th>
+ </tr>
+
+ [%- FOREACH row = STOCK_INFO %]
+ <tr [% IF row.stock_error %] class="tr_error"[% ELSE %]class="listrow[% loop.count % 2 %]"[% END %]>
+ <td>[% loop.count %]</td>
+
+ [%- IF delivered %]
+
+ <td>[% HTML.escape(row.warehouse_description) %]</td>
+ <td>[% HTML.escape(row.bin_description) %]</td>
+ <td>[% HTML.escape(row.chargenumber) %]</td>
+ [% IF conf_show_best_before %]
+ <td>[% HTML.escape(row.bestbefore) %]</td>
+ [% END %]
+ <td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td>
+ <td>[% HTML.escape(row.unit) %]</td>
+
+ [%- ELSE %]
+
+ <td>
+ <select name="warehouse_id_[% loop.count %]" onchange="warehouse_selected([% loop.count %], this.selectedIndex)">
+ [%- FOREACH wh = WAREHOUSES %]
+ <option value="[% HTML.escape(wh.id) %]"[% IF wh.id == row.warehouse_id %] selected[% END %]>[% HTML.escape(wh.description) %]</option>
+ [%- END %]
+ </select>
+ </td>
+
+ <td><select name="bin_id_[% loop.count %]" id="bin_id_[% loop.count %]"></select></td>
+ <td><input name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]"></td>
+ [% IF conf_show_best_before %]
+ <td>
+ <input name="bestbefore_[% loop.count %]" id="bestbefore_[% loop.count %]" value="[% HTML.escape(row.bestbefore) %]" size="11" title="[% myconfig_dateformat %]">
+ <input type="button" name="b_bestbefore_[% loop.count %]" id="bestbefore_trigger_[% loop.count %]" value="?">
+ </td>
+ [% END %]
+ <td><input name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td>
+
+ <td>
+ <select name="unit_[% loop.count %]">
+ [%- FOREACH unit = UNITS %]
+ <option[% IF unit.name == row.unit %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
+ [%- END %]
+ </select>
+ </td>
+
+ [%- END %]
+ </tr>
+
+ [%- END %]
+ </table>
+ </p>
+
+ <hr size="3" noshade>
+
+ <p>
+ [%- IF delivered %]
+ <button type="button" class="submit" name="action" onclick="window.close()">[% 'Close Window' | $T8 %]</button>
+ [%- ELSE %]
+ <input class="submit" type="submit" name="action" value="[% 'Update' | $T8 %]">
+ <input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]">
+ [%- END %]
+ </p>
+ </form>
+
+ [%- IF NOT delivered %]
+ [% IF conf_show_best_before %]
+ <script type="text/javascript">
+ <!--
+ [%- FOREACH row = STOCK_INFO %]
+ Calendar.setup( {
+ inputField : "bestbefore_[% loop.count %]",
+ ifFormat :"[% myconfig_jsc_dateformat %]",
+ align : "BR",
+ button : "bestbefore_trigger_[% loop.count %]"
+ });
+ [%- END %]
+ //-->
+ </script>
+ [% END %]
+ [%- END %]
+
+</body>
+</html>
+