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