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 <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>
21 <div class="main container-fluid">
23 [% AcqCreateItem = order.basket.effective_create_items %]
24 <div class="col-sm-10 col-sm-push-2">
27 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber | html %])</h1>
30 <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
32 <div class="col-sm-6">
33 <div class="dialog alert order_error" style="display:none"></div>
35 <fieldset class="rows">
36 <legend>Catalog details</legend>
37 <ol><li><span class="label">Title: </span><span class="title">[% order.biblio.title | html %]</span></li>
38 <li> <span class="label">Author: </span>
39 [% order.biblio.author | html %]</li>
40 <li><span class="label">Copyright: </span>
41 [% order.biblio.copyrightdate | html %]</li>
42 <li> <span class="label">ISBN: </span>
43 [% order.biblio.biblioitem.isbn | html %]</li>
44 <li> <span class="label">Series: </span>
45 [% order.biblio.seriestitle | html %]</li>
50 <fieldset class="rows">
51 <legend>Suggestion</legend>
54 <span class="label">Suggested by: </span>
55 [% 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>)
56 [% IF suggestion.reason %]
58 <span class="label">Reason:</span>
59 [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
60 [% SET other_reason = 1 %]
61 <select class="select-reason" id="reason" name="reason">
62 <option value=""> -- Choose a reason -- </option>
63 [% FOREACH reason IN suggestion_reasons %]
64 [% IF reason.lib == suggestion.reason %]
65 <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
66 [% SET other_reason = 0 %]
68 <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
71 <option value="other">Others...</option>
74 <span id="other_reason" name="other_reason">
76 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
78 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
80 <a href="#back">Cancel</a>
83 <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
91 [% IF order.subscriptionid and orders.count %]
92 <fieldset class="rows">
93 <legend>Receipt history for this subscription</legend>
99 <th class="title-string">Creation date</th>
100 <th class="title-string">Receive date</th>
101 <th>Quantity received</th>
102 <th class="title-string">Status</th>
103 <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
104 <th>Internal note</th>
108 [% FOR suborder IN orders %]
111 [% IF suborder.invoice %]
112 [% IF CAN_user_acquisition %]
113 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% suborder.invoiceid | uri %]" title="Invoice detail page">
114 [% suborder.invoice.invoicenumber | html %]</a>
116 [% suborder.invoice.invoicenumber | html %]
120 <td>[% suborder.ordernumber | html %]</td>
121 <td><span title="[% suborder.basket.creationdate | uri %]">[% suborder.basket.creationdate | $KohaDates%]</span></td>
122 <td>[% IF suborder.datereceived %]<span title="[% suborder.datereceived | uri %]">[% suborder.datereceived | $KohaDates %]</span>[% END %]</td>
123 <td>[% suborder.quantityreceived | html %]</td>
125 [% SWITCH suborder.orderstatus %]
126 [%# FIXME We should only see/display Complete here, right? %]
127 [% CASE 'new' %]<span title="status_1">New</span>
128 [% CASE 'ordered' %]<span title="status_2">Ordered</span>
129 [% CASE 'partial' %]<span title="status_3">Partial</span>
130 [% CASE 'complete' %]<span title="status_4">Complete</span>
131 [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
135 [% IF suborder.datereceived %][%# FIXME Should only be true, right? %]
136 [%# FIXME What if unitprice has not been filled? %]
137 [% suborder.unitprice_tax_excluded * suborder.quantity | $Price %] / [% suborder.unitprice_tax_included * suborder.quantity | $Price %]
140 <td>[% suborder.order_internalnote | html %]</td>
146 [% ELSIF (AcqCreateItem == 'receiving') %]
147 <div id="items_list" style="display:none">
148 <p><strong>Items list</strong></p>
149 <div style="width:100%;overflow:auto;">
153 <th class="noExport">Actions</th>
155 <th>Home library</th>
156 <th>Holding library</th>
157 <th>Not for loan</th>
162 <th>Inventory number</th>
175 [% UNLESS order.subscriptionid %]
176 <fieldset class="rows" id="itemfieldset">
177 <legend>Item</legend>
178 [% IF ( NoACQframework ) %]
180 No ACQ framework, using default. You should create a
181 framework with code ACQ, the items framework would be
185 <div id="outeritemblock"></div>
188 [% ELSIF (AcqCreateItem == 'ordering') %]
189 [% IF (order.items) %]
191 <div style="width:100%;overflow:auto">
198 <th>Home library</th>
199 <th>Current library</th>
200 <th>Not for loan</th>
205 <th>Inventory number</th>
213 [% FOREACH item IN order.items %]
214 <tr id="item_[% item.itemnumber | html %]">
215 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
216 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
217 <td>[% item.barcode | html %]</td>
218 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
219 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
220 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]</td>
221 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %]</td>
222 <td><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</span></td>
223 <td>[% item.itemcallnumber | html %]</td>
224 <td>[% item.copynumber | html %]</td>
225 <td>[% item.stocknumber | html %]</td>
226 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
227 <td>[% ItemTypes.GetDescription( item.itype ) | html %]</td>
228 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.materials', authorised_value => item.materials ) | html %]</td>
229 <td>[% item.itemnotes | html %]</td>
237 <input type="hidden" name="biblionumber" value="[% order.biblionumber | html %]" />
238 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
239 <input type="hidden" name="ordernumber" value="[% order.ordernumber | html %]" />
240 <input type="hidden" name="booksellerid" value="[% order.basket.booksellerid | html %]" />
242 <div class="col-sm-6">
243 <fieldset class="rows">
244 <legend>Accounting details</legend>
247 <label for="datereceived">Date received: </label>
248 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
250 <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
251 <option value="">Keep current ([% budget_period_description | html %] - [% order.fund.budget_name | html %])</option>
252 [% FOREACH period IN budget_loop %]
253 <optgroup label="[% period.description | html %]">
254 [% FOREACH fund IN period.funds %]
255 [% IF ( fund.b_sel ) %]
256 <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
258 <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
264 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
266 <label for="creator">Ordered by: </label>
268 [% INCLUDE 'patron-title.inc' patron = creator %]
271 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
272 [% IF edit or order.subscriptionid %]
273 <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
275 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
278 <li><label for="quantity">Quantity received: </label>
279 [% IF order.subscriptionid %]
280 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
281 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
282 [% ELSIF AcqCreateItem == 'receiving' %]
283 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
285 [% IF ( order.quantityreceived ) %]
287 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
288 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
290 [% IF ( order.items.count ) %]
291 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
293 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
295 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
298 <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
299 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
301 <div id="qtyrecerror" style="display:none">
302 <p class="error">Warning, you have entered more items than expected.
303 Items will not be created.</p>
305 [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItem == 'receiving' ) %]
308 [% IF ( gst_values ) %]
310 <label for="tax_rate">Tax rate: </label>
311 <select name="tax_rate" id="tax_rate">
312 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
313 [% FOREACH gst IN gst_values %]
314 [% IF gst.option == tax_rate %]
315 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
317 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
323 <input type="hidden" name="tax_rate" value="0" />
326 <li><label for="rrp">Retail price: </label>
327 [% IF (invoiceincgst == 1) %]
328 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
330 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
333 <label for="replacementprice">Replacement price:</label>
334 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
337 [% IF (invoiceincgst) %]
338 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
340 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
344 <label for="unitprice">Actual cost:</label>
345 [% IF (invoiceincgst) %]
346 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_included | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
348 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_excluded | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
350 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
352 <li id="select_currency">
353 <label for="unitprice_currency"></label>
354 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
355 [% IF currencies.count %]
356 <select name="currency">
357 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
358 [% FOR currency IN currencies %]
359 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
364 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
365 [% IF order_vendornote %]
366 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
372 </div><div class="row"><fieldset class="action">
373 <input type="submit" value="Save" class="button" accesskey="w" />
374 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]">Cancel</a>
375 </fieldset></div> </form>
377 This ordernumber does not exist.
381 </div> <!-- /.col-sm-10.col-sm-push-2 -->
383 <div class="col-sm-2 col-sm-pull-10">
385 [% INCLUDE 'acquisitions-menu.inc' %]
387 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
388 </div> <!-- /.row -->
389 [% MACRO jsinclude BLOCK %]
390 [% Asset.js("js/acquisitions-menu.js") | $raw %]
391 [% INCLUDE 'calendar.inc' %]
392 [% Asset.js("js/additem.js") | $raw %]
393 [% Asset.js("js/cataloging.js") | $raw %]
395 function Check(form) {
396 [% IF (AcqCreateItem == 'receiving') %]
397 var total_errors = CheckMandatorySubfields(form);
398 if (total_errors != 0) {
399 var alertString = _("Form not submitted because of the following problem(s)");
400 alertString += "\n------------------------------------------------------------------------------------\n";
401 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
406 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
407 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
411 // Remove last itemblock if it is not in items_list
412 var lastitemblock = $("#outeritemblock > div:last");
413 var tobedeleted = true;
414 var listitems = $("#items_list tr");
415 $(listitems).each(function(){
416 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
421 $(lastitemblock).remove();
424 if(check_additem('[% Koha.Preference("UniqueItemFields") | html %]') == false){
425 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
427 $(lastitemblock).appendTo("#outeritemblock");
433 if( $("#quantity").val() < 1 ) {
434 alert(_("You must receive at least one item"));
441 [% IF (AcqCreateItem == 'ordering') %]
442 var items_columns = [null, null, 'barcode', 'homebranchname',
443 'holdingbranchname', 'notforloan', 'restricted', 'location',
444 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
445 'itemtype', 'materials', 'itemnotes'];
447 function PopupEditPage(biblionumber, itemnumber) {
448 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
449 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
450 var w = window.open(url);
451 var watchClose = setInterval(function() {
453 clearTimeout(watchClose);
454 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
456 'itemnumber': itemnumber
459 var tds = $("#item_"+itemnumber+" td");
460 for(var i=2; i<tds.length; i++) {
461 var column = items_columns[i];
462 var text = item[column];
463 if ( text == null ) text = '';
464 $(tds[i]).text(text);
472 function CalcQtyToReceive() {
473 var qty = $("input[name='items_to_receive']:checked").length;
474 $("#quantity").val(qty);
477 function CheckNItems(n) {
478 $("input[name='items_to_receive']").each(function() {
479 $(this).prop('checked', false);
481 $("input[name='items_to_receive']:lt("+n+")").each(function () {
482 $(this).prop('checked', true);
487 $(document).ready(function() {
488 [% IF (AcqCreateItem == 'receiving') %]
489 cloneItemBlock(0, '[% Koha.Preference('UniqueItemFields') | html %]');
490 [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
491 $("input[name='items_to_receive']").change(function() {
495 $("#quantity").keyup(function() {
496 var qty = parseInt($("#quantity").val());
497 var qtyto = parseInt($("#quantity_to_receive").val());
499 $("#qtyrecerror").show();
501 $("#qtyrecerror").hide();
503 CheckNItems($(this).val());
507 $("input[name='change_currency']").on("change", function(){
508 if ( $(this).is(":checked") ) {
509 $("#select_currency").show();
510 $("#unitprice").prop("readonly", "true");
512 $("#select_currency").hide();
513 $("#unitprice").prop("readonly", "");
517 function update_unitprice() {
518 var rate = Number($("select[name='currency'] option:selected").val());
519 var unitprice = $("#unitprice_currency").val();
520 var new_unitprice = Number( unitprice * rate ).toFixed(2);
521 $("#unitprice").val(new_unitprice);
523 $("select[name='currency']").on("change", function(){update_unitprice()} );
524 $("#unitprice_currency").on("change", function(){update_unitprice()} );
526 [% IF other_reason %]
527 $(".select-reason").hide();
528 $(".select-reason").find("option[value='other']").attr("selected","selected");
529 $("#other_reason").show();
531 $("#other_reason").hide();
533 $(".select-reason").change(function(){
534 if($(this).val() == "other"){
536 $("#other_reason").show();
539 $("a[href*=back]").click(function(){
540 $(".select-reason").show().find("option[value='']").attr("selected","selected");
541 $("#other_reason").hide();
548 [% INCLUDE 'intranet-bottom.inc' %]