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"><i class="fa fa-home"></i></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) %]
230 <div 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>
290 <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
291 <option value="">Keep current ([% budget_period_description | html %] - [% order.fund.budget_name | html %])</option>
292 [% FOREACH period IN budget_loop %]
293 <optgroup label="[% period.description | html %]">
294 [% FOREACH fund IN period.funds %]
295 [% IF ( fund.b_sel ) %]
296 <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
298 <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
304 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
306 <label for="creator">Ordered by: </label>
308 [% INCLUDE 'patron-title.inc' patron = creator %]
311 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
312 [% IF edit or order.subscriptionid %]
313 <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
315 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
318 <li><label for="quantity">Quantity received: </label>
319 [% IF order.subscriptionid %]
320 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
321 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
322 [% ELSIF AcqCreateItem == 'receiving' %]
323 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
325 [% IF ( order.quantityreceived ) %]
327 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
328 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
330 [% IF ( order.items.count ) %]
331 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
333 <input type="text" inputmode="numeric" pattern="[0-9]*" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
335 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
338 <input type="text" inputmode="numeric" pattern="[0-9]*" id="quantity" size="20" name="quantityrec" value="1" />
339 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
341 <div id="qtyrecerror" style="display:none">
342 <p class="error">Warning, you have entered more items than expected.
343 Items will not be created.</p>
345 [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
348 [% IF ( gst_values ) %]
350 <label for="tax_rate">Tax rate: </label>
351 <select name="tax_rate" id="tax_rate">
352 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
353 [% tax_rate = tax_rate + 0 %]
354 [% FOREACH gst IN gst_values %]
355 [% IF gst.option == tax_rate %]
356 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
358 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
364 <input type="hidden" name="tax_rate" value="0" />
367 <li><label for="rrp">Retail price: </label>
368 [% IF (invoiceincgst == 1) %]
369 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
371 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
374 <label for="replacementprice">Replacement price:</label>
375 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
378 [% IF (invoiceincgst) %]
379 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
381 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
385 <label for="unitprice">Actual cost:</label>
386 [% IF (invoiceincgst) %]
387 [% SET unitprice = order.unitprice_tax_included > 0 ? order.unitprice_tax_included : order.ecost_tax_included %]
388 <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
390 [% SET unitprice = order.unitprice_tax_included > 0 ? order.unitprice_tax_excluded : order.ecost_tax_excluded %]
391 <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
393 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
395 <li id="select_currency">
396 <label for="unitprice_currency"></label>
397 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
398 [% IF currencies.count %]
399 <select name="currency">
400 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
401 [% FOR currency IN currencies %]
402 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
407 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
408 [% IF order_vendornote %]
409 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
415 </div><div class="row"><fieldset class="action">
416 <input type="submit" value="Save" class="button" accesskey="w" />
417 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
418 </fieldset></div> </form>
420 This ordernumber does not exist.
424 </div> <!-- /.col-sm-10.col-sm-push-2 -->
426 <div class="col-sm-2 col-sm-pull-10">
428 [% INCLUDE 'acquisitions-menu.inc' %]
430 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
431 </div> <!-- /.row -->
432 [% MACRO jsinclude BLOCK %]
433 [% Asset.js("js/acquisitions-menu.js") | $raw %]
434 [% INCLUDE 'calendar.inc' %]
435 [% Asset.js("js/additem.js") | $raw %]
436 [% Asset.js("js/cataloging.js") | $raw %]
438 function Check(form) {
439 [% IF (AcqCreateItem == 'receiving') %]
440 var total_errors = CheckMandatorySubfields(form);
441 if (total_errors != 0) {
442 var alertString = _("Form not submitted because of the following problem(s)");
443 alertString += "\n------------------------------------------------------------------------------------\n";
444 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
449 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
450 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
454 // Remove last itemblock if it is not in items_list
455 var lastitemblock = $("#outeritemblock > div:last");
456 var tobedeleted = true;
457 var listitems = $("#items_list tr");
458 $(listitems).each(function(){
459 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
464 $(lastitemblock).remove();
467 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
468 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
470 $(lastitemblock).appendTo("#outeritemblock");
476 if( $("#quantity").val() < 1 ) {
477 alert(_("You must receive at least one item"));
484 [% IF (AcqCreateItem == 'ordering') %]
485 var items_columns = [null, null, 'barcode', 'homebranchname',
486 'holdingbranchname', 'notforloan', 'restricted', 'location',
487 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
488 'itemtype', 'materials', 'itemnotes'];
490 function PopupEditPage(biblionumber, itemnumber) {
491 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
492 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
493 var w = window.open(url);
494 var watchClose = setInterval(function() {
496 clearTimeout(watchClose);
497 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
499 'itemnumber': itemnumber
502 var tds = $("#item_"+itemnumber+" td");
503 for(var i=2; i<tds.length; i++) {
504 var column = items_columns[i];
505 var text = item[column];
506 if ( text == null ) text = '';
507 $(tds[i]).text(text);
515 function CalcQtyToReceive() {
516 var qty = $("input[name='items_to_receive']:checked").length;
517 $("#quantity").val(qty);
520 function CheckNItems(n) {
521 $("input[name='items_to_receive']").each(function() {
522 $(this).prop('checked', false);
524 $("input[name='items_to_receive']:lt("+n+")").each(function () {
525 $(this).prop('checked', true);
530 $(document).ready(function() {
531 [% IF (AcqCreateItem == 'receiving') %]
532 cloneItemBlock(0, '[% Koha.Preference('UniqueItemFields') | html %]');
533 [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
534 $("input[name='items_to_receive']").change(function() {
538 $("#quantity").keyup(function() {
539 var qty = parseInt($("#quantity").val());
540 var qtyto = parseInt($("#quantity_to_receive").val());
542 $("#qtyrecerror").show();
544 $("#qtyrecerror").hide();
546 CheckNItems($(this).val());
550 $("input[name='change_currency']").on("change", function(){
551 if ( $(this).is(":checked") ) {
552 $("#select_currency").show();
553 $("#unitprice").prop("readonly", "true");
555 $("#select_currency").hide();
556 $("#unitprice").prop("readonly", "");
560 function update_unitprice() {
561 var rate = Number($("select[name='currency'] option:selected").val());
562 var unitprice = $("#unitprice_currency").val();
563 var new_unitprice = Number( unitprice * rate ).toFixed(2);
564 $("#unitprice").val(new_unitprice);
566 $("select[name='currency']").on("change", function(){update_unitprice()} );
567 $("#unitprice_currency").on("change", function(){update_unitprice()} );
569 [% IF other_reason %]
570 $(".select-reason").hide();
571 $(".select-reason").find("option[value='other']").attr("selected","selected");
572 $("#other_reason").show();
574 $("#other_reason").hide();
576 $(".select-reason").change(function(){
577 if($(this).val() == "other"){
579 $("#other_reason").show();
582 $("a[href*=back]").click(function(){
583 $(".select-reason").show().find("option[value='']").attr("selected","selected");
584 $("#other_reason").hide();
591 [% INCLUDE 'intranet-bottom.inc' %]