70b6e6fc1c935a76eedb4166a9293acb47b68dd9
[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" id="form">
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 </form>
70
71 <div id='stock'>
72   [%- PROCESS 'inventory/_stock.html' %]
73 </div>
74 <div id='journal'>
75  [%- PROCESS 'inventory/_journal.html' journal=SELF.mini_journal %]
76 </div>
77
78 <script type='text/javascript'>
79 function reload_warehouse_selection () {
80   $.post("controller.pl", { action: 'Inventory/part_changed', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
81   $.post("controller.pl", { action: 'Inventory/mini_stock', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
82 }
83 function reload_bin_selection () {
84   $.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
85 }
86 function check_part_selection_before_stocking() {
87   if ($('#part_id').val() !== '')
88     return true;
89
90   alert(kivi.t8('No article has been selected yet.'));
91   return false;
92 }
93 $(function(){
94   $('#part_id').change(reload_warehouse_selection);
95   $('#warehouse_id').change(reload_bin_selection);
96 })
97 </script>