Koha/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/orderreceive.tt
Julian Maurice 2338d02e9e Bug 7175: Allow to choose which items to receive
If AcqCreateItem=ordering, when you receive an order, you now have a
list of all created items and checkboxes that permit you to choose which
items you want to receive.
A 'Edit' link open additem.pl page in a popup to allow you edit the
items before receiving them (popup is automatically closed after
modification, and items table is automatically updated)
If quantity is set manually in the text box, the appropriate number of
checkbox are checked from top to bottom and a warning shows up if
quantity is greater than order quantity

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-05-21 17:46:07 +02:00

338 lines
15 KiB
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Acquisitions &rsaquo; Receipt summary for : [% name %] [% IF ( invoice ) %]invoice, [% invoice %][% END %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'additem.js.inc' %]
<script type="text/javascript" src="[% themelang %]/js/additem.js"> </script>
<script type="text/javascript">
//<![CDATA[
function Check(form) {
[% IF (AcqCreateItemReceiving) %]
// Remove last itemblock if it is not in items_list
var lastitemblock = $("#outeritemblock > div:last");
var tobedeleted = true;
var listitems = $("#items_list tr");
$(listitems).each(function(){
if($(this).attr('idblock') == $(lastitemblock).attr('id')){
tobedeleted = false;
}
});
if(tobedeleted){
$(lastitemblock).remove();
}
if(check_additem('[% UniqueItemFields %]') == false){
alert(_('Duplicate values detected. Please correct the errors and resubmit.') );
if(tobedeleted) {
$(lastitemblock).appendTo("#outeritemblock");
}
return false;
};
[% END %]
return true;
}
[% IF (AcqCreateItem == 'ordering') %]
var items_columns = [null, null, 'barcode', 'homebranchname',
'holdingbranchname', 'notforloan', 'restricted', 'location',
'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
'itemtype', 'materials', 'itemnotes'];
function PopupEditPage(biblionumber, itemnumber) {
var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
+ biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
var w = window.open(url);
var watchClose = setInterval(function() {
if (w.closed) {
clearTimeout(watchClose);
$.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
{
'itemnumber': itemnumber
},
function(item) {
var tds = $("#item_"+itemnumber+" td");
for(var i=2; i<tds.length; i++) {
var column = items_columns[i];
$(tds[i]).text(item[column]);
}
}
);
}
}, 500);
}
function CalcQtyToReceive() {
var qty = $("input[name='items_to_receive']:checked").length;
$("#quantity").val(qty);
}
function CheckNItems(n) {
$("input[name='items_to_receive']").each(function() {
$(this).attr('checked', false);
});
$("input[name='items_to_receive']:lt("+n+")").each(function () {
$(this).attr('checked', true);
});
}
[% END %]
$(document).ready(function() {
[% IF (AcqCreateItemReceiving) %]
cloneItemBlock(0, '[% UniqueItemFields %]');
[% ELSIF (AcqCreateItem == 'ordering') %]
$("input[name='items_to_receive']").change(function() {
CalcQtyToReceive();
});
CalcQtyToReceive();
$("#quantity").keyup(function() {
var qty = parseInt($("#quantity").val());
var qtyto = parseInt($("#quantity_to_receive").val());
if(qty > qtyto) {
$("#qtyrecerror").show();
} else {
$("#qtyrecerror").hide();
}
CheckNItems($(this).val());
});
[% END %]
});
//]]>
</script>
</head>
<body id="acq_orderreceive" class="acq">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'acquisitions-search.inc' %]
<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; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name %]</a> &rsaquo; Receive items from : [% name %] [% IF ( invoice ) %][[% invoice %]][% END %] (order #[% ordernumber %])</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Receive items from : [% name %] [% IF ( invoice ) %][[% invoice %]] [% END %] (order #[% ordernumber %])</h1>
[% IF ( count ) %]
<form action="/cgi-bin/koha/acqui/finishreceive.pl" method="post" onsubmit="return Check(this);">
<div class="yui-g">
<div class="yui-u first">
<div class="error" style="display:none"></div>
<fieldset class="rows">
<legend>Catalog details</legend>
<ol><li><span class="label">Title: </span><span class="title">[% title |html %]</span></li>
<li> <span class="label">Author: </span>
[% author %]</li>
<li><span class="label">Copyright: </span>
[% copyrightdate %]</li>
<li> <span class="label">ISBN: </span>
[% isbn %]</li>
<li> <span class="label">Series: </span>
[% seriestitle %]</li>
</ol>
</fieldset>
[% IF ( suggestionid ) %]
<fieldset class="rows">
<legend>Suggestion</legend>
<ol>
<li>
<span class="label">Suggested by: </span>
[% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&amp;op=show">suggestion #[% suggestionid %]</a>)
</li>
</ol>
</fieldset>
[% END %]
[% IF (AcqCreateItemReceiving) %]
<div id="items_list" style="display:none">
<p><b>Items list</b></p>
<div style="width:100%;overflow:auto;">
<table>
<thead>
<tr>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>Barcode</th>
<th>Home branch</th>
<th>Holding branch</th>
<th>Not for loan</th>
<th>Restricted</th>
<th>Location</th>
<th>Call number</th>
<th>Copy number</th>
<th>Stock number</th>
<th>Collection code</th>
<th>Item type</th>
<th>Materials</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
<fieldset class="rows" id="itemfieldset">
<legend>Item</legend>
[% IF ( NoACQframework ) %]
<p class="required">
No ACQ framework, using default. You should create a
framework with code ACQ, the items framework would be
used
</p>
[% END %]
<div id="outeritemblock"></div>
</fieldset>
[% ELSIF (AcqCreateItem == 'ordering') %]
[% IF (items.size) %]
<h5>Items</h5>
<div style="width:100%;overflow:auto">
<table>
<thead>
<tr>
<th>Receive?</th>
<th>&nbsp;</th>
<th>Barcode</th>
<th>Home branch</th>
<th>Holding branch</th>
<th>Not for loan</th>
<th>Restricted</th>
<th>Location</th>
<th>Call number</th>
<th>Copy number</th>
<th>Stock number</th>
<th>Collection code</th>
<th>Item type</th>
<th>Materials</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
[% FOREACH item IN items %]
<tr id="item_[% item.itemnumber %]">
<td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber %]" /></td>
<td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber %],[% item.itemnumber %]);">Edit</a></td>
<td>[% item.barcode %]</td>
<td>[% item.homebranchname %]</td>
<td>[% item.holdingbranchname %]</td>
<td>[% item.notforloan %]</td>
<td>[% item.restricted %]</td>
<td>[% item.location %]</td>
<td>[% item.itemcallnumber %]</td>
<td>[% item.copynumber %]</td>
<td>[% item.stocknumber %]</td>
<td>[% item.collection %]</td>
<td>[% item.itemtype %]</td>
<td>[% item.materials %]</td>
<td>[% item.itemnotes %]</td>
</tr>
[% END %]
</tbody>
</table>
</div>
[% END %]
[% END %]
<input type="hidden" name="biblionumber" value="[% biblionumber %]" />
<input type="hidden" name="ordernumber" value="[% ordernumber %]" />
<input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
<input type="hidden" name="booksellerid" value="[% booksellerid %]" />
<input type="hidden" name="datereceived" value="[% datereceived_iso %]" />
<input type="hidden" name="freight" value="[% freight %]" />
<input type="hidden" name="gst" value="[% gst %]" />
</div>
<div class="yui-u">
<fieldset class="rows">
<legend>Accounting details</legend>
<ol>
<li><label for="datereceived">Date received: </label><span> [% datereceived %] </span></li>
<li><label for="bookfund">Budget: </label><span> [% bookfund %] </span></li>
<li><label for="creator">Created by: </label><span> [% IF ( memberfirstname and membersurname ) %][% IF ( memberfirstname ) %][% memberfirstname %][% END %] [% membersurname %][% ELSE %]No name[% END %]</span></li>
<li><label for="quantity_to_receive">Quantity to receive: </label><span class="label">
[% IF ( edit ) %]
<input type="text" id="quantity_to_receive" name="quantity" value="[% quantity %]" />
[% ELSE %]
<input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% quantity %]" />
[% END %]
</span></li>
<li><label for="quantity">Quantity received: </label>
[% IF (AcqCreateItemReceiving) %]
<input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
[% ELSE %]
[% IF ( quantityreceived ) %]
[% IF ( edit ) %]
<input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived %]" />
<input id="origquantityrec" READONLY type="hidden" name="origquantityrec" value="[% quantityreceived %]" />
[% ELSE %]
[% IF ( items ) %]
<input READONLY type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceivedplus1 %]" />
[% ELSE %]
<input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceivedplus1 %]" />
[% END %]
<input id="origquantityrec" READONLY type="hidden" name="origquantityrec" value="[% quantityreceived %]" />
[% END %]
[% ELSE %]
[% IF ( items ) %]
<input type="text" id="quantity" size="20" name="quantityrec" value="1" />
[% ELSE %]
<input type="text" size="20" id="quantity" name="quantityrec" value="1" />
[% END %]
<input id="origquantityrec" READONLY type="hidden" name="origquantityrec" value="0" />
[% END %]
<div id="qtyrecerror" style="display:none">
<p class="error">Warning, you have entered more items than expected.
Items will not be created.</p>
</div>
[% END %][%# IF (AcqCreateItemReceiving) %]
</li>
<li><label for="rrp">Replacement cost: </label><input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /></li>
<li><label for="ecost">Budgeted cost: </label><input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" /></li>
<li><label for="cost">Actual cost:</label>
[% IF ( unitprice ) %]
<input type="text" size="20" name="cost" id="cost" value="[% unitprice %]" />
[% ELSE %]
<input type="text" size="20" name="cost" id="cost" value="[% ecost %]" />
[% END %]</li></ol>
<label for="note">Notes: </label><textarea name="note" width="40" rows="8" >[% notes %]</textarea>
<input type="hidden" name="invoice" value="[% invoice %]" />
</fieldset>
</div>
</div><div class="yui-g"><fieldset class="action">
<input type="submit" value="Save" />
<a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?booksellerid=[% supplierid %]&amp;invoice=[% invoice %]&amp;gst=[% gst %]&amp;freight=[% freight %]">Cancel</a>
</fieldset></div> </form>
[% ELSE %]
<div id="acqui_acquire_orderlist">
<table>
<tr>
<th>Basket</th>
<th>ISBN</th>
<th>Title</th>
<th>Author</th>
<th>Qty</th>
<th>Received</th>
</tr>
[% FOREACH loo IN loop %]
<tr>
<td>[% loo.basketno %]</td>
<td>[% loo.isbn %]</td>
<td><a href="orderreceive.pl?datereceived=[% loo.datereceived %]&amp;receive=[% loo.ordernumber %]&amp;biblio=[% loo.biblionumber %]&amp;invoice=[% loo.invoice %]&amp;freight=[% loo.freight %]&amp;gst=[% loo.gst %]&amp;id=[% loo.id %]">[% loo.title |html %]</a></td>
<td>[% loo.author %]</td>
<td>[% loo.quantity %]</td>
<td>[% loo.quantityreceived %]</td>
</tr>
[% END %]
</table>
</div>
[% END %]
</div>
</div>
<div class="yui-b">
[% INCLUDE 'acquisitions-menu.inc' %]
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]