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 [% WRAPPER breadcrumbs %]
22 [% WRAPPER breadcrumb_item %]
23 <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
25 [% WRAPPER breadcrumb_item %]
26 <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.basket.booksellerid | uri %]">[% name | html %]</a>
28 [% WRAPPER breadcrumb_item bc_active= 1 %]
30 <span>Receive items from: [% name | html %] [[% invoice | html %]] (order #[% order.ordernumber | html %])</span>
32 <span>Receive items from: [% name | html %] (order #[% order.ordernumber | html %])</span>
35 [% END #/ WRAPPER breadcrumbs %]
36 [% END #/ WRAPPER sub-header.inc %]
38 <div class="main container-fluid">
40 [% AcqCreateItem = order.basket.effective_create_items %]
41 <div class="col-sm-10 col-sm-push-2">
44 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber | html %])</h1>
47 <form id="f" action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
49 <div class="col-sm-6">
50 <div class="dialog alert order_error" style="display:none"></div>
52 <fieldset class="rows">
53 <legend>Catalog details</legend>
56 <span class="label">Title: </span>
57 [% INCLUDE 'biblio-title.inc' biblio=order.biblio link = 1 %]
59 <li> <span class="label">Author: </span>
60 [% order.biblio.author | html %]</li>
61 <li><span class="label">Copyright: </span>
62 [% order.biblio.copyrightdate | html %]</li>
63 <li> <span class="label">ISBN: </span>
64 [% order.biblio.biblioitem.isbn | html %]</li>
65 <li> <span class="label">Series: </span>
66 [% order.biblio.seriestitle | html %]</li>
71 <fieldset class="rows">
72 <legend>Suggestion</legend>
75 <span class="label">Suggested by: </span>
76 [% 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>)
77 [% IF suggestion.reason %]
79 <span class="label">Reason:</span>
80 [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
81 [% SET other_reason = 1 %]
82 <select class="select-reason" id="reason" name="reason">
83 <option value=""> -- Choose a reason -- </option>
84 [% FOREACH reason IN suggestion_reasons %]
85 [% IF reason.lib == suggestion.reason %]
86 <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
87 [% SET other_reason = 0 %]
89 <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
92 <option value="other">Others...</option>
95 <span id="other_reason" name="other_reason">
97 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
99 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
101 <a href="#back">Cancel</a>
104 <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
112 [% IF order.subscriptionid and orders.count %]
113 <fieldset class="rows">
114 <legend>Receipt history for this subscription</legend>
119 <th>Order number</th>
120 <th>Creation date</th>
121 <th>Receive date</th>
122 <th>Quantity received</th>
124 <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
125 <th>Internal note</th>
129 [% FOR suborder IN orders %]
132 [% IF suborder.invoice %]
133 [% IF CAN_user_acquisition %]
134 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% suborder.invoiceid | uri %]" title="Invoice detail page">
135 [% suborder.invoice.invoicenumber | html %]</a>
137 [% suborder.invoice.invoicenumber | html %]
141 <td>[% suborder.ordernumber | html %]</td>
142 <td data-order="[% suborder.basket.creationdate | uri %]">[% suborder.basket.creationdate | $KohaDates%]</td>
143 <td data-order="[% suborder.datereceived | uri %]">
144 [% IF suborder.datereceived %]
145 [% suborder.datereceived | $KohaDates %]
148 <td>[% suborder.quantityreceived | html %]</td>
149 [% SWITCH suborder.orderstatus %]
150 [%# FIXME We should only see/display Complete here, right? %]
152 <td data-order="status_1">
155 <td data-order="status_2">
158 <td data-order="status_3">
160 [% CASE 'complete' %]
161 <td data-order="status_4">
162 <span>Complete</span>
163 [% CASE 'cancelled' %]
164 <td data-order="status_5">
165 <span>Cancelled</span>
169 [% IF suborder.datereceived %][%# FIXME Should only be true, right? %]
170 [%# FIXME What if unitprice has not been filled? %]
171 [% suborder.unitprice_tax_excluded * suborder.quantity | $Price %] / [% suborder.unitprice_tax_included * suborder.quantity | $Price %]
174 <td>[% suborder.order_internalnote | html %]</td>
180 [% ELSIF (AcqCreateItem == 'receiving') %]
181 <div id="items_list" style="display:none">
182 <p><strong>Items list</strong></p>
183 <div style="width:100%;overflow:auto;">
187 <th class="noExport">Actions</th>
189 <th>Home library</th>
190 <th>Holding library</th>
191 <th>Not for loan</th>
196 <th>Inventory number</th>
209 [% UNLESS order.subscriptionid %]
210 <fieldset class="rows" id="itemfieldset">
211 <legend>Item</legend>
212 [% IF ( NoACQframework ) %]
214 No ACQ framework, using default. You should create a
215 framework with code ACQ, the items framework would be
219 <div id="outeritemblock"></div>
222 [% ELSIF (AcqCreateItem == 'ordering') %]
223 [% IF (order.items) %]
224 <div class="page-section" style="width:100%;overflow:auto">
232 <th>Home library</th>
233 <th>Current library</th>
234 <th>Not for loan</th>
239 <th>Inventory number</th>
247 [% FOREACH item IN order.items %]
248 <tr id="item_[% item.itemnumber | html %]">
249 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
250 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
251 <td>[% item.barcode | html %]</td>
252 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
253 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
254 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]</td>
255 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %]</td>
256 <td><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</span></td>
257 <td>[% item.itemcallnumber | html %]</td>
258 <td>[% item.copynumber | html %]</td>
259 <td>[% item.stocknumber | html %]</td>
260 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
261 <td>[% ItemTypes.GetDescription( item.itype ) | html %]</td>
262 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.materials', authorised_value => item.materials ) | html %]</td>
263 <td>[% item.itemnotes | html %]</td>
271 <input type="hidden" name="biblionumber" value="[% order.biblionumber | html %]" />
272 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
273 <input type="hidden" name="ordernumber" value="[% order.ordernumber | html %]" />
274 <input type="hidden" name="booksellerid" value="[% order.basket.booksellerid | html %]" />
276 <div class="col-sm-6">
277 <fieldset class="rows">
278 <legend>Accounting details</legend>
281 <label for="datereceived">Date received: </label>
282 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | html %]" class="flatpickr" />
283 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
286 <label class="required" for="bookfund">Fund: </label>
287 [% active_count = 0 %]
288 [% IF !ordernumber %]
289 [% FOREACH budget_period IN budget_loops.keys %]
290 [% FOREACH fund IN budget_loops.$budget_period.funds %]
291 [% active_count= active_count + fund.b_active %]
295 <select class="select2" id="bookfund" name="bookfund">
296 <optgroup label="Current">
297 <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 %]">
298 Keep current ([% order.fund.budget_name | html %])</option>
300 [% FOREACH budget_period_id IN budget_loops.keys %]
301 [% SET budget_period = budget_loops.$budget_period_id %]
302 [% IF budget_period.active %]
303 <optgroup label="[% budget_period.description | html %]">
305 <optgroup class="inactive_budget" label="[% budget_period.description | html %] (Inactive)">
307 [% FOREACH budget_loo IN budget_period.funds %]
308 [% level_indent_cnt = 0 %]
309 [% level_indent = "" %]
310 [% WHILE level_indent_cnt < budget_loo.b_level %]
311 [% level_indent = level_indent _ " -- " %]
312 [% level_indent_cnt = level_indent_cnt +1 %]
315 [% IF ( budget_loo.b_sel ) %]
316 [% active_count = 0 #select no other fund %]
317 <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 %]">
318 [% ELSIF active_count==1 && budget_loo.b_active %]
319 <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 %]">
321 [% bdgclass=budget_loo.b_active? "": "inactive_budget" | html %]
322 <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 %]">
324 [% level_indent | html %][% budget_loo.b_txt | html %][% IF !budget_loo.b_active %] (inactive)[% END %]
330 <span class="required">Required</span>
331 <label for="showallbudgets" style="float:none;"> Show inactive:</label>
332 <input type="checkbox" id="showallbudgets" />
334 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
336 <label for="creator">Ordered by: </label>
338 [% INCLUDE 'patron-title.inc' patron = creator %]
341 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
342 [% IF edit or order.subscriptionid %]
343 <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
345 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
348 <li><label for="quantity">Quantity received: </label>
349 [% IF order.subscriptionid %]
350 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
351 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
352 [% ELSIF AcqCreateItem == 'receiving' %]
353 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
355 [% IF ( order.quantityreceived ) %]
357 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
358 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
360 [% IF ( order.items.count ) %]
361 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
363 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
365 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
368 <input type="text" inputmode="numeric" pattern="[0-9]*" id="quantity" size="20" name="quantityrec" value="1" />
369 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
371 <div id="qtyrecerror" style="display:none">
372 <p class="error">Warning, you have entered more items than expected.
373 Items will not be created.</p>
375 [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
378 [% IF ( gst_values ) %]
380 <label for="tax_rate">Tax rate: </label>
381 <select name="tax_rate" id="tax_rate">
382 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
383 [% tax_rate = tax_rate + 0 %]
384 [% FOREACH gst IN gst_values %]
385 [% IF gst.option == tax_rate %]
386 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
388 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
394 <input type="hidden" name="tax_rate" value="0" />
397 <li><label for="rrp">Retail price: </label>
398 [% IF (invoiceincgst == 1) %]
399 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
401 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
404 <label for="replacementprice">Replacement price:</label>
405 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
408 [% IF (invoiceincgst) %]
409 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
411 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
415 <label for="unitprice">Actual cost:</label>
416 [% IF (invoiceincgst) %]
417 [% SET unitprice = order.unitprice_tax_included > 0 ? order.unitprice_tax_included : order.ecost_tax_included %]
418 <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
420 [% SET unitprice = order.unitprice_tax_included > 0 ? order.unitprice_tax_excluded : order.ecost_tax_excluded %]
421 <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
423 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
425 <li id="select_currency">
426 <label for="unitprice_currency"></label>
427 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
428 [% IF currencies.count %]
429 <select name="currency">
430 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
431 [% FOR currency IN currencies %]
432 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
437 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
438 [% IF order_vendornote %]
439 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
445 </div><div class="row"><fieldset class="action">
446 <input type="submit" value="Save" class="btn btn-primary" accesskey="w" />
447 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
448 </fieldset></div> </form>
450 This ordernumber does not exist.
454 </div> <!-- /.col-sm-10.col-sm-push-2 -->
456 <div class="col-sm-2 col-sm-pull-10">
458 [% INCLUDE 'acquisitions-menu.inc' %]
460 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
461 </div> <!-- /.row -->
462 [% MACRO jsinclude BLOCK %]
463 [% Asset.js("js/acquisitions-menu.js") | $raw %]
464 [% INCLUDE 'calendar.inc' %]
465 [% Asset.js("js/additem.js") | $raw %]
466 [% Asset.js("js/cataloging.js") | $raw %]
467 [% INCLUDE 'select2.inc' %]
469 function Check(form) {
470 [% IF (AcqCreateItem == 'receiving') %]
471 var total_errors = CheckMandatorySubfields(form);
472 if (total_errors != 0) {
473 var alertString = _("Form not submitted because of the following problem(s)");
474 alertString += "\n------------------------------------------------------------------------------------\n";
475 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
480 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
481 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
485 // Remove last itemblock if it is not in items_list
486 var lastitemblock = $("#outeritemblock > div:last");
487 var tobedeleted = true;
488 var listitems = $("#items_list tr");
489 $(listitems).each(function(){
490 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
495 $(lastitemblock).remove();
498 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
499 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
501 $(lastitemblock).appendTo("#outeritemblock");
507 if( $("#quantity").val() < 1 ) {
508 alert(_("You must receive at least one item"));
515 [% IF (AcqCreateItem == 'ordering') %]
516 var items_columns = [null, null, 'barcode', 'homebranchname',
517 'holdingbranchname', 'notforloan', 'restricted', 'location',
518 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
519 'itemtype', 'materials', 'itemnotes'];
521 function PopupEditPage(biblionumber, itemnumber) {
522 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
523 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
524 var w = window.open(url);
525 var watchClose = setInterval(function() {
527 clearTimeout(watchClose);
528 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
530 'itemnumber': itemnumber
533 var tds = $("#item_"+itemnumber+" td");
534 for(var i=2; i<tds.length; i++) {
535 var column = items_columns[i];
536 var text = item[column];
537 if ( text == null ) text = '';
538 $(tds[i]).text(text);
546 function CalcQtyToReceive() {
547 var qty = $("input[name='items_to_receive']:checked").length;
548 $("#quantity").val(qty);
551 function CheckNItems(n) {
552 $("input[name='items_to_receive']").each(function() {
553 $(this).prop('checked', false);
555 $("input[name='items_to_receive']:lt("+n+")").each(function () {
556 $(this).prop('checked', true);
561 $(document).ready(function() {
563 //keep a copy of all budgets before removing the inactives
564 disabledBudgetsCopy = $('#bookfund').html();
565 $('#bookfund .inactive_budget').remove();
567 $('#showallbudgets').click(function() {
568 if ($(this).is(":checked")) {
569 $('#bookfund').html(disabledBudgetsCopy); //Puts back all the funds
572 $('#bookfund .inactive_budget').remove();
576 [% IF (AcqCreateItem == 'receiving') %]
577 cloneItemBlock(0, '[% Koha.Preference('UniqueItemFields') | html %]');
578 [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
579 $("input[name='items_to_receive']").change(function() {
583 $("#quantity").keyup(function() {
584 var qty = parseInt($("#quantity").val());
585 var qtyto = parseInt($("#quantity_to_receive").val());
587 $("#qtyrecerror").show();
589 $("#qtyrecerror").hide();
591 CheckNItems($(this).val());
595 $("input[name='change_currency']").on("change", function(){
596 if ( $(this).is(":checked") ) {
597 $("#select_currency").show();
598 $("#unitprice").prop("readonly", "true");
600 $("#select_currency").hide();
601 $("#unitprice").prop("readonly", "");
605 function update_unitprice() {
606 var rate = Number($("select[name='currency'] option:selected").val());
607 var unitprice = $("#unitprice_currency").val();
608 var new_unitprice = Number( unitprice * rate ).toFixed(2);
609 $("#unitprice").val(new_unitprice);
611 $("select[name='currency']").on("change", function(){update_unitprice()} );
612 $("#unitprice_currency").on("change", function(){update_unitprice()} );
614 [% IF other_reason %]
615 $(".select-reason").hide();
616 $(".select-reason").find("option[value='other']").attr("selected","selected");
617 $("#other_reason").show();
619 $("#other_reason").hide();
621 $(".select-reason").change(function(){
622 if($(this).val() == "other"){
624 $("#other_reason").show();
627 $("a[href*=back]").click(function(){
628 $(".select-reason").show().find("option[value='']").attr("selected","selected");
629 $("#other_reason").hide();
636 [% INCLUDE 'intranet-bottom.inc' %]