d04edd03eb0d5ab1b12e98feb80d91f8218fceb5
[kivitendo-erp.git] / templates / webpages / part / _inventory_data.html
1 [%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%][%- USE T8 -%]
2
3 [%- SET dec = 2 %]
4 [%- SET show_warehouse_subtotals = 1 %]
5
6 <div id="stock_levels">
7
8 <h3>[% 'Stock levels' | $T8 %]</h3>
9
10 [%- IF SELF.stock_amounts.size %]
11 <a href="wh.pl?action=report&partnumber=[% HTML.escape(SELF.part.partnumber) %]">[% 'Stock levels' | $T8 %]</a>:
12 <table>
13  <thead>
14   <tr class='listheading'>
15    <th>[% 'Warehouse'   | $T8 %]</th>
16    <th>[% 'Bin'         | $T8 %]</th>
17    <th>[% 'Qty'         | $T8 %]</th>
18    <th>[% 'Unit'        | $T8 %]</th>
19    <th>[% 'Stock value' | $T8 %]</th>
20  </tr>
21  </thead>
22  <tbody>
23  [% FOREACH stock = SELF.stock_amounts %]
24   <tr class='listrow'>
25    <td                >[% HTML.escape(stock.warehouse_description)  %]</td>
26    <td                >[% IF stock.order_link %]<a target="_blank" href="[% stock.order_link %]">[% END %]
27                        [% HTML.escape(stock.bin_description)        %]
28                        [% IF stock.order_link %]</a>[% END %]
29    </td>
30    <td class='numeric'>[% LxERP.format_amount(stock.qty, dec)       %]</td>
31    <td                >[% HTML.escape(stock.unit)                   %]</td>
32    <td class='numeric'>[% LxERP.format_amount(stock.stock_value, 2) %]</td>
33   </tr>
34   [% IF show_warehouse_subtotals AND stock.wh_lead != stock.warehouse_description %]
35   <tr class='listheading'>
36    <th                >[% HTML.escape(stock.warehouse_description)           %]</th>
37    <td></td>
38    <td class='numeric bold'>[% LxERP.format_amount(stock.wh_run_qty, dec)         %]</td>
39    <td></td>
40    <td class='numeric bold'>[% LxERP.format_amount(stock.wh_run_stock_value, dec) %]</td>
41   </tr>
42   [% END %]
43   [% IF loop.last %]
44   <tr class='listheading'>
45    <th>[% 'Total' | $T8 %]</th>
46    <td></td>
47    <td class='numeric bold'>[% LxERP.format_amount(stock.run_qty, dec)         %]</td>
48    <td></td>
49    <td class='numeric bold'>[% LxERP.format_amount(stock.run_stock_value, dec) %]</td>
50   </tr>
51   [% END %]
52  [% END %]
53  </tbody>
54 </table>
55 [% ELSE %]
56   <p>[% 'No transactions yet.' | $T8 %]</p>
57 [% END %]
58 </div>
59
60 [% IF AUTH.assert('warehouse_management', 1) %]
61 <div>
62 <h3>[% 'Journal of Last 10 Transfers' | $T8 %]</h3>
63 <a href="wh.pl?action=journal&partnumber=[% HTML.escape(SELF.part.partnumber) %]">[% 'WHJournal' | $T8 %]</a>:
64 [%- IF SELF.journal.size %]
65 <table>
66  <tr class='listheading'>
67   <th>[% 'Date'           | $T8 %]</th>
68   <th>[% 'Trans Type'     | $T8 %]</th>
69   <th>[% 'Warehouse From' | $T8 %]</th>
70   <th>[% 'Qty'            | $T8 %]</th>
71   <th>[% 'Unit'           | $T8 %]</th>
72   <th>[% 'Warehouse To'   | $T8 %]</th>
73   <th>[% 'Charge Number'  | $T8 %]</th>
74   <th>[% 'Comment'        | $T8 %]</th>
75  </tr>
76 [% FOREACH row = SELF.journal %]
77  <tr class='listrow'>
78   <td>[% row.base.itime_as_date  %]</td>
79   <td>[% row.base.trans_type.description | $T8 %]</td>
80   <td>[% row.out ? row.out.bin.full_description : '-' | html %]</td>
81   <td class='numeric'>[% row.in ? row.in.qty_as_number : LxERP.format_amount(-1 * row.out.qty, 2) %]</td>
82   <td>[% row.base.part.unit | html %]</td>
83   <td>[% row.in ? row.in.bin.full_description : '-' | html %]</td>
84   <td>[% row.base.chargenumber | html %]</td>
85   <td>[% row.base.comment | html %]</td>
86  </tr>
87 [% END %]
88 </table>
89 [%- ELSE %]
90 <p>[% 'No transactions yet.' | $T8 %]</p>
91 [%- END %]
92 </div>
93 [% END # assert warehouse_management %]