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