Bug 19812: Fix confusing holds count values in "Already received" table
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / parcel.tt
1 [% USE Koha %]
2 [% USE KohaDates %]
3 [% USE Price %]
4 [% USE currency = format('%.2f') -%]
5 [% SET footerjs = 1 %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha &rsaquo; Acquisitions &rsaquo; [% IF ( date ) %]
8             Receipt summary for [% name %] [% IF ( invoice ) %]invoice [% invoice %][% END %] on [% datereceived | $KohaDates %][% ELSE %]Receive orders from [% name %][% END %]</title>
9 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
10 [% INCLUDE 'doc-head-close.inc' %]
11 </head>
12
13 <body id="acq_parcel" class="acq">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'acquisitions-search.inc' %]
16
17 <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;
18     [% IF datereceived %]
19         Receipt summary for <i>[% name %]</i>
20         [% IF ( invoice ) %]
21             <i>[ [% invoice |html %] ]</i>
22         [% END %]
23         on <i>[% datereceived | $KohaDates %]</i>
24     [% ELSE %]
25         Receive orders from [% name %]
26     [% END %]
27 </div>
28
29 <div id="doc3" class="yui-t2">
30
31    <div id="bd">
32         <div id="yui-main">
33         <div class="yui-b">
34         [% IF ( receive_error ) %]
35         <div class="dialog alert">
36         <h3>Error adding items:</h3>
37         <ul>
38         [% FOREACH error_loo IN error_loop %]
39                 <li>[% error_loo.error_param %][% IF ( error_loo.error_duplicate_barcode ) %]Duplicate Barcode[% END %] <!-- todo: other error conditions come here. --></li>
40         [% END %]
41         </ul>
42         </div>
43         [% END %]
44     <h1>
45         [% IF datereceived %]
46             Receipt summary for <i>[% name %]</i> [% IF ( invoice ) %] <i> [ [% invoice |html %] ] </i>[% END %] on <i>[% datereceived | $KohaDates %]</i>
47         [% ELSE %]
48             Receive orders from [% name %]
49         [% END %]
50     </h1>
51
52     [% IF ( success_delorder ) %]
53     <div class="dialog message">The order has been successfully canceled.</div>
54     [% ELSE %]
55         [% IF ( error_delitem ) %]
56             <div class="dialog alert">The order has been canceled, although one or more items could not have been deleted.</div>
57         [% END %]
58         [% IF ( error_delbiblio ) %]
59             <div class="dialog alert">The order has been canceled, although the record has not been deleted.</div>
60         [% END %]
61     [% END %]
62
63     [% IF (error_cancelling_receipt) %]
64       <div class="dialog error">
65       Cannot cancel receipt. Possible reasons :
66       <ul>
67         <li>
68           The order line you trying to cancel was created from a partial receipt
69           of another order line which is already received. Try to cancel this
70           one first and retry.
71         </li>
72         <li>
73           The order line you trying to cancel was created from a partial receipt
74           of another order line which has been deleted. Cancellation is not
75           possible.
76         </li>
77       </ul>
78       </div>
79     [% END %]
80
81     [% IF error_invoice_not_known %]
82         <div class="dialog error">
83             The invoice referenced by this invoiceid does not exist.
84         </div>
85     [% END %]
86
87 [% UNLESS no_orders_to_display %]
88 <div id="acqui_receive_summary">
89 <p><strong>Invoice number:</strong> [% invoice |html %] <strong>Received by:</strong> [% loggedinusername %] <strong>On:</strong> [% datereceived | $KohaDates %]</p>
90 </div>
91 [% UNLESS (invoiceclosedate) %]
92   <div id="acqui_receive_search">
93     <h3>Pending orders</h3>
94
95     [% IF ( loop_orders ) %]
96       <table id="pendingt">
97         <thead>
98           <tr>
99             <th>Basket search</th>
100             <th>Basket group search</th>
101             <th>Order line search</th>
102             <th>Summary search</th>
103             <th>&nbsp;</th>
104             <th>Quantity search</th>
105             <th>Unit cost search</th>
106             <th>Order cost search</th>
107             <th>Fund search</th>
108             <th>&nbsp;</th>
109             <th>&nbsp;</th>
110           </tr>
111           <tr>
112             <th>Basket</th>
113             <th>Basket group</th>
114             <th>Order line</th>
115             <th>Summary</th>
116             <th>View record</th>
117             <th>Quantity</th>
118             <th>Unit cost</th>
119             <th>Order cost</th>
120             <th>Fund</th>
121             <th>&nbsp;</th>
122             <th>&nbsp;</th>
123           </tr>
124         </thead>
125         <tbody class="filterclass">
126         [% FOREACH loop_order IN loop_orders %]
127             <tr>
128                 <td class="basketfilterclass">[% loop_order.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno %]">[% loop_order.basketno %]</a>)</td>
129                 <td>
130                   [% IF loop_order.basketgroupid %]
131                     [% loop_order.basketgroupname %] (<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% loop_order.booksellerid %]">[% loop_order.basketgroupid %]</a>)
132                   [% ELSE %]
133                     No basket group
134                   [% END %]
135                 </td>
136                 <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber %]&amp;booksellerid=[% loop_order.booksellerid %]">[% loop_order.ordernumber %]</a></td>
137                 <td class="summaryfilterclass">
138                   <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber %]">[% loop_order.title |html %]</a>
139                 [% IF ( loop_order.author ) %] by [% loop_order.author %][% END %]
140                 [% IF ( loop_order.isbn ) %] &ndash; [% loop_order.isbn %][% END %]
141                 [% IF ( loop_order.publishercode ) %]
142                     <br />Publisher: [% loop_order.publishercode %]
143                     [%- IF    ( loop_order.publicationyear > 0) -%], [% loop_order.publicationyear %]
144                     [%- ELSIF ( loop_order.copyrightdate   > 0) -%] [% loop_order.copyrightdate %]
145                     [% END %]
146                 [% END %]
147                 [% IF ( loop_order.suggestionid ) %]
148                     <br/>
149                     Suggested by: [% loop_order.surnamesuggestedby %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby %] [% END %]
150                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid %]&amp;op=show">suggestion #[% loop_order.suggestionid %]</a>)
151                 [% END %]
152                 <br />
153                 [% IF ( loop_order.order_internalnote ) %]
154                     <p class="ordernote"><strong>Internal note: </strong>[% loop_order.order_internalnote|html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=internal">Change internal note</a>]</p>
155                 [% ELSE %]
156                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=internal">Add internal note</a>]
157                 [% END %]
158                 [% IF ( loop_order.order_vendornote ) %]
159                     <p class="ordernote"><strong>Vendor note: </strong>[% loop_order.order_vendornote|html %]</p>
160                 [% ELSE %]
161                     [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber %]&amp;referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]&type=vendor">Add vendor note</a>]
162                 [% END %]
163                 </td>
164                 <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% loop_order.biblionumber %]" class="previewData">Card</a></td>
165                 <td>[% loop_order.quantity %]</td>
166                 <td>[% loop_order.ecost | $Price %]</td>
167                 <td>[% loop_order.total | $Price %]</td>
168                 <td>[% loop_order.budget_name %]</td>
169                                 <td>
170                               <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber %]&amp;invoiceid=[% invoiceid %]">Receive</a>
171                     <br />
172                     <a href="#" onclick="transfer_order_popup([% loop_order.ordernumber %]); return false;">Transfer</a>
173                                 </td>
174                                 <td>
175                         [% IF ( loop_order.left_holds_on_order ) %]
176                         <span class="button" title="Can't cancel order, ([% loop_order.holds_on_order %]) holds are linked with this order cancel holds first">Can't cancel order</span><br>
177                         [% ELSE %]
178                         <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]">Cancel order</a><br />
179                         [% END %]
180                         [% IF ( loop_order.can_del_bib ) %]
181                         <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber %]&biblionumber=[% loop_order.biblionumber %]&del_biblio=1&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]">Cancel order and catalog record</a><br />
182                         [% ELSE %]
183                         <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
184                         [% END %]
185                         [% IF ( loop_order.left_item ) %]
186                         <b title="Can't delete catalog record, because of [% loop_order.items %] existing item(s)" >[% loop_order.items %] item(s) left</b><br>
187                         [% END %]
188                         [% IF ( loop_order.left_biblio ) %]
189                         <b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios %] order(s) left</b><br>
190                         [% END %]
191                         [% IF ( loop_order.left_subscription ) %]
192                         <b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions %] subscription(s) left</b><br>
193                         [% END %]
194                         [% IF ( loop_order.left_holds ) %]
195                         <b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds %] hold(s) left</b>
196                         [% END %]
197                     </td>
198                 </tr>
199         [% END %]
200         </tbody>
201       </table>
202     [% ELSE %]There are no pending orders.[% END %]
203   </div>
204 [% ELSE %]
205     <p>
206         Invoice is closed, so you can't receive orders anymore.
207         <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid %]">Reopen it</a>.
208     </p>
209 [% END %]
210
211 <div id="acqui_receive_receivelist">
212     <h3>Already received</h3>
213
214    [% IF ( loop_received ) %]
215    <form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
216     <table id="receivedt">
217       <thead>
218         <tr>
219           <th>Basket</th>
220           <th>Basket group</th>
221           <th>Order line</th>
222           <th title="Item holds / Total holds">Holds</th>
223           <th>Summary</th>
224           <th>View record</th>
225           <th>Quantity</th>
226           <th>Fund</th>
227           <th>Est cost</th>
228           <th>Actual cost</th>
229           <th>TOTAL</th>
230           <th></th>
231         </tr>
232       </thead>
233     <tfoot>
234         [% FOREACH key IN subtotal_for_funds.keys.sort %]
235             <tr>
236                 [% IF invoiceincgst %]
237                     <td colspan="6" class="total">(Tax inc.)</td>
238                 [% ELSE %]
239                     <td colspan="6" class="total">(Tax exc.)</td>
240                 [% END %]
241                 <td colspan="2"><i>Subtotal for</i> [% key %]</td>
242                 <td>[% subtotal_for_funds.$key.ecost | $Price %]</td>
243                 <td>[% subtotal_for_funds.$key.unitprice | $Price  %]</td>
244                 <td>&nbsp;</td>
245                 <td>&nbsp;</td>
246             </tr>
247         [% END %]
248         <tr>
249             <th colspan="10" class="total">Total tax exc.</th>
250             <th>[% total_tax_excluded | $Price %]</th>
251             <th></th>
252         </tr>
253         [% FOREACH book_foot IN book_foot_loop %]
254             <tr>
255                 <th colspan="10">Total (GST [% book_foot.tax_rate * 100 %]%)</th>
256                 <th>[% book_foot.tax_value | $Price %]</th>
257                 <th></th>
258             </tr>
259         [% END %]
260         <tr>
261             <th colspan="10" class="total">Total tax inc.</th>
262             <th>[% total_tax_included | $Price %]</th>
263             <th></th>
264         </tr>
265     </tfoot>
266     <tbody class="filterclass">
267         [% FOREACH order IN loop_received %]
268             <tr>
269                 <td>[% order.basketname %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno %]">[% order.basketno %]</a>)</td>
270                 <td>
271                   [% IF order.basketgroupid %]
272                     [% order.basketgroupname %] (<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% order.booksellerid %]">[% order.basketgroupid %]</a>)
273                   [% ELSE %]
274                     No basket group
275                   [% END %]
276                 </td>
277                 <td>
278                   <a href="neworderempty.pl?ordernumber=[% order.ordernumber %]&amp;booksellerid=[% booksellerid %]">[% order.ordernumber %]</a>
279                   [% IF (order.parent_ordernumber && (order.parent_ordernumber != order.ordernumber)) %]
280                     (<a href="neworderempty.pl?ordernumber=[% order.parent_ordernumber %]&amp;booksellerid=[% booksellerid %]" title="Original order line">[% order.parent_ordernumber %]</a>)
281                   [% END %]
282                 </td>
283                 <td>
284                   [% IF order.total_holds > 0 %]
285                     [% IF order.item_holds > 0 %]
286                       <span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% order.biblionumber %]">[% order.item_holds %]</a></span>
287                     [% ELSE %]
288                       0
289                     [% END %]
290                     /
291                     <span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% order.biblionumber %]">[% order.total_holds %]</a></span>
292                   [% ELSE %]
293                     0
294                   [% END %]
295                 </td>
296                 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a>
297                 [% IF ( order.author ) %] / [% order.author %][% END %]
298                 [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
299                 [% IF ( order.publishercode ) %]
300                     <br />Publisher: [% order.publishercode %]
301                     [%- IF    ( order.publicationyear > 0) -%], [% order.publicationyear %]
302                     [%- ELSIF ( order.copyrightdate   > 0) -%] [% order.copyrightdate %]
303                     [% END %]
304                 [% END %]
305                 [% IF ( order.suggestionid ) %]
306                     <br/>
307                     Suggested by: [% order.surnamesuggestedby %][% IF ( order.firstnamesuggestedby ) %], [% order.firstnamesuggestedby %] [% END %]
308                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% order.suggestionid %]&amp;op=show">suggestion #[% order.suggestionid %]</a>)
309                 [% END %]
310                 </td>
311                 <td><a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;id=[% order.biblionumber %]" class="previewData">Card</a></td>
312                 <td>[% order.quantityreceived %]</td>
313                 <td>[% order.budget.budget_name %]</td>
314                 <td>[% order.ecost | $Price %]</td>
315                 <td>[% order.unitprice | $Price %]</td>
316                 <td>[% order.total | $Price %]</td>
317                 <td>
318                     [% IF loop_receive.cannot_cancel or ( order.basket.effective_create_items == "receiving" and loop_receive.holds > 0 ) %]
319                       [% IF loop_receive.cannot_cancel %]
320                         [% span_title = BLOCK %]
321                             Cannot cancel receipt of this order line because it
322                             was created from a partial receipt of order line no.
323                             [% order.parent_ordernumber %], which is
324                             already received. Try cancelling this one first and
325                             retry.
326                         [% END %]
327                       [% ELSE %]
328                         [%# FIXME Here we block the cancellation if holds exist. Actually it could be possible if items will be exist after the deletion %]
329                         [%# Some additional checks should be added in the pl file %]
330                         [% span_title = BLOCK %]
331                           Cannot cancel receipt of this order line because at least one reservation exists on the records.
332                         [% END %]
333                       [% END %]
334                       <span title="[% span_title | collapse %]">
335                           Can't cancel receipt
336                       </span>
337                     [% ELSE %]
338                         <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&op=cancelreceipt&ordernumber=[% order.ordernumber %]">Cancel receipt</a>
339                     [% END %]
340                 </td>
341             </tr>
342             [% END %]
343         </tbody>
344     </table>
345     </form>
346
347         [% ELSE %]There are no received orders.[% END %]
348 </div>
349
350 <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
351     <div class="modal-dialog">
352     <div class="modal-content">
353     <div class="modal-header">
354         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
355         <h3 id="dataPreviewLabel">MARC preview</h3>
356     </div>
357     <div class="modal-body">
358         <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
359     </div>
360     <div class="modal-footer">
361         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
362     </div>
363     </div>
364     </div>
365 </div>
366
367 [% IF (invoiceclosedate) %]
368     <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">View invoice</a>
369 [% ELSE %]
370     <form action="/cgi-bin/koha/acqui/invoice.pl" method="get">
371         <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
372         <fieldset class="action">
373             <input type="submit" value="Finish receiving" />
374         </fieldset>
375     </form>
376 [% END %]
377
378 [% END %]
379
380 </div>
381 </div>
382
383
384 <div class="yui-b">
385 <form action="/cgi-bin/koha/acqui/parcel.pl" id="filterform" method="post">
386   <fieldset class="brief">
387     <h4>Filter</h4>
388     <ol>
389       <li>
390         <label for="summaryfilter">ISBN, author or title :</label>
391         <input type="text" name="summaryfilter" id="summaryfilter" value="[% summaryfilter %]"/>
392       </li>
393       <li>
394         <label for="basketfilter">Basket :</label>
395         <input type="text" name="basketfilter" id="basketfilter" value="[% basketfilter %]"/>
396       </li>
397       <li>
398           <label for="basketgroupnamefilter">Basket group name :</label>
399           <input type="text" name="basketgroupnamefilter" id="basketgroupnamefilter" value="[% basketgroupnamefilter %]" />
400       </li>
401       <li>
402         <label for="orderfilter">Order line :</label>
403         <input type="text" name="orderfilter" id="orderfilter" value="[% orderfilter %]"/>
404       </li>
405       [% IF (UNIMARC) %]
406         <li>
407           <label for="eanfilter">EAN :</label>
408           <input type="text" name="eanfilter" id="eanfilter" value="[% eanfilter %]"/>
409         </li>
410       [% END %]
411     </ol>
412     <fieldset class="action">
413       <input type="hidden" value="search" name="op" />
414       <input type="hidden" value="[% invoiceid %]" name="invoiceid" />
415       <input type="submit" value="Filter" />
416       <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Clear</a>
417     </fieldset>
418   </fieldset>
419 </form>
420 [% INCLUDE 'acquisitions-menu.inc' %]
421 </div>
422 </div>
423
424 [% MACRO jsinclude BLOCK %]
425     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
426     [% INCLUDE 'datatables.inc' %]
427     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter_[% KOHA_VERSION %].js"></script>
428     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min_[% KOHA_VERSION %].js"></script>
429     <style type="text/css">#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
430     <script type="text/javascript">
431
432         dt_overwrite_html_sorting_localeCompare();
433         var sticky_filters = [% sticky_filters %];
434
435         $(document).ready(function(){
436             if ( $("#pendingt").length ) {
437                 var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
438                     "bStateSave": true,
439                     "iCookieDuration": 60*60*24*1000, // 1000 days
440                     "iDisplayLength": 10,
441                     "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]],
442                     "aoColumnDefs": [
443                         { "aTargets": [ 4, 9, 10 ], "bSortable": false, "bSearchable": false },
444                     ],
445                     "aoColumns": [
446                         { "sType": "html" },
447                         { "sType": "html" },
448                         { "sType": "num-html" },
449                         { "sType": "anti-the" },
450                         null,
451                         null,
452                         null,
453                         null,
454                         null,
455                         null,
456                         null,
457                     ],
458                     'bAutoWidth': false,
459                     "sPaginationType": "four_button"
460                 })
461                 ).columnFilter({
462                     sPlaceHolder: "head:after",
463                     aoColumns: [
464                         { type: "text" },
465                         { type: "text" },
466                         { type: "text" },
467                         { type: "text" },
468                         null,
469                         { type: "text" },
470                         { type: "text" },
471                         { type: "text" },
472                         { type: "text" },
473                         null,
474                         null
475                     ]
476                 });
477             }
478
479             if ( $("#receivedt").length ) {
480                 var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
481                     "bStateSave": true,
482                     "iCookieDuration": 60*60*24*1000, // 1000 days
483                     "iDisplayLength": 10,
484                     "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]],
485                     "aoColumnDefs": [
486                         { "aTargets": [ 5, -1 ], "bSortable": false, "bSearchable": false },
487                     ],
488                     "aoColumns": [
489                         { "sType": "html" },
490                         { "sType": "html" },
491                         { "sType": "html" },
492                         { "sType": "num-html" },
493                         { "sType": "anti-the" },
494                         null,
495                         null,
496                         null,
497                         null,
498                         null,
499                         null,
500                         null
501                     ],
502                     "sPaginationType": "four_button"
503                 }));
504             }
505
506             // Keep filters from finishreceive.pl to parcel.pl
507             $.cookie("filter_parcel_summary", $("#summaryfilter").val());
508             $.cookie("filter_parcel_basketname", $("#basketfilter").val());
509             $.cookie("filter_parcel_orderno", $("#orderfilter").val());
510             $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val());
511             $.cookie("filter_parcel_ean", $("#eanfilter").val());
512
513             $("#filterform").on('submit', function(){
514                 $.cookie("filter_parcel_summary", $("#summaryfilter").val());
515                 $.cookie("filter_parcel_basketname", $("#basketfilter").val());
516                 $.cookie("filter_parcel_orderno", $("#orderfilter").val());
517                 $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val());
518                 $.cookie("filter_parcel_ean", $("#eanfilter").val());
519             });
520
521             $(".previewData").on("click", function(e){
522                 e.preventDefault();
523                 var ltitle = $(this).text();
524                 var page = $(this).attr("href");
525                 $("#dataPreviewLabel").text(ltitle);
526                 $("#dataPreview .modal-body").load(page + " div");
527                 $('#dataPreview').modal({show:true});
528             });
529             $("#dataPreview").on("hidden", function(){
530                 $("#dataPreviewLabel").html("");
531                 $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
532             });
533
534         });
535
536         // Case-insensitive version of jquery's contains function
537         jQuery.extend(jQuery.expr[':'], {
538             icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
539         });
540
541          // Contains exactly function
542         jQuery.extend(jQuery.expr[':'], {
543             containsExactly: "$(a).text() == m[3]"
544         });
545
546         function transfer_order_popup(ordernumber) {
547             var url = "/cgi-bin/koha/acqui/transferorder.pl?"
548                 + "ordernumber=" + ordernumber
549                 window.open(url, 'TransferOrder');
550         }
551     </script>
552 [% END %]
553
554 [% INCLUDE 'intranet-bottom.inc' %]