--- /dev/null
+[% USE T8 %]
+[% USE HTML %]
+[% USE LxERP %]
+<div id="delivery">
+ <table width="100%">
+ <tr>
+ <td>
+ <table width="100%">
+ <tr class="listheading">
+ <th class="listheading">[% 'Shipping Address' | $T8 %]</th>
+ <th class="listheading">[% 'Invoice' | $T8 %]</th>
+ <th class="listheading">[% 'Order' | $T8 %]</th>
+ <th class="listheading">[% 'Invdate' | $T8 %]</th>
+ <th class="listheading">[% 'Description' | $T8 %]</th>
+ <th class="listheading">[% 'Qty' | $T8 %]</th>
+ <th class="listheading">[% 'Unit' | $T8 %]</th>
+ [% IF ( SELF.is_customer() ) %]
+ <th class="listheading">[% 'Sell Price' | $T8 %]</th>
+ [% ELSE %]
+ <th class="listheading">[% 'Last Cost' | $T8 %]</th>
+ [%- END %]
+ </tr>
+
+
+ [% FOREACH row = SELF.delivery %]
+ [% row.script = SELF.is_vendor() ? ( row.invoice ? 'ir' : 'ap' ) : ( row.invoice ? 'is' : 'ar' ) %]
+ <tr class="listrow[% loop.count % 2 %]">
+ <td>[% HTML.escape(row.shiptoname) UNLESS loop.prev.shiptoname == row.shiptoname %] </td>
+ <td>[% IF row.id %]<a href='[% row.script %].pl?action=edit&id=[% HTML.escape(row.id) %]'>[% END %][% HTML.escape(row.invnumber) || ' ' %][% IF row.id %]</a>[% END %]</td>
+ <td>[% IF row.oe_id %]<a href='oe.pl?action=edit&type=[% IF is_customer %]sales_order[% ELSE %]purchase_order[% END %]&vc=customer&id=[% HTML.escape(row.oe_id) %]'>[% END %][% HTML.escape(row.ordnumber) || ' ' %][% IF row.oe_id %]</a>[% END %]</td>
+ <td>[% HTML.escape(row.transdate) || ' ' %]</td>
+ <td>[% HTML.escape(row.description) || ' ' %]</td>
+ <td>[% HTML.escape(row.qty) || ' ' %]</td>
+ <td>[% HTML.escape(row.unit) || ' ' %]</td>
+ <td>[% LxERP.format_amount(row.sellprice, 2) || ' ' %]</td>
+ </tr>
+ [% END %]
+
+ </table>
+
+ [% IF DELIVERY.size == 15 %]
+ <p>[% 'This list is capped at 15 items to keep it fast. If you need a full list, please use reports.' | $T8 %]</p>
+ [% END %]
+
+ </td>
+ </tr>
+ </table>
+</div>