d38759d9e646ff88eb40fea73bf6fcf65caa5c37
[kivitendo-erp.git] / templates / webpages / inventory / warehouse_selection_stock.html
1 [%- USE T8 %]
2 [%- USE L %]
3 [%- USE P %]
4 [%- USE HTML %]
5 [%- USE LxERP %]
6
7 <h1>[% title | html %]</h1>
8
9 [%- INCLUDE 'common/flash.html' %]
10
11 <form name="Form" method="post" action="controller.pl" id="form">
12
13  <table>
14   <tr>
15    <th align="right" nowrap>[% 'Part' | $T8 %]</th>
16    <td>[% P.part.picker('part_id', SELF.part) %]</td>
17   </tr>
18
19   <tr>
20    <th align="right" nowrap>[% 'Destination warehouse' | $T8 %]</th>
21    <td>[% L.select_tag('warehouse_id', SELF.warehouses, default=SELF.warehouse.id, title_key='description') %]
22      [% IF SELF.warehouse.id %]
23        [% L.select_tag('bin_id', SELF.warehouse.bins, default=SELF.bin.id, title_key='description') %]
24       [%- ELSE %]
25        <span id='bin_id'></span>
26       [% END %]
27        <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>
28     </td>
29   </tr>
30
31   <tr>
32    <th align="right" nowrap>[% 'Charge number' | $T8 %]</th>
33    <td>[% L.input_tag('chargenumber', FORM.chargenumber, size=30) %]</td>
34   </tr>
35
36 [% IF INSTANCE_CONF.get_show_bestbefore %]
37   <tr>
38    <th align="right" nowrap>[% 'Best Before' | $T8 %]</th>
39    <td>[% L.date_tag('bestbefore', FORM.bestbefore) %]</td>
40   </tr>
41 [%- END %]
42
43   <tr>
44    <th align="right" nowrap>[% 'EAN' | $T8 %]</th>
45    <td>[% L.input_tag('ean', FORM.ean, size=30) %]</td>
46   </tr>
47
48   <tr>
49    <th align="right" nowrap>[% 'Quantity' | $T8 %]</th>
50    <td>
51     [% L.input_tag('qty', LxERP.format_amount(FORM.qty), size=10) %]
52 [%- IF SELF.part.unit %]
53     [% L.select_tag('unit_id', SELF.part.available_units, title_key='name', default=SELF.unit.id) %]
54 [%- ELSE %]
55     [% L.select_tag('unit_id', SELF.units, title_key='name') %]
56 [%- END %]
57    </td>
58   </tr>
59
60   <tr>
61    <td>[% 'Select type of transfer in' | $T8 %]:</td>
62    <td>[% L.select_tag('transfer_type_id', TRANSFER_TYPES, title_key='description') %] </td>
63   </tr>
64
65   <tr>
66    <th align="right" nowrap>[% 'Optional comment' | $T8 %]</th>
67    <td>[% L.input_tag('comment', FORM.comment, size=60) %]</td>
68   </tr>
69  </table>
70 </form>
71
72 <div id='stock'>
73   [%- PROCESS 'inventory/_stock.html' %]
74 </div>
75 <div id='journal'>
76  [%- PROCESS 'inventory/_journal.html' journal=SELF.mini_journal %]
77 </div>
78
79 <script type='text/javascript'>
80 function reload_warehouse_selection () {
81   $.post("controller.pl", { action: 'Inventory/part_changed', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
82   $.post("controller.pl", { action: 'Inventory/mini_stock', part_id: function(){ return $('#part_id').val() } }, kivi.eval_json_result);
83 }
84 function reload_bin_selection () {
85   $.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
86 }
87 function check_part_selection_before_stocking() {
88   if ($('#part_id').val() !== '')
89     return true;
90
91   alert(kivi.t8('No article has been selected yet.'));
92   return false;
93 }
94 $(function(){
95   $('#part_id').change(reload_warehouse_selection);
96   $('#warehouse_id').change(reload_bin_selection);
97 })
98 </script>