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 <div class="col-sm-10 col-sm-push-2">
25 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% order.ordernumber | html %])</h1>
28 <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
30 <div class="col-sm-6">
31 <div class="dialog alert order_error" style="display:none"></div>
33 <fieldset class="rows">
34 <legend>Catalog details</legend>
35 <ol><li><span class="label">Title: </span><span class="title">[% order.biblio.title | html %]</span></li>
36 <li> <span class="label">Author: </span>
37 [% order.biblio.author | html %]</li>
38 <li><span class="label">Copyright: </span>
39 [% order.biblio.copyrightdate | html %]</li>
40 <li> <span class="label">ISBN: </span>
41 [% order.biblio.biblioitem.isbn | html %]</li>
42 <li> <span class="label">Series: </span>
43 [% order.biblio.seriestitle | html %]</li>
48 <fieldset class="rows">
49 <legend>Suggestion</legend>
52 <span class="label">Suggested by: </span>
53 [% 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>)
54 [% IF suggestion.reason %]
56 <span class="label">Reason:</span>
57 [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
58 [% SET other_reason = 1 %]
59 <select class="select-reason" id="reason" name="reason">
60 <option value=""> -- Choose a reason -- </option>
61 [% FOREACH reason IN suggestion_reasons %]
62 [% IF reason.lib == suggestion.reason %]
63 <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
64 [% SET other_reason = 0 %]
66 <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
69 <option value="other">Others...</option>
72 <span id="other_reason" name="other_reason">
74 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
76 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
78 <a href="#back">Cancel</a>
81 <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
89 [% IF order.subscriptionid and orders.count %]
90 <fieldset class="rows">
91 <legend>Receipt history for this subscription</legend>
97 <th class="title-string">Creation date</th>
98 <th class="title-string">Receive date</th>
99 <th>Quantity received</th>
100 <th class="title-string">Status</th>
101 <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
102 <th>Internal note</th>
106 [% FOR order IN orders %]
109 [% IF order.invoice %]
110 [% IF CAN_user_acquisition %]
111 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]" title="Invoice detail page">
112 [% order.invoice.invoicenumber | html %]</a>
114 [% order.invoice.invoicenumber | html %]
118 <td>[% order.ordernumber | html %]</td>
119 <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
120 <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
121 <td>[% order.quantityreceived | html %]</td>
123 [% SWITCH order.orderstatus %]
124 [%# FIXME We should only see/display Complete here, right? %]
125 [% CASE 'new' %]<span title="status_1">New</span>
126 [% CASE 'ordered' %]<span title="status_2">Ordered</span>
127 [% CASE 'partial' %]<span title="status_3">Partial</span>
128 [% CASE 'complete' %]<span title="status_4">Complete</span>
129 [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
133 [% IF order.datereceived %][%# FIXME Should only be true, right? %]
134 [%# FIXME What if unitprice has not been filled? %]
135 [% order.unitprice_tax_excluded * order.quantity | $Price %] / [% order.unitprice_tax_included * order.quantity | $Price %]
138 <td>[% order.order_internalnote | html %]</td>
144 [% ELSIF (AcqCreateItemReceiving) %]
145 <div id="items_list" style="display:none">
146 <p><strong>Items list</strong></p>
147 <div style="width:100%;overflow:auto;">
153 <th>Home library</th>
154 <th>Holding library</th>
155 <th>Not for loan</th>
160 <th>Inventory number</th>
173 [% UNLESS order.subscriptionid %]
174 <fieldset class="rows" id="itemfieldset">
175 <legend>Item</legend>
176 [% IF ( NoACQframework ) %]
178 No ACQ framework, using default. You should create a
179 framework with code ACQ, the items framework would be
183 <div id="outeritemblock"></div>
186 [% ELSIF (AcqCreateItem == 'ordering') %]
187 [% IF (items.count) %]
189 <div style="width:100%;overflow:auto">
196 <th>Home library</th>
197 <th>Current library</th>
198 <th>Not for loan</th>
203 <th>Inventory number</th>
211 [% FOREACH item IN items %]
212 <tr id="item_[% item.itemnumber | html %]">
213 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
214 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
215 <td>[% item.barcode | html %]</td>
216 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
217 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
218 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) | html %]</td>
219 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.restricted', authorised_value => item.restricted ) | html %]</td>
220 <td><span class="shelvingloc">[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %]</span></td>
221 <td>[% item.itemcallnumber | html %]</td>
222 <td>[% item.copynumber | html %]</td>
223 <td>[% item.stocknumber | html %]</td>
224 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]</td>
225 <td>[% ItemTypes.GetDescription( item.itype ) | html %]</td>
226 <td>[% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.materials', authorised_value => item.materials ) | html %]</td>
227 <td>[% item.itemnotes | html %]</td>
235 <input type="hidden" name="biblionumber" value="[% order.biblionumber | html %]" />
236 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
237 <input type="hidden" name="ordernumber" value="[% order.ordernumber | html %]" />
238 <input type="hidden" name="booksellerid" value="[% order.basket.booksellerid | html %]" />
240 <div class="col-sm-6">
241 <fieldset class="rows">
242 <legend>Accounting details</legend>
245 <label for="datereceived">Date received: </label>
246 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
248 <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
249 <option value="">Keep current ([% budget_period_description | html %] - [% order.fund.budget_name | html %])</option>
250 [% FOREACH period IN budget_loop %]
251 <optgroup label="[% period.description | html %]">
252 [% FOREACH fund IN period.funds %]
253 [% IF ( fund.b_sel ) %]
254 <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
256 <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
262 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
264 <label for="creator">Ordered by: </label>
266 [% INCLUDE 'patron-title.inc' patron = creator %]
269 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
270 [% IF edit or order.subscriptionid %]
271 <input type="text" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
273 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% order.quantity | html %]" />
276 <li><label for="quantity">Quantity received: </label>
277 [% IF order.subscriptionid %]
278 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantity | html %]" />
279 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
280 [% ELSIF AcqCreateItemReceiving %]
281 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
283 [% IF ( order.quantityreceived ) %]
285 <input type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived | html %]" />
286 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
289 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% order.quantityreceived + 1 | html %]" />
291 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived + 1 | html %]" />
293 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% order.quantityreceived | html %]" />
296 <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
297 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
299 <div id="qtyrecerror" style="display:none">
300 <p class="error">Warning, you have entered more items than expected.
301 Items will not be created.</p>
303 [% END %][%# IF (order.subscriptionid) ELSIF (AcqCreateItemReceiving) %]
306 [% IF ( gst_values ) %]
308 <label for="tax_rate">Tax rate: </label>
309 <select name="tax_rate" id="tax_rate">
310 [% tax_rate = order.tax_rate_on_receiving || order.tax_rate_on_ordering %]
311 [% FOREACH gst IN gst_values %]
312 [% IF gst.option == tax_rate %]
313 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
315 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
321 <input type="hidden" name="tax_rate" value="0" />
324 <li><label for="rrp">Retail price: </label>
325 [% IF (invoiceincgst == 1) %]
326 [% order.rrp_tax_included | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax inclusive)</span></li>
328 [% order.rrp_tax_excluded | $Price %]<span class="hint">(adjusted for [% active_currency.currency | html %],tax exclusive)</span></li>
331 <label for="replacementprice">Replacement price:</label>
332 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% order.replacementprice | $Price on_editing => 1 %]" />
335 [% IF (invoiceincgst) %]
336 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_included | $Price %] <span class="hint">(tax inclusive)</span>
338 <label for="ecost">Budgeted cost: </label>[% order.ecost_tax_excluded | $Price %] <span class="hint">(tax exclusive)</span>
342 <label for="unitprice">Actual cost:</label>
343 [% IF (invoiceincgst) %]
344 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_included | $Price on_editing => 1 %]" /> <span class="hint">(tax inclusive)</span>
346 <input type="text" size="20" name="unitprice" id="unitprice" value="[% order.unitprice_tax_excluded | $Price on_editing => 1 %]" /> <span class="hint">(tax exclusive)</span>
348 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
350 <li id="select_currency">
351 <label for="unitprice_currency"></label>
352 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
353 [% IF currencies.count %]
354 <select name="currency">
355 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
356 [% FOR currency IN currencies %]
357 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
362 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
363 [% IF order_vendornote %]
364 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
370 </div><div class="row"><fieldset class="action">
371 <input type="submit" value="Save" class="button" accesskey="w" />
372 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&sticky_filters=1">Cancel</a>
373 </fieldset></div> </form>
375 This ordernumber does not exist.
379 </div> <!-- /.col-sm-10.col-sm-push-2 -->
381 <div class="col-sm-2 col-sm-pull-10">
383 [% INCLUDE 'acquisitions-menu.inc' %]
385 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
386 </div> <!-- /.row -->
387 [% MACRO jsinclude BLOCK %]
388 [% Asset.js("js/acquisitions-menu.js") | $raw %]
389 [% INCLUDE 'calendar.inc' %]
390 [% Asset.js("js/additem.js") | $raw %]
391 [% Asset.js("js/cataloging.js") | $raw %]
393 function Check(form) {
394 [% IF (AcqCreateItemReceiving) %]
395 var total_errors = CheckMandatorySubfields(form);
396 if (total_errors != 0) {
397 var alertString = _("Form not submitted because of the following problem(s)");
398 alertString += "\n------------------------------------------------------------------------------------\n";
399 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
404 if(check_additem('[% UniqueItemFields | html %]') == false){
405 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
409 // Remove last itemblock if it is not in items_list
410 var lastitemblock = $("#outeritemblock > div:last");
411 var tobedeleted = true;
412 var listitems = $("#items_list tr");
413 $(listitems).each(function(){
414 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
419 $(lastitemblock).remove();
422 if(check_additem('[% UniqueItemFields | html %]') == false){
423 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
425 $(lastitemblock).appendTo("#outeritemblock");
434 [% IF (AcqCreateItem == 'ordering') %]
435 var items_columns = [null, null, 'barcode', 'homebranchname',
436 'holdingbranchname', 'notforloan', 'restricted', 'location',
437 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
438 'itemtype', 'materials', 'itemnotes'];
440 function PopupEditPage(biblionumber, itemnumber) {
441 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
442 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
443 var w = window.open(url);
444 var watchClose = setInterval(function() {
446 clearTimeout(watchClose);
447 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
449 'itemnumber': itemnumber
452 var tds = $("#item_"+itemnumber+" td");
453 for(var i=2; i<tds.length; i++) {
454 var column = items_columns[i];
455 var text = item[column];
456 if ( text == null ) text = '';
457 $(tds[i]).text(text);
465 function CalcQtyToReceive() {
466 var qty = $("input[name='items_to_receive']:checked").length;
467 $("#quantity").val(qty);
470 function CheckNItems(n) {
471 $("input[name='items_to_receive']").each(function() {
472 $(this).prop('checked', false);
474 $("input[name='items_to_receive']:lt("+n+")").each(function () {
475 $(this).prop('checked', true);
480 $(document).ready(function() {
481 [% IF (AcqCreateItemReceiving) %]
482 cloneItemBlock(0, '[% UniqueItemFields | html %]');
483 [% ELSIF (AcqCreateItem == 'ordering') && not order.subscriptionid %]
484 $("input[name='items_to_receive']").change(function() {
488 $("#quantity").keyup(function() {
489 var qty = parseInt($("#quantity").val());
490 var qtyto = parseInt($("#quantity_to_receive").val());
492 $("#qtyrecerror").show();
494 $("#qtyrecerror").hide();
496 CheckNItems($(this).val());
500 $("input[name='change_currency']").on("change", function(){
501 if ( $(this).is(":checked") ) {
502 $("#select_currency").show();
503 $("#unitprice").prop("readonly", "true");
505 $("#select_currency").hide();
506 $("#unitprice").prop("readonly", "");
510 function update_unitprice() {
511 var rate = Number($("select[name='currency'] option:selected").val());
512 var unitprice = $("#unitprice_currency").val();
513 var new_unitprice = Number( unitprice * rate ).toFixed(2);
514 $("#unitprice").val(new_unitprice);
516 $("select[name='currency']").on("change", function(){update_unitprice()} );
517 $("#unitprice_currency").on("change", function(){update_unitprice()} );
519 [% IF other_reason %]
520 $(".select-reason").hide();
521 $(".select-reason").find("option[value='other']").attr("selected","selected");
522 $("#other_reason").show();
524 $("#other_reason").hide();
526 $(".select-reason").change(function(){
527 if($(this).val() == "other"){
529 $("#other_reason").show();
532 $("a[href*=back]").click(function(){
533 $(".select-reason").show().find("option[value='']").attr("selected","selected");
534 $("#other_reason").hide();
541 [% INCLUDE 'intranet-bottom.inc' %]