1 [%- USE HTML %][%- USE L -%][%- USE P -%][%- USE LxERP -%][%- USE T8 -%]
 
   4 [%- SET show_warehouse_subtotals = 1 %]
 
   6 <div id="stock_levels">
 
   8 <h3>[% 'Stock levels' | $T8 %]</h3>
 
  10 [%- IF SELF.stock_amounts.size %]
 
  11 <a href="wh.pl?action=report&partnumber=[% HTML.escape(SELF.part.partnumber) %]">[% 'Stock levels' | $T8 %]</a>:
 
  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>
 
  23  [% FOREACH stock = SELF.stock_amounts %]
 
  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 %]
 
  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>
 
  34   [% IF show_warehouse_subtotals AND stock.wh_lead != stock.warehouse_description %]
 
  35   <tr class='listheading'>
 
  36    <th                >[% HTML.escape(stock.warehouse_description)           %]</th>
 
  38    <td class='numeric bold'>[% LxERP.format_amount(stock.wh_run_qty, dec)         %]</td>
 
  40    <td class='numeric bold'>[% LxERP.format_amount(stock.wh_run_stock_value, dec) %]</td>
 
  44   <tr class='listheading'>
 
  45    <th>[% 'Total' | $T8 %]</th>
 
  47    <td class='numeric bold'>[% LxERP.format_amount(stock.run_qty, dec)         %]</td>
 
  49    <td class='numeric bold'>[% LxERP.format_amount(stock.run_stock_value, dec) %]</td>
 
  56   <p>[% 'No transactions yet.' | $T8 %]</p>
 
  60 [% IF AUTH.assert('warehouse_management', 1) %]
 
  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 %]
 
  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>
 
  76 [% FOREACH row = SELF.journal %]
 
  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>
 
  90 <p>[% 'No transactions yet.' | $T8 %]</p>
 
  93 [% END # assert warehouse_management %]