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