Bug 12944 [Patron lists follow-up] There is no way to search orders by creator
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / histsearch.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( order_loop ) %]Orders search &rsaquo; Search results[% ELSE %]Order search[% END %]</title>
4 <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'calendar.inc' %]
7 [% INCLUDE 'datatables.inc' %]
8
9 <script type="text/javascript" src="[% interface %]/js/autocomplete/patrons.js"></script>
10 <script type="text/javascript">
11 //<![CDATA[
12  $(document).ready(function() {
13     $("#histsearcht").dataTable($.extend(true, {}, dataTablesDefaults, {
14         "aoColumnDefs": [
15             { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
16             { "sType": "title-string", "aTargets" : [ "title-string" ] }
17         ],
18         "sPaginationType": "four_button"
19     } ) );
20
21
22     patron_autocomplete({
23         patron_container: $("#basket_creators"),
24         input_autocomplete: $("#find_patron"),
25         patron_input_name: 'created_by',
26         field_to_retrieve: 'borrowernumber'
27     });
28 });
29
30  //]]>
31 </script>
32 </head>
33 <body id="acq_histsearch" class="acq">
34 [% INCLUDE 'header.inc' %]
35 [% INCLUDE 'acquisitions-search.inc' %]
36
37 <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>
38
39 <div id="doc3" class="yui-t2">
40    
41    <div id="bd">
42         <div id="yui-main">
43         <div class="yui-b">
44         
45 [% UNLESS ( order_loop ) %]<form action="/cgi-bin/koha/acqui/histsearch.pl" method="post">
46 <fieldset class="rows">
47     <legend>Search orders</legend>
48                 <ol>
49                 <li><label for="title">Title: </label> <input type="text" name="title" id="title" value="[% title %]" /></li>
50                 <li><label for="author">Author: </label> <input type="text" name="author" id="author" value="[% author %]" /></li>
51         <li><label for="isbn">ISBN: </label> <input type="text" name="isbn" id="isbn" value="[% isbn %]" /></li>
52                 [% IF (UNIMARC) %]
53         <li><label for="ean">EAN: </label> <input type="text" name="ean" id="ean" value="[% ean %]" /></li>
54                 [% END %]
55                 <li><label for="name">Vendor: </label> <input type="text" name="name" id="name" value="[% name %]" /></li>
56                 <li><label for="basket">Basket: </label> <input type="text" name="basket" id="basket" value="[% basket %]" /></li>
57         <li><label for="basket_creators">Basket created by: </label>
58             <input autocomplete="off" id="find_patron" type="text" style="width:150px" class="noEnterSubmit" />
59             <div>
60                 <div id="basket_creators" style="float:left;"></div>
61             </div>
62         </li>
63         <li><label for="booksellerinvoicenumber ">Bookseller invoice no: </label> <input type="text" name="booksellerinvoicenumber" id="booksellerinvoicenumber" value="[% booksellerinvoicenumber %]" /></li>
64         <li>
65             <label for="basketgroupname">Basket group:</label>
66             <input type="text" name="basketgroupname" id="basketgroupname" value="[% basketgroupname %]" />
67         </li>
68         <li>
69           <label for="ordernumber">Order line:</label>
70           <input type="text" name="ordernumber" id="ordernumber" value="[% ordernumber %]" />
71           [% IF search_children_too %]
72             <input type="checkbox" name="search_children_too" id="search_children_too" value="1" checked="checked" />
73           [% ELSE %]
74             <input type="checkbox" name="search_children_too" id="search_children_too" value="1" />
75           [% END %]
76           <label class="yesno" for="search_children_too">Display children too.</label>
77         </li>
78
79         <li>
80             <label for="orderstatus">Order status: </label>
81             <select name="orderstatus" id="orderstatus">
82                 [% IF orderstatus == "" %]
83                   <option value="">Any status except cancelled</option>
84                 [% ELSE %]
85                   <option value="" selected="selected"></option>
86                 [% END %]
87                 [% IF orderstatus == "new" %]
88                   <option value="new" selected="selected">New</option>
89                 [% ELSE %]
90                   <option value="new">New</option>
91                 [% END %]
92                 [% IF orderstatus == "ordered" %]
93                   <option value="ordered" selected="selected">Pending</option>
94                 [% ELSE %]
95                   <option value="ordered">Pending</option>
96                 [% END %]
97                 [% IF orderstatus == "partial" %]
98                   <option value="partial" selected="selected">Partially received</option>
99                 [% ELSE %]
100                   <option value="partial">Partially received</option>
101                 [% END %]
102                 [% IF orderstatus == "complete" %]
103                   <option value="complete" selected="selected">Received</option>
104                 [% ELSE %]
105                   <option value="complete">Received</option>
106                 [% END %]
107                 [% IF orderstatus == "cancelled" %]
108                   <option value="cancelled" selected="selected">Cancelled</option>
109                 [% ELSE %]
110                   <option value="cancelled">Cancelled</option>
111                 [% END %]
112             </select>
113         </li>
114         <li>
115             <label for="fund">Fund: </label>
116             <select name="budget" id="fund">
117                 <option value="">All funds</option>
118                 [% FOREACH bp_loo IN bp_loop %]
119                     <optgroup label="[% bp_loo.budget_period_description %]">
120                     [% FOREACH h_loo IN bp_loo.hierarchy %]
121                       [% IF h_loo.budget_id == budget_id %]
122                         <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]" selected="selected">
123                       [% ELSE %]
124                         <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]">
125                       [% END %]
126                             [% h_loo.budget_display_name %]
127                         </option>
128                     [% END %]
129                     </optgroup>
130                 [% END %]
131             </select>
132         </li>
133
134                 <li><label for="from">From: </label> 
135         <input type="text" size="10" id="from" name="from" value="[% from_placed_on %]" class="datepickerfrom" />
136                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
137                 </li>
138                 <li><label for="to">To: </label> 
139         <input type="text" size="10" id="to" name="to" value="[% to_placed_on %]" class="datepickerto" />
140                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
141                 </li>
142                 </ol>
143         </fieldset>
144     <input type="hidden" name="do_search" value="1" />
145         <fieldset class="action"><input type="submit" value="Search" /></fieldset>
146         </form>[% END %]
147     [% IF ( order_loop ) %]<h1>Search results</h1>
148         <div id="acqui_histsearch">
149         <table id="histsearcht">
150             <thead>
151                         <tr>
152                 <th>Order line (parent)</th>
153                 <th>Status</th>
154                                 <th>Basket</th>
155                 <th>Basket creator</th>
156                                 <th>Basket group</th>
157                 <th>Invoice number</th>
158                 <th class="anti-the">Summary</th>
159                                 <th>Vendor</th>
160                 <th class="title-string">Placed on</th>
161                 <th class="title-string">Received on</th>
162                 <th>Quantity received</th>
163                 <th>Pending order</th>
164                                 <th>Unit cost</th>
165                 <th>Fund</th>
166                         </tr>
167             </thead>
168             <tbody>
169             [% FOREACH order IN order_loop %]
170                 <tr>
171                     <td>
172                         [% order.ordernumber %]
173                         [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber %])[% END %]
174                     </td>
175                     <td>
176                         [% SWITCH order.orderstatus %]
177                             [% CASE 'new' %]New
178                             [% CASE 'ordered' %]Pending
179                             [% CASE 'partial' %]Partially received
180                             [% CASE 'complete' %]Received
181                             [% CASE 'cancelled' %]Cancelled
182                         [% END %]
183                     </td>
184                     <td>[% order.basketname %] (<a href="basket.pl?basketno=[% order.basketno %]">[% order.basketno %]</a>)</td>
185                     <td>[% order.authorisedbyname %]</td>
186                     <td>
187                         [% IF ( order.basketgroupid ) %]
188                             [% order.groupname %] (<a href="basketgroup.pl?booksellerid=[% order.id %]">[% order.basketgroupid %]</a>)
189                         [% ELSE %]
190                             &nbsp;
191                         [% END %]
192                     </td>
193                     <td>[% IF ( order.invoicenumber ) %]
194                             <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid %]">[% order.invoicenumber %]</a>
195                         [% ELSE %]
196                             &nbsp;
197                         [% END %]
198                     </td>
199                     <td>
200                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a>
201                         <br />[% order.author %] <br /> [% order.isbn %]
202                     </td>
203                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id %]">[% order.name %]</a></td>
204                     <td><span title="[% order.creationdate %]">[% order.creationdate | $KohaDates %]</span></td>
205                     <td>
206                         [% IF order.datereceived %]
207                             <span title="[% order.datereceived %]">[% order.datereceived | $KohaDates %]</span>
208                         [% ELSE %]
209                             <span title="0000-00-00"></span>
210                         [% END %]
211                     </td>
212                     <td>[% order.quantityreceived %]</td>
213                     <td>[% order.quantity %]</td>
214                     <td>[% order.ecost %]</td>
215                     <td>[% order.budget_name %]</td>
216                 </tr>
217             [% END %]
218             </tbody>
219         </table>
220     </div>
221     [% ELSIF search_done %]
222       There is no order for this search.
223     [% END %]
224
225 </div>
226 </div>
227 <div class="yui-b">
228 [% INCLUDE 'acquisitions-menu.inc' %]
229 </div>
230 </div>
231 [% INCLUDE 'intranet-bottom.inc' %]