Erzeugnis fertigen: Standardlager des Erzeugnisses auswählen
authorMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 2 Feb 2017 10:32:53 +0000 (11:32 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Thu, 2 Feb 2017 10:32:53 +0000 (11:32 +0100)
templates/webpages/wh/warehouse_selection_assembly.html

index 4ed6ab3..149aa31 100644 (file)
 
   <p>
    <table>
+    <tr>
+     <th align="right" nowrap>[% 'Assembly' | $T8 %]</th>
+     <td>
+      [% P.part_picker("parts_id", parts_id, part_type="assembly", class="partpicker_fat_set_item initial_focus") %]
+     </td>
+    </tr>
+
     <tr>
      <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
      <td>
-      <select name="warehouse_id" onchange="warehouse_selected(warehouses[this.selectedIndex]['id'], 0)">
+      <select name="warehouse_id" id="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 %]
      <td><select id="bin_id" name="bin_id"></select></td>
     </tr>
 
-    <tr>
-     <th align="right" nowrap>[% 'Assembly' | $T8 %]</th>
-     <td>
-      [% P.part_picker("parts_id", parts_id, part_type="assembly") %]
-     </td>
-    </tr>
-
     <tr>
      <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
      <td><input name="chargenumber" size="30" value="[% HTML.escape(chargenumber) %]"></td>
   </p>
  </form>
 
+<script type='text/javascript'>
+$(function(){
+  $('#parts_id').on('set_item:PartPicker', function(event, item) {
+    if (!item.warehouse_id)
+      return;
+
+    $('#warehouse_id').val(item.warehouse_id);
+    warehouse_selected(item.warehouse_id, item.bin_id);
+  });
+})
+</script>