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