3 [%- USE HTML %][%- USE LxERP %][%- USE JavaScript %]
 
   4  [%- UNLESS delivered %]
 
   5  <script type="text/javascript">
 
   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) %]"];
 
  14       function warehouse_selected(row, index, initial_bin_index) {
 
  15         var cname = "bin_id_" + row;
 
  16         var control = document.getElementById(cname);
 
  18         for (var i = control.options.length - 1; i >= 0; i--) {
 
  19           control.options[i] = null;
 
  22         for (i = 0; i < warehouses[index].length; i++) {
 
  23           control.options[i] = new Option(warehouses[index][i][0], warehouses[index][i][1]);
 
  26         if (!initial_bin_index)
 
  27           initial_bin_index = 0;
 
  28         control.options[initial_bin_index].selected = true;
 
  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 %]
 
  37             [%- USE BINS_it = Iterator(wh.BINS) %][%- FOREACH bin = BINS_it %]
 
  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' %]
 
  45           [%- UNLESS warehouse_selected %]
 
  46           warehouse_selected([% STOCK_INFO_it.count %], 0);
 
  54  <form method="post" action="do.pl" name="Form">
 
  56   <div class="listtop">[% title %]</div>
 
  58   [%- IF ERRORS && ERRORS.size %]
 
  59   <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
 
  65      <td>[% 'Part Number' | $T8 %]</td>
 
  66      <td>[% HTML.escape(PART_INFO.partnumber) %]</td>
 
  69      <td>[% 'Description' | $T8 %]</td>
 
  70      <td>[% HTML.escape(PART_INFO.description) %]</td>
 
  73      <td>[% 'Qty according to delivery order' | $T8 %]</td>
 
  74      <td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td>
 
  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) %]">
 
  91     <tr class="listheading">
 
  92      <th class="listheading"> </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>
 
  99      <th align="right" class="listheading">[% 'Qty' | $T8 %]</th>
 
 100      <th align="right" class="listheading">[% 'Unit' | $T8 %]</th>
 
 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>
 
 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>
 
 115      <td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td>
 
 116      <td>[% HTML.escape(row.unit) %]</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>
 
 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 %]
 
 132        [% L.date_tag('bestbefore_'_ loop.count, row.bestbefore) %]
 
 135      <td><input name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td>
 
 138       <select name="unit_[% loop.count %]">
 
 139        [%- FOREACH unit = UNITS %]
 
 140        <option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
 
 152   <hr size="3" noshade>
 
 156    <button type="button" class="submit" name="action" onclick="window.close()">[% 'Close Window' | $T8 %]</button>
 
 158    <input class="submit" type="submit" name="action" value="[% 'Update' | $T8 %]">
 
 159    <input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]">