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