5 [% USE AuthorisedValues %]
9 [% INCLUDE 'doc-head-open.inc' %]
10 <title>Koha › Acquisitions › Receipt summary for : [% name | html %] [% IF ( invoice ) %]invoice, [% invoice | html %][% END %]</title>
11 [% INCLUDE 'doc-head-close.inc' %]
14 <body id="acq_orderreceive" class="acq">
15 [% INCLUDE 'header.inc' %]
16 [% INCLUDE 'acquisitions-search.inc' %]
18 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% order.basket.booksellerid | html %]">[% name | html %]</a> › Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]][% END %] (order #[% order.ordernumber | html %])</div>
20 <div class="main container-fluid">
22 [% AcqCreateItem = order.basket.effective_create_items %]
23 <div class="col-sm-10 col-sm-push-2">
26 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber | html %])</h1>
29 <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
31 <div class="col-sm-6">
32 <div class="dialog alert order_error" style="display:none"></div>
34 <fieldset class="rows">
35 <legend>Catalog details</legend>
36 <ol><li><span class="label">Title: </span><span class="title">[% order.biblio.title | html %]</span></li>
37 <li> <span class="label">Author: </span>
38 [% order.biblio.author | html %]</li>
39 <li><span class="label">Copyright: </span>
40 [% order.biblio.copyrightdate | html %]</li>
41 <li> <span class="label">ISBN: </span>
42 [% order.biblio.biblioitem.isbn | html %]</li>
43 <li> <span class="label">Series: </span>
44 [% order.biblio.seriestitle | html %]</li>
49 <fieldset class="rows">
50 <legend>Suggestion</legend>
53 <span class="label">Suggested by: </span>
54 [% 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>)
55 [% IF suggestion.reason %]
57 <span class="label">Reason:</span>
58 [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
59 [% SET other_reason = 1 %]
60 <select class="select-reason" id="reason" name="reason">
61 <option value=""> -- Choose a reason -- </option>
62 [% FOREACH reason IN suggestion_reasons %]
63 [% IF reason.lib == suggestion.reason %]
64 <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
65 [% SET other_reason = 0 %]
67 <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
70 <option value="other">Others...</option>
73 <span id="other_reason" name="other_reason">
75 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
77 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
79 <a href="#back">Cancel</a>
82 <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
90 [% IF order.subscriptionid and orders.count %]
91 <fieldset class="rows">
92 <legend>Receipt history for this subscription</legend>
98 <th class="title-string">Creation date</th>
99 <th class="title-string">Receive date</th>
100 <th>Quantity received</th>
101 <th class="title-string">Status</th>
102 <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
103 <th>Internal note</th>
107 [% FOR suborder IN orders %]
110 [% IF suborder.invoice %]
111 [% IF CAN_user_acquisition %]
112 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% suborder.invoiceid | uri %]" title="Invoice detail page">
113 [% suborder.invoice.invoicenumber | html %]</a>
115 [% suborder.invoice.invoicenumber | html %]
119 <td>[% suborder.ordernumber | html %]</td>
120 <td><span title="[% suborder.basket.creationdate | uri %]">[% suborder.basket.creationdate | $KohaDates%]</span></td>
121 <td>[% IF suborder.datereceived %]<span title="[% suborder.datereceived | uri %]">[% suborder.datereceived | $KohaDates %]</span>[% END %]</td>
122 <td>[% suborder.quantityreceived | html %]</td>
124 [% SWITCH suborder.orderstatus %]
125 [%# FIXME We should only see/display Complete here, right? %]
126 [% CASE 'new' %]<span title="status_1">New</span>
127 [% CASE 'ordered' %]<span title="status_2">Ordered</span>
128 [% CASE 'partial' %]<span title="status_3">Partial</span>
129 [% CASE 'complete' %]<span title="status_4">Complete</span>
130 [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
134 [% IF suborder.datereceived %][%# FIXME Should only be true, right? %]
135 [%# FIXME What if unitprice has not been filled? %]
136 [% suborder.unitprice_tax_excluded * suborder.quantity | $Price %] / [% suborder.unitprice_tax_included * suborder.quantity | $Price %]
139 <td>[% suborder.order_internalnote | html %]</td>
145 [% ELSIF (AcqCreateItem == 'receiving') %]
146 <div id="items_list" style="display:none">
147 <p><strong>Items list</strong></p>
148 <div style="width:100%;overflow:auto;">
154 <th>Home library</th>
155 <th>Holding library</th>
156 <th>Not for loan</th>
161 <th>Inventory number</th>
174 [% UNLESS order.subscriptionid %]
175 <fieldset class="rows" id="itemfieldset">
176 <legend>Item</legend>
177 [% IF ( NoACQframework ) %]
179 No ACQ framework, using default. You should create a
180 framework with code ACQ, the items framework would be
184 <div id="outeritemblock"></div>
187 [% ELSIF (AcqCreateItem == 'ordering') %]
188 [% IF (order.items.size) %]
190 <div style="width:100%;overflow:auto">
197 <th>Home library</th>
198 <th>Current library</th>
199 <th>Not for loan</th>
204 <th>Inventory number</th>
212 [% FOREACH item IN order.items %]
213 <tr id="item_[% item.itemnumber | html %]">
214 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
215 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
216 <td>[% item.barcode | html %]</td>
217 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
218 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
219 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]</td>
220 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %]</td>
221 <td><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</span></td>
222 <td>[% item.itemcallnumber | html %]</td>
223 <td>[% item.copynumber | html %]</td>
224 <td>[% item.stocknumber | html %]</td>
225 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
226 <td>[% ItemTypes.GetDescription( item.itype ) | html %]</td>
227 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.materials', authorised_value => item.materials ) | html %]</td>
228 <td>[% item.itemnotes | html %]</td>
236 <input type="hidden" name="biblionumber" value="[% order.biblionumber | html %]" />
237 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
238 <input type="hidden" name="ordernumber" value="[% order.ordernumber | html %]" />
239 <input type="hidden" name="booksellerid" value="[% order.basket.booksellerid | html %]" />
241 <div class="col-sm-6">
242 <fieldset class="rows">
243 <legend>Accounting details</legend>
246 <label for="datereceived">Date received: </label>
247 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
249 <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
250 <option value="">Keep current ([% budget_period_description | html %] - [% order.fund.budget_name | html %])</option>
251 [% FOREACH period IN budget_loop %]
252 <optgroup label="[% period.description | html %]">
253 [% FOREACH fund IN period.funds %]
254 [% IF ( fund.b_sel ) %]
255 <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
257 <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
263 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
265 <label for="creator">Ordered by: </label>
267 [% INCLUDE 'patron-title.inc' patron = creator %]
270 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
271 [% IF edit or order.subscriptionid %]
272 <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
274 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
277 <li><label for="quantity">Quantity received: </label>
278 [% IF order.subscriptionid %]
279 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
280 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
281 [% ELSIF AcqCreateItem == 'receiving' %]
282 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
284 [% IF ( order.quantityreceived ) %]
286 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
287 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
289 [% IF ( order.items.count ) %]
290 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
292 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
294 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
297 <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
298 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
300 <div id="qtyrecerror" style="display:none">
301 <p class="error">Warning, you have entered more items than expected.
302 Items will not be created.</p>
304 [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
307 [% IF ( gst_values ) %]
309 <label for="tax_rate">Tax rate: </label>
310 <select name="tax_rate" id="tax_rate">
311 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
312 [% FOREACH gst IN gst_values %]
313 [% IF gst.option == tax_rate %]
314 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
316 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
322 <input type="hidden" name="tax_rate" value="0" />
325 <li><label for="rrp">Retail price: </label>
326 [% IF (invoiceincgst == 1) %]
327 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
329 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
332 <label for="replacementprice">Replacement price:</label>
333 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
336 [% IF (invoiceincgst) %]
337 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
339 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
343 <label for="unitprice">Actual cost:</label>
344 [% IF (invoiceincgst) %]
345 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_included | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
347 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_excluded | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
349 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
351 <li id="select_currency">
352 <label for="unitprice_currency"></label>
353 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
354 [% IF currencies.count %]
355 <select name="currency">
356 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
357 [% FOR currency IN currencies %]
358 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
363 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
364 [% IF order_vendornote %]
365 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
371 </div><div class="row"><fieldset class="action">
372 <input type="submit" value="Save" class="button" accesskey="w" />
373 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&sticky_filters=1">Cancel</a>
374 </fieldset></div> </form>
376 This ordernumber does not exist.
380 </div> <!-- /.col-sm-10.col-sm-push-2 -->
382 <div class="col-sm-2 col-sm-pull-10">
384 [% INCLUDE 'acquisitions-menu.inc' %]
386 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
387 </div> <!-- /.row -->
388 [% MACRO jsinclude BLOCK %]
389 [% Asset.js("js/acquisitions-menu.js") | $raw %]
390 [% INCLUDE 'calendar.inc' %]
391 [% Asset.js("js/additem.js") | $raw %]
392 [% Asset.js("js/cataloging.js") | $raw %]
394 function Check(form) {
395 [% IF (AcqCreateItem == 'receiving') %]
396 var total_errors = CheckMandatorySubfields(form);
397 if (total_errors != 0) {
398 var alertString = _("Form not submitted because of the following problem(s)");
399 alertString += "\n------------------------------------------------------------------------------------\n";
400 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
405 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
406 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
410 // Remove last itemblock if it is not in items_list
411 var lastitemblock = $("#outeritemblock > div:last");
412 var tobedeleted = true;
413 var listitems = $("#items_list tr");
414 $(listitems).each(function(){
415 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
420 $(lastitemblock).remove();
423 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
424 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
426 $(lastitemblock).appendTo("#outeritemblock");
435 [% IF (AcqCreateItem == 'ordering') %]
436 var items_columns = [null, null, 'barcode', 'homebranchname',
437 'holdingbranchname', 'notforloan', 'restricted', 'location',
438 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
439 'itemtype', 'materials', 'itemnotes'];
441 function PopupEditPage(biblionumber, itemnumber) {
442 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
443 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
444 var w = window.open(url);
445 var watchClose = setInterval(function() {
447 clearTimeout(watchClose);
448 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
450 'itemnumber': itemnumber
453 var tds = $("#item_"+itemnumber+" td");
454 for(var i=2; i<tds.length; i++) {
455 var column = items_columns[i];
456 var text = item[column];
457 if ( text == null ) text = '';
458 $(tds[i]).text(text);
466 function CalcQtyToReceive() {
467 var qty = $("input[name='items_to_receive']:checked").length;
468 $("#quantity").val(qty);
471 function CheckNItems(n) {
472 $("input[name='items_to_receive']").each(function() {
473 $(this).prop('checked', false);
475 $("input[name='items_to_receive']:lt("+n+")").each(function () {
476 $(this).prop('checked', true);
481 $(document).ready(function() {
482 [% IF (AcqCreateItem == 'receiving') %]
483 cloneItemBlock(0, '[% UniqueItemFields | html %]');
484 [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
485 $("input[name='items_to_receive']").change(function() {
489 $("#quantity").keyup(function() {
490 var qty = parseInt($("#quantity").val());
491 var qtyto = parseInt($("#quantity_to_receive").val());
493 $("#qtyrecerror").show();
495 $("#qtyrecerror").hide();
497 CheckNItems($(this).val());
501 $("input[name='change_currency']").on("change", function(){
502 if ( $(this).is(":checked") ) {
503 $("#select_currency").show();
504 $("#unitprice").prop("readonly", "true");
506 $("#select_currency").hide();
507 $("#unitprice").prop("readonly", "");
511 function update_unitprice() {
512 var rate = Number($("select[name='currency'] option:selected").val());
513 var unitprice = $("#unitprice_currency").val();
514 var new_unitprice = Number( unitprice * rate ).toFixed(2);
515 $("#unitprice").val(new_unitprice);
517 $("select[name='currency']").on("change", function(){update_unitprice()} );
518 $("#unitprice_currency").on("change", function(){update_unitprice()} );
520 [% IF other_reason %]
521 $(".select-reason").hide();
522 $(".select-reason").find("option[value='other']").attr("selected","selected");
523 $("#other_reason").show();
525 $("#other_reason").hide();
527 $(".select-reason").change(function(){
528 if($(this).val() == "other"){
530 $("#other_reason").show();
533 $("a[href*=back]").click(function(){
534 $(".select-reason").show().find("option[value='']").attr("selected","selected");
535 $("#other_reason").hide();
542 [% INCLUDE 'intranet-bottom.inc' %]