Layout: title Ausgabe normalisieren
[kivitendo-erp.git] / templates / webpages / do / stock_out_form.html
1 [%- USE T8 %]
2 [%- USE HTML %][%- USE LxERP %]
3 <h1>[% title %]</h1>
4
5  [%- IF delivered %]
6  [%- SET RO = ' readonly' %]
7  [%- END %]
8
9  <style type="text/css">
10   .tr_error {
11     background-color: #ffc9c9;
12   }
13  </style>
14
15  <form method="post" action="do.pl" name="Form">
16
17   [%- IF ERRORS && ERRORS.size %]
18   <p><font color="#ff0000">[% ERRORS.join('<br>') %]</font></p>
19   [%- END %]
20
21   <p>
22    <table>
23     <tr>
24      <td>[% 'Part Number' | $T8 %]</td>
25      <td>[% HTML.escape(PART_INFO.partnumber) %]</td>
26     </tr>
27     <tr>
28      <td>[% 'Description' | $T8 %]</td>
29      <td>[% HTML.escape(PART_INFO.description) %]</td>
30     </tr>
31     <tr>
32      <td>[% 'Qty according to delivery order' | $T8 %]</td>
33      <td>[% HTML.escape(do_qty) %] [% HTML.escape(do_unit) %]</td>
34     </tr>
35    </table>
36   </p>
37
38   [%- UNLESS WHCONTENTS.size %]
39   <p>[% 'There are no items in stock.' | $T8 %]</p>
40
41   <p><button type="button" onclick="window.close()">[% 'Close Window' | $T8 %]</button></p>
42
43   <script type="text/javascript">
44    <!--
45        $(function(){
46          $(window.opener.document.getElementsByName("stock_out_[% HTML.escape(row) %]")).val("");
47        });
48      -->
49   </script>
50
51   [%- ELSE %]
52
53   <input type="hidden" name="nextsub"   value="set_stock_out">
54   <input type="hidden" name="rowcount"  value="[% HTML.escape(WHCONTENTS.size) %]">
55   <input type="hidden" name="in_out"    value="out">
56   <input type="hidden" name="parts_id"  value="[% HTML.escape(parts_id) %]">
57   <input type="hidden" name="partunit"  value="[% HTML.escape(PART_INFO.unit) %]">
58   <input type="hidden" name="do_qty"    value="[% HTML.escape(do_qty) %]">
59   <input type="hidden" name="do_unit"   value="[% HTML.escape(do_unit) %]">
60   <input type="hidden" name="row"       value="[% HTML.escape(row) %]">
61   <input type="hidden" name="closed"    value="[% HTML.escape(closed) %]">
62   <input type="hidden" name="delivered" value="[% HTML.escape(delivered) %]">
63
64   <p>
65    <table>
66     <tr class="listheading">
67      <th class="listheading">&nbsp;</th>
68      <th class="listheading">[% 'Warehouse' | $T8 %]</th>
69      <th class="listheading">[% 'Bin' | $T8 %]</th>
70      <th class="listheading">[% 'Charge Number' | $T8 %]</th>
71      [% IF INSTANCE_CONF.get_show_bestbefore %]
72      <th class="listheading">[% 'Best Before' | $T8 %]</th>
73      [% END %]
74      [%- UNLESS delivered %]
75      <th align="right" class="listheading">[% 'Available qty' | $T8 %]</th>
76      [%- END %]
77      <th align="right" class="listheading">[% 'Qty' | $T8 %]</th>
78      <th align="right" class="listheading">[% 'Unit' | $T8 %]</th>
79     </tr>
80
81     [%- FOREACH row = WHCONTENTS %]
82     <tr [% IF row.stock_error %] class="tr_error"[% ELSE %]class="listrow[% loop.count % 2 %]"[% END %]>
83      <td>[% loop.count %]</td>
84      <td>[% HTML.escape(row.warehousedescription) %]</td>
85      <td>[% HTML.escape(row.bindescription) %]</td>
86      <td>[% HTML.escape(row.chargenumber) %]</td>
87      [% IF INSTANCE_CONF.get_show_bestbefore %]
88      <td>[% HTML.escape(row.bestbefore) %]</td>
89      [% END %]
90      [%- IF delivered %]
91
92      <td>[% HTML.escape(LxERP.format_amount(row.stock_qty)) %]</td>
93      <td>[% HTML.escape(row.stock_unit) %]</td>
94
95      [%- ELSE %]
96
97      <td>[% HTML.escape(row.available_qty) %]</td>
98      <td><input name="qty_[% loop.count %]" style="text-align: right;" size="12"
99                 [%- IF row.stock_qty %]
100                 value="[% HTML.escape(LxERP.format_amount(row.stock_qty)) %]"
101                 [%- ELSIF ((WHCONTENTS.size == 1) && (!row.stock_qty)) %]
102                 value="[% HTML.escape(do_qty) %]"
103                 [%- END %]
104                 ></td>
105      <td>
106       <select name="unit_[% loop.count %]">
107        [%- FOREACH unit = UNITS %]
108        <option[% IF unit.name == row.stock_unit %] selected[% END %]>[% HTML.escape(unit.name) %]</option>
109        [%- END %]
110       </select>
111      </td>
112
113      [%- END %]
114     </tr>
115
116     <input type="hidden" name="warehouse_id_[% loop.count %]" value="[% HTML.escape(row.warehouse_id) %]">
117     <input type="hidden" name="bin_id_[% loop.count %]"       value="[% HTML.escape(row.bin_id) %]">
118     <input type="hidden" name="chargenumber_[% loop.count %]" value="[% HTML.escape(row.chargenumber) %]">
119     [% IF INSTANCE_CONF.get_show_bestbefore %]
120     <input type="hidden" name="bestbefore_[% loop.count %]" value="[% HTML.escape(row.bestbefore) %]">
121     [% END %]
122     [%- END %]
123    </table>
124   </p>
125
126   <hr size="3" noshade>
127
128   <p>
129    [%- IF delivered %]
130    <button type="button" class="submit" name="action" onclick="window.close()">[% 'Close Window' | $T8 %]</button>
131    [%- ELSE %]
132    <input class="submit" type="submit" name="action" value="[% 'Continue' | $T8 %]">
133    [%- END %]
134   </p>
135
136   [%- END %]
137  </form>
138
139