1 [% USE HTML %][% USE JavaScript %]<body onload="on_load();">
 
   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">
 
   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       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0] = new Array();
 
  13       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['description'] = "---";
 
  14       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][0]['id'] = "";
 
  15       [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
 
  16       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]] = new Array();
 
  17       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['description'] = "[% JavaScript.escape(bin.description) %]";
 
  18       warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'][[% BINS_it.count %]]['id'] = [% bin.id %];
 
  22       function warehouse_selected(warehouse_id, bin_id) {
 
  23         var control = document.getElementById("bin_id");
 
  25         for (var i = control.options.length - 1; i >= 0; i--) {
 
  26           control.options[i] = null;
 
  29         var warehouse_index = 0;
 
  31         for (i = 0; i < warehouses.length; i++)
 
  32           if (warehouses[i]['id'] == warehouse_id) {
 
  37         var warehouse = warehouses[warehouse_index];
 
  40         for (i = 0; i < warehouse['bins'].length; i++)
 
  41           if (warehouse['bins'][i]['id'] == bin_id) {
 
  46         for (i = 0; i < warehouse['bins'].length; i++) {
 
  47           control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
 
  51         control.options[bin_index].selected = true;
 
  55         warehouse_selected(0, 0);
 
  56         document.Form.partnumber.focus();
 
  61  <form name="Form" method="post" action="wh.pl">
 
  63   <input type="hidden" name="nextsub" value="[% HTML.escape(nextsub) %]">
 
  65   [% IF saved_message %]
 
  66   <p>[% saved_message %]</p>
 
  69   <div class="listtop">[% title %]</div>
 
  72    If you enter values for the part number and / or part description then only those bins containing parts whose part number or part description match your input will be shown.
 
  78      <th align="right" nowrap>Transfer from warehouse:</th>
 
  80       <select name="warehouse_id" id="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
 
  81        [%- FOREACH warehouse = WAREHOUSES %]
 
  82        <option value="[% HTML.escape(warehouse.id) %]">[% warehouse.description %]</option>
 
  89      <th align="right" nowrap>Bin:</th>
 
  90      <td><select id="bin_id" name="bin_id"></select></td>
 
  94      <th align="right" nowrap>Limit part selection:</th>
 
  99      <th align="right" nowrap>Part Number</th>
 
 101       <input type="hidden" name="parts_id" id="parts_id">
 
 102       <input name="partnumber" id="partnumber" size="30">
 
 107      <th align="right" nowrap>Part Description</th>
 
 109       <input name="description" size="30">
 
 110       <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'no_services:')" value="?">
 
 115      <th align="right" nowrap>Charge number</th>
 
 116      <td><input name="chargenumber" size="30"></td>
 
 120      <th align="right" nowrap>Best Before</th>
 
 122        <input name="bestbefore" id="bestbefore" size="11" title="[% myconfig_dateformat %]">
 
 123        <input type="button" name="b_bestbefore" id="bestbefore_trigger" value="?">
 
 128      <th align="right" nowrap>EAN</th>
 
 129      <td><input name="ean" size="30"></td>
 
 135    <input type="submit" class="submit" name="action" value="Continue">
 
 139  <script type="text/javascript">
 
 142      inputField : "bestbefore",
 
 143      ifFormat :"[% myconfig_jsc_dateformat %]",
 
 145      button : "bestbefore_trigger"