Owen Leonard
a682c620ee
I think the "breadcrumbs" ID is worth saving for past and future CSS customization reasons. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
672 lines
33 KiB
Text
672 lines
33 KiB
Text
[% USE raw %]
|
||
[% USE Asset %]
|
||
[% USE Koha %]
|
||
[% USE KohaDates %]
|
||
[% USE Price %]
|
||
[% USE currency = format('%.2f') -%]
|
||
[% PROCESS 'i18n.inc' %]
|
||
[% SET footerjs = 1 %]
|
||
[% INCLUDE 'doc-head-open.inc' %]
|
||
<title>
|
||
Koha › Acquisitions ›
|
||
[% IF ( invoiceclosedate ) %]
|
||
Receipt summary for [% name | html %] [% IF ( invoice ) %]invoice [% invoice | html %][% END %]
|
||
[% ELSE %]
|
||
Receive orders from [% name | html %]
|
||
[% END %]
|
||
</title>
|
||
[% INCLUDE 'doc-head-close.inc' %]
|
||
</head>
|
||
|
||
<body id="acq_parcel" class="acq">
|
||
[% INCLUDE 'header.inc' %]
|
||
[% INCLUDE 'acquisitions-search.inc' %]
|
||
|
||
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
|
||
<ol>
|
||
<li>
|
||
<a href="/cgi-bin/koha/mainpage.pl">Home</a>
|
||
</li>
|
||
<li>
|
||
<a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
|
||
</li>
|
||
[% IF invoiceclosedate %]
|
||
<li>
|
||
Receipt summary for <em>[% name | html %]</em>
|
||
[% IF ( invoice ) %]
|
||
<em>[ [% invoice | html %] ]</em>
|
||
[% END %]
|
||
</li>
|
||
[% ELSE %]
|
||
<li>
|
||
<a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a>
|
||
</li>
|
||
<li>
|
||
Receive orders from [% name | html %]
|
||
</li>
|
||
[% END %]
|
||
</ol>
|
||
</nav>
|
||
|
||
|
||
<div class="main container-fluid">
|
||
<div class="row">
|
||
<div class="col-sm-10 col-sm-push-2">
|
||
<main>
|
||
|
||
[% IF ( receive_error ) %]
|
||
<div class="dialog alert">
|
||
<h3>Error adding items:</h3>
|
||
<ul>
|
||
[% FOREACH error_loo IN error_loop %]
|
||
<li>[% error_loo.error_param | html %][% IF ( error_loo.error_duplicate_barcode ) %]Duplicate Barcode[% END %] <!-- todo: other error conditions come here. --></li>
|
||
[% END %]
|
||
</ul>
|
||
</div>
|
||
[% END %]
|
||
<h1>
|
||
[% IF ( invoiceclosedate ) %]
|
||
Receipt summary for <em>[% name | html %]</em> [% IF ( invoice ) %] <em> [ [% invoice | html %] ] </em>[% END %]
|
||
[% ELSE %]
|
||
Receive orders from [% name | html %]
|
||
[% END %]
|
||
</h1>
|
||
|
||
[% IF ( success_delorder ) %]
|
||
<div class="dialog message">The order has been successfully canceled.</div>
|
||
[% ELSE %]
|
||
[% IF ( error_delitem ) %]
|
||
<div class="dialog alert">The order has been canceled, although one or more items could not have been deleted.</div>
|
||
[% END %]
|
||
[% IF ( error_delbiblio ) %]
|
||
<div class="dialog alert">The order has been canceled, although the record has not been deleted.</div>
|
||
[% END %]
|
||
[% END %]
|
||
|
||
[% IF (error_cancelling_receipt) %]
|
||
<div class="dialog alert">
|
||
Cannot cancel receipt. Possible reasons :
|
||
<ul>
|
||
<li>
|
||
The order line you are trying to cancel was created from a partial receipt
|
||
of another order line which is already received. Try to cancel this
|
||
one first and retry.
|
||
</li>
|
||
<li>
|
||
The order line you are trying to cancel was created from a partial receipt
|
||
of another order line which has been deleted. Cancellation is not
|
||
possible.
|
||
</li>
|
||
</ul>
|
||
</div>
|
||
[% END %]
|
||
|
||
[% IF error_invoice_not_known %]
|
||
<div class="dialog alert">
|
||
The invoice referenced by this invoiceid does not exist.
|
||
</div>
|
||
[% END %]
|
||
|
||
[% UNLESS no_orders_to_display %]
|
||
<div id="acqui_receive_summary">
|
||
<p><strong>Invoice number:</strong> [% invoice | html %] <strong>Shipment date:</strong> [% shipmentdate | $KohaDates %]</p>
|
||
</div>
|
||
[% UNLESS (invoiceclosedate) %]
|
||
<div id="acqui_receive_search">
|
||
<h3>Pending orders</h3>
|
||
<table id="pending_orders" class="table table-bordered table-striped">
|
||
<thead>
|
||
<tr>
|
||
<th>Basket</th>
|
||
<th>Basket group</th>
|
||
<th>Order line</th>
|
||
<th>Summary</th>
|
||
<th>More</th>
|
||
<th>Replacement price</th>
|
||
<th>Quantity</th>
|
||
<th>Unit cost</th>
|
||
<th>Order cost</th>
|
||
<th>Fund</th>
|
||
<th> </th>
|
||
<th> </th>
|
||
</tr>
|
||
</thead>
|
||
</table>
|
||
</div>
|
||
[% ELSE %]
|
||
<p>
|
||
Invoice is closed, so you can't receive orders anymore.
|
||
[% IF CAN_user_acquisition_reopen_closed_invoices %]
|
||
<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>.
|
||
[% END %]
|
||
</p>
|
||
[% END %]
|
||
|
||
<div id="acqui_receive_receivelist">
|
||
<h3>Already received</h3>
|
||
|
||
[% IF ( loop_received ) %]
|
||
<form action="/cgi-bin/koha/acqui/parcel.pl" method="get" name="orderform">
|
||
<table id="receivedt">
|
||
<thead>
|
||
<tr>
|
||
<th>Basket</th>
|
||
<th>Basket group</th>
|
||
<th>Order line</th>
|
||
<th title="Item holds / Total holds">Holds</th>
|
||
<th>Summary</th>
|
||
<th>More</th>
|
||
<th>Replacement price</th>
|
||
<th>Quantity</th>
|
||
<th>Fund</th>
|
||
<th>Est cost</th>
|
||
<th>Actual cost</th>
|
||
<th>TOTAL</th>
|
||
<th></th>
|
||
</tr>
|
||
</thead>
|
||
<tfoot>
|
||
[% FOREACH key IN subtotal_for_funds.keys.sort %]
|
||
<tr>
|
||
[% IF invoiceincgst %]
|
||
<td colspan="6" class="total">(Tax inc.)</td>
|
||
[% ELSE %]
|
||
<td colspan="6" class="total">(Tax exc.)</td>
|
||
[% END %]
|
||
<td colspan="3"><em>Subtotal for</em> [% key | html %]</td>
|
||
<td>[% subtotal_for_funds.$key.ecost | $Price %]</td>
|
||
<td>[% subtotal_for_funds.$key.unitprice | $Price %]</td>
|
||
<td> </td>
|
||
<td> </td>
|
||
</tr>
|
||
[% END %]
|
||
<tr>
|
||
<th colspan="11" class="total">Total tax exc.</th>
|
||
<th>[% total_tax_excluded | $Price %]</th>
|
||
<th></th>
|
||
</tr>
|
||
[% FOREACH book_foot IN book_foot_loop %]
|
||
<tr>
|
||
<th colspan="11">Total (GST [% book_foot.tax_rate * 100 | html %]%)</th>
|
||
<th>[% book_foot.tax_value | $Price %]</th>
|
||
<th></th>
|
||
</tr>
|
||
[% END %]
|
||
<tr>
|
||
<th colspan="11" class="total">Total tax inc.</th>
|
||
<th>[% total_tax_included | $Price %]</th>
|
||
<th></th>
|
||
</tr>
|
||
</tfoot>
|
||
<tbody class="filterclass">
|
||
[% FOREACH order IN loop_received %]
|
||
<tr>
|
||
<td><a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% order.basketno | uri %]"> [% order.basketname | html %] ([% order.basketno | html %])</a></td>
|
||
<td>
|
||
[% IF order.basketgroupid %]
|
||
<a href="/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid=[% booksellerid | uri %]">[% order.basketgroupname | html %] ([% order.basketgroupid | html %])</a>
|
||
[% ELSE %]
|
||
No basket group
|
||
[% END %]
|
||
</td>
|
||
<td>
|
||
<a href="neworderempty.pl?ordernumber=[% order.ordernumber | uri %]&booksellerid=[% booksellerid | uri %]">[% order.ordernumber | html %]</a>
|
||
[% IF (order.parent_ordernumber && (order.parent_ordernumber != order.ordernumber)) %]
|
||
(<a href="neworderempty.pl?ordernumber=[% order.parent_ordernumber | uri %]&booksellerid=[% booksellerid | uri %]" title="Original order line">[% order.parent_ordernumber | html %]</a>)
|
||
[% END %]
|
||
</td>
|
||
<td>
|
||
[% IF order.total_holds > 0 %]
|
||
[% IF order.item_holds > 0 %]
|
||
<span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% order.biblionumber | uri %]">[% order.item_holds | html %]</a></span>
|
||
[% ELSE %]
|
||
0
|
||
[% END %]
|
||
/
|
||
<span class="error"><a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% order.biblionumber | uri %]">[% order.total_holds | html %]</a></span>
|
||
[% ELSE %]
|
||
0
|
||
[% END %]
|
||
</td>
|
||
<td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% order.biblionumber | uri %]">[% order.title | html %]</a>
|
||
[% IF ( order.author ) %] / [% order.author | html %][% END %]
|
||
[% IF ( order.isbn ) %] - [% order.isbn | html %][% END %]
|
||
[% IF ( order.publishercode ) %]
|
||
<br />Publisher: [% order.publishercode | html %]
|
||
[%- IF ( order.publicationyear > 0) -%], [% order.publicationyear | html %]
|
||
[%- ELSIF ( order.copyrightdate > 0) -%] [% order.copyrightdate | html %]
|
||
[% END %]
|
||
[% END %]
|
||
[% IF ( order.suggestionid ) %]
|
||
<br/>
|
||
Suggested by: [% order.surnamesuggestedby | html %][% IF ( order.firstnamesuggestedby ) %], [% order.firstnamesuggestedby | html %] [% END %]
|
||
(<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% order.suggestionid | uri %]&op=show">suggestion #[% order.suggestionid | html %]</a>)
|
||
[% END %]
|
||
<br />
|
||
[% IF ( order.order_internalnote ) %]
|
||
<p class="ordernote"><strong>Internal note: </strong>[% order.order_internalnote | html %] [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% order.ordernumber | uri %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]&type=internal">Change internal note</a>]</p>
|
||
[% ELSE %]
|
||
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% order.ordernumber | uri %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]&type=internal">Add internal note</a>]
|
||
[% END %]
|
||
[% IF ( order.order_vendornote ) %]
|
||
<p class="ordernote"><strong>Vendor note: </strong>[% order.order_vendornote | html %]</p>
|
||
[% ELSE %]
|
||
[<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber=[% order.ordernumber | uri %]&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]&type=vendor">Add vendor note</a>]
|
||
[% END %]
|
||
</td>
|
||
<td>
|
||
<a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=[% order.ordernumber | uri %]" class="previewData">[% tp('noun', 'Order') | html %]</a><br>
|
||
<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=[% order.biblionumber | uri %]" class="previewData">MARC</a><br>
|
||
<a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=[% order.biblionumber | uri %]" class="previewData">Card</a>
|
||
</td>
|
||
<td>[% order.replacementprice | $Price %]</td>
|
||
<td>[% order.quantityreceived | html %]</td>
|
||
<td>[% order.budget.budget_name | html %]</td>
|
||
<td>[% order.ecost | $Price %]</td>
|
||
<td>[% order.unitprice | $Price %]</td>
|
||
<td>[% order.total | $Price %]</td>
|
||
<td>
|
||
[% IF loop_receive.cannot_cancel or ( order.basket.effective_create_items == "receiving" and loop_receive.holds > 0 ) %]
|
||
[% IF loop_receive.cannot_cancel %]
|
||
[% span_title = BLOCK %]
|
||
Cannot cancel receipt of this order line because it
|
||
was created from a partial receipt of order line no.
|
||
[% order.parent_ordernumber | html %], which is
|
||
already received. Try cancelling this one first and
|
||
retry.
|
||
[% END %]
|
||
[% ELSE %]
|
||
[%# FIXME Here we block the cancellation if holds exist. Actually it could be possible if items will be exist after the deletion %]
|
||
[%# Some additional checks should be added in the pl file %]
|
||
[% span_title = BLOCK %]
|
||
Cannot cancel receipt of this order line because at least one reservation exists on the records.
|
||
[% END %]
|
||
[% END %]
|
||
<span title="[% span_title | collapse | html %]">
|
||
Can't cancel receipt
|
||
</span>
|
||
[% ELSE %]
|
||
<a href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]&op=cancelreceipt&ordernumber=[% order.ordernumber | uri %]">Cancel receipt</a>
|
||
[% END %]
|
||
</td>
|
||
</tr>
|
||
[% END %]
|
||
</tbody>
|
||
</table>
|
||
</form>
|
||
|
||
[% ELSE %]There are no received orders.[% END %]
|
||
</div>
|
||
|
||
<div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
|
||
<div class="modal-dialog">
|
||
<div class="modal-content">
|
||
<div class="modal-header">
|
||
<button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
|
||
<h3 id="dataPreviewLabel">MARC preview</h3>
|
||
</div>
|
||
<div class="modal-body">
|
||
<div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
|
||
</div>
|
||
<div class="modal-footer">
|
||
<button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
[% IF (invoiceclosedate) %]
|
||
<a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoiceid | uri %]">View invoice</a>
|
||
[% ELSE %]
|
||
<form action="/cgi-bin/koha/acqui/invoice.pl" method="get">
|
||
<input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
|
||
<fieldset class="action">
|
||
<input type="submit" value="Finish receiving" />
|
||
</fieldset>
|
||
</form>
|
||
[% END %]
|
||
|
||
[% END %]
|
||
|
||
</main>
|
||
</div> <!-- /.col-sm-10.col-sm-push-2 -->
|
||
|
||
<div class="col-sm-2 col-sm-pull-10">
|
||
<aside>
|
||
|
||
[% INCLUDE 'acquisitions-menu.inc' %]
|
||
</aside>
|
||
</div> <!-- /.col-sm-2.col-sm-pull-10 -->
|
||
</div> <!-- /.row -->
|
||
|
||
[% MACRO jsinclude BLOCK %]
|
||
[% Asset.js("js/acquisitions-menu.js") | $raw %]
|
||
[% INCLUDE 'datatables.inc' %]
|
||
[% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %]
|
||
<style>#dataPreview { width : 80%; } @media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
|
||
<script>
|
||
dt_overwrite_html_sorting_localeCompare();
|
||
var columns_filter = {};
|
||
|
||
$(document).ready(function(){
|
||
|
||
if ( $("#receivedt").length ) {
|
||
var receivedt = $("#receivedt").dataTable($.extend(true, {}, dataTablesDefaults, {
|
||
"bStateSave": true,
|
||
"iDisplayLength": 10,
|
||
"aLengthMenu": [[5, 10, 20, 50, 100, -1], [5, 10, 20, 50, 100, _("All")]],
|
||
"aoColumnDefs": [
|
||
{ "aTargets": [ 5, -1 ], "bSortable": false, "bSearchable": false },
|
||
],
|
||
"aoColumns": [
|
||
{ "sType": "html" },
|
||
{ "sType": "html" },
|
||
{ "sType": "html" },
|
||
{ "sType": "num-html" },
|
||
{ "sType": "anti-the" },
|
||
null,
|
||
null,
|
||
null,
|
||
null,
|
||
null,
|
||
null,
|
||
null,
|
||
null
|
||
],
|
||
"sPaginationType": "full"
|
||
}));
|
||
}
|
||
|
||
var pending_orders_table = $("#pending_orders").api({
|
||
"ajax": {
|
||
"url": '/api/v1/acquisitions/orders?only_active=1'
|
||
},
|
||
"header_filter": true,
|
||
"embed": [
|
||
"basket.basket_group",
|
||
"biblio.active_orders+count",
|
||
"biblio.holds+count",
|
||
"biblio.items+count",
|
||
"biblio.suggestions.suggester",
|
||
"fund",
|
||
"current_item_level_holds+count",
|
||
"items"
|
||
],
|
||
"stateSave": true, // remember state on page reload
|
||
"drawCallback": function (settings) {
|
||
$(".previewData").on("click", function(e){
|
||
e.preventDefault();
|
||
var ltitle = $(this).text();
|
||
var page = $(this).attr("href");
|
||
$("#dataPreviewLabel").text(ltitle);
|
||
$("#dataPreview .modal-body").load(page + " div");
|
||
$('#dataPreview').modal({show:true});
|
||
});
|
||
},
|
||
"columns": [
|
||
{ "data": "basket.name",
|
||
"searchable": true,
|
||
"orderable": true,
|
||
"render": function(data, type, row, meta) {
|
||
if (type != 'display') return escape_str(data);
|
||
return "<a href=\"/cgi-bin/koha/acqui/basket.pl?basketno=" + encodeURIComponent(row.basket.basket_id) + "\">" + escape_str(data) + " (" + escape_str(row.basket.basket_id) + ")</a>";
|
||
}
|
||
},
|
||
{ "data": "basket.basket_group.name",
|
||
"orderable": true,
|
||
"render": function(data, type, row, meta) {
|
||
if ( type != 'display' ) {
|
||
return escape_str(data);
|
||
}
|
||
if ( row.basket.basket_group_id == null ) {
|
||
return _("No basket group");
|
||
}
|
||
else {
|
||
return "<a href=\"/cgi-bin/koha/acqui/basketgroup.pl?op=add&booksellerid="
|
||
+ encodeURIComponent(row.basket.vendor_id) + "&basketgroupid="
|
||
+ encodeURIComponent(row.basket.basket_group_id) + "\">"
|
||
+ escape_str(row.basket.basket_group.name) + " (" + escape_str(row.basket.basket_group_id) + ")</a>";
|
||
}
|
||
}
|
||
},
|
||
{
|
||
"data": "order_id",
|
||
"render": function(data, type, row, meta) {
|
||
if (type != 'display') return escape_str(data);
|
||
return "<a href=\"neworderempty.pl?ordernumber="+encodeURIComponent(data)+"&booksellerid="+encodeURIComponent(row.basket.vendor_id)+"\">"+escape_str(data)+"</a>";
|
||
}
|
||
},
|
||
{
|
||
[% SET summary_fields = "biblio.author:biblio.title:biblio.isbn:biblio.publisher:me.internal_note:me.vendor_note" %]
|
||
[% IF Koha.Preference('marcflavour')=='UNIMARC' %][% SET summary_fields = summary_fields _ ":biblio.ean" %][% END %]
|
||
"data": "[% summary_fields | html %]",
|
||
"render": function(data, type, row, meta) {
|
||
var result = '';
|
||
if ( row && row.biblio_id != null ) {
|
||
result = "<p><a href=\"/cgi-bin/koha/catalogue/detail.pl?biblionumber="+encodeURIComponent(row.biblio_id)+"\">"+escape_str(row.biblio.title)+"</a>";
|
||
if ( row.biblio.author != null )
|
||
result += _(" by ") + escape_str(row.biblio.author);
|
||
if ( row.biblio.isbn != null )
|
||
result += " – " + escape_str(row.biblio.isbn);
|
||
[% IF Koha.Preference('marcflavour')=='UNIMARC' %]
|
||
if ( row.biblio.ean != null )
|
||
result += " – EAN:" + escape_str(row.biblio.ean);
|
||
[% END %]
|
||
if ( row.biblio.publisher != null ) {
|
||
result += "<br/>" + _("Publisher: ") + escape_str(row.biblio.publisher);
|
||
if ( row.biblio.publication_year != null ) {
|
||
result += ", " + escape_str(row.biblio.publication_year);
|
||
}
|
||
else if ( row.biblio.copyright_date != null ) {
|
||
result += escape_str(row.biblio.copyright_date);
|
||
}
|
||
}
|
||
var suggestions = row.biblio.suggestions;
|
||
if ( suggestions != null && suggestions.length > 0 ) {
|
||
var suggestion = suggestions[0];
|
||
if ( suggestion.suggester != null ) {
|
||
var suggester = suggestion.suggester;
|
||
var suggested_by = [];
|
||
if ( suggester.surname != null ) {
|
||
suggested_by.push(escape_str(suggester.surname));
|
||
}
|
||
if ( suggester.firstname != null ) {
|
||
suggested_by.push(escape_str(suggester.firstname));
|
||
}
|
||
|
||
result += "<br/>" + _("Suggested by: ") +
|
||
'<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid='
|
||
+ encodeURIComponent(suggestion.suggestionid)
|
||
+ '&op=show">'
|
||
+ suggested_by.join(", ")
|
||
+ " (#" + escape_str(suggestions[0].suggestionid) + ")</a>"; // FIXME: could be changed if we allow matching multiple suggestions
|
||
}
|
||
}
|
||
result += '</p>';
|
||
}
|
||
|
||
var internal_note = row.internal_note;
|
||
if ( internal_note != null && internal_note != '' ) {
|
||
result += '<p class="ordernote"><strong>'
|
||
+ _("Internal note: ")
|
||
+ '</strong>' + escape_str(internal_note)
|
||
+ ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber='
|
||
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]'
|
||
+ '&type=internal">' + _("Change internal note") + '</a>]</p>';
|
||
}
|
||
else {
|
||
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber='
|
||
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]'
|
||
+ '&type=internal">' + _("Add internal note") + '</a>]';
|
||
}
|
||
|
||
var vendor_note = row.vendor_note;
|
||
if ( vendor_note != null && vendor_note != '' ) {
|
||
result += '<p class="ordernote"><strong>'
|
||
+ _("Vendor note: ")
|
||
+ '</strong>' + escape_str(vendor_note) + '</p>';
|
||
}
|
||
else {
|
||
result += ' [<a href="/cgi-bin/koha/acqui/modordernotes.pl?ordernumber='
|
||
+ encodeURIComponent(row.order_id) + '&referrer=/cgi-bin/koha/acqui/parcel.pl%3Finvoiceid=[% invoiceid | uri %]'
|
||
+ '&type=vendor">' + _("Add vendor note") + '</a>]';
|
||
}
|
||
|
||
return result;
|
||
},
|
||
"orderable": false,
|
||
},
|
||
{
|
||
"data": "",
|
||
"render": function(data, type, row, meta) {
|
||
var result = '<a href="/cgi-bin/koha/acqui/showorder.pl?ordernumber=' + encodeURIComponent(row.order_id) + '" class="previewData">' + _("Order") + '</a><br>'
|
||
+ '<a href="/cgi-bin/koha/catalogue/showmarc.pl?id=' + encodeURIComponent(row.biblio_id) + '" class="previewData">' + _("MARC") + '</a><br>'
|
||
+ '<a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&id=' + encodeURIComponent(row.biblio_id) + '" class="previewData">' + _("Card") + '</a>';
|
||
return result;
|
||
},
|
||
"orderable": false,
|
||
"searchable": false
|
||
},
|
||
{
|
||
"data": "replacement_price",
|
||
"render": function(data, type, row, meta) {
|
||
return escape_price(row.replacement_price);
|
||
},
|
||
},
|
||
{
|
||
"data": "quantity",
|
||
"orderable": true
|
||
},
|
||
{
|
||
"data": "ecost",
|
||
"render": function(data, type, row, meta) {
|
||
return escape_price(row.ecost);
|
||
},
|
||
},
|
||
{
|
||
"data": "",
|
||
"render": function(data, type, row, meta) {
|
||
return escape_price(row.quantity * row.ecost);
|
||
},
|
||
"orderable": false, // FIXME: How can we do it in DBIC?
|
||
"searchable": false
|
||
},
|
||
{
|
||
"data": "fund.name",
|
||
"render": function(data, type, row, meta) {
|
||
if (type != 'display') return escape_str(data);
|
||
return escape_str(row.fund.name);
|
||
}
|
||
},
|
||
{
|
||
"data": "",
|
||
"render": function(data, type, row, meta) {
|
||
return '<a href="orderreceive.pl?ordernumber='
|
||
+ encodeURIComponent(row.order_id) + '&invoiceid=[% invoiceid | uri %]' + '">'
|
||
+ _("Receive") + '</a><br/>'
|
||
+ '<a href="#" onclick="transfer_order_popup(' + escape_str(row.order_id) + '); return false;">'
|
||
+ _("Transfer") + '</a>';
|
||
},
|
||
"orderable": false,
|
||
"searchable": false
|
||
},
|
||
{
|
||
"data": "",
|
||
"render": function(data, type, row, meta) {
|
||
var result = "";
|
||
|
||
if ( row.current_holds_count > 0 ) {
|
||
result += '<span class="button" title="'
|
||
+ _("Can't cancel order, (%s) holds are linked with this order. Cancel holds first").format( escape_str(row.holds_count) ) + '">'
|
||
+ _("Can't cancel order") + '</span><br/>';
|
||
}
|
||
else {
|
||
result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber='
|
||
+ encodeURIComponent(row.order_id)
|
||
+ '&biblionumber=' + encodeURIComponent(row.biblio_id)
|
||
+ '&referrer=/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | uri %]">'
|
||
+ _("Cancel order") + '</a><br/>';
|
||
}
|
||
|
||
if ( row.biblio != null ) {
|
||
if ( row.biblio.items_count - row.items.length > 0 ||
|
||
row.biblio.active_orders_count > 1 ||
|
||
row.biblio.subscriptions_count > 0 ||
|
||
row.biblio.holds_count > 0 ) { // biblio can be deleted
|
||
result += '<span class="button" title="'
|
||
+ _("Can't delete catalog record, see constraints below") + '">'
|
||
+ _("Can't cancel order and delete catalog record") + '</span><br>';
|
||
}
|
||
else {
|
||
result += '<a href="/cgi-bin/koha/acqui/cancelorder.pl?ordernumber='
|
||
+ encodeURIComponent(row.order_id) + '&biblionumber=' + encodeURIComponent(row.biblio_id)
|
||
+ '&del_biblio=1&referrer="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[$ invoiceid | uri ]">'
|
||
+ _("Cancel order and catalog record") + '</a><br/>';
|
||
}
|
||
|
||
if ( row.biblio.items_count - row.items.length > 0 ) {
|
||
result += '<strong title="'
|
||
+ _("Can't delete catalog record, because of %s existing item(s)").format(row.items.length)
|
||
+'">' + (row.biblio.items_count - row.items.length) + _(" item(s) left") + '</strong><br/>';
|
||
}
|
||
|
||
if ( row.biblio.active_orders_count > 1 ) {
|
||
result += '<strong title="'
|
||
+ _("Can't delete catalog record, delete other orders linked to it first") + '">'
|
||
+ (row.biblio.active_orders_count - 1) + _(" order(s) left") + '</strong><br/>';
|
||
}
|
||
|
||
if ( row.biblio.subscriptions_count > 0 ) {
|
||
result += '<strong title="' + _("Can't delete catalog record, delete subscriptions first") + '">'
|
||
+ _("%s subscription(s) left").format(row.biblio.subscriptions_count)
|
||
+ '</strong><br>';
|
||
}
|
||
|
||
if ( row.biblio.holds_count > 0 ) {
|
||
result += '<strong title="' + _("Can't delete catalog record or order, cancel holds first") + '">'
|
||
+ _("%s hold(s) left").format(row.biblio.holds_count) + '</strong>';
|
||
}
|
||
}
|
||
|
||
return result;
|
||
},
|
||
"orderable": false,
|
||
"searchable": false
|
||
}
|
||
]
|
||
}, {}, 1, {"basket.vendor_id": [% booksellerid | html %]});
|
||
|
||
$(".previewData").on("click", function(e){
|
||
e.preventDefault();
|
||
var ltitle = $(this).text();
|
||
var page = $(this).attr("href");
|
||
$("#dataPreviewLabel").text(ltitle);
|
||
$("#dataPreview .modal-body").load(page + " div");
|
||
$('#dataPreview').modal({show:true});
|
||
});
|
||
|
||
$("#dataPreview").on("hidden.bs.modal", function(){
|
||
$("#dataPreviewLabel").html("");
|
||
$("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
|
||
});
|
||
});
|
||
|
||
// Case-insensitive version of jquery's contains function
|
||
jQuery.extend(jQuery.expr[':'], {
|
||
icontains : "jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase())>=0"
|
||
});
|
||
|
||
// Contains exactly function
|
||
jQuery.extend(jQuery.expr[':'], {
|
||
containsExactly: "$(a).text() == m[3]"
|
||
});
|
||
|
||
function transfer_order_popup(ordernumber) {
|
||
var url = "/cgi-bin/koha/acqui/transferorder.pl?"
|
||
+ "ordernumber=" + ordernumber
|
||
window.open(url, 'TransferOrder');
|
||
}
|
||
</script>
|
||
[% END %]
|
||
|
||
[% INCLUDE 'intranet-bottom.inc' %]
|