Bug 19755: Move template JavaScript to the footer: Acquisitions, part 3
[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>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.holds > 0 %]
285                     <span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% order.biblionumber %]">[% order.holds %]</a></span>
286                   [% ELSE %]
287                     0
288                   [% END %]
289                 </td>
290                 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber %]">[% order.title |html %]</a>
291                 [% IF ( order.author ) %] / [% order.author %][% END %]
292                 [% IF ( order.isbn ) %] - [% order.isbn %][% END %]
293                 [% IF ( order.publishercode ) %]
294                     <br />Publisher: [% order.publishercode %]
295                     [%- IF    ( order.publicationyear > 0) -%], [% order.publicationyear %]
296                     [%- ELSIF ( order.copyrightdate   > 0) -%] [% order.copyrightdate %]
297                     [% END %]
298                 [% END %]
299                 [% IF ( order.suggestionid ) %]
300                     <br/>
301                     Suggested by: [% order.surnamesuggestedby %][% IF ( order.firstnamesuggestedby ) %], [% order.firstnamesuggestedby %] [% END %]
302                     (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% order.suggestionid %]&amp;op=show">suggestion #[% order.suggestionid %]</a>)
303                 [% END %]
304                 </td>
305                 <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>
306                 <td>[% order.quantityreceived %]</td>
307                 <td>[% order.budget.budget_name %]</td>
308                 <td>[% order.ecost | $Price %]</td>
309                 <td>[% order.unitprice | $Price %]</td>
310                 <td>[% order.total | $Price %]</td>
311                 <td>
312                     [% IF loop_receive.cannot_cancel or ( order.basket.effective_create_items == "receiving" and loop_receive.holds > 0 ) %]
313                       [% IF loop_receive.cannot_cancel %]
314                         [% span_title = BLOCK %]
315                             Cannot cancel receipt of this order line because it
316                             was created from a partial receipt of order line no.
317                             [% order.parent_ordernumber %], which is
318                             already received. Try cancelling this one first and
319                             retry.
320                         [% END %]
321                       [% ELSE %]
322                         [%# FIXME Here we block the cancellation if holds exist. Actually it could be possible if items will be exist after the deletion %]
323                         [%# Some additional checks should be added in the pl file %]
324                         [% span_title = BLOCK %]
325                           Cannot cancel receipt of this order line because at least one reservation exists on the records.
326                         [% END %]
327                       [% END %]
328                       <span title="[% span_title | collapse %]">
329                           Can't cancel receipt
330                       </span>
331                     [% ELSE %]
332                         <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]&op=cancelreceipt&ordernumber=[% order.ordernumber %]">Cancel receipt</a>
333                     [% END %]
334                 </td>
335             </tr>
336             [% END %]
337         </tbody>
338     </table>
339     </form>
340
341         [% ELSE %]There are no received orders.[% END %]
342 </div>
343
344 <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
345     <div class="modal-dialog">
346     <div class="modal-content">
347     <div class="modal-header">
348         <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
349         <h3 id="dataPreviewLabel">MARC preview</h3>
350     </div>
351     <div class="modal-body">
352         <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
353     </div>
354     <div class="modal-footer">
355         <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
356     </div>
357     </div>
358     </div>
359 </div>
360
361 [% IF (invoiceclosedate) %]
362     <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid %]">View invoice</a>
363 [% ELSE %]
364     <form action="/cgi-bin/koha/acqui/invoice.pl" method="get">
365         <input type="hidden" name="invoiceid" value="[% invoiceid %]" />
366         <fieldset class="action">
367             <input type="submit" value="Finish receiving" />
368         </fieldset>
369     </form>
370 [% END %]
371
372 [% END %]
373
374 </div>
375 </div>
376
377
378 <div class="yui-b">
379 <form action="/cgi-bin/koha/acqui/parcel.pl" id="filterform" method="post">
380   <fieldset class="brief">
381     <h4>Filter</h4>
382     <ol>
383       <li>
384         <label for="summaryfilter">ISBN, author or title :</label>
385         <input type="text" name="summaryfilter" id="summaryfilter" value="[% summaryfilter %]"/>
386       </li>
387       <li>
388         <label for="basketfilter">Basket :</label>
389         <input type="text" name="basketfilter" id="basketfilter" value="[% basketfilter %]"/>
390       </li>
391       <li>
392           <label for="basketgroupnamefilter">Basket group name :</label>
393           <input type="text" name="basketgroupnamefilter" id="basketgroupnamefilter" value="[% basketgroupnamefilter %]" />
394       </li>
395       <li>
396         <label for="orderfilter">Order line :</label>
397         <input type="text" name="orderfilter" id="orderfilter" value="[% orderfilter %]"/>
398       </li>
399       [% IF (UNIMARC) %]
400         <li>
401           <label for="eanfilter">EAN :</label>
402           <input type="text" name="eanfilter" id="eanfilter" value="[% eanfilter %]"/>
403         </li>
404       [% END %]
405     </ol>
406     <fieldset class="action">
407       <input type="hidden" value="search" name="op" />
408       <input type="hidden" value="[% invoiceid %]" name="invoiceid" />
409       <input type="submit" value="Filter" />
410       <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid %]">Clear</a>
411     </fieldset>
412   </fieldset>
413 </form>
414 [% INCLUDE 'acquisitions-menu.inc' %]
415 </div>
416 </div>
417
418 [% MACRO jsinclude BLOCK %]
419     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
420     [% INCLUDE 'datatables.inc' %]
421     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.columnFilter_[% KOHA_VERSION %].js"></script>
422     <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.cookie.min_[% KOHA_VERSION %].js"></script>
423     <style type="text/css">#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
424     <script type="text/javascript">
425
426         dt_overwrite_html_sorting_localeCompare();
427         var sticky_filters = [% sticky_filters %];
428
429         $(document).ready(function(){
430             if ( $("#pendingt").length ) {
431                 var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
432                     "bStateSave": true,
433                     "iCookieDuration": 60*60*24*1000, // 1000 days
434                     "iDisplayLength": 10,
435                     "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]],
436                     "aoColumnDefs": [
437                         { "aTargets": [ 4, 9, 10 ], "bSortable": false, "bSearchable": false },
438                     ],
439                     "aoColumns": [
440                         { "sType": "html" },
441                         { "sType": "html" },
442                         { "sType": "num-html" },
443                         { "sType": "anti-the" },
444                         null,
445                         null,
446                         null,
447                         null,
448                         null,
449                         null,
450                         null,
451                     ],
452                     'bAutoWidth': false,
453                     "sPaginationType": "four_button"
454                 })
455                 ).columnFilter({
456                     sPlaceHolder: "head:after",
457                     aoColumns: [
458                         { type: "text" },
459                         { type: "text" },
460                         { type: "text" },
461                         { type: "text" },
462                         null,
463                         { type: "text" },
464                         { type: "text" },
465                         { type: "text" },
466                         { type: "text" },
467                         null,
468                         null
469                     ]
470                 });
471             }
472
473             if ( $("#receivedt").length ) {
474                 var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
475                     "bStateSave": true,
476                     "iCookieDuration": 60*60*24*1000, // 1000 days
477                     "iDisplayLength": 10,
478                     "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]],
479                     "aoColumnDefs": [
480                         { "aTargets": [ 5, -1 ], "bSortable": false, "bSearchable": false },
481                     ],
482                     "aoColumns": [
483                         { "sType": "html" },
484                         { "sType": "html" },
485                         { "sType": "html" },
486                         { "sType": "num-html" },
487                         { "sType": "anti-the" },
488                         null,
489                         null,
490                         null,
491                         null,
492                         null,
493                         null,
494                         null
495                     ],
496                     "sPaginationType": "four_button"
497                 }));
498             }
499
500             // Keep filters from finishreceive.pl to parcel.pl
501             $.cookie("filter_parcel_summary", $("#summaryfilter").val());
502             $.cookie("filter_parcel_basketname", $("#basketfilter").val());
503             $.cookie("filter_parcel_orderno", $("#orderfilter").val());
504             $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val());
505             $.cookie("filter_parcel_ean", $("#eanfilter").val());
506
507             $("#filterform").on('submit', function(){
508                 $.cookie("filter_parcel_summary", $("#summaryfilter").val());
509                 $.cookie("filter_parcel_basketname", $("#basketfilter").val());
510                 $.cookie("filter_parcel_orderno", $("#orderfilter").val());
511                 $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val());
512                 $.cookie("filter_parcel_ean", $("#eanfilter").val());
513             });
514
515             $(".previewData").on("click", function(e){
516                 e.preventDefault();
517                 var ltitle = $(this).text();
518                 var page = $(this).attr("href");
519                 $("#dataPreviewLabel").text(ltitle);
520                 $("#dataPreview .modal-body").load(page + " div");
521                 $('#dataPreview').modal({show:true});
522             });
523             $("#dataPreview").on("hidden", function(){
524                 $("#dataPreviewLabel").html("");
525                 $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
526             });
527
528         });
529
530         // Case-insensitive version of jquery's contains function
531         jQuery.extend(jQuery.expr[':'], {
532             icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
533         });
534
535          // Contains exactly function
536         jQuery.extend(jQuery.expr[':'], {
537             containsExactly: "$(a).text() == m[3]"
538         });
539
540         function transfer_order_popup(ordernumber) {
541             var url = "/cgi-bin/koha/acqui/transferorder.pl?"
542                 + "ordernumber=" + ordernumber
543                 window.open(url, 'TransferOrder');
544         }
545     </script>
546 [% END %]
547
548 [% INCLUDE 'intranet-bottom.inc' %]