Lines 34-49
Link Here
|
34 |
<div class="col-sm-10 col-sm-push-2"> |
34 |
<div class="col-sm-10 col-sm-push-2"> |
35 |
<main> |
35 |
<main> |
36 |
|
36 |
|
37 |
[% IF ( receive_error ) %] |
37 |
[% IF ( receive_error ) %] |
38 |
<div class="dialog alert"> |
38 |
<div class="dialog alert"> |
39 |
<h3>Error adding items:</h3> |
39 |
<h3>Error adding items:</h3> |
40 |
<ul> |
40 |
<ul> |
41 |
[% FOREACH error_loo IN error_loop %] |
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> |
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 %] |
43 |
[% END %] |
44 |
</ul> |
44 |
</ul> |
45 |
</div> |
45 |
</div> |
46 |
[% END %] |
46 |
[% END %] |
47 |
<h1> |
47 |
<h1> |
48 |
[% IF datereceived %] |
48 |
[% IF datereceived %] |
49 |
Receipt summary for <i>[% name | html %]</i> [% IF ( invoice ) %] <i> [ [% invoice | html %] ] </i>[% END %] on <i>[% datereceived | $KohaDates %]</i> |
49 |
Receipt summary for <i>[% name | html %]</i> [% IF ( invoice ) %] <i> [ [% invoice | html %] ] </i>[% END %] on <i>[% datereceived | $KohaDates %]</i> |
Lines 55-66
Link Here
|
55 |
[% IF ( success_delorder ) %] |
55 |
[% IF ( success_delorder ) %] |
56 |
<div class="dialog message">The order has been successfully canceled.</div> |
56 |
<div class="dialog message">The order has been successfully canceled.</div> |
57 |
[% ELSE %] |
57 |
[% ELSE %] |
58 |
[% IF ( error_delitem ) %] |
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> |
59 |
<div class="dialog alert">The order has been canceled, although one or more items could not have been deleted.</div> |
60 |
[% END %] |
60 |
[% END %] |
61 |
[% IF ( error_delbiblio ) %] |
61 |
[% IF ( error_delbiblio ) %] |
62 |
<div class="dialog alert">The order has been canceled, although the record has not been deleted.</div> |
62 |
<div class="dialog alert">The order has been canceled, although the record has not been deleted.</div> |
63 |
[% END %] |
63 |
[% END %] |
64 |
[% END %] |
64 |
[% END %] |
65 |
|
65 |
|
66 |
[% IF (error_cancelling_receipt) %] |
66 |
[% IF (error_cancelling_receipt) %] |
Lines 87-92
Link Here
|
87 |
</div> |
87 |
</div> |
88 |
[% END %] |
88 |
[% END %] |
89 |
|
89 |
|
|
|
90 |
<h3>Pending orders (api)</h3> |
91 |
<table id="pending_orders" class="table table-bordered table-striped"> |
92 |
<thead> |
93 |
<tr> |
94 |
<th>Basket</th> |
95 |
<th>Basket group</th> |
96 |
<th>Order line</th> |
97 |
<th class="hidden">Title</th> |
98 |
<th class="hidden">Author</th> |
99 |
<th class="hidden">ISBN</th> |
100 |
<th>Summary</th> |
101 |
<th>More</th> |
102 |
<th>Replacement price</th> |
103 |
<th>Quantity</th> |
104 |
<th>Unit cost</th> |
105 |
<th>Order cost</th> |
106 |
<th>Fund</th> |
107 |
<th> </th> |
108 |
<th> </th> |
109 |
</tr> |
110 |
</thead> |
111 |
</table> |
112 |
|
90 |
[% UNLESS no_orders_to_display %] |
113 |
[% UNLESS no_orders_to_display %] |
91 |
<div id="acqui_receive_summary"> |
114 |
<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> |
115 |
<p><strong>Invoice number:</strong> [% invoice | html %] <strong>Received by:</strong> [% logged_in_user.userid | html %] <strong>On:</strong> [% datereceived | $KohaDates %]</p> |
Lines 175-206
Link Here
|
175 |
<td>[% loop_order.ecost | $Price %]</td> |
198 |
<td>[% loop_order.ecost | $Price %]</td> |
176 |
<td>[% loop_order.total | $Price %]</td> |
199 |
<td>[% loop_order.total | $Price %]</td> |
177 |
<td>[% loop_order.budget_name | html %]</td> |
200 |
<td>[% loop_order.budget_name | html %]</td> |
178 |
<td> |
201 |
<td> |
179 |
<a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber | uri %]&invoiceid=[% invoiceid | uri %]">Receive</a> |
202 |
<a href="orderreceive.pl?ordernumber=[% loop_order.ordernumber | uri %]&invoiceid=[% invoiceid | uri %]">Receive</a> |
180 |
<br /> |
203 |
<br /> |
181 |
<a href="#" onclick="transfer_order_popup([% loop_order.ordernumber | html %]); return false;">Transfer</a> |
204 |
<a href="#" onclick="transfer_order_popup([% loop_order.ordernumber | html %]); return false;">Transfer</a> |
182 |
</td> |
205 |
</td> |
183 |
<td> |
206 |
<td> |
184 |
[% IF ( loop_order.left_holds_on_order ) %] |
207 |
[% IF ( loop_order.left_holds_on_order ) %] [%# DONE %] |
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> |
208 |
<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 %] |
209 |
[% ELSE %] [%# DONE %] |
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 /> |
210 |
<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 %] |
211 |
[% END %] [%# DONE %] |
189 |
[% IF ( loop_order.can_del_bib ) %] |
212 |
[% IF ( loop_order.can_del_bib ) %] [%# DONE %] |
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 /> |
213 |
<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 %] |
214 |
[% ELSE %] [%# DONE %] |
192 |
<span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br> |
215 |
<span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br> |
193 |
[% END %] |
216 |
[% END %] |
194 |
[% IF ( loop_order.left_item ) %] |
217 |
[% IF ( loop_order.left_item ) %] [%# DONE %] |
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> |
218 |
<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 %] |
219 |
[% END %] |
197 |
[% IF ( loop_order.left_biblio ) %] |
220 |
[% IF ( loop_order.left_biblio ) %] [%# DONE %] |
198 |
<b title="Can't delete catalog record, delete other orders linked to it first">[% loop_order.biblios | html %] order(s) left</b><br> |
221 |
<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 %] |
222 |
[% END %] |
200 |
[% IF ( loop_order.left_subscription ) %] |
223 |
[% IF ( loop_order.left_subscription ) %] [%# DONE %] |
201 |
<b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions | html %] subscription(s) left</b><br> |
224 |
<b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions | html %] subscription(s) left</b><br> |
202 |
[% END %] |
225 |
[% END %] |
203 |
[% IF ( loop_order.left_holds ) %] |
226 |
[% IF ( loop_order.left_holds ) %] [%# DONE %] |
204 |
<b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds | html %] hold(s) left</b> |
227 |
<b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds | html %] hold(s) left</b> |
205 |
[% END %] |
228 |
[% END %] |
206 |
</td> |
229 |
</td> |
Lines 365-376
Link Here
|
365 |
[% END %] |
388 |
[% END %] |
366 |
</td> |
389 |
</td> |
367 |
</tr> |
390 |
</tr> |
368 |
[% END %] |
391 |
[% END %] |
369 |
</tbody> |
392 |
</tbody> |
370 |
</table> |
393 |
</table> |
371 |
</form> |
394 |
</form> |
372 |
|
395 |
|
373 |
[% ELSE %]There are no received orders.[% END %] |
396 |
[% ELSE %]There are no received orders.[% END %] |
374 |
</div> |
397 |
</div> |
375 |
|
398 |
|
376 |
<div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true"> |
399 |
<div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true"> |
Lines 431-437
Link Here
|
431 |
</li> |
454 |
</li> |
432 |
[% IF (UNIMARC) %] |
455 |
[% IF (UNIMARC) %] |
433 |
<li> |
456 |
<li> |
434 |
<label for="eanfilter">EAN :</label> |
457 |
<label for="eanfilter">EAN:</label> |
435 |
<input type="text" name="eanfilter" id="eanfilter" value="[% eanfilter | html %]"/> |
458 |
<input type="text" name="eanfilter" id="eanfilter" value="[% eanfilter | html %]"/> |
436 |
</li> |
459 |
</li> |
437 |
[% END %] |
460 |
[% END %] |
Lines 440-446
Link Here
|
440 |
<input type="hidden" value="search" name="op" /> |
463 |
<input type="hidden" value="search" name="op" /> |
441 |
<input type="hidden" value="[% invoiceid | html %]" name="invoiceid" /> |
464 |
<input type="hidden" value="[% invoiceid | html %]" name="invoiceid" /> |
442 |
<input type="submit" value="Filter" /> |
465 |
<input type="submit" value="Filter" /> |
443 |
<a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">Clear</a> |
466 |
<a href="#" id="clear_form_filters">Clear</a> |
444 |
</fieldset> |
467 |
</fieldset> |
445 |
</fieldset> |
468 |
</fieldset> |
446 |
</form> |
469 |
</form> |
Lines 533-552
Link Here
|
533 |
})); |
556 |
})); |
534 |
} |
557 |
} |
535 |
|
558 |
|
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 |
|
559 |
|
543 |
$("#filterform").on('submit', function(){ |
560 |
var pending_orders_url = "/api/v1/acquisitions/orders?status=ordered"; |
|
|
561 |
var pending_orders_table = $("#pending_orders").api({ |
562 |
"ajax": { |
563 |
"url": pending_orders_url |
564 |
}, |
565 |
"embed": [ |
566 |
"basket.basket_group", |
567 |
"biblio.active_orders+count", |
568 |
"biblio.holds+count", |
569 |
"biblio.items+count", |
570 |
"biblio.suggestions.suggester", |
571 |
"fund", |
572 |
"current_item_level_holds+count", |
573 |
"items" |
574 |
], |
575 |
'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
576 |
"columns": [ |
577 |
{ "data": "basket.name", |
578 |
"orderable": true, |
579 |
"render": function(data, type, row, meta) { |
580 |
if (type != 'display') return data; |
581 |
return "<a href=\"/cgi-bin/koha/acqui/basket.pl?basketno=" + row.basket.basket_id + "\">" + data + " (" + row.basket.basket_id + ")</a>"; |
582 |
} |
583 |
}, |
584 |
{ "data": "basket.basket_group.name", |
585 |
"orderable": true, |
586 |
"render": function(data, type, row, meta) { |
587 |
if ( type != 'display' ) return data; |
588 |
if ( row.basket.basket_group_id == null ) { |
589 |
return _("No basket group"); |
590 |
} |
591 |
else { |
592 |
return "<a href=\"/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=" |
593 |
+ row.basket.vendor_id + "&basketgroupid=" |
594 |
+ row.basket.basket_group_id + "\">" |
595 |
+ row.basket.basket_group.name + " (" + row.basket.basket_group_id + ")</a>"; |
596 |
} |
597 |
} |
598 |
}, |
599 |
{ "data": "order_id", |
600 |
"render": function(data, type, row, meta) { |
601 |
if (type != 'display') return data; |
602 |
return "<a href=\"neworderempty.pl?ordernumber="+data+"&booksellerid="+row.basket.vendor_id+"\">"+data+"</a>"; |
603 |
} |
604 |
}, |
605 |
{ |
606 |
"data": "biblio.author", |
607 |
"visible": false, |
608 |
"searchable": true, |
609 |
"orderable": false |
610 |
}, |
611 |
{ |
612 |
"data": "biblio.title", |
613 |
"visible": false, |
614 |
"searchable": true, |
615 |
"orderable": false |
616 |
}, |
617 |
{ |
618 |
"data": "biblio.isbn", |
619 |
"visible": false, |
620 |
"searchable": true, |
621 |
"orderable": false |
622 |
}, |
623 |
{ "data": function(row, type, val, meta) { |
624 |
var result = "<p><a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber="+row.biblio_id+"\">"+row.biblio.title+"</a>"; |
625 |
if ( row.biblio.author != null ) |
626 |
result += _(" by ") + row.biblio.author; |
627 |
if ( row.biblio.isbn != null ) |
628 |
result += " – " + row.biblio.isbn; |
629 |
if ( row.biblio.publisher != null ) { |
630 |
result += "<br/>" + _("Publisher: ") + row.biblio.publisher; |
631 |
if ( row.biblio.publication_year != null ) { |
632 |
result += ", " + row.biblio.publication_year; |
633 |
} |
634 |
else if ( row.biblio.copyright_date != null ) { |
635 |
result += row.biblio.copyright_date; |
636 |
} |
637 |
} |
638 |
var suggestions = row.biblio.suggestions; |
639 |
if ( suggestions != null && suggestions.length > 0 ) { |
640 |
var suggestion = suggestions[0]; |
641 |
if ( suggestion.suggester != null ) { |
642 |
var suggester = suggestion.suggester; |
643 |
var suggested_by = []; |
644 |
if ( suggester.surname != null ) { |
645 |
suggested_by.push(suggester.surname); |
646 |
} |
647 |
if ( suggester.firstname != null ) { |
648 |
suggested_by.push(suggester.firstname); |
649 |
} |
650 |
|
651 |
result += "<br/>" + _("Suggested by: ") + |
652 |
'<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=' |
653 |
+ suggestion.suggestionid |
654 |
+ '&op=show">' |
655 |
+ suggested_by.join(", ") |
656 |
+ " (#" + suggestions[0].suggestionid + ")</a>"; |
657 |
} |
658 |
} |
659 |
result += '</p>'; |
660 |
|
661 |
var internal_note = row.internal_note; |
662 |
if ( internal_note != '' ) { |
663 |
result += '<p class="ordernote"><strong>' |
664 |
+ _("Internal note: ") |
665 |
+ '</strong>' + internal_note |
666 |
+ ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
667 |
+ row.order_id + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
668 |
+ '&type=internal">' + _("Change internal note") + '</a>]</p>'; |
669 |
} |
670 |
else { |
671 |
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
672 |
+ row.order_id + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
673 |
+ '&type=internal">' + _("Add internal note") + '</a>]'; |
674 |
} |
675 |
|
676 |
var vendor_note = row.vendor_note; |
677 |
if ( vendor_note != '' ) { |
678 |
result += '<p class="ordernote"><strong>' |
679 |
+ _("Vendor note: ") |
680 |
+ '</strong>' + vendor_note + '</p>'; |
681 |
} |
682 |
else { |
683 |
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
684 |
+ row.order_id + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
685 |
+ '&type=vendor">' + _("Add vendor note") + '</a>]'; |
686 |
} |
687 |
|
688 |
return result; |
689 |
}, |
690 |
"orderable": false // FIXME |
691 |
}, |
692 |
{ "data": function( row, type, val, meta) { |
693 |
var result = '<a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=' + row.order_id + '" class="previewData">' + _("Order") + '</a><br>' |
694 |
+ '<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=' + row.biblio_id + '" class="previewData">' + _("MARC") + '</a><br>' |
695 |
+ '<a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=' + row.biblio_id + '" class="previewData">' + _("Card") + '</a>'; |
696 |
return result; |
697 |
}, |
698 |
"orderable": false |
699 |
}, |
700 |
{ "data": "replacement_price", |
701 |
"render": function(data, type, val, meta) { |
702 |
if (type != 'display') return data; |
703 |
return data.format_price(); |
704 |
} |
705 |
}, |
706 |
{ "data": "quantity", |
707 |
"orderable": true |
708 |
}, |
709 |
{ "data": "ecost", |
710 |
"render": function(data, type, val, meta) { |
711 |
if (type != 'display') return data; |
712 |
return data.format_price(); |
713 |
}, |
714 |
"orderable": true |
715 |
}, |
716 |
{ "data": function ( row, type, val, meta ) { |
717 |
return (row.quantity * row.ecost).format_price(); |
718 |
}, |
719 |
"orderable": false // FIXME: How can we do it in DBIC? |
720 |
}, |
721 |
{ "data": "fund_id", |
722 |
"render": function(data, type, row, meta) { |
723 |
if (type != 'display') return data; |
724 |
return row.fund.name; |
725 |
} |
726 |
}, |
727 |
{ "data": function( row, type, val, meta ) { |
728 |
return '<a href="orderreceive.pl?ordernumber=' |
729 |
+ row.order_id + '&invoiceid=[% invoiceid | uri %]' + '">' |
730 |
+ _("Receive") + '</a><br/>' |
731 |
+ '<a href="#" onclick="transfer_order_popup(' + row.order_id + '); return false;">' |
732 |
+ _("Transfer") + '</a>'; |
733 |
}, |
734 |
"orderable": false |
735 |
}, |
736 |
{ "data": function( row, type, val, meta ) { |
737 |
var result = ""; |
738 |
|
739 |
if ( row.current_holds_count > 0 ) { |
740 |
result += '<span class="button" title="' |
741 |
+ _("Can't cancel order, (%s) holds are linked with this order. Cancel holds first").format( row.holds_count ) + '">' |
742 |
+ _("Can't cancel order") + '</span><br/>'; |
743 |
} |
744 |
else { |
745 |
result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=' |
746 |
+ row.order_id |
747 |
+ '&biblionumber=' + row.biblio_id |
748 |
+ '&referrer=/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">' |
749 |
+ _("Cancel order") + '</a><br/>'; |
750 |
} |
751 |
|
752 |
if ( row.items.length > 0 || |
753 |
row.biblio.active_orders_count > 1 || |
754 |
row.biblio.subscriptions_count > 0 || |
755 |
row.bibio.holds_count > 0 ) { // biblio can be deleted |
756 |
result += '<span class="button" title="' |
757 |
+ _("Can't delete catalog record, see constraints below") + '">' |
758 |
+ _("Can't cancel order and delete catalog record") + '</span><br>'; |
759 |
} |
760 |
else { |
761 |
result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=' |
762 |
+ row.order_id + '&biblionumber=' + row.biblio_id |
763 |
+ '&del_biblio=1&referrer="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[$ invoiceid | uri ]">' |
764 |
+ _("Cancel order and catalog record") + '</a><br/>'; |
765 |
} |
766 |
|
767 |
if ( row.biblio.items_count - row.items.length > 0 ) { |
768 |
result += '<b title="' |
769 |
+ _("Can't delete catalog record, because of %s existing item(s)").format(row.items.length) |
770 |
+'">' + (row.biblio.items_count - row.items.length) + _(" item(s) left") + '</b><br/>'; |
771 |
} |
772 |
|
773 |
if ( row.biblio.active_orders_count > 1 ) { |
774 |
result += '<b title="' |
775 |
+ _("Can't delete catalog record, delete other orders linked to it first") + '">' |
776 |
+ (row.biblio.active_orders_count - 1) + _(" order(s) left") + '</b><br/>'; |
777 |
} |
778 |
|
779 |
if ( row.biblio.subscriptions_count > 0 ) { |
780 |
result += '<b title="' + _("Can't delete catalog record, delete subscriptions first") + '">' |
781 |
+ _("%s subscription(s) left").format(row.biblio.subscriptions_count) |
782 |
+ '</b><br>'; |
783 |
} |
784 |
|
785 |
if ( row.biblio.holds_count > 0 ) { |
786 |
result += '<b title="' + _("Can't delete catalog record or order, cancel holds first") + '">' |
787 |
+ _("%s hold(s) left").format(row.bibio.holds_count) + '</b>'; |
788 |
} |
789 |
|
790 |
return result; |
791 |
}, |
792 |
"orderable": false |
793 |
} |
794 |
] |
795 |
}); |
796 |
|
797 |
$("#filterform").on("submit", function(e) { |
798 |
e.preventDefault(); |
799 |
// Update the datatable URL |
800 |
var summary = $("#summaryfilter").val(); |
801 |
var basket_name = $("#basketfilter").val(); |
802 |
var basket_group = $("#basketgroupnamefilter").val(); |
803 |
var order_id = $("#orderfilter").val(); |
804 |
var ean = $("#eanfilter").val(); |
805 |
|
806 |
var q = {}; |
807 |
|
808 |
if (order_id != "") { |
809 |
q['order_id'] = order_id; |
810 |
} |
811 |
if (basket_name != "") { |
812 |
q['basket.name'] = { "like": '%'+basket_name+'%' }; |
813 |
} |
814 |
if (basket_group != "") { |
815 |
q['basket.basket_group.name'] = { "like": '%'+basket_group+'%' }; |
816 |
} |
817 |
if (summary != "") { |
818 |
q["-or"] = [{"biblio.title": { "like": '%'+summary+'%' } }, |
819 |
{"biblio.author": { "like": '%'+summary+'%' } }, |
820 |
{"biblio.isbn": { "like": '%'+summary+'%' } } ]; |
821 |
} |
822 |
[% IF (UNIMARC) %] |
823 |
if (ean != "") { |
824 |
q['biblio.ean'] = ean; |
825 |
} |
826 |
[% END %] |
827 |
|
828 |
if ( !jQuery.isEmptyObject(q) ) { |
829 |
pending_orders_table.api().ajax.url( pending_orders_url + '&q=' + encodeURI(JSON.stringify(q)) ); |
830 |
} |
831 |
else { |
832 |
pending_orders_table.api().ajax.url( pending_orders_url ); |
833 |
} |
834 |
pending_orders_table.api().ajax.reload( null, false ); |
835 |
}); |
836 |
|
837 |
$('#clear_form_filters').on("click", function(e){ |
838 |
$("#filterform").trigger("reset"); |
839 |
pending_orders_table.api().ajax.url(pending_orders_url).draw(); |
840 |
}); |
841 |
|
842 |
// Keep filters from finishreceive.pl to parcel.pl |
544 |
$.cookie("filter_parcel_summary", $("#summaryfilter").val()); |
843 |
$.cookie("filter_parcel_summary", $("#summaryfilter").val()); |
545 |
$.cookie("filter_parcel_basketname", $("#basketfilter").val()); |
844 |
$.cookie("filter_parcel_basketname", $("#basketfilter").val()); |
546 |
$.cookie("filter_parcel_orderno", $("#orderfilter").val()); |
845 |
$.cookie("filter_parcel_orderno", $("#orderfilter").val()); |
547 |
$.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); |
846 |
$.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); |
548 |
$.cookie("filter_parcel_ean", $("#eanfilter").val()); |
847 |
$.cookie("filter_parcel_ean", $("#eanfilter").val()); |
549 |
}); |
848 |
|
|
|
849 |
$("#filterform").on('submit', function(){ |
850 |
$.cookie("filter_parcel_summary", $("#summaryfilter").val()); |
851 |
$.cookie("filter_parcel_basketname", $("#basketfilter").val()); |
852 |
$.cookie("filter_parcel_orderno", $("#orderfilter").val()); |
853 |
$.cookie("filter_parcel_basketgroupname", $("#basketgroupnamefilter").val()); |
854 |
$.cookie("filter_parcel_ean", $("#eanfilter").val()); |
855 |
}); |
550 |
|
856 |
|
551 |
$(".previewData").on("click", function(e){ |
857 |
$(".previewData").on("click", function(e){ |
552 |
e.preventDefault(); |
858 |
e.preventDefault(); |
Lines 556-583
Link Here
|
556 |
$("#dataPreview .modal-body").load(page + " div"); |
862 |
$("#dataPreview .modal-body").load(page + " div"); |
557 |
$('#dataPreview').modal({show:true}); |
863 |
$('#dataPreview').modal({show:true}); |
558 |
}); |
864 |
}); |
|
|
865 |
|
559 |
$("#dataPreview").on("hidden.bs.modal", function(){ |
866 |
$("#dataPreview").on("hidden.bs.modal", function(){ |
560 |
$("#dataPreviewLabel").html(""); |
867 |
$("#dataPreviewLabel").html(""); |
561 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
868 |
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); |
562 |
}); |
869 |
}); |
|
|
870 |
}); |
871 |
|
872 |
// Case-insensitive version of jquery's contains function |
873 |
jQuery.extend(jQuery.expr[':'], { |
874 |
icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" |
875 |
}); |
563 |
|
876 |
|
|
|
877 |
// Contains exactly function |
878 |
jQuery.extend(jQuery.expr[':'], { |
879 |
containsExactly: "$(a).text() == m[3]" |
564 |
}); |
880 |
}); |
565 |
|
881 |
|
566 |
// Case-insensitive version of jquery's contains function |
882 |
function transfer_order_popup(ordernumber) { |
567 |
jQuery.extend(jQuery.expr[':'], { |
883 |
var url = "/cgi-bin/koha/acqui/transferorder.pl?" |
568 |
icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0" |
884 |
+ "ordernumber=" + ordernumber |
569 |
}); |
885 |
window.open(url, 'TransferOrder'); |
570 |
|
886 |
} |
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> |
887 |
</script> |
582 |
[% END %] |
888 |
[% END %] |
583 |
|
889 |
|
584 |
- |
|
|