6 [% USE currency = format('%.2f') -%]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Acquisitions › [% IF ( date ) %]
10 Receipt summary for [% name | html %] [% IF ( invoice ) %]invoice [% invoice | html %][% END %] on [% datereceived | $KohaDates %][% ELSE %]Receive orders from [% name | html %][% END %]</title>
11 [% Asset.css("css/datatables.css") | $raw %]
12 [% INCLUDE 'doc-head-close.inc' %]
15 <body id="acq_parcel" class="acq">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'acquisitions-search.inc' %]
19 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> ›
21 Receipt summary for <i>[% name | html %]</i>
23 <i>[ [% invoice | html %] ]</i>
25 on <i>[% datereceived | $KohaDates %]</i>
27 Receive orders from [% name | html %]
32 <div class="main container-fluid">
34 <div class="col-sm-10 col-sm-push-2">
37 [% IF ( receive_error ) %]
38 <div class="dialog alert">
39 <h3>Error adding items:</h3>
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>
49 Receipt summary for <i>[% name | html %]</i> [% IF ( invoice ) %] <i> [ [% invoice | html %] ] </i>[% END %] on <i>[% datereceived | $KohaDates %]</i>
51 Receive orders from [% name | html %]
55 [% IF ( success_delorder ) %]
56 <div class="dialog message">The order has been successfully canceled.</div>
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>
61 [% IF ( error_delbiblio ) %]
62 <div class="dialog alert">The order has been canceled, although the record has not been deleted.</div>
66 [% IF (error_cancelling_receipt) %]
67 <div class="dialog error">
68 Cannot cancel receipt. Possible reasons :
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
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
84 [% IF error_invoice_not_known %]
85 <div class="dialog error">
86 The invoice referenced by this invoiceid does not exist.
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>
94 [% UNLESS (invoiceclosedate) %]
95 <div id="acqui_receive_search">
96 <h3>Pending orders</h3>
98 [% IF ( loop_orders ) %]
102 <th>Basket search</th>
103 <th>Basket group search</th>
104 <th>Order line search</th>
105 <th>Summary search</th>
107 <th>Replacement price search</th>
108 <th>Quantity search</th>
109 <th>Unit cost search</th>
110 <th>Order cost search</th>
117 <th>Basket group</th>
121 <th>Replacement price</th>
130 <tbody class="filterclass">
131 [% FOREACH loop_order IN loop_orders %]
133 <td class="basketfilterclass">[% loop_order.basketname | html %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% loop_order.basketno | html %]">[% loop_order.basketno | html %]</a>)</td>
135 [% IF loop_order.basketgroupid %]
136 [% loop_order.basketgroupname | html %] (<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% loop_order.booksellerid | html %]">[% loop_order.basketgroupid | html %]</a>)
141 <td class="orderfilterclass"><a href="neworderempty.pl?ordernumber=[% loop_order.ordernumber | html %]&booksellerid=[% loop_order.booksellerid | html %]">[% loop_order.ordernumber | html %]</a></td>
142 <td class="summaryfilterclass">
143 <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_order.biblionumber | html %]">[% loop_order.title | html %]</a>
144 [% IF ( loop_order.author ) %] by [% loop_order.author | html %][% END %]
145 [% IF ( loop_order.isbn ) %] – [% 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 %]
152 [% IF ( loop_order.suggestionid ) %]
154 Suggested by: [% loop_order.surnamesuggestedby | html %][% IF ( loop_order.firstnamesuggestedby ) %], [% loop_order.firstnamesuggestedby | html %] [% END %]
155 (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% loop_order.suggestionid | html %]&op=show">suggestion #[% loop_order.suggestionid | html %]</a>)
158 [% IF ( loop_order.order_internalnote ) %]
159 <p class="ordernote"><strong>Internal note: </strong>[% loop_order.order_internalnote | html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber | html %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | html %]&type=internal">Change internal note</a>]</p>
161 [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber | html %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | html %]&type=internal">Add internal note</a>]
163 [% IF ( loop_order.order_vendornote ) %]
164 <p class="ordernote"><strong>Vendor note: </strong>[% loop_order.order_vendornote | html %]</p>
166 [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% loop_order.ordernumber | html %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | html %]&type=vendor">Add vendor note</a>]
170 <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% loop_order.ordernumber | html %]" class="previewData">Order</a><br>
171 <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% loop_order.biblionumber | html %]" class="previewData">MARC</a><br>
172 <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% loop_order.biblionumber | html %]" class="previewData">Card</a>
174 <td>[% loop_order.replacementprice | $Price | html %]</td>
175 <td>[% loop_order.quantity | html %]</td>
176 <td>[% loop_order.ecost | $Price | html %]</td>
177 <td>[% loop_order.total | $Price | html %]</td>
178 <td>[% loop_order.budget_name | html %]</td>
180 <a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber | html %]&invoiceid=[% invoiceid | html %]">Receive</a>
182 <a href="#" onclick="transfer_order_popup([% loop_order.ordernumber | html %]); return false;">Transfer</a>
185 [% IF ( loop_order.left_holds_on_order ) %]
186 <span class="button" title="Can't cancel order, ([% loop_order.holds_on_order | html %]) holds are linked with this order cancel holds first">Can't cancel order</span><br>
188 <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber | html %]&biblionumber=[% loop_order.biblionumber | html %]&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]">Cancel order</a><br />
190 [% IF ( loop_order.can_del_bib ) %]
191 <a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=[% loop_order.ordernumber | html %]&biblionumber=[% loop_order.biblionumber | html %]&del_biblio=1&referrer=[% "/cgi-bin/koha/acqui/parcel.pl?invoiceid=$invoiceid" | uri %]">Cancel order and catalog record</a><br />
193 <span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br>
195 [% IF ( loop_order.left_item ) %]
196 <b title="Can't delete catalog record, because of [% loop_order.items | html %] existing item(s)" >[% loop_order.items | html %] item(s) left</b><br>
198 [% IF ( loop_order.left_biblio ) %]
199 <b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios | html %] order(s) left</b><br>
201 [% IF ( loop_order.left_subscription ) %]
202 <b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions | html %] subscription(s) left</b><br>
204 [% IF ( loop_order.left_holds ) %]
205 <b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds | html %] hold(s) left</b>
212 [% ELSE %]There are no pending orders.[% END %]
216 Invoice is closed, so you can't receive orders anymore.
217 <a href="/cgi-bin/koha/acqui/invoice.pl?op=reopen&invoiceid=[% invoiceid | html %]&referer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | html %]">Reopen it</a>.
221 <div id="acqui_receive_receivelist">
222 <h3>Already received</h3>
224 [% IF ( loop_received ) %]
225 <form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
226 <table id="receivedt">
230 <th>Basket group</th>
232 <th title="Item holds / Total holds">Holds</th>
235 <th>Replacement price</th>
245 [% FOREACH key IN subtotal_for_funds.keys.sort %]
247 [% IF invoiceincgst %]
248 <td colspan="6" class="total">(Tax inc.)</td>
250 <td colspan="6" class="total">(Tax exc.)</td>
252 <td colspan="2"><i>Subtotal for</i> [% key | html %]</td>
253 <td>[% subtotal_for_funds.$key.ecost | $Price | html %]</td>
254 <td>[% subtotal_for_funds.$key.unitprice | $Price | html %]</td>
260 <th colspan="10" class="total">Total tax exc.</th>
261 <th>[% total_tax_excluded | $Price | html %]</th>
264 [% FOREACH book_foot IN book_foot_loop %]
266 <th colspan="10">Total (GST [% book_foot.tax_rate * 100 | html %]%)</th>
267 <th>[% book_foot.tax_value | $Price | html %]</th>
272 <th colspan="10" class="total">Total tax inc.</th>
273 <th>[% total_tax_included | $Price | html %]</th>
277 <tbody class="filterclass">
278 [% FOREACH order IN loop_received %]
280 <td>[% order.basketname | html %] (<a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno | html %]">[% order.basketno | html %]</a>)</td>
282 [% IF order.basketgroupid %]
283 [% order.basketgroupname | html %] (<a href="/cgi-bin/koha/acqui/basketgroup.pl?booksellerid=[% order.booksellerid | html %]">[% order.basketgroupid | html %]</a>)
289 <a href="neworderempty.pl?ordernumber=[% order.ordernumber | html %]&booksellerid=[% booksellerid | html %]">[% order.ordernumber | html %]</a>
290 [% IF (order.parent_ordernumber && (order.parent_ordernumber != order.ordernumber)) %]
291 (<a href="neworderempty.pl?ordernumber=[% order.parent_ordernumber | html %]&booksellerid=[% booksellerid | html %]" title="Original order line">[% order.parent_ordernumber | html %]</a>)
295 [% IF order.total_holds > 0 %]
296 [% IF order.item_holds > 0 %]
297 <span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% order.biblionumber | html %]">[% order.item_holds | html %]</a></span>
302 <span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% order.biblionumber | html %]">[% order.total_holds | html %]</a></span>
307 <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | html %]">[% order.title | html %]</a>
308 [% IF ( order.author ) %] / [% order.author | html %][% END %]
309 [% IF ( order.isbn ) %] - [% order.isbn | html %][% END %]
310 [% IF ( order.publishercode ) %]
311 <br />Publisher: [% order.publishercode | html %]
312 [%- IF ( order.publicationyear > 0) -%], [% order.publicationyear | html %]
313 [%- ELSIF ( order.copyrightdate > 0) -%] [% order.copyrightdate | html %]
316 [% IF ( order.suggestionid ) %]
318 Suggested by: [% order.surnamesuggestedby | html %][% IF ( order.firstnamesuggestedby ) %], [% order.firstnamesuggestedby | html %] [% END %]
319 (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% order.suggestionid | html %]&op=show">suggestion #[% order.suggestionid | html %]</a>)
323 <a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% order.ordernumber | html %]" class="previewData">Order</a><br>
324 <a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber | html %]" class="previewData">MARC</a><br>
325 <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% order.biblionumber | html %]" class="previewData">Card</a>
327 <td>[% order.replacementprice | $Price | html %]</td>
328 <td>[% order.quantityreceived | html %]</td>
329 <td>[% order.budget.budget_name | html %]</td>
330 <td>[% order.ecost | $Price | html %]</td>
331 <td>[% order.unitprice | $Price | html %]</td>
332 <td>[% order.total | $Price | html %]</td>
334 [% IF loop_receive.cannot_cancel or ( order.basket.effective_create_items == "receiving" and loop_receive.holds > 0 ) %]
335 [% IF loop_receive.cannot_cancel %]
336 [% span_title = BLOCK %]
337 Cannot cancel receipt of this order line because it
338 was created from a partial receipt of order line no.
339 [% order.parent_ordernumber | html %], which is
340 already received. Try cancelling this one first and
344 [%# FIXME Here we block the cancellation if holds exist. Actually it could be possible if items will be exist after the deletion %]
345 [%# Some additional checks should be added in the pl file %]
346 [% span_title = BLOCK %]
347 Cannot cancel receipt of this order line because at least one reservation exists on the records.
350 <span title="[% span_title | collapse | html %]">
354 <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&op=cancelreceipt&ordernumber=[% order.ordernumber | html %]">Cancel receipt</a>
363 [% ELSE %]There are no received orders.[% END %]
366 <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
367 <div class="modal-dialog">
368 <div class="modal-content">
369 <div class="modal-header">
370 <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
371 <h3 id="dataPreviewLabel">MARC preview</h3>
373 <div class="modal-body">
374 <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
376 <div class="modal-footer">
377 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
383 [% IF (invoiceclosedate) %]
384 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid | html %]">View invoice</a>
386 <form action="/cgi-bin/koha/acqui/invoice.pl" method="get">
387 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
388 <fieldset class="action">
389 <input type="submit" value="Finish receiving" />
397 </div> <!-- /.col-sm-10.col-sm-push-2 -->
399 <div class="col-sm-2 col-sm-pull-10">
402 <form action="/cgi-bin/koha/acqui/parcel.pl" id="filterform" method="post">
403 <fieldset class="brief">
407 <label for="summaryfilter">ISBN, author or title :</label>
408 <input type="text" name="summaryfilter" id="summaryfilter" value="[% summaryfilter | html %]"/>
411 <label for="basketfilter">Basket :</label>
412 <input type="text" name="basketfilter" id="basketfilter" value="[% basketfilter | html %]"/>
415 <label for="basketgroupnamefilter">Basket group name :</label>
416 <input type="text" name="basketgroupnamefilter" id="basketgroupnamefilter" value="[% basketgroupnamefilter | html %]" />
419 <label for="orderfilter">Order line :</label>
420 <input type="text" name="orderfilter" id="orderfilter" value="[% orderfilter | html %]"/>
424 <label for="eanfilter">EAN :</label>
425 <input type="text" name="eanfilter" id="eanfilter" value="[% eanfilter | html %]"/>
429 <fieldset class="action">
430 <input type="hidden" value="search" name="op" />
431 <input type="hidden" value="[% invoiceid | html %]" name="invoiceid" />
432 <input type="submit" value="Filter" />
433 <a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Clear</a>
437 [% INCLUDE 'acquisitions-menu.inc' %]
439 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
440 </div> <!-- /.row -->
442 [% MACRO jsinclude BLOCK %]
443 [% Asset.js("js/acquisitions-menu.js") | $raw %]
444 [% INCLUDE 'datatables.inc' %]
445 [% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
446 [% Asset.js("lib/jquery/plugins/jquery.cookie.min.js") | $raw %]
447 <style>#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
449 dt_overwrite_html_sorting_localeCompare();
450 var sticky_filters = [% sticky_filters | html %];
452 $(document).ready(function(){
453 if ( $("#pendingt").length ) {
454 var pendingt = $("#pendingt").dataTable($.extend(true, {}, dataTablesDefaults, {
456 "iCookieDuration": 60*60*24*1000, // 1000 days
457 "iDisplayLength": 10,
458 "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]],
460 { "aTargets": [ 4, 9, 10 ], "bSortable": false, "bSearchable": false },
465 { "sType": "num-html" },
466 { "sType": "anti-the" },
477 "sPaginationType": "four_button"
480 sPlaceHolder: "head:after",
498 if ( $("#receivedt").length ) {
499 var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
501 "iCookieDuration": 60*60*24*1000, // 1000 days
502 "iDisplayLength": 10,
503 "aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]],
505 { "aTargets": [ 5, -1 ], "bSortable": false, "bSearchable": false },
511 { "sType": "num-html" },
512 { "sType": "anti-the" },
521 "sPaginationType": "four_button"
525 // Keep filters from finishreceive.pl to parcel.pl
526 $.cookie("filter_parcel_summary", $("#summaryfilter").val());
527 $.cookie("filter_parcel_basketname", $("#basketfilter").val());
528 $.cookie("filter_parcel_orderno", $("#orderfilter").val());
529 $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val());
530 $.cookie("filter_parcel_ean", $("#eanfilter").val());
532 $("#filterform").on('submit', function(){
533 $.cookie("filter_parcel_summary", $("#summaryfilter").val());
534 $.cookie("filter_parcel_basketname", $("#basketfilter").val());
535 $.cookie("filter_parcel_orderno", $("#orderfilter").val());
536 $.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val());
537 $.cookie("filter_parcel_ean", $("#eanfilter").val());
540 $(".previewData").on("click", function(e){
542 var ltitle = $(this).text();
543 var page = $(this).attr("href");
544 $("#dataPreviewLabel").text(ltitle);
545 $("#dataPreview .modal-body").load(page + " div");
546 $('#dataPreview').modal({show:true});
548 $("#dataPreview").on("hidden", function(){
549 $("#dataPreviewLabel").html("");
550 $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
555 // Case-insensitive version of jquery's contains function
556 jQuery.extend(jQuery.expr[':'], {
557 icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
560 // Contains exactly function
561 jQuery.extend(jQuery.expr[':'], {
562 containsExactly: "$(a).text() == m[3]"
565 function transfer_order_popup(ordernumber) {
566 var url = "/cgi-bin/koha/acqui/transferorder.pl?"
567 + "ordernumber=" + ordernumber
568 window.open(url, 'TransferOrder');
573 [% INCLUDE 'intranet-bottom.inc' %]