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 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 class="title-string">Creation date</th>
119 <th class="title-string">Receive date</th>
120 <th>Quantity received</th>
121 <th class="title-string">Status</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><span title="[% suborder.basket.creationdate | uri %]">[% suborder.basket.creationdate | $KohaDates%]</span></td>
141 <td>[% IF suborder.datereceived %]<span title="[% suborder.datereceived | uri %]">[% suborder.datereceived | $KohaDates %]</span>[% END %]</td>
142 <td>[% suborder.quantityreceived | html %]</td>
144 [% SWITCH suborder.orderstatus %]
145 [%# FIXME We should only see/display Complete here, right? %]
146 [% CASE 'new' %]<span title="status_1">New</span>
147 [% CASE 'ordered' %]<span title="status_2">Ordered</span>
148 [% CASE 'partial' %]<span title="status_3">Partial</span>
149 [% CASE 'complete' %]<span title="status_4">Complete</span>
150 [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
154 [% IF suborder.datereceived %][%# FIXME Should only be true, right? %]
155 [%# FIXME What if unitprice has not been filled? %]
156 [% suborder.unitprice_tax_excluded * suborder.quantity | $Price %] / [% suborder.unitprice_tax_included * suborder.quantity | $Price %]
159 <td>[% suborder.order_internalnote | html %]</td>
165 [% ELSIF (AcqCreateItem == 'receiving') %]
166 <div id="items_list" style="display:none">
167 <p><strong>Items list</strong></p>
168 <div style="width:100%;overflow:auto;">
172 <th class="noExport">Actions</th>
174 <th>Home library</th>
175 <th>Holding library</th>
176 <th>Not for loan</th>
181 <th>Inventory number</th>
194 [% UNLESS order.subscriptionid %]
195 <fieldset class="rows" id="itemfieldset">
196 <legend>Item</legend>
197 [% IF ( NoACQframework ) %]
199 No ACQ framework, using default. You should create a
200 framework with code ACQ, the items framework would be
204 <div id="outeritemblock"></div>
207 [% ELSIF (AcqCreateItem == 'ordering') %]
208 [% IF (order.items) %]
210 <div style="width:100%;overflow:auto">
217 <th>Home library</th>
218 <th>Current library</th>
219 <th>Not for loan</th>
224 <th>Inventory number</th>
232 [% FOREACH item IN order.items %]
233 <tr id="item_[% item.itemnumber | html %]">
234 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
235 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
236 <td>[% item.barcode | html %]</td>
237 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
238 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
239 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]</td>
240 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %]</td>
241 <td><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</span></td>
242 <td>[% item.itemcallnumber | html %]</td>
243 <td>[% item.copynumber | html %]</td>
244 <td>[% item.stocknumber | html %]</td>
245 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
246 <td>[% ItemTypes.GetDescription( item.itype ) | html %]</td>
247 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.materials', authorised_value => item.materials ) | html %]</td>
248 <td>[% item.itemnotes | html %]</td>
256 <input type="hidden" name="biblionumber" value="[% order.biblionumber | html %]" />
257 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
258 <input type="hidden" name="ordernumber" value="[% order.ordernumber | html %]" />
259 <input type="hidden" name="booksellerid" value="[% order.basket.booksellerid | html %]" />
261 <div class="col-sm-6">
262 <fieldset class="rows">
263 <legend>Accounting details</legend>
266 <label for="datereceived">Date received: </label>
267 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
269 <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
270 <option value="">Keep current ([% budget_period_description | html %] - [% order.fund.budget_name | html %])</option>
271 [% FOREACH period IN budget_loop %]
272 <optgroup label="[% period.description | html %]">
273 [% FOREACH fund IN period.funds %]
274 [% IF ( fund.b_sel ) %]
275 <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
277 <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
283 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
285 <label for="creator">Ordered by: </label>
287 [% INCLUDE 'patron-title.inc' patron = creator %]
290 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
291 [% IF edit or order.subscriptionid %]
292 <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
294 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
297 <li><label for="quantity">Quantity received: </label>
298 [% IF order.subscriptionid %]
299 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
300 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
301 [% ELSIF AcqCreateItem == 'receiving' %]
302 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
304 [% IF ( order.quantityreceived ) %]
306 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
307 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
309 [% IF ( order.items.count ) %]
310 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
312 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
314 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
317 <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
318 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
320 <div id="qtyrecerror" style="display:none">
321 <p class="error">Warning, you have entered more items than expected.
322 Items will not be created.</p>
324 [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
327 [% IF ( gst_values ) %]
329 <label for="tax_rate">Tax rate: </label>
330 <select name="tax_rate" id="tax_rate">
331 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
332 [% FOREACH gst IN gst_values %]
333 [% IF gst.option == tax_rate %]
334 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
336 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
342 <input type="hidden" name="tax_rate" value="0" />
345 <li><label for="rrp">Retail price: </label>
346 [% IF (invoiceincgst == 1) %]
347 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
349 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
352 <label for="replacementprice">Replacement price:</label>
353 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
356 [% IF (invoiceincgst) %]
357 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
359 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
363 <label for="unitprice">Actual cost:</label>
364 [% IF (invoiceincgst) %]
365 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_included | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
367 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_excluded | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
369 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
371 <li id="select_currency">
372 <label for="unitprice_currency"></label>
373 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
374 [% IF currencies.count %]
375 <select name="currency">
376 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
377 [% FOR currency IN currencies %]
378 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
383 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
384 [% IF order_vendornote %]
385 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
391 </div><div class="row"><fieldset class="action">
392 <input type="submit" value="Save" class="button" accesskey="w" />
393 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
394 </fieldset></div> </form>
396 This ordernumber does not exist.
400 </div> <!-- /.col-sm-10.col-sm-push-2 -->
402 <div class="col-sm-2 col-sm-pull-10">
404 [% INCLUDE 'acquisitions-menu.inc' %]
406 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
407 </div> <!-- /.row -->
408 [% MACRO jsinclude BLOCK %]
409 [% Asset.js("js/acquisitions-menu.js") | $raw %]
410 [% INCLUDE 'calendar.inc' %]
411 [% Asset.js("js/additem.js") | $raw %]
412 [% Asset.js("js/cataloging.js") | $raw %]
414 function Check(form) {
415 [% IF (AcqCreateItem == 'receiving') %]
416 var total_errors = CheckMandatorySubfields(form);
417 if (total_errors != 0) {
418 var alertString = _("Form not submitted because of the following problem(s)");
419 alertString += "\n------------------------------------------------------------------------------------\n";
420 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
425 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
426 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
430 // Remove last itemblock if it is not in items_list
431 var lastitemblock = $("#outeritemblock > div:last");
432 var tobedeleted = true;
433 var listitems = $("#items_list tr");
434 $(listitems).each(function(){
435 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
440 $(lastitemblock).remove();
443 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
444 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
446 $(lastitemblock).appendTo("#outeritemblock");
452 if( $("#quantity").val() < 1 ) {
453 alert(_("You must receive at least one item"));
460 [% IF (AcqCreateItem == 'ordering') %]
461 var items_columns = [null, null, 'barcode', 'homebranchname',
462 'holdingbranchname', 'notforloan', 'restricted', 'location',
463 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
464 'itemtype', 'materials', 'itemnotes'];
466 function PopupEditPage(biblionumber, itemnumber) {
467 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
468 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
469 var w = window.open(url);
470 var watchClose = setInterval(function() {
472 clearTimeout(watchClose);
473 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
475 'itemnumber': itemnumber
478 var tds = $("#item_"+itemnumber+" td");
479 for(var i=2; i<tds.length; i++) {
480 var column = items_columns[i];
481 var text = item[column];
482 if ( text == null ) text = '';
483 $(tds[i]).text(text);
491 function CalcQtyToReceive() {
492 var qty = $("input[name='items_to_receive']:checked").length;
493 $("#quantity").val(qty);
496 function CheckNItems(n) {
497 $("input[name='items_to_receive']").each(function() {
498 $(this).prop('checked', false);
500 $("input[name='items_to_receive']:lt("+n+")").each(function () {
501 $(this).prop('checked', true);
506 $(document).ready(function() {
507 [% IF (AcqCreateItem == 'receiving') %]
508 cloneItemBlock(0, '[% Koha.Preference('UniqueItemFields') | html %]');
509 [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
510 $("input[name='items_to_receive']").change(function() {
514 $("#quantity").keyup(function() {
515 var qty = parseInt($("#quantity").val());
516 var qtyto = parseInt($("#quantity_to_receive").val());
518 $("#qtyrecerror").show();
520 $("#qtyrecerror").hide();
522 CheckNItems($(this).val());
526 $("input[name='change_currency']").on("change", function(){
527 if ( $(this).is(":checked") ) {
528 $("#select_currency").show();
529 $("#unitprice").prop("readonly", "true");
531 $("#select_currency").hide();
532 $("#unitprice").prop("readonly", "");
536 function update_unitprice() {
537 var rate = Number($("select[name='currency'] option:selected").val());
538 var unitprice = $("#unitprice_currency").val();
539 var new_unitprice = Number( unitprice * rate ).toFixed(2);
540 $("#unitprice").val(new_unitprice);
542 $("select[name='currency']").on("change", function(){update_unitprice()} );
543 $("#unitprice_currency").on("change", function(){update_unitprice()} );
545 [% IF other_reason %]
546 $(".select-reason").hide();
547 $(".select-reason").find("option[value='other']").attr("selected","selected");
548 $("#other_reason").show();
550 $("#other_reason").hide();
552 $(".select-reason").change(function(){
553 if($(this).val() == "other"){
555 $("#other_reason").show();
558 $("a[href*=back]").click(function(){
559 $(".select-reason").show().find("option[value='']").attr("selected","selected");
560 $("#other_reason").hide();
567 [% INCLUDE 'intranet-bottom.inc' %]