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