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