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