Inventory Controller und neue stock_in Maske
[kivitendo-erp.git] / templates / webpages / inventory / warehouse_selection_stock.html
diff --git a/templates/webpages/inventory/warehouse_selection_stock.html b/templates/webpages/inventory/warehouse_selection_stock.html
new file mode 100644 (file)
index 0000000..32d6250
--- /dev/null
@@ -0,0 +1,94 @@
+[%- USE T8 %]
+[%- USE L %]
+[%- USE HTML %]
+[%- USE LxERP %]
+
+<h1>[% title | html %]</div>
+
+[%- PROCESS 'common/flash.html' %]
+
+<form name="Form" method="post" action="controller.pl">
+
+ <table>
+  <tr>
+   <th align="right" nowrap>[% 'Part' | $T8 %]</th>
+   <td>[% L.part_picker('part_id', SELF.part) %]</td>
+  </tr>
+
+  <tr>
+   <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
+   <td>[% L.select_tag('warehouse_id', SELF.warehouses, default=SELF.warehouse.id, title_key='description') %]
+     [% IF SELF.warehouse.id %]
+       [% L.select_tag('bin_id', SELF.warehouse.bins, default=SELF.bin.id, title_key='description') %]
+      [%- ELSE %]
+       <span id='bin_id'></span>
+      [% END %]
+       <span id='write_default_bin_span' style='display:none'><br>[% L.checkbox_tag('write_default_bin', label=LxERP.t8('Write bin to default bin in part?')) %]</span>
+    </td>
+  </tr>
+
+  <tr>
+   <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
+   <td>[% L.input_tag('chargenumber', SELF.chargenumber, size=30) %]</td>
+  </tr>
+
+[% IF INSTANCE_CONF.get_show_bestbefore %]
+  <tr>
+   <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
+   <td>[% L.date_tag('bestbefore', SELF.bestbefore) %]</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)) %]">
+[%- IF SELF.part.unit %]
+    [% L.select_tag('unit_id', SELF.part.available_units, title_key='name', default=SELF.unit.id) %]
+[%- ELSE %]
+    [% L.select_tag('unit_id', SELF.units, title_key='name') %]
+[%- END %]
+   </td>
+  </tr>
+
+  <tr>
+   <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
+   <td><input name="comment" size="60" value="[% HTML.escape(comment) %]"></td>
+  </tr>
+ </table>
+
+ <input type="hidden" name="action" value="Inventory/dispatch">
+ <input type="submit" id='action_stock' class="submit" name="action_stock" value="[% 'Stock' | $T8 %]" [% IF !SELF.part.id %]disabled[% END %]>
+</form>
+
+<div id='stock'>
+  [%- PROCESS 'inventory/_stock.html' %]
+</div>
+<div id='journal'>
+ [%- PROCESS 'inventory/_journal.html' journal=SELF.mini_journal %]
+</div>
+
+<script type='text/javascript'>
+function reload_warehouse_selection () {
+  $.post("controller.pl", { action: 'Inventory/part_changed', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
+  $.post("controller.pl", { action: 'Inventory/mini_stock', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
+}
+function reload_bin_selection () {
+  $.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
+}
+$(function(){
+  $('#part_id').change(reload_warehouse_selection);
+  $('#part_id').change(function(){
+    if ($('#part_id').val() > 0)
+      $('#action_stock').removeAttr('disabled');
+    else
+      $('#action_stock').attr('disabled', 'disabled');
+  });
+  $('#warehouse_id').change(reload_bin_selection);
+})
+</script>