Beim Einlagern Grund für Einlagerung mit aufnehmen
[kivitendo-erp.git] / templates / webpages / inventory / warehouse_selection_stock.html
1 [%- USE T8 %]
2 [%- USE L %]
3 [%- USE HTML %]
4 [%- USE LxERP %]
5
6 <h1>[% title | html %]</h1>
7
8 [%- INCLUDE 'common/flash.html' %]
9
10 <form name="Form" method="post" action="controller.pl">
11
12  <table>
13   <tr>
14    <th align="right" nowrap>[% 'Part' | $T8 %]</th>
15    <td>[% L.part_picker('part_id', SELF.part) %]</td>
16   </tr>
17
18   <tr>
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') %]
23       [%- ELSE %]
24        <span id='bin_id'></span>
25       [% END %]
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>
27     </td>
28   </tr>
29
30   <tr>
31    <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
32    <td>[% L.input_tag('chargenumber', FORM.chargenumber, size=30) %]</td>
33   </tr>
34
35 [% IF INSTANCE_CONF.get_show_bestbefore %]
36   <tr>
37    <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
38    <td>[% L.date_tag('bestbefore', FORM.bestbefore) %]</td>
39   </tr>
40 [%- END %]
41
42   <tr>
43    <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
44    <td>[% L.input_tag('ean', FORM.ean, size=30) %]</td>
45   </tr>
46
47   <tr>
48    <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
49    <td>
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) %]
53 [%- ELSE %]
54     [% L.select_tag('unit_id', SELF.units, title_key='name') %]
55 [%- END %]
56    </td>
57   </tr>
58
59   <tr>
60    <td>[% 'Select type of transfer in' | $T8 %]:</td>
61    <td>[% L.select_tag('transfer_type_id', TRANSFER_TYPES, title_key='description') %] </td>
62   </tr>
63
64   <tr>
65    <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
66    <td>[% L.input_tag('comment', FORM.comment, size=60) %]</td>
67   </tr>
68  </table>
69
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 %]>
72 </form>
73
74 <div id='stock'>
75   [%- PROCESS 'inventory/_stock.html' %]
76 </div>
77 <div id='journal'>
78  [%- PROCESS 'inventory/_journal.html' journal=SELF.mini_journal %]
79 </div>
80
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);
85 }
86 function reload_bin_selection () {
87   $.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
88 }
89 $(function(){
90   $('#part_id').change(reload_warehouse_selection);
91   $('#part_id').change(function(){
92     if ($('#part_id').val() > 0)
93       $('#action_stock').removeAttr('disabled');
94     else
95       $('#action_stock').attr('disabled', 'disabled');
96   });
97   $('#warehouse_id').change(reload_bin_selection);
98 })
99 </script>