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>Summary</th> |
98 |
<th>More</th> |
99 |
<th>Replacement price</th> |
100 |
<th>Quantity</th> |
101 |
<th>Unit cost</th> |
102 |
<th>Order cost</th> |
103 |
<th>Fund</th> |
104 |
<th> </th> |
105 |
<th> </th> |
106 |
</tr> |
107 |
</thead> |
108 |
</table> |
109 |
|
90 |
[% UNLESS no_orders_to_display %] |
110 |
[% UNLESS no_orders_to_display %] |
91 |
<div id="acqui_receive_summary"> |
111 |
<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> |
112 |
<p><strong>Invoice number:</strong> [% invoice | html %] <strong>Received by:</strong> [% logged_in_user.userid | html %] <strong>On:</strong> [% datereceived | $KohaDates %]</p> |
Lines 181-206
Link Here
|
181 |
<a href="#" onclick="transfer_order_popup([% loop_order.ordernumber | html %]); return false;">Transfer</a> |
201 |
<a href="#" onclick="transfer_order_popup([% loop_order.ordernumber | html %]); return false;">Transfer</a> |
182 |
</td> |
202 |
</td> |
183 |
<td> |
203 |
<td> |
184 |
[% IF ( loop_order.left_holds_on_order ) %] |
204 |
[% 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> |
205 |
<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 %] |
206 |
[% 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 /> |
207 |
<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 %] |
208 |
[% END %] [%# DONE %] |
189 |
[% IF ( loop_order.can_del_bib ) %] |
209 |
[% 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 /> |
210 |
<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 %] |
211 |
[% 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> |
212 |
<span class="button" title="Can't delete catalog record, see constraints below">Can't cancel order and delete catalog record</span><br> |
193 |
[% END %] |
213 |
[% END %] |
194 |
[% IF ( loop_order.left_item ) %] |
214 |
[% 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> |
215 |
<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 %] |
216 |
[% END %] |
197 |
[% IF ( loop_order.left_biblio ) %] |
217 |
[% 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> |
218 |
<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 %] |
219 |
[% END %] |
200 |
[% IF ( loop_order.left_subscription ) %] |
220 |
[% 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> |
221 |
<b title="Can't delete catalog record, delete subscriptions first">[% loop_order.subscriptions | html %] subscription(s) left</b><br> |
202 |
[% END %] |
222 |
[% END %] |
203 |
[% IF ( loop_order.left_holds ) %] |
223 |
[% 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> |
224 |
<b title="Can't delete catalog record or order, cancel holds first">[% loop_order.holds | html %] hold(s) left</b> |
205 |
[% END %] |
225 |
[% END %] |
206 |
</td> |
226 |
</td> |
Lines 533-538
Link Here
|
533 |
})); |
553 |
})); |
534 |
} |
554 |
} |
535 |
|
555 |
|
|
|
556 |
var pendig_orders_tb = $("#pending_orders").api({ |
557 |
"ajax": { |
558 |
"url": "/api/v1/acquisitions/orders" |
559 |
}, |
560 |
"embed": [ |
561 |
"basket.basket_group", |
562 |
"biblio.active_orders_count", |
563 |
"biblio.holds_count", |
564 |
"biblio.items_count", |
565 |
"biblio.suggestions.suggester", |
566 |
"fund", |
567 |
"holds_count", |
568 |
"items" |
569 |
], |
570 |
'dom': 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>', |
571 |
"columns": [ |
572 |
{ "data": "basket_id", |
573 |
"orderable": true, |
574 |
"render": function(data, type, row, meta) { |
575 |
if (type != 'display') return data; |
576 |
return "<a href=\"/cgi-bin/koha/acqui/basket.pl?basketno=" + data + "\">" + row.basket.name + " (" + data + ")</a>"; |
577 |
} |
578 |
}, |
579 |
{ "data": function(row, type, val, meta) { |
580 |
if ( type != 'display' ) return row.basket.basket_group_id; |
581 |
if ( row.basket.basket_group_id == null ) { |
582 |
return _("No basket group"); |
583 |
} |
584 |
else { |
585 |
return "<a href=\"/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=" |
586 |
+ row.basket.vendor_id + "&basketgroupid=" |
587 |
+ row.basket.basket_group_id + "\">" |
588 |
+ row.basket.basket_group.name + " (" + row.basket.basket_group_id + ")</a>"; |
589 |
} |
590 |
}, |
591 |
"orderable": false // FIXME |
592 |
}, |
593 |
{ "data": "order_id", |
594 |
"render": function(data, type, row, meta) { |
595 |
if (type != 'display') return data; |
596 |
return "<a href=\"neworderempty.pl?ordernumber="+data+"&booksellerid="+row.basket.vendor_id+"\">"+data+"</a>"; |
597 |
} |
598 |
}, |
599 |
{ "data": function(row, type, val, meta) { |
600 |
var result = "<a href=\"opac-detail.pl?biblionumber="+row.biblio_id+"\">"+row.biblio.title+"</a>"; |
601 |
if ( row.biblio.author != null ) |
602 |
result += _(" by ") + row.biblio.author; |
603 |
if ( row.biblio.isbn != null ) |
604 |
result += " – " + row.biblio.isbn; |
605 |
if ( row.biblio.publisher != null ) { |
606 |
result += "<br/>" + _("Publisher: ") + row.biblio.publisher; |
607 |
if ( row.biblio.publication_year != null ) { |
608 |
result += ", " + row.biblio.publication_year; |
609 |
} |
610 |
else if ( row.biblio.copyright_date != null ) { |
611 |
result += row.biblio.copyright_date; |
612 |
} |
613 |
} |
614 |
var suggestions = row.biblio.suggestions; |
615 |
if ( suggestions != null && suggestions.length > 0 ) { |
616 |
var suggestion = suggestions[0]; |
617 |
if ( suggestion.suggester != null ) { |
618 |
var suggester = suggestion.suggester; |
619 |
var suggested_by = []; |
620 |
if ( suggester.surname != null ) { |
621 |
suggested_by.push(suggester.surname); |
622 |
} |
623 |
if ( suggester.firstname != null ) { |
624 |
suggested_by.push(suggester.firstname); |
625 |
} |
626 |
|
627 |
result += "<br/>" + _("Suggested by: ") + |
628 |
'<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=' |
629 |
+ suggestion.suggestionid |
630 |
+ '&op=show">' |
631 |
+ suggested_by.join(", ") |
632 |
+ " (#" + suggestions[0].suggestionid + ")</a>"; |
633 |
} |
634 |
} |
635 |
|
636 |
var internal_note = row.internal_note; |
637 |
if ( internal_note != '' ) { |
638 |
result += '<p class="ordernote"><strong>' |
639 |
+ _("Internal note: ") |
640 |
+ '</strong>' + internal_note |
641 |
+ ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
642 |
+ row.order_id + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
643 |
+ '&type=internal">' + _("Change internal note") + '</a>]</p>'; |
644 |
} |
645 |
else { |
646 |
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
647 |
+ row.order_id + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
648 |
+ '&type=internal">' + _("Add internal note") + '</a>]'; |
649 |
} |
650 |
|
651 |
var vendor_note = row.vendor_note; |
652 |
if ( vendor_note != '' ) { |
653 |
result += '<p class="ordernote"><strong>' |
654 |
+ _("Vendor note: ") |
655 |
+ '</strong>' + vendor_note + '</p>'; |
656 |
} |
657 |
else { |
658 |
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=' |
659 |
+ row.order_id + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]' |
660 |
+ '&type=vendor">' + _("Add vendor note") + '</a>]'; |
661 |
} |
662 |
|
663 |
return result; |
664 |
}, |
665 |
"orderable": false // FIXME |
666 |
}, |
667 |
{ "data": function( row, type, val, meta) { |
668 |
var result = '<a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=' + row.order_id + '" class="previewData">' + _('Order') + '</a><br>' |
669 |
+ '<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=' + row.biblio_id + '" class="previewData">' + _("MARC") + '</a><br>' |
670 |
+ '<a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=' + row.biblio_id + '" class="previewData">' + _("Card") + '</a>'; |
671 |
return result; |
672 |
}, |
673 |
"orderable": false |
674 |
}, |
675 |
{ "data": "replacement_price" }, |
676 |
{ "data": "quantity" }, |
677 |
{ "data": "ecost" }, |
678 |
{ "data": function ( row, type, val, meta ) { |
679 |
return row.quantity * row.ecost; |
680 |
} |
681 |
}, |
682 |
{ "data": "fund_id", |
683 |
"render": function(data, type, row, meta) { |
684 |
if (type != 'display') return data; |
685 |
return row.fund.name; |
686 |
} |
687 |
}, |
688 |
{ |
689 |
"data": function( row, type, val, meta ) { |
690 |
return '<a href="orderreceive.pl?ordernumber=' |
691 |
+ row.order_id + '&invoiceid=[% invoiceid | uri %]' + '">' |
692 |
+ _("Receive") + '</a><br/>' |
693 |
+ '<a href="#" onclick="transfer_order_popup(' + row.order_id + '); return false;">' |
694 |
+ _("Transfer") + '</a>'; |
695 |
}, |
696 |
"orderable": false |
697 |
}, |
698 |
{ |
699 |
"data": function( row, type, val, meta ) { |
700 |
var result = ""; |
701 |
|
702 |
if ( row.holds_count > 0 ) { |
703 |
result += '<span class="button" title="' |
704 |
+ _("Can't cancel order, (%s) holds are linked with this order. Cancel holds first").format( row.holds_count ) + '">' |
705 |
+ _("Can't cancel order") + '</span><br/>'; |
706 |
} |
707 |
else { |
708 |
result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=' |
709 |
+ row.order_id |
710 |
+ '&biblionumber=' + row.biblio_id |
711 |
+ '&referrer=/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">' |
712 |
+ _("Cancel order") + '</a><br/>'; |
713 |
} |
714 |
|
715 |
if ( row.items.length > 0 || |
716 |
row.biblio.active_orders_count > 1 || |
717 |
row.biblio.subscriptions_count > 0 || |
718 |
row.bibio.holds_count > 0 ) { // biblio can be deleted |
719 |
result += '<span class="button" title="' |
720 |
+ _("Can't delete catalog record, see constraints below") + '">' |
721 |
+ _("Can't cancel order and delete catalog record") + '</span><br>'; |
722 |
} |
723 |
else { |
724 |
result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber=' |
725 |
+ row.order_id + '&biblionumber=' + row.biblio_id |
726 |
+ '&del_biblio=1&referrer="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[$ invoiceid | uri ]">' |
727 |
+ _("Cancel order and catalog record") + '</a><br/>'; |
728 |
} |
729 |
|
730 |
if ( row.items.length > 0 ) { |
731 |
result += '<b title="' |
732 |
+ _("Can't delete catalog record, because of %s existing item(s)").format(row.items.length) |
733 |
+'">' + (row.biblio.items_count - row.items.length) + _(" item(s) left") + '</b><br/>'; |
734 |
} |
735 |
|
736 |
if ( row.biblio.active_orders_count > 1 ) { |
737 |
result += '<b title="' |
738 |
+ _("Can't delete catalog record, delete other orders linked to it first") + '">' |
739 |
+ (row.biblio.active_orders_count - 1) + _(" order(s) left") + '</b><br/>'; |
740 |
} |
741 |
|
742 |
if ( row.biblio.subscriptions_count > 0 ) { |
743 |
result += '<b title="' + _("Can't delete catalog record, delete subscriptions first") + '">' |
744 |
+ _("%s subscription(s) left").format(row.biblio.subscriptions_count) |
745 |
+ '</b><br>'; |
746 |
} |
747 |
|
748 |
if ( row.biblio.holds_count > 0 ) { |
749 |
result += '<b title="' + _("Can't delete catalog record or order, cancel holds first") + '">' |
750 |
+ _("%s hold(s) left").format(row.bibio.holds_count) + '</b>'; |
751 |
} |
752 |
|
753 |
return result; |
754 |
}, |
755 |
"orderable": false |
756 |
} |
757 |
] |
758 |
}); |
759 |
|
760 |
|
536 |
// Keep filters from finishreceive.pl to parcel.pl |
761 |
// Keep filters from finishreceive.pl to parcel.pl |
537 |
$.cookie("filter_parcel_summary", $("#summaryfilter").val()); |
762 |
$.cookie("filter_parcel_summary", $("#summaryfilter").val()); |
538 |
$.cookie("filter_parcel_basketname", $("#basketfilter").val()); |
763 |
$.cookie("filter_parcel_basketname", $("#basketfilter").val()); |
539 |
- |
|
|