6 [% USE AuthorisedValues %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Koha › Acquisitions › Receipt summary for : [% name | html %] [% IF ( invoice ) %]invoice, [% invoice | html %][% END %]</title>
12 [% INCLUDE 'doc-head-close.inc' %]
15 <body id="acq_orderreceive" class="acq">
16 [% INCLUDE 'header.inc' %]
17 [% INCLUDE 'acquisitions-search.inc' %]
19 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
22 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
25 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
28 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.basket.booksellerid | uri %]">[% name | html %]</a>
31 <a href="#" aria-current="page">
32 Receive items from : [% name | html %] [% IF ( invoice ) %]
33 [[% invoice | html %]]
34 [% END %] (order #[% order.ordernumber | html %])
40 <div class="main container-fluid">
42 [% AcqCreateItem = order.basket.effective_create_items %]
43 <div class="col-sm-10 col-sm-push-2">
46 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber | html %])</h1>
49 <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
51 <div class="col-sm-6">
52 <div class="dialog alert order_error" style="display:none"></div>
54 <fieldset class="rows">
55 <legend>Catalog details</legend>
56 <ol><li><span class="label">Title: </span><span class="title">[% order.biblio.title | html %]</span></li>
57 <li> <span class="label">Author: </span>
58 [% order.biblio.author | html %]</li>
59 <li><span class="label">Copyright: </span>
60 [% order.biblio.copyrightdate | html %]</li>
61 <li> <span class="label">ISBN: </span>
62 [% order.biblio.biblioitem.isbn | html %]</li>
63 <li> <span class="label">Series: </span>
64 [% order.biblio.seriestitle | html %]</li>
69 <fieldset class="rows">
70 <legend>Suggestion</legend>
73 <span class="label">Suggested by: </span>
74 [% suggestion.surnamesuggestedby | html %][% IF suggestion.firstnamesuggestedby %], [% suggestion.firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestion.suggestionid | uri %]&op=show">suggestion #[% suggestion.suggestionid | html %]</a>)
75 [% IF suggestion.reason %]
77 <span class="label">Reason:</span>
78 [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
79 [% SET other_reason = 1 %]
80 <select class="select-reason" id="reason" name="reason">
81 <option value=""> -- Choose a reason -- </option>
82 [% FOREACH reason IN suggestion_reasons %]
83 [% IF reason.lib == suggestion.reason %]
84 <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
85 [% SET other_reason = 0 %]
87 <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
90 <option value="other">Others...</option>
93 <span id="other_reason" name="other_reason">
95 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
97 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
99 <a href="#back">Cancel</a>
102 <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
110 [% IF order.subscriptionid and orders.count %]
111 <fieldset class="rows">
112 <legend>Receipt history for this subscription</legend>
117 <th>Order number</th>
118 <th>Creation date</th>
119 <th>Receive date</th>
120 <th>Quantity received</th>
122 <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
123 <th>Internal note</th>
127 [% FOR suborder IN orders %]
130 [% IF suborder.invoice %]
131 [% IF CAN_user_acquisition %]
132 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% suborder.invoiceid | uri %]" title="Invoice detail page">
133 [% suborder.invoice.invoicenumber | html %]</a>
135 [% suborder.invoice.invoicenumber | html %]
139 <td>[% suborder.ordernumber | html %]</td>
140 <td data-order="[% suborder.basket.creationdate | uri %]">[% suborder.basket.creationdate | $KohaDates%]</td>
141 <td data-order="[% suborder.datereceived | uri %]">
142 [% IF suborder.datereceived %]
143 [% suborder.datereceived | $KohaDates %]
146 <td>[% suborder.quantityreceived | html %]</td>
147 [% SWITCH suborder.orderstatus %]
148 [%# FIXME We should only see/display Complete here, right? %]
150 <td data-order="status_1">
153 <td data-order="status_2">
156 <td data-order="status_3">
158 [% CASE 'complete' %]
159 <td data-order="status_4">
161 [% CASE 'cancelled' %]
162 <td data-order="status_5">
167 [% IF suborder.datereceived %][%# FIXME Should only be true, right? %]
168 [%# FIXME What if unitprice has not been filled? %]
169 [% suborder.unitprice_tax_excluded * suborder.quantity | $Price %] / [% suborder.unitprice_tax_included * suborder.quantity | $Price %]
172 <td>[% suborder.order_internalnote | html %]</td>
178 [% ELSIF (AcqCreateItem == 'receiving') %]
179 <div id="items_list" style="display:none">
180 <p><strong>Items list</strong></p>
181 <div style="width:100%;overflow:auto;">
185 <th class="noExport">Actions</th>
187 <th>Home library</th>
188 <th>Holding library</th>
189 <th>Not for loan</th>
194 <th>Inventory number</th>
207 [% UNLESS order.subscriptionid %]
208 <fieldset class="rows" id="itemfieldset">
209 <legend>Item</legend>
210 [% IF ( NoACQframework ) %]
212 No ACQ framework, using default. You should create a
213 framework with code ACQ, the items framework would be
217 <div id="outeritemblock"></div>
220 [% ELSIF (AcqCreateItem == 'ordering') %]
221 [% IF (order.items) %]
223 <div style="width:100%;overflow:auto">
230 <th>Home library</th>
231 <th>Current library</th>
232 <th>Not for loan</th>
237 <th>Inventory number</th>
245 [% FOREACH item IN order.items %]
246 <tr id="item_[% item.itemnumber | html %]">
247 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
248 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
249 <td>[% item.barcode | html %]</td>
250 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
251 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
252 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]</td>
253 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %]</td>
254 <td><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</span></td>
255 <td>[% item.itemcallnumber | html %]</td>
256 <td>[% item.copynumber | html %]</td>
257 <td>[% item.stocknumber | html %]</td>
258 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
259 <td>[% ItemTypes.GetDescription( item.itype ) | html %]</td>
260 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.materials', authorised_value => item.materials ) | html %]</td>
261 <td>[% item.itemnotes | html %]</td>
269 <input type="hidden" name="biblionumber" value="[% order.biblionumber | html %]" />
270 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
271 <input type="hidden" name="ordernumber" value="[% order.ordernumber | html %]" />
272 <input type="hidden" name="booksellerid" value="[% order.basket.booksellerid | html %]" />
274 <div class="col-sm-6">
275 <fieldset class="rows">
276 <legend>Accounting details</legend>
279 <label for="datereceived">Date received: </label>
280 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
282 <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
283 <option value="">Keep current ([% budget_period_description | html %] - [% order.fund.budget_name | html %])</option>
284 [% FOREACH period IN budget_loop %]
285 <optgroup label="[% period.description | html %]">
286 [% FOREACH fund IN period.funds %]
287 [% IF ( fund.b_sel ) %]
288 <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
290 <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
296 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
298 <label for="creator">Ordered by: </label>
300 [% INCLUDE 'patron-title.inc' patron = creator %]
303 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
304 [% IF edit or order.subscriptionid %]
305 <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
307 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
310 <li><label for="quantity">Quantity received: </label>
311 [% IF order.subscriptionid %]
312 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
313 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
314 [% ELSIF AcqCreateItem == 'receiving' %]
315 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
317 [% IF ( order.quantityreceived ) %]
319 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
320 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
322 [% IF ( order.items.count ) %]
323 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
325 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
327 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
330 <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
331 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
333 <div id="qtyrecerror" style="display:none">
334 <p class="error">Warning, you have entered more items than expected.
335 Items will not be created.</p>
337 [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
340 [% IF ( gst_values ) %]
342 <label for="tax_rate">Tax rate: </label>
343 <select name="tax_rate" id="tax_rate">
344 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
345 [% FOREACH gst IN gst_values %]
346 [% IF gst.option == tax_rate %]
347 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
349 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
355 <input type="hidden" name="tax_rate" value="0" />
358 <li><label for="rrp">Retail price: </label>
359 [% IF (invoiceincgst == 1) %]
360 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
362 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
365 <label for="replacementprice">Replacement price:</label>
366 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
369 [% IF (invoiceincgst) %]
370 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
372 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
376 <label for="unitprice">Actual cost:</label>
377 [% IF (invoiceincgst) %]
378 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_included | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
380 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_excluded | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
382 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
384 <li id="select_currency">
385 <label for="unitprice_currency"></label>
386 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
387 [% IF currencies.count %]
388 <select name="currency">
389 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
390 [% FOR currency IN currencies %]
391 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
396 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
397 [% IF order_vendornote %]
398 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
404 </div><div class="row"><fieldset class="action">
405 <input type="submit" value="Save" class="button" accesskey="w" />
406 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
407 </fieldset></div> </form>
409 This ordernumber does not exist.
413 </div> <!-- /.col-sm-10.col-sm-push-2 -->
415 <div class="col-sm-2 col-sm-pull-10">
417 [% INCLUDE 'acquisitions-menu.inc' %]
419 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
420 </div> <!-- /.row -->
421 [% MACRO jsinclude BLOCK %]
422 [% Asset.js("js/acquisitions-menu.js") | $raw %]
423 [% INCLUDE 'calendar.inc' %]
424 [% Asset.js("js/additem.js") | $raw %]
425 [% Asset.js("js/cataloging.js") | $raw %]
427 function Check(form) {
428 [% IF (AcqCreateItem == 'receiving') %]
429 var total_errors = CheckMandatorySubfields(form);
430 if (total_errors != 0) {
431 var alertString = _("Form not submitted because of the following problem(s)");
432 alertString += "\n------------------------------------------------------------------------------------\n";
433 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
438 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
439 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
443 // Remove last itemblock if it is not in items_list
444 var lastitemblock = $("#outeritemblock > div:last");
445 var tobedeleted = true;
446 var listitems = $("#items_list tr");
447 $(listitems).each(function(){
448 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
453 $(lastitemblock).remove();
456 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
457 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
459 $(lastitemblock).appendTo("#outeritemblock");
465 if( $("#quantity").val() < 1 ) {
466 alert(_("You must receive at least one item"));
473 [% IF (AcqCreateItem == 'ordering') %]
474 var items_columns = [null, null, 'barcode', 'homebranchname',
475 'holdingbranchname', 'notforloan', 'restricted', 'location',
476 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
477 'itemtype', 'materials', 'itemnotes'];
479 function PopupEditPage(biblionumber, itemnumber) {
480 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
481 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
482 var w = window.open(url);
483 var watchClose = setInterval(function() {
485 clearTimeout(watchClose);
486 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
488 'itemnumber': itemnumber
491 var tds = $("#item_"+itemnumber+" td");
492 for(var i=2; i<tds.length; i++) {
493 var column = items_columns[i];
494 var text = item[column];
495 if ( text == null ) text = '';
496 $(tds[i]).text(text);
504 function CalcQtyToReceive() {
505 var qty = $("input[name='items_to_receive']:checked").length;
506 $("#quantity").val(qty);
509 function CheckNItems(n) {
510 $("input[name='items_to_receive']").each(function() {
511 $(this).prop('checked', false);
513 $("input[name='items_to_receive']:lt("+n+")").each(function () {
514 $(this).prop('checked', true);
519 $(document).ready(function() {
520 [% IF (AcqCreateItem == 'receiving') %]
521 cloneItemBlock(0, '[% Koha.Preference('UniqueItemFields') | html %]');
522 [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
523 $("input[name='items_to_receive']").change(function() {
527 $("#quantity").keyup(function() {
528 var qty = parseInt($("#quantity").val());
529 var qtyto = parseInt($("#quantity_to_receive").val());
531 $("#qtyrecerror").show();
533 $("#qtyrecerror").hide();
535 CheckNItems($(this).val());
539 $("input[name='change_currency']").on("change", function(){
540 if ( $(this).is(":checked") ) {
541 $("#select_currency").show();
542 $("#unitprice").prop("readonly", "true");
544 $("#select_currency").hide();
545 $("#unitprice").prop("readonly", "");
549 function update_unitprice() {
550 var rate = Number($("select[name='currency'] option:selected").val());
551 var unitprice = $("#unitprice_currency").val();
552 var new_unitprice = Number( unitprice * rate ).toFixed(2);
553 $("#unitprice").val(new_unitprice);
555 $("select[name='currency']").on("change", function(){update_unitprice()} );
556 $("#unitprice_currency").on("change", function(){update_unitprice()} );
558 [% IF other_reason %]
559 $(".select-reason").hide();
560 $(".select-reason").find("option[value='other']").attr("selected","selected");
561 $("#other_reason").show();
563 $("#other_reason").hide();
565 $(".select-reason").change(function(){
566 if($(this).val() == "other"){
568 $("#other_reason").show();
571 $("a[href*=back]").click(function(){
572 $(".select-reason").show().find("option[value='']").attr("selected","selected");
573 $("#other_reason").hide();
580 [% INCLUDE 'intranet-bottom.inc' %]