Templates werden nicht mehr explizit übersetzt: *_master in * umbenannt
[kivitendo-erp.git] / templates / webpages / wh / warehouse_selection_stock.html
diff --git a/templates/webpages/wh/warehouse_selection_stock.html b/templates/webpages/wh/warehouse_selection_stock.html
new file mode 100644 (file)
index 0000000..ca164a5
--- /dev/null
@@ -0,0 +1,164 @@
+[%- USE T8 %]
+[% USE HTML %][% USE JavaScript %][% USE LxERP %]<body onload="on_load(); [% onload %]">
+
+ <script type="text/javascript" src="js/common.js"></script>
+ <script type="text/javascript" src="js/part_selection.js"></script>
+ <script type="text/javascript">
+  <!--
+      warehouses = new Array();
+      [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH warehouse = WAREHOUSES_it %]
+      warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
+      warehouses[[% WAREHOUSES_it.count - 1 %]]['id'] = [% warehouse.id %];
+      warehouses[[% WAREHOUSES_it.count - 1 %]]['bins'] = new Array();
+      [% USE BINS_it = Iterator(warehouse.BINS) %][% FOREACH bin = BINS_it %]
+      warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]] = new Array();
+      warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['description'] = "[% JavaScript.escape(bin.description) %]";
+      warehouses[[% WAREHOUSES_it.count - 1%]]['bins'][[% BINS_it.count - 1 %]]['id'] = [% bin.id %];
+      [% END %]
+      [% END %]
+
+      function warehouse_selected(warehouse_id, bin_id) {
+        var control = document.getElementById("bin_id");
+
+        for (var i = control.options.length - 1; i >= 0; i--) {
+          control.options[i] = null;
+        }
+
+        var warehouse_index = 0;
+
+        for (i = 0; i < warehouses.length; i++)
+          if (warehouses[i]['id'] == warehouse_id) {
+            warehouse_index = i;
+            break;
+          }
+
+        var warehouse = warehouses[warehouse_index];
+        var bin_index = 0;
+
+        for (i = 0; i < warehouse['bins'].length; i++)
+          if (warehouse['bins'][i]['id'] == bin_id) {
+            bin_index = i;
+            break;
+          }
+
+        for (i = 0; i < warehouse['bins'].length; i++) {
+          control.options[i] = new Option(warehouse['bins'][i]['description'], warehouse['bins'][i]['id']);
+        }
+
+
+        control.options[bin_index].selected = true;
+      }
+
+      function on_load() {
+        warehouse_selected([% warehouse_id %], [% bin_id %]);
+      }
+    -->
+ </script>
+
+ <form name="Form" method="post" action="wh.pl">
+
+  <input type="hidden" name="nextsub" value="transfer_stock">
+  <input type="hidden" name="update_nextsub" value="transfer_stock_update_part">
+
+  [% IF saved_message %]
+  <p>[% saved_message %]</p>
+  [% END %]
+
+  <div class="listtop">[% title %]</div>
+
+  <p>
+   <table>
+    <tr>
+     <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
+     <td>
+      <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
+       [%- FOREACH warehouse = WAREHOUSES %]
+       <option value="[% HTML.escape(warehouse.id) %]"[% IF warehouse_id == warehouse.id %] selected[% END %]>[% warehouse.description %]</option>
+       [%- END %]
+      </select>
+     </td>
+    </tr>
+
+    <tr>
+     <th align="right" nowrap>[% 'Destination bin' | $T8 %]:</th>
+     <td><select id="bin_id" name="bin_id"></select></td>
+    </tr>
+
+    <tr>
+     <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
+     <td>
+      <input type="hidden" name="parts_id" id="parts_id" value="[% HTML.escape(parts_id) %]">
+      <input type="hidden" name="old_partnumber" id="old_partnumber" value="[% HTML.escape(partnumber) %]">
+      <input name="partnumber" size="30" value="[% HTML.escape(partnumber) %]">
+     </td>
+    </tr>
+
+    <tr>
+     <th align="right" nowrap>[% 'Part Description' | $T8 %]</th>
+     <td>
+      <input name="description" size="30" value="[% HTML.escape(description) %]">
+      <input type="button" onclick="part_selection_window('partnumber', 'description', 'parts_id', 0, 'Form', 'no_services:click_button=update_button')" value="?">
+     </td>
+    </tr>
+
+    <tr>
+     <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
+     <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
+    </tr>
+
+    [% IF conf_show_best_before %]
+    <tr>
+     <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
+     <td>
+       <input name="bestbefore" id="bestbefore" size="11" value="[% HTML.escape(bestbefore) %]" title="[% myconfig_dateformat %]">
+       <input type="button" name="b_bestbefore" id="bestbefore_trigger" value="?">
+     </td>
+    </tr>
+    [% END %]
+
+    <tr>
+     <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
+     <td><input name="ean" size="30" value="[% HTML.escape(ean) %]"></td>
+    </tr>
+
+    <tr>
+     <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
+     <td>
+      <input name="qty" size="10" value="[% HTML.escape(LxERP.format_amount(qty)) %]">
+      <select name="unit">
+       [%- FOREACH unit = UNITS %]<option[% IF unit.selected %] selected[% END %]>[% HTML.escape(unit.name) %]</option>[% END %]
+      </select>
+     </td>
+    </tr>
+
+    <tr>
+     <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
+     <td><input name="comment" size="60" value="[% HTML.escape(comment) %]"></td>
+    </tr>
+
+   </table>
+  </p>
+
+  <p>
+   <input type="submit" class="submit" name="action" id="update_button" value="[% 'Update' | $T8 %]">
+   [%- IF parts_id %]
+   <input type="submit" class="submit" name="action" value="[% 'Stock' | $T8 %]">
+   [%- END %]
+  </p>
+ </form>
+
+ [% IF conf_show_best_before %]
+ <script type="text/javascript">
+   <!--
+     Calendar.setup( {
+     inputField : "bestbefore",
+     ifFormat :"[% myconfig_jsc_dateformat %]",
+     align : "BR",
+     button : "bestbefore_trigger"
+     });
+   //-->
+ </script>
+  [% END %]
+
+</body>
+</html>