06b2a5b07fbb2cd4eca23e617a58304f5f346b8e
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / histsearch.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE TablesSettings %]
5 [% USE Branches %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( order_loop ) %]Orders search &rsaquo; Search results[% ELSE %]Order search[% END %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="acq_histsearch" 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; [% IF ( order_loop ) %]<a href="/cgi-bin/koha/acqui/histsearch.pl">Orders search</a> &rsaquo; Search results[% ELSE %]Order search[% END %]</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                 [% IF !order_loop && search_done %]
23                     <div class="dialog message">
24                         Your search returned no results.
25                     </div>
26                 [% END %]
27
28                 [% UNLESS ( order_loop ) %]
29                     [% PROCESS filter_form context => "main" %]
30                 [% END %]
31
32
33     [% IF ( order_loop ) %]<h1>Search results</h1>
34         <div id="acqui_histsearch">
35         <table id="histsearcht">
36             <thead>
37                         <tr>
38                 <th>Order line (parent)</th>
39                 <th>Status</th>
40                                 <th>Basket</th>
41                 <th>Basket creator</th>
42                 <th>Basket group</th>
43                 <th>Managing library</th>
44                 <th>Invoice number</th>
45                 <th class="anti-the">Summary</th>
46                                 <th>Vendor</th>
47                 <th class="title-string">Placed on</th>
48                 <th class="title-string">Received on</th>
49                 <th>Quantity received</th>
50                 <th>Quantity ordered</th>
51                                 <th>Unit cost</th>
52                 <th>Fund</th>
53                         </tr>
54             </thead>
55             <tbody>
56             [% FOREACH order IN order_loop %]
57                 <tr>
58                     <td>
59                         [% order.ordernumber | html %]
60                         [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber | html %])[% END %]
61                     </td>
62                     <td>
63                         [% SWITCH order.orderstatus %]
64                             [% CASE 'new' %]New
65                             [% CASE 'ordered' %]Ordered
66                             [% CASE 'partial' %]Partially received
67                             [% CASE 'complete' %]Received
68                             [% CASE 'cancelled' %]Cancelled
69                         [% END %]
70                     </td>
71                     <td><a href="basket.pl?basketno=[% order.basketno | uri %]">[% order.basketname | html %] ([% order.basketno | html %])</a></td>
72                     <td>[% order.authorisedbyname | html %]</td>
73                     <td>
74                         [% IF ( order.basketgroupid ) %]
75                         <a href="basketgroup.pl?op=add&booksellerid=[% order.id | uri %]&basketgroupid=[% order.basketgroupid | uri %]">[% order.groupname | html %] ([% order.basketgroupid | html %])</a>
76                         [% ELSE %]
77                             &nbsp;
78                         [% END %]
79                     </td>
80                     <td>[% Branches.GetName(order.managing_library) | html %]</td>
81                     <td>[% IF ( order.invoicenumber ) %]
82                             <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid | uri %]">[% order.invoicenumber | html %]</a>
83                         [% ELSE %]
84                             &nbsp;
85                         [% END %]
86                     </td>
87                     <td>
88                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
89                         <br />[% order.author | html %] <br /> [% order.isbn | html %]
90                     </td>
91                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id | uri %]">[% order.name | html %]</a></td>
92                     <td><span title="[% order.creationdate | html %]">[% order.creationdate | $KohaDates %]</span></td>
93                     <td>
94                         [% IF order.datereceived %]
95                             <span title="[% order.datereceived | html %]">[% order.datereceived | $KohaDates %]</span>
96                         [% ELSE %]
97                             <span title="0000-00-00"></span>
98                         [% END %]
99                     </td>
100                     <td>[% order.quantityreceived | html %]</td>
101                     <td>[% order.quantity | html %]</td>
102                     <td>[% order.ecost | html %]</td>
103                     <td>[% order.budget_name | html %]</td>
104                 </tr>
105             [% END %]
106             </tbody>
107         </table>
108     </div>
109     [% END %]
110
111 </main>
112 </div> <!-- /.col-sm-10.col-sm-push-2 -->
113
114 <div class="col-sm-2 col-sm-pull-10">
115     <aside>
116         [% IF ( order_loop ) %]
117             [% PROCESS filter_form context => "sidebar" %]
118         [% END %]
119         [% INCLUDE 'acquisitions-menu.inc' %]
120     </aside>
121 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
122 </div>
123
124 [% MACRO jsinclude BLOCK %]
125     [% Asset.js("js/acquisitions-menu.js") | $raw %]
126 [% INCLUDE 'calendar.inc' %]
127     [% INCLUDE 'datatables.inc' %]
128     [% INCLUDE 'columns_settings.inc' %]
129     [% Asset.js("js/autocomplete/patrons.js") | $raw %]
130     <script>
131         var MSG_REMOVE_PATRON = _("Remove");
132         $(document).ready(function() {
133             var columns_settings = [% TablesSettings.GetColumns( 'acqui', 'histsearch', 'histsearcht', 'json' ) | $raw %];
134             KohaTable("histsearcht", {
135                 "aoColumnDefs": [
136                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
137                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
138                 ],
139                 "sPaginationType": "full"
140             }, columns_settings );
141
142             patron_autocomplete({
143                 patron_container: $("#basket_creators"),
144                 input_autocomplete: $("#find_patron"),
145                 patron_input_name: 'created_by',
146                 field_to_retrieve: 'borrowernumber'
147             });
148         });
149     </script>
150 [% END %]
151
152 [% BLOCK filter_form %]
153     <form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
154         [% IF ( context == "sidebar" ) %]
155             <fieldset class="brief">
156                 <h4>Search orders</h4>
157         [% ELSE %]
158             <fieldset class="rows">
159                 <legend>Search orders</legend>
160         [% END %]
161             [% INCLUDE 'filter-orders.inc' %]
162         </fieldset>
163         <input type="hidden" name="do_search" value="1" />
164         <fieldset class="action"><input type="submit" value="Search" /></fieldset>
165     </form>
166 [% END %]
167
168 [% INCLUDE 'intranet-bottom.inc' %]