Eingabe, Anzeige und Filter für Mindesthaltbarkeitsanzeige ist
[kivitendo-erp.git] / templates / webpages / do / stock_in_form_master.html
1 [% USE HTML %][% USE LxERP %][% USE JavaScript %]<body[% UNLESS delivered %] onload="on_load();"[% END %]>
2
3  [%- UNLESS delivered %]
4  <script type="text/javascript">
5   <!--
6       warehouses = new Array();
7       [% USE WAREHOUSES_it = Iterator(WAREHOUSES) %][% FOREACH wh = WAREHOUSES_it %]
8       warehouses[[% WAREHOUSES_it.count - 1 %]] = new Array();
9       [% USE BINS_it = Iterator(wh.BINS) %][% FOREACH bin = BINS_it %]warehouses[[% WAREHOUSES_it.count - 1 %]][[% BINS_it.count - 1 %]] = ["[% JavaScript.escape(bin.description) %]", "[% JavaScript.escape(bin.id) %]"];
10       [% END %]
11       [% END %]
12
13       function warehouse_selected(row, index, initial_bin_index) {
14         var cname = "bin_id_" + row;
15         var control = document.getElementById(cname);
16
17         for (var i = control.options.length - 1; i >= 0; i--) {
18           control.options[i] = null;
19         }
20
21         for (i = 0; i < warehouses[index].length; i++) {
22           control.options[i] = new Option(warehouses[index][i][0], warehouses[index][i][1]);
23         }
24
25         if (!initial_bin_index)
26           initial_bin_index = 0;
27         control.options[initial_bin_index].selected = true;
28       }
29
30       function on_load() {
31         [%- USE STOCK_INFO_it = Iterator(STOCK_INFO) %][%- FOREACH si = STOCK_INFO_it %]
32           // new si for wh [% si.warehouse_id %] bin [% si.bin_id %]
33           [%- SET warehouse_selected = '0' %]
34           [%- USE WAREHOUSES_it = Iterator(WAREHOUSES) %][%- FOREACH wh = WAREHOUSES_it %]
35             // wh [% wh.id %]
36             [%- USE BINS_it = Iterator(wh.BINS) %][%- FOREACH bin = BINS_it %]
37               // bin [% bin.id %]
38               [%- IF bin.id == si.bin_id %]
39                 warehouse_selected([% STOCK_INFO_it.count %], [% WAREHOUSES_it.count - 1 %], [% BINS_it.count - 1%]);
40                 [%- SET warehouse_selected = '1' %]
41               [%- END %]
42             [%- END %]
43           [%- END %]
44           [%- UNLESS warehouse_selected %]
45           warehouse_selected([% STOCK_INFO_it.count %], 0);
46           [%- END %]
47         [%- END %]
48       }
49     -->
50  </script>
51  [%- END %]
52
53  <form method="post" action="do.pl" name="Form">
54
55   <div class="listtop">[% title %]</div>
56
57   [%- IF ERRORS && ERRORS.size %]
58   <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
59   [%- END %]
60
61   <p>
62    <table>
63     <tr>
64      <td><translate>Part Number</translate></td>
65      <td>[% HTML.escape(PART_INFO.partnumber) %]</td>
66     </tr>
67     <tr>
68      <td><translate>Description</translate></td>
69      <td>[% HTML.escape(PART_INFO.description) %]</td>
70     </tr>
71     <tr>
72      <td><translate>Qty according to delivery order</translate></td>
73      <td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td>
74     </tr>
75    </table>
76   </p>
77
78   <input type="hidden" name="nextsub"        value="set_stock_in">
79   <input type="hidden" name="update_nextsub" value="update_stock_in">
80   <input type="hidden" name="rowcount"       value="[% HTML.escape(STOCK_INFO.size) %]">
81   <input type="hidden" name="in_out"         value="in">
82   <input type="hidden" name="parts_id"       value="[% HTML.escape(parts_id) %]">
83   <input type="hidden" name="partunit"       value="[% HTML.escape(PART_INFO.unit) %]">
84   <input type="hidden" name="do_qty"         value="[% HTML.escape(do_qty) %]">
85   <input type="hidden" name="do_unit"        value="[% HTML.escape(do_unit) %]">
86   <input type="hidden" name="row"            value="[% HTML.escape(row) %]">
87
88   <p>
89    <table>
90     <tr class="listheading">
91      <th class="listheading">&nbsp;</th>
92      <th class="listheading"><translate>Warehouse</translate></th>
93      <th class="listheading"><translate>Bin</translate></th>
94      <th class="listheading"><translate>Charge Number</translate></th>
95      [% IF conf_show_best_before %]
96      <th class="listheading"><translate>Best Before</translate></th>
97      [% END %]
98      <th align="right" class="listheading"><translate>Qty</translate></th>
99      <th align="right" class="listheading"><translate>Unit</translate></th>
100     </tr>
101
102     [%- FOREACH row = STOCK_INFO %]
103     <tr [% IF row.stock_error %] class="tr_error"[% ELSE %]class="listrow[% loop.count % 2 %]"[% END %]>
104      <td>[% loop.count %]</td>
105
106      [%- IF delivered %]
107
108      <td>[% HTML.escape(row.warehouse_description) %]</td>
109      <td>[% HTML.escape(row.bin_description) %]</td>
110      <td>[% HTML.escape(row.chargenumber) %]</td>
111      [% IF conf_show_best_before %]
112      <td>[% HTML.escape(row.bestbefore) %]</td>
113      [% END %]
114      <td>[% HTML.escape(LxERP.format_amount(row.qty)) %]</td>
115      <td>[% HTML.escape(row.unit) %]</td>
116
117      [%- ELSE %]
118
119      <td>
120       <select name="warehouse_id_[% loop.count %]" onchange="warehouse_selected([% loop.count %], this.selectedIndex)">
121        [%- FOREACH wh = WAREHOUSES %]
122        <option value="[% HTML.escape(wh.id) %]"[% IF wh.id == row.warehouse_id %] selected[% END %]>[% HTML.escape(wh.description) %]</option>
123        [%- END %]
124       </select>
125      </td>
126
127      <td><select name="bin_id_[% loop.count %]" id="bin_id_[% loop.count %]"></select></td>
128      <td><input name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]"></td>
129      [% IF conf_show_best_before %]
130      <td>
131        <input name="bestbefore_[% loop.count %]" id="bestbefore_[% loop.count %]" value="[% HTML.escape(row.bestbefore) %]" size="11" title="[% myconfig_dateformat %]">
132        <input type="button" name="b_bestbefore_[% loop.count %]" id="bestbefore_trigger_[% loop.count %]" value="?">
133      </td>
134      [% END %]
135      <td><input name="qty_[% loop.count %]" size="12" value="[% HTML.escape(LxERP.format_amount(row.qty)) %]"></td>
136
137      <td>
138       <select name="unit_[% loop.count %]">
139        [%- FOREACH unit = UNITS %]
140        <option[% IF unit.name == row.unit %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
141        [%- END %]
142       </select>
143      </td>
144
145      [%- END %]
146     </tr>
147
148     [%- END %]
149    </table>
150   </p>
151
152   <hr size="3" noshade>
153
154   <p>
155    [%- IF delivered %]
156    <button type="button" class="submit" name="action" onclick="window.close()"><translate>Close Window</translate></button>
157    [%- ELSE %]
158    <input class="submit" type="submit" name="action" value="<translate>Update</translate>">
159    <input class="submit" type="submit" name="action" value="<translate>Continue</translate>">
160    [%- END %]
161   </p>
162  </form>
163
164  [%- IF NOT delivered %]
165  [% IF conf_show_best_before %]
166   <script type="text/javascript">
167     <!--
168     [%- FOREACH row = STOCK_INFO %]
169     Calendar.setup( {
170       inputField : "bestbefore_[% loop.count %]",
171       ifFormat :"[% myconfig_jsc_dateformat %]",
172       align : "BR",
173       button : "bestbefore_trigger_[% loop.count %]"
174     });
175     [%- END %]
176     //-->
177   </script>
178   [% END %]
179   [%- END %]
180
181 </body>
182 </html>
183