6 <h1>[% title | html %]</h1>
8 [%- INCLUDE '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', FORM.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', FORM.bestbefore) %]</td>
43 <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
44 <td>[% L.input_tag('ean', FORM.ean, size=30) %]</td>
48 <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
50 [% L.input_tag('qty', LxERP.format_amount(FORM.qty), size=10) %]
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 <td>[% 'Select type of transfer in' | $T8 %]:</td>
61 <td>[% L.select_tag('transfer_type_id', TRANSFER_TYPES, title_key='description') %] </td>
65 <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
66 <td>[% L.input_tag('comment', FORM.comment, size=60) %]</td>
70 <input type="hidden" name="action" value="Inventory/dispatch">
71 <input type="submit" id='action_stock' class="submit" name="action_stock" value="[% 'Stock' | $T8 %]" [% IF !SELF.part.id %]disabled[% END %]>
75 [%- PROCESS 'inventory/_stock.html' %]
78 [%- PROCESS 'inventory/_journal.html' journal=SELF.mini_journal %]
81 <script type='text/javascript'>
82 function reload_warehouse_selection () {
83 $.post("controller.pl", { action: 'Inventory/part_changed', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
84 $.post("controller.pl", { action: 'Inventory/mini_stock', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
86 function reload_bin_selection () {
87 $.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
90 $('#part_id').change(reload_warehouse_selection);
91 $('#part_id').change(function(){
92 if ($('#part_id').val() > 0)
93 $('#action_stock').removeAttr('disabled');
95 $('#action_stock').attr('disabled', 'disabled');
97 $('#warehouse_id').change(reload_bin_selection);