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