]> wagnertech.de Git - mfinanz.git/blob - templates/design40_webpages/inventory/warehouse_selection_stock.html
date error in mapping
[mfinanz.git] / templates / design40_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 <div class="wrapper">
14
15   <table class="tbl-horizontal">
16     <colgroup> <col class="wi-mediumsmall"><col class="wi-verywide"> </colgroup>
17     <tbody>
18       <tr>
19         <th>[% 'Part' | $T8 %]</th>
20         <td>[% P.part.picker('part_id', SELF.part, class='wi-wide') %]</td>
21       </tr>
22       <tr>
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') %]
28           [% ELSE %]
29             <span id="bin_id" class="data wi-wide"></span>
30           [% END %]
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>
32         </td>
33       </tr>
34       <tr>
35         <th>[% 'Charge number' | $T8 %]</th>
36         <td>[% L.input_tag('chargenumber', FORM.chargenumber, class='wi-wide') %]</td>
37       </tr>
38       [% IF INSTANCE_CONF.get_show_bestbefore %]
39         <tr>
40           <th>[% 'Best Before' | $T8 %]</th>
41           <td>[% L.date_tag('bestbefore', FORM.bestbefore) %]</td>
42         </tr>
43       [% END %]
44       <tr>
45         <th>[% 'Quantity' | $T8 %]</th>
46         <td>
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') %]
50           [% ELSE %]
51             [% L.select_tag('unit_id', SELF.units, title_key='name', class='wi-small') %]
52           [% END %]
53         </td>
54       </tr>
55       <tr>
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>
58       </tr>
59       <tr>
60         <th>[% 'Optional comment' | $T8 %]</th>
61         <td>[% L.input_tag('comment', FORM.comment, class='wi-wide') %]</td>
62       </tr>
63     </tbody>
64   </table>
65
66 </div><!-- /.wrapper -->
67
68 </form>
69
70 <div class="wrapper">
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 </div><!-- /.wrapper -->
80
81
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);
86   }
87   function reload_bin_selection () {
88     $.post("controller.pl", { action: 'Inventory/warehouse_changed', warehouse_id: function(){ return $('#warehouse_id').val() } }, kivi.eval_json_result);
89   }
90   function check_part_selection_before_stocking() {
91     if ($('#part_id').val() !== '')
92       return true;
93
94     alert(kivi.t8('No article has been selected yet.'));
95     return false;
96   }
97   $(function(){
98     $('#part_id').change(reload_warehouse_selection);
99     $('#warehouse_id').change(reload_bin_selection);
100   })
101 </script>