Bug 23397: (follow-up) Split and display itemtypes
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / spent.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE ItemTypes %]
5 [% USE Price %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Acquisitions &rsaquo; Spent</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="acq_spent" class="acq">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'acquisitions-search.inc' %]
15
16 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; Spent - [% fund_code | html %]</div>
17
18 <div class="main container-fluid">
19     <div class="row">
20         <div class="col-sm-10 col-sm-push-2">
21             <main>
22
23 <h1>Fund: [% fund_code | html %]</h1>
24 <h2>Spent</h2>
25
26 <table id="spent">
27     <thead>
28         <tr>
29            <th class="anti-the">Title</th>
30            <th>Order</th>
31            <th>Vendor</th>
32            <th>Invoice</th>
33            <th>Item types</th>
34            <th>Received</th>
35            <th>Unit price</th>
36            <th class="title-string">Date ordered</th>
37            <th class="title-string">Date received</th>
38            <th>Subtotal</th>
39         </tr>
40     </thead>
41
42     [% FOREACH order IN spent %]
43         <tr>
44             <td class="cell">
45                 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">
46                     [% order.title | html %]
47                 </a>
48             </td>
49             <td class="cell">
50                 [% order.ordernumber | html %]
51             </td>
52             <td class="cell">
53                 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.booksellerid | uri %]">[% order.vendorname | html %]</a>
54             </td>
55             <td class="cell">
56                 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]">[% order.invoicenumber | html %]</a>
57             </td>
58             <td class="cell">
59                 [% FOREACH itemtype IN order.itemtypes %]
60                     [% IF !(loop.count() mod 2) %] | [% END %]
61                     [% ItemTypes.GetDescription( itemtype ) | html %]
62                 [% END %]
63             </td>
64             <td class="cell">
65                 [% order.quantityreceived | html %]
66             </td>
67             <td class="cell">
68                 [% order.unitprice_tax_included | $Price %]
69             </td>
70             <td class="cell">
71                 <span title="[% order.entrydate | html %]">[% order.entrydate | $KohaDates %]</span>
72             </td>
73             <td class="cell">
74                 <span title="[% order.datereceived | html %]">[% order.datereceived | $KohaDates %]</span>
75             </td>
76             <td class="data cell">
77                 [% order.rowtotal | $Price %]
78             </td>
79         </tr>
80     [% END %]
81
82     <tfoot>
83         [% IF shipmentcosts.size || ( adjustments && adjustments.count > 0 ) %]
84             <tr>
85                 <td colspan="9"> Sub total </td>
86                 <td class="data"> [% subtotal | $Price %] </td>
87             </tr>
88         [% END %]
89         [% IF shipmentcosts.size %]
90             [% FOREACH shipmentcost IN shipmentcosts %]
91                 <tr>
92                     <td></td>
93                     <td colspan="8">Shipping cost for invoice
94                         <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% shipmentcost.invoiceid | uri %]">
95                              [% shipmentcost.invoicenumber | html %]
96                         </a>
97                     </td>
98                     <td class="data total">[% shipmentcost.shipmentcost | $Price %]</td>
99                 </tr>
100             [% END %]
101         [% END %]
102         [% IF ( adjustments && adjustments.count > 0 ) %]
103             [% FOREACH adjustment IN adjustments %]
104                 <tr>
105                     <td></td>
106                     <td colspan="8">Adjustment cost for invoice
107                         <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% adjustment.invoiceid | uri %]">
108                             [% adjustment.invoice.invoicenumber | html %]
109                         </a>
110                     </td>
111                     <td class="data total">[% adjustment.adjustment | $Price %]</td>
112                 </tr>
113             [% END %]
114         [% END %]
115         <tr>
116             <td colspan="9">TOTAL</td>
117             <td class="data total">[% total | $Price %]</td>
118         </tr>
119     </tfoot>
120 </table>
121
122 </main>
123 </div> <!-- /.col-sm-10.col-sm-push-2 -->
124
125 <div class="col-sm-2 col-sm-pull-10">
126     <aside>
127         [% INCLUDE 'acquisitions-menu.inc' %]
128     </aside>
129 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
130 </div> <!-- /.row -->
131
132 [% MACRO jsinclude BLOCK %]
133     [% Asset.js("js/acquisitions-menu.js") | $raw %]
134     [% INCLUDE 'datatables.inc' %]
135     <script>
136         $(document).ready(function() {
137             $("#spent").dataTable($.extend(true, {}, dataTablesDefaults, {
138                 "aoColumnDefs": [
139                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
140                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
141                 ],
142                 "sPaginationType": "full"
143             } ) );
144         });
145     </script>
146 [% END %]
147
148 [% INCLUDE 'intranet-bottom.inc' %]