6 <h1>[% title | html %]</h1>
 
   8 [%- PROCESS 'common/flash.html' %]
 
  10 <form name="Form" method="post" action="controller.pl">
 
  14    <th align="right" nowrap>[% 'Part' | $T8 %]</th>
 
  15    <td>[% L.part_picker('part_id', SELF.part) %]</td>
 
  19    <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
 
  20    <td>[% L.select_tag('warehouse_id', SELF.warehouses, default=SELF.warehouse.id, title_key='description') %]
 
  21      [% IF SELF.warehouse.id %]
 
  22        [% L.select_tag('bin_id', SELF.warehouse.bins, default=SELF.bin.id, title_key='description') %]
 
  24        <span id='bin_id'></span>
 
  26        <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>
 
  31    <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
 
  32    <td>[% L.input_tag('chargenumber', SELF.chargenumber, size=30) %]</td>
 
  35 [% IF INSTANCE_CONF.get_show_bestbefore %]
 
  37    <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
 
  38    <td>[% L.date_tag('bestbefore', SELF.bestbefore) %]</td>
 
  43    <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
 
  44    <td><input name="ean" size="30" value="[% HTML.escape(ean) %]"></td>
 
  48    <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
 
  50     <input name="qty" size="10" value="[% HTML.escape(LxERP.format_amount(qty)) %]">
 
  51 [%- IF SELF.part.unit %]
 
  52     [% L.select_tag('unit_id', SELF.part.available_units, title_key='name', default=SELF.unit.id) %]
 
  54     [% L.select_tag('unit_id', SELF.units, title_key='name') %]
 
  60    <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
 
  61    <td><input name="comment" size="60" value="[% HTML.escape(comment) %]"></td>
 
  65  <input type="hidden" name="action" value="Inventory/dispatch">
 
  66  <input type="submit" id='action_stock' class="submit" name="action_stock" value="[% 'Stock' | $T8 %]" [% IF !SELF.part.id %]disabled[% END %]>
 
  70   [%- PROCESS 'inventory/_stock.html' %]
 
  73  [%- PROCESS 'inventory/_journal.html' journal=SELF.mini_journal %]
 
  76 <script type='text/javascript'>
 
  77 function reload_warehouse_selection () {
 
  78   $.post("controller.pl", { action: 'Inventory/part_changed', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
 
  79   $.post("controller.pl", { action: 'Inventory/mini_stock', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
 
  81 function reload_bin_selection () {
 
  82   $.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
 
  85   $('#part_id').change(reload_warehouse_selection);
 
  86   $('#part_id').change(function(){
 
  87     if ($('#part_id').val() > 0)
 
  88       $('#action_stock').removeAttr('disabled');
 
  90       $('#action_stock').attr('disabled', 'disabled');
 
  92   $('#warehouse_id').change(reload_bin_selection);