6 [% USE AuthorisedValues %]
10 [% INCLUDE 'doc-head-open.inc' %]
11 <title>Receipt summary for : [% name | html %] [% IF ( invoice ) %]invoice, [% invoice | html %][% END %] › Acquisitions › Koha</title>
12 [% INCLUDE 'doc-head-close.inc' %]
15 <body id="acq_orderreceive" class="acq">
16 [% WRAPPER 'header.inc' %]
17 [% INCLUDE 'acquisitions-search.inc' %]
20 [% WRAPPER 'sub-header.inc' %]
21 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
24 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
27 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
30 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.basket.booksellerid | uri %]">[% name | html %]</a>
33 <a href="#" aria-current="page">
34 Receive items from : [% name | html %] [% IF ( invoice ) %]
35 [[% invoice | html %]]
36 [% END %] (order #[% order.ordernumber | html %])
43 <div class="main container-fluid">
45 [% AcqCreateItem = order.basket.effective_create_items %]
46 <div class="col-sm-10 col-sm-push-2">
49 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber | html %])</h1>
52 <form id="f" action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
54 <div class="col-sm-6">
55 <div class="dialog alert order_error" style="display:none"></div>
57 <fieldset class="rows">
58 <legend>Catalog details</legend>
61 <span class="label">Title: </span>
62 [% INCLUDE 'biblio-title.inc' biblio=order.biblio link = 1 %]
64 <li> <span class="label">Author: </span>
65 [% order.biblio.author | html %]</li>
66 <li><span class="label">Copyright: </span>
67 [% order.biblio.copyrightdate | html %]</li>
68 <li> <span class="label">ISBN: </span>
69 [% order.biblio.biblioitem.isbn | html %]</li>
70 <li> <span class="label">Series: </span>
71 [% order.biblio.seriestitle | html %]</li>
76 <fieldset class="rows">
77 <legend>Suggestion</legend>
80 <span class="label">Suggested by: </span>
81 [% 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>)
82 [% IF suggestion.reason %]
84 <span class="label">Reason:</span>
85 [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
86 [% SET other_reason = 1 %]
87 <select class="select-reason" id="reason" name="reason">
88 <option value=""> -- Choose a reason -- </option>
89 [% FOREACH reason IN suggestion_reasons %]
90 [% IF reason.lib == suggestion.reason %]
91 <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
92 [% SET other_reason = 0 %]
94 <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
97 <option value="other">Others...</option>
100 <span id="other_reason" name="other_reason">
101 [% IF other_reason %]
102 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
104 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
106 <a href="#back">Cancel</a>
109 <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
117 [% IF order.subscriptionid and orders.count %]
118 <fieldset class="rows">
119 <legend>Receipt history for this subscription</legend>
124 <th>Order number</th>
125 <th>Creation date</th>
126 <th>Receive date</th>
127 <th>Quantity received</th>
129 <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
130 <th>Internal note</th>
134 [% FOR suborder IN orders %]
137 [% IF suborder.invoice %]
138 [% IF CAN_user_acquisition %]
139 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% suborder.invoiceid | uri %]" title="Invoice detail page">
140 [% suborder.invoice.invoicenumber | html %]</a>
142 [% suborder.invoice.invoicenumber | html %]
146 <td>[% suborder.ordernumber | html %]</td>
147 <td data-order="[% suborder.basket.creationdate | uri %]">[% suborder.basket.creationdate | $KohaDates%]</td>
148 <td data-order="[% suborder.datereceived | uri %]">
149 [% IF suborder.datereceived %]
150 [% suborder.datereceived | $KohaDates %]
153 <td>[% suborder.quantityreceived | html %]</td>
154 [% SWITCH suborder.orderstatus %]
155 [%# FIXME We should only see/display Complete here, right? %]
157 <td data-order="status_1">
160 <td data-order="status_2">
163 <td data-order="status_3">
165 [% CASE 'complete' %]
166 <td data-order="status_4">
167 <span>Complete</span>
168 [% CASE 'cancelled' %]
169 <td data-order="status_5">
170 <span>Cancelled</span>
174 [% IF suborder.datereceived %][%# FIXME Should only be true, right? %]
175 [%# FIXME What if unitprice has not been filled? %]
176 [% suborder.unitprice_tax_excluded * suborder.quantity | $Price %] / [% suborder.unitprice_tax_included * suborder.quantity | $Price %]
179 <td>[% suborder.order_internalnote | html %]</td>
185 [% ELSIF (AcqCreateItem == 'receiving') %]
186 <div id="items_list" style="display:none">
187 <p><strong>Items list</strong></p>
188 <div style="width:100%;overflow:auto;">
192 <th class="noExport">Actions</th>
194 <th>Home library</th>
195 <th>Holding library</th>
196 <th>Not for loan</th>
201 <th>Inventory number</th>
214 [% UNLESS order.subscriptionid %]
215 <fieldset class="rows" id="itemfieldset">
216 <legend>Item</legend>
217 [% IF ( NoACQframework ) %]
219 No ACQ framework, using default. You should create a
220 framework with code ACQ, the items framework would be
224 <div id="outeritemblock"></div>
227 [% ELSIF (AcqCreateItem == 'ordering') %]
228 [% IF (order.items) %]
229 <div class="page-section" style="width:100%;overflow:auto">
237 <th>Home library</th>
238 <th>Current library</th>
239 <th>Not for loan</th>
244 <th>Inventory number</th>
252 [% FOREACH item IN order.items %]
253 <tr id="item_[% item.itemnumber | html %]">
254 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
255 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
256 <td>[% item.barcode | html %]</td>
257 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
258 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
259 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]</td>
260 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %]</td>
261 <td><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</span></td>
262 <td>[% item.itemcallnumber | html %]</td>
263 <td>[% item.copynumber | html %]</td>
264 <td>[% item.stocknumber | html %]</td>
265 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
266 <td>[% ItemTypes.GetDescription( item.itype ) | html %]</td>
267 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.materials', authorised_value => item.materials ) | html %]</td>
268 <td>[% item.itemnotes | html %]</td>
276 <input type="hidden" name="biblionumber" value="[% order.biblionumber | html %]" />
277 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
278 <input type="hidden" name="ordernumber" value="[% order.ordernumber | html %]" />
279 <input type="hidden" name="booksellerid" value="[% order.basket.booksellerid | html %]" />
281 <div class="col-sm-6">
282 <fieldset class="rows">
283 <legend>Accounting details</legend>
286 <label for="datereceived">Date received: </label>
287 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | html %]" class="flatpickr" />
288 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
291 <label class="required" for="bookfund">Fund: </label>
292 [% active_count = 0 %]
293 [% IF !ordernumber %]
294 [% FOREACH budget_period IN budget_loops.keys %]
295 [% FOREACH fund IN budget_loops.$budget_period.funds %]
296 [% active_count= active_count + fund.b_active %]
300 <select class="select2" id="bookfund" name="bookfund">
301 <optgroup label="Current">
302 <option value="[% order.fund.budget.id | html %]" selected="selected" data-sort1-authcat="[% order.fund.sort1_authcat | html %]" data-sort2-authcat="[% order.fund.sort2_authcat | html %]">
303 Keep current ([% order.fund.budget_name | html %])</option>
305 [% FOREACH budget_period_id IN budget_loops.keys %]
306 [% SET budget_period = budget_loops.$budget_period_id %]
307 [% IF budget_period.active %]
308 <optgroup label="[% budget_period.description | html %]">
310 <optgroup class="inactive_budget" label="[% budget_period.description | html %] (Inactive)">
312 [% FOREACH budget_loo IN budget_period.funds %]
313 [% level_indent_cnt = 0 %]
314 [% level_indent = "" %]
315 [% WHILE level_indent_cnt < budget_loo.b_level %]
316 [% level_indent = level_indent _ " -- " %]
317 [% level_indent_cnt = level_indent_cnt +1 %]
320 [% IF ( budget_loo.b_sel ) %]
321 [% active_count = 0 #select no other fund %]
322 <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]">
323 [% ELSIF active_count==1 && budget_loo.b_active %]
324 <option value="[% budget_loo.b_id | html %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]">
326 [% bdgclass=budget_loo.b_active? "": "inactive_budget" | html %]
327 <option value="[% budget_loo.b_id | html %]" class="[% bdgclass | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]">
329 [% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %]
335 <span class="required">Required</span>
336 <label for="showallbudgets" style="float:none;"> Show inactive:</label>
337 <input type="checkbox" id="showallbudgets" />
339 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
341 <label for="creator">Ordered by: </label>
343 [% INCLUDE 'patron-title.inc' patron = creator %]
346 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
347 [% IF edit or order.subscriptionid %]
348 <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
350 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
353 <li><label for="quantity">Quantity received: </label>
354 [% IF order.subscriptionid %]
355 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
356 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
357 [% ELSIF AcqCreateItem == 'receiving' %]
358 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
360 [% IF ( order.quantityreceived ) %]
362 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
363 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
365 [% IF ( order.items.count ) %]
366 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
368 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
370 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
373 <input type="text" inputmode="numeric" pattern="[0-9]*" id="quantity" size="20" name="quantityrec" value="1" />
374 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
376 <div id="qtyrecerror" style="display:none">
377 <p class="error">Warning, you have entered more items than expected.
378 Items will not be created.</p>
380 [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
383 [% IF ( gst_values ) %]
385 <label for="tax_rate">Tax rate: </label>
386 <select name="tax_rate" id="tax_rate">
387 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
388 [% tax_rate = tax_rate + 0 %]
389 [% FOREACH gst IN gst_values %]
390 [% IF gst.option == tax_rate %]
391 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
393 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
399 <input type="hidden" name="tax_rate" value="0" />
402 <li><label for="rrp">Retail price: </label>
403 [% IF (invoiceincgst == 1) %]
404 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
406 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
409 <label for="replacementprice">Replacement price:</label>
410 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
413 [% IF (invoiceincgst) %]
414 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
416 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
420 <label for="unitprice">Actual cost:</label>
421 [% IF (invoiceincgst) %]
422 [% SET unitprice = order.unitprice_tax_included > 0 ? order.unitprice_tax_included : order.ecost_tax_included %]
423 <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
425 [% SET unitprice = order.unitprice_tax_included > 0 ? order.unitprice_tax_excluded : order.ecost_tax_excluded %]
426 <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
428 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
430 <li id="select_currency">
431 <label for="unitprice_currency"></label>
432 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
433 [% IF currencies.count %]
434 <select name="currency">
435 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
436 [% FOR currency IN currencies %]
437 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
442 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
443 [% IF order_vendornote %]
444 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
450 </div><div class="row"><fieldset class="action">
451 <input type="submit" value="Save" class="btn btn-primary" accesskey="w" />
452 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
453 </fieldset></div> </form>
455 This ordernumber does not exist.
459 </div> <!-- /.col-sm-10.col-sm-push-2 -->
461 <div class="col-sm-2 col-sm-pull-10">
463 [% INCLUDE 'acquisitions-menu.inc' %]
465 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
466 </div> <!-- /.row -->
467 [% MACRO jsinclude BLOCK %]
468 [% Asset.js("js/acquisitions-menu.js") | $raw %]
469 [% INCLUDE 'calendar.inc' %]
470 [% Asset.js("js/additem.js") | $raw %]
471 [% Asset.js("js/cataloging.js") | $raw %]
472 [% INCLUDE 'select2.inc' %]
474 function Check(form) {
475 [% IF (AcqCreateItem == 'receiving') %]
476 var total_errors = CheckMandatorySubfields(form);
477 if (total_errors != 0) {
478 var alertString = _("Form not submitted because of the following problem(s)");
479 alertString += "\n------------------------------------------------------------------------------------\n";
480 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
485 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
486 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
490 // Remove last itemblock if it is not in items_list
491 var lastitemblock = $("#outeritemblock > div:last");
492 var tobedeleted = true;
493 var listitems = $("#items_list tr");
494 $(listitems).each(function(){
495 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
500 $(lastitemblock).remove();
503 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
504 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
506 $(lastitemblock).appendTo("#outeritemblock");
512 if( $("#quantity").val() < 1 ) {
513 alert(_("You must receive at least one item"));
520 [% IF (AcqCreateItem == 'ordering') %]
521 var items_columns = [null, null, 'barcode', 'homebranchname',
522 'holdingbranchname', 'notforloan', 'restricted', 'location',
523 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
524 'itemtype', 'materials', 'itemnotes'];
526 function PopupEditPage(biblionumber, itemnumber) {
527 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
528 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
529 var w = window.open(url);
530 var watchClose = setInterval(function() {
532 clearTimeout(watchClose);
533 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
535 'itemnumber': itemnumber
538 var tds = $("#item_"+itemnumber+" td");
539 for(var i=2; i<tds.length; i++) {
540 var column = items_columns[i];
541 var text = item[column];
542 if ( text == null ) text = '';
543 $(tds[i]).text(text);
551 function CalcQtyToReceive() {
552 var qty = $("input[name='items_to_receive']:checked").length;
553 $("#quantity").val(qty);
556 function CheckNItems(n) {
557 $("input[name='items_to_receive']").each(function() {
558 $(this).prop('checked', false);
560 $("input[name='items_to_receive']:lt("+n+")").each(function () {
561 $(this).prop('checked', true);
566 $(document).ready(function() {
568 //keep a copy of all budgets before removing the inactives
569 disabledBudgetsCopy = $('#bookfund').html();
570 $('#bookfund .inactive_budget').remove();
572 $('#showallbudgets').click(function() {
573 if ($(this).is(":checked")) {
574 $('#bookfund').html(disabledBudgetsCopy); //Puts back all the funds
577 $('#bookfund .inactive_budget').remove();
581 [% IF (AcqCreateItem == 'receiving') %]
582 cloneItemBlock(0, '[% Koha.Preference('UniqueItemFields') | html %]');
583 [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
584 $("input[name='items_to_receive']").change(function() {
588 $("#quantity").keyup(function() {
589 var qty = parseInt($("#quantity").val());
590 var qtyto = parseInt($("#quantity_to_receive").val());
592 $("#qtyrecerror").show();
594 $("#qtyrecerror").hide();
596 CheckNItems($(this).val());
600 $("input[name='change_currency']").on("change", function(){
601 if ( $(this).is(":checked") ) {
602 $("#select_currency").show();
603 $("#unitprice").prop("readonly", "true");
605 $("#select_currency").hide();
606 $("#unitprice").prop("readonly", "");
610 function update_unitprice() {
611 var rate = Number($("select[name='currency'] option:selected").val());
612 var unitprice = $("#unitprice_currency").val();
613 var new_unitprice = Number( unitprice * rate ).toFixed(2);
614 $("#unitprice").val(new_unitprice);
616 $("select[name='currency']").on("change", function(){update_unitprice()} );
617 $("#unitprice_currency").on("change", function(){update_unitprice()} );
619 [% IF other_reason %]
620 $(".select-reason").hide();
621 $(".select-reason").find("option[value='other']").attr("selected","selected");
622 $("#other_reason").show();
624 $("#other_reason").hide();
626 $(".select-reason").change(function(){
627 if($(this).val() == "other"){
629 $("#other_reason").show();
632 $("a[href*=back]").click(function(){
633 $(".select-reason").show().find("option[value='']").attr("selected","selected");
634 $("#other_reason").hide();
641 [% INCLUDE 'intranet-bottom.inc' %]