Bug 5336: (follow-up) multiple QA fixes
[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
51         <li>
52             <label for="orderstatus">Order status: </label>
53             <select name="orderstatus" id="orderstatus">
54                 [% IF orderstatus == "" %]
55                   <option value=""></option>
56                 [% ELSE %]
57                   <option value="" selected="selected"></option>
58                 [% END %]
59                 [% IF orderstatus == "new" %]
60                   <option value="new" selected="selected">New</option>
61                 [% ELSE %]
62                   <option value="new">New</option>
63                 [% END %]
64                 [% IF orderstatus == "ordered" %]
65                   <option value="ordered" selected="selected">Pending</option>
66                 [% ELSE %]
67                   <option value="ordered">Pending</option>
68                 [% END %]
69                 [% IF orderstatus == "partial" %]
70                   <option value="partial" selected="selected">Partially received</option>
71                 [% ELSE %]
72                   <option value="partial">Partially received</option>
73                 [% END %]
74                 [% IF orderstatus == "complete" %]
75                   <option value="complete" selected="selected">Received</option>
76                 [% ELSE %]
77                   <option value="complete">Received</option>
78                 [% END %]
79                 [% IF orderstatus == "cancelled" %]
80                   <option value="cancelled" selected="selected">Cancelled</option>
81                 [% ELSE %]
82                   <option value="cancelled">Cancelled</option>
83                 [% END %]
84             </select>
85         </li>
86         <li>
87             <label for="fund">Fund: </label>
88             <select name="budget" id="fund">
89                 <option value="">All funds</option>
90                 [% FOREACH bp_loo IN bp_loop %]
91                     <optgroup label="[% bp_loo.budget_period_description %]">
92                     [% FOREACH h_loo IN bp_loo.hierarchy %]
93                       [% IF h_loo.budget_id == budget_id %]
94                         <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]" selected="selected">
95                       [% ELSE %]
96                         <option type="text" value="[% h_loo.budget_id %]" branchcode="[% h_loo.budget_branchcode %]">
97                       [% END %]
98                             [% h_loo.budget_display_name %]
99                         </option>
100                     [% END %]
101                     </optgroup>
102                 [% END %]
103             </select>
104         </li>
105
106                 <li><label for="from">From: </label> 
107         <input type="text" size="10" id="from" name="from" value="[% from_placed_on %]" class="datepickerfrom" />
108                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
109                 </li>
110                 <li><label for="to">To: </label> 
111         <input type="text" size="10" id="to" name="to" value="[% to_placed_on %]" class="datepickerto" />
112                                 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
113                 </li>
114                 </ol>
115         </fieldset>
116     <input type="hidden" name="do_search" value="1" />
117         <fieldset class="action"><input type="submit" value="Search" /></fieldset>
118         </form>[% END %]
119     [% IF ( order_loop ) %]<h1>Search results</h1>
120         <div id="acqui_histsearch">
121         <table id="histsearcht">
122             <thead>
123                         <tr>
124                 <th>Order line (parent)</th>
125                 <th>Status</th>
126                                 <th>Basket</th>
127                                 <th>Basket group</th>
128                 <th>Invoice number</th>
129                                 <th>Summary</th>
130                                 <th>Vendor</th>
131                                 <th>Placed on</th>
132                                 <th>Received on</th>
133                 <th>Quantity received</th>
134                 <th>Pending order</th>
135                                 <th>Unit cost</th>
136                 <th>Fund</th>
137                         </tr>
138             </thead>
139             <tbody>
140             [% FOREACH order IN order_loop %]
141                 <tr>
142                     <td>
143                         [% order.ordernumber %]
144                         [% IF order.ordernumber != order.parent_ordernumber %]([% order.parent_ordernumber %])[% END %]
145                     </td>
146                     <td>
147                         [% SWITCH order.orderstatus %]
148                             [% CASE 'new' %]New
149                             [% CASE 'ordered' %]Pending
150                             [% CASE 'partial' %]Partially received
151                             [% CASE 'complete' %]Received
152                             [% CASE 'cancelled' %]Cancelled
153                         [% END %]
154                     </td>
155                     <td>[% order.basketname %] (<a href="basket.pl?basketno=[% order.basketno %]">[% order.basketno %]</a>)</td>
156                     <td>
157                         [% IF ( order.basketgroupid ) %]
158                             [% order.groupname %] (<a href="basketgroup.pl?booksellerid=[% order.id %]">[% order.basketgroupid %]</a>)
159                         [% ELSE %]
160                             &nbsp;
161                         [% END %]
162                     </td>
163                     <td>[% IF ( order.invoicenumber ) %]
164                             <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% order.invoiceid %]">[% order.invoicenumber %]</a>
165                         [% ELSE %]
166                             &nbsp;
167                         [% END %]
168                     </td>
169                     <td>
170                         <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a>
171                         <br />[% order.author %] <br /> [% order.isbn %]
172                     </td>
173                     <td><a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.id %]">[% order.name %]</a></td>
174                     <td>[% order.creationdate | $KohaDates %]</td>
175                     <td>
176                         [% IF order.datereceived %]
177                             [% order.datereceived | $KohaDates %]
178                         [% END %]
179                     </td>
180                     <td>[% order.quantityreceived %]</td>
181                     <td>[% order.quantity %]</td>
182                     <td>[% order.ecost %]</td>
183                     <td>[% order.budget_name %]</td>
184                 </tr>
185             [% END %]
186             </tbody>
187         </table>
188     </div>
189     [% ELSIF search_done %]
190       There is no order for this search.
191     [% END %]
192
193 </div>
194 </div>
195 <div class="yui-b">
196 [% INCLUDE 'acquisitions-menu.inc' %]
197 </div>
198 </div>
199 [% INCLUDE 'intranet-bottom.inc' %]