7 <h1>[% title | html %]</h1>
9 [% INCLUDE 'common/flash.html' %]
11 <form name="Form" method="post" action="controller.pl" id="form">
15 <table class="tbl-horizontal">
16 <colgroup> <col class="wi-mediumsmall"><col class="wi-verywide"> </colgroup>
19 <th>[% 'Part' | $T8 %]</th>
20 <td>[% P.part.picker('part_id', SELF.part, class='wi-wide') %]</td>
23 <th>[% 'Destination warehouse' | $T8 %]</th>
24 <td class="wi-wide below">
25 [% L.select_tag('warehouse_id', SELF.warehouses, default=SELF.warehouse.id, title_key='description', class='wi-wide') %]
26 [% IF SELF.warehouse.id %]
27 [% L.select_tag('bin_id', SELF.warehouse.bins_sorted_naturally, default=SELF.bin.id, title_key='description', class='wi-wide below') %]
29 <span id="bin_id" class="data wi-wide"></span>
31 <span id="write_default_bin_span" style="display:none;" class="below">[% L.checkbox_tag('write_default_bin', label=LxERP.t8('Write bin to default bin in part?')) %]</span>
35 <th>[% 'Charge number' | $T8 %]</th>
36 <td>[% L.input_tag('chargenumber', FORM.chargenumber, class='wi-wide') %]</td>
38 [% IF INSTANCE_CONF.get_show_bestbefore %]
40 <th>[% 'Best Before' | $T8 %]</th>
41 <td>[% L.date_tag('bestbefore', FORM.bestbefore) %]</td>
45 <th>[% 'Quantity' | $T8 %]</th>
47 [% L.input_tag('qty', LxERP.format_amount(FORM.qty), class='wi-verysmall') %]
48 [% IF SELF.part.unit %]
49 [% L.select_tag('unit_id', SELF.part.available_units, title_key='name', default=SELF.unit.id, class='wi-small') %]
51 [% L.select_tag('unit_id', SELF.units, title_key='name', class='wi-small') %]
56 <th>[% 'Select type of transfer in' | $T8 %]</th>
57 <td>[% L.select_tag('transfer_type_id', TRANSFER_TYPES, title_key='description', class='wi-wide') %]</td>
60 <th>[% 'Optional comment' | $T8 %]</th>
61 <td>[% L.input_tag('comment', FORM.comment, class='wi-wide') %]</td>
66 </div><!-- /.wrapper -->
73 [% PROCESS 'inventory/_stock.html' %]
76 [% PROCESS 'inventory/_journal.html' journal=SELF.mini_journal %]
79 </div><!-- /.wrapper -->
82 <script type="text/javascript">
83 function reload_warehouse_selection () {
84 $.post("controller.pl", { action: 'Inventory/part_changed', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
85 $.post("controller.pl", { action: 'Inventory/mini_stock', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
87 function reload_bin_selection () {
88 $.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
90 function check_part_selection_before_stocking() {
91 if ($('#part_id').val() !== '')
94 alert(kivi.t8('No article has been selected yet.'));
98 $('#part_id').change(reload_warehouse_selection);
99 $('#warehouse_id').change(reload_bin_selection);