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