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