5 [% USE AuthorisedValues %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>Koha › Acquisitions › Receipt summary for : [% name | html %] [% IF ( invoice ) %]invoice, [% invoice | html %][% END %]</title>
10 [% INCLUDE 'doc-head-close.inc' %]
13 <body id="acq_orderreceive" class="acq">
14 [% INCLUDE 'header.inc' %]
15 [% INCLUDE 'acquisitions-search.inc' %]
17 <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=[% booksellerid | html %]">[% name | html %]</a> › Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]][% END %] (order #[% ordernumber | html %])</div>
19 <div class="main container-fluid">
21 <div class="col-sm-10 col-sm-push-2">
24 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% ordernumber | html %])</h1>
27 <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
29 <div class="col-sm-6">
30 <div class="dialog alert order_error" style="display:none"></div>
32 <fieldset class="rows">
33 <legend>Catalog details</legend>
34 <ol><li><span class="label">Title: </span><span class="title">[% title | html %]</span></li>
35 <li> <span class="label">Author: </span>
36 [% author | html %]</li>
37 <li><span class="label">Copyright: </span>
38 [% copyrightdate | html %]</li>
39 <li> <span class="label">ISBN: </span>
40 [% isbn | html %]</li>
41 <li> <span class="label">Series: </span>
42 [% seriestitle | html %]</li>
47 <fieldset class="rows">
48 <legend>Suggestion</legend>
51 <span class="label">Suggested by: </span>
52 [% 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>)
53 [% IF suggestion.reason %]
55 <span class="label">Reason:</span>
56 [% SET suggestion_reasons = AuthorisedValues.GetAuthValueDropbox( 'SUGGEST' ) %]
57 [% SET other_reason = 1 %]
58 <select class="select-reason" id="reason" name="reason">
59 <option value=""> -- Choose a reason -- </option>
60 [% FOREACH reason IN suggestion_reasons %]
61 [% IF reason.lib == suggestion.reason %]
62 <option value="[% reason.lib | html %]" selected="selected">[% reason.lib | html %]</option>
63 [% SET other_reason = 0 %]
65 <option value="[% reason.lib | html %]">[% reason.lib | html %]</option>
68 <option value="other">Others...</option>
71 <span id="other_reason" name="other_reason">
73 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." value="[% suggestion.reason | html %]"/>
75 <input type="text" size="31" id="select-other_reason" name="other_reason" placeholder="please note your reason here..." />
77 <a href="#back">Cancel</a>
80 <input type="hidden" name="suggestionid" value="[% suggestion.suggestionid | html %]" />
88 [% IF subscriptionid and orders.count %]
89 <fieldset class="rows">
90 <legend>Receipt history for this subscription</legend>
96 <th class="title-string">Creation date</th>
97 <th class="title-string">Receive date</th>
98 <th>Quantity received</th>
99 <th class="title-string">Status</th>
100 <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
101 <th>Internal note</th>
105 [% FOR order IN orders %]
108 [% IF order.invoice %]
109 [% IF CAN_user_acquisition %]
110 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]" title="Invoice detail page">
111 [% order.invoice.invoicenumber | html %]</a>
113 [% order.invoice.invoicenumber | html %]
117 <td>[% order.ordernumber | html %]</td>
118 <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
119 <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
120 <td>[% order.quantityreceived | html %]</td>
122 [% SWITCH order.orderstatus %]
123 [%# FIXME We should only see/display Complete here, right? %]
124 [% CASE 'new' %]<span title="status_1">New</span>
125 [% CASE 'ordered' %]<span title="status_2">Ordered</span>
126 [% CASE 'partial' %]<span title="status_3">Partial</span>
127 [% CASE 'complete' %]<span title="status_4">Complete</span>
128 [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
132 [% IF order.datereceived %][%# FIXME Should only be true, right? %]
133 [%# FIXME What if unitprice has not been filled? %]
134 [% order.unitprice_tax_excluded * order.quantity | $Price %] / [% order.unitprice_tax_included * order.quantity | $Price %]
137 <td>[% order.order_internalnote | html %]</td>
143 [% ELSIF (AcqCreateItemReceiving) %]
144 <div id="items_list" style="display:none">
145 <p><b>Items list</b></p>
146 <div style="width:100%;overflow:auto;">
152 <th>Home library</th>
153 <th>Holding library</th>
154 <th>Not for loan</th>
159 <th>Inventory number</th>
172 [% UNLESS subscriptionid %]
173 <fieldset class="rows" id="itemfieldset">
174 <legend>Item</legend>
175 [% IF ( NoACQframework ) %]
177 No ACQ framework, using default. You should create a
178 framework with code ACQ, the items framework would be
182 <div id="outeritemblock"></div>
185 [% ELSIF (AcqCreateItem == 'ordering') %]
186 [% IF (items.size) %]
188 <div style="width:100%;overflow:auto">
195 <th>Home library</th>
196 <th>Current library</th>
197 <th>Not for loan</th>
202 <th>Inventory number</th>
210 [% FOREACH item IN items %]
211 <tr id="item_[% item.itemnumber | html %]">
212 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
213 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
214 <td>[% item.barcode | html %]</td>
215 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
216 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
217 <td>[% item.notforloan | html %]</td>
218 <td>[% item.restricted | html %]</td>
219 <td><span class="shelvingloc">[% item.location | html %]</span></td>
220 <td>[% item.itemcallnumber | html %]</td>
221 <td>[% item.copynumber | html %]</td>
222 <td>[% item.stocknumber | html %]</td>
223 <td>[% item.collection | html %]</td>
224 <td>[% item.itemtype | html %]</td>
225 <td>[% item.materials | html %]</td>
226 <td>[% item.itemnotes | html %]</td>
234 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
235 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
236 <input type="hidden" name="ordernumber" value="[% ordernumber | html %]" />
237 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
239 <div class="col-sm-6">
240 <fieldset class="rows">
241 <legend>Accounting details</legend>
244 <label for="datereceived">Date received: </label>
245 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
247 <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
248 <option value="">Keep current ([% budget_period_description | html %] - [% bookfund | html %])</option>
249 [% FOREACH period IN budget_loop %]
250 <optgroup label="[% period.description | html %]">
251 [% FOREACH fund IN period.funds %]
252 [% IF ( fund.b_sel ) %]
253 <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
255 <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
261 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
263 <label for="creator">Ordered by: </label>
265 [% INCLUDE 'patron-title.inc' patron = creator %]
268 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
269 [% IF edit or subscriptionid %]
270 <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity | html %]" />
272 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% quantity | html %]" />
275 <li><label for="quantity">Quantity received: </label>
276 [% IF subscriptionid %]
277 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantity | html %]" />
278 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
279 [% ELSIF AcqCreateItemReceiving %]
280 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
282 [% IF ( quantityreceived ) %]
284 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived | html %]" />
285 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
288 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceivedplus1 | html %]" />
290 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceivedplus1 | html %]" />
292 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
295 <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
296 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
298 <div id="qtyrecerror" style="display:none">
299 <p class="error">Warning, you have entered more items than expected.
300 Items will not be created.</p>
302 [% END %][%# IF (subscriptionid) ELSIF (AcqCreateItemReceiving) %]
305 [% IF ( gst_values ) %]
307 <label for="tax_rate">Tax rate: </label>
308 <select name="tax_rate" id="tax_rate">
309 [% FOREACH gst IN gst_values %]
310 [% IF gst.option == tax_rate %]
311 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
313 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
319 <input type="hidden" name="tax_rate" value="0" />
322 <li><label for="rrp">Retail price: </label>[% rrp | $Price %] <span class="hint">(adjusted for [% active_currency.currency | html %], [% IF (invoiceincgst == 1) %]tax inclusive[% ELSE %]tax exclusive[% END %])</span></li>
324 <label for="replacementprice">Replacement price:</label>
325 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | $Price on_editing => 1 %]" />
327 <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %] <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span></li>
329 <label for="unitprice">Actual cost:</label>
330 <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" />
331 <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span>
332 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
334 <li id="select_currency">
335 <label for="unitprice_currency"></label>
336 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
337 [% IF currencies.count %]
338 <select name="currency">
339 <option value="[% active_currency.rate | html %]" selected="selected">[% active_currency.currency | html %] ([% active_currency.symbol | html %])</option>
340 [% FOR currency IN currencies %]
341 <option value="[% currency.rate | html %]">[% currency.currency | html %] ([% currency.symbol | html %])</option>
346 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
347 [% IF order_vendornote %]
348 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
354 </div><div class="row"><fieldset class="action">
355 <input type="submit" value="Save" class="button" accesskey="w" />
356 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&sticky_filters=1">Cancel</a>
357 </fieldset></div> </form>
359 This ordernumber does not exist.
363 </div> <!-- /.col-sm-10.col-sm-push-2 -->
365 <div class="col-sm-2 col-sm-pull-10">
367 [% INCLUDE 'acquisitions-menu.inc' %]
369 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
370 </div> <!-- /.row -->
371 [% MACRO jsinclude BLOCK %]
372 [% Asset.js("js/acquisitions-menu.js") | $raw %]
373 [% INCLUDE 'calendar.inc' %]
374 [% INCLUDE 'additem.js.inc' %]
375 [% Asset.js("js/additem.js") | $raw %]
376 [% Asset.js("js/cataloging.js") | $raw %]
378 function Check(form) {
379 [% IF (AcqCreateItemReceiving) %]
380 var total_errors = CheckMandatorySubfields(form);
381 if (total_errors != 0) {
382 var alertString = _("Form not submitted because of the following problem(s)");
383 alertString += "\n------------------------------------------------------------------------------------\n";
384 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
389 if(check_additem('[% UniqueItemFields | html %]') == false){
390 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
394 // Remove last itemblock if it is not in items_list
395 var lastitemblock = $("#outeritemblock > div:last");
396 var tobedeleted = true;
397 var listitems = $("#items_list tr");
398 $(listitems).each(function(){
399 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
404 $(lastitemblock).remove();
407 if(check_additem('[% UniqueItemFields | html %]') == false){
408 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
410 $(lastitemblock).appendTo("#outeritemblock");
419 [% IF (AcqCreateItem == 'ordering') %]
420 var items_columns = [null, null, 'barcode', 'homebranchname',
421 'holdingbranchname', 'notforloan', 'restricted', 'location',
422 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
423 'itemtype', 'materials', 'itemnotes'];
425 function PopupEditPage(biblionumber, itemnumber) {
426 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
427 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
428 var w = window.open(url);
429 var watchClose = setInterval(function() {
431 clearTimeout(watchClose);
432 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
434 'itemnumber': itemnumber
437 var tds = $("#item_"+itemnumber+" td");
438 for(var i=2; i<tds.length; i++) {
439 var column = items_columns[i];
440 var text = item[column];
441 if ( text == null ) text = '';
442 $(tds[i]).text(text);
450 function CalcQtyToReceive() {
451 var qty = $("input[name='items_to_receive']:checked").length;
452 $("#quantity").val(qty);
455 function CheckNItems(n) {
456 $("input[name='items_to_receive']").each(function() {
457 $(this).prop('checked', false);
459 $("input[name='items_to_receive']:lt("+n+")").each(function () {
460 $(this).prop('checked', true);
465 $(document).ready(function() {
466 [% IF (AcqCreateItemReceiving) %]
467 cloneItemBlock(0, '[% UniqueItemFields | html %]');
468 [% ELSIF (AcqCreateItem == 'ordering') && not subscriptionid %]
469 $("input[name='items_to_receive']").change(function() {
473 $("#quantity").keyup(function() {
474 var qty = parseInt($("#quantity").val());
475 var qtyto = parseInt($("#quantity_to_receive").val());
477 $("#qtyrecerror").show();
479 $("#qtyrecerror").hide();
481 CheckNItems($(this).val());
485 $("input[name='change_currency']").on("change", function(){
486 if ( $(this).is(":checked") ) {
487 $("#select_currency").show();
488 $("#unitprice").prop("readonly", "true");
490 $("#select_currency").hide();
491 $("#unitprice").prop("readonly", "");
495 function update_unitprice() {
496 var rate = Number($("select[name='currency'] option:selected").val());
497 var unitprice = $("#unitprice_currency").val();
498 var new_unitprice = Number( unitprice * rate ).toFixed(2);
499 $("#unitprice").val(new_unitprice);
501 $("select[name='currency']").on("change", function(){update_unitprice()} );
502 $("#unitprice_currency").on("change", function(){update_unitprice()} );
504 [% IF other_reason %]
505 $(".select-reason").hide();
506 $(".select-reason").find("option[value='other']").attr("selected","selected");
507 $("#other_reason").show();
509 $("#other_reason").hide();
511 $(".select-reason").change(function(){
512 if($(this).val() == "other"){
514 $("#other_reason").show();
517 $("a[href*=back]").click(function(){
518 $(".select-reason").show().find("option[value='']").attr("selected","selected");
519 $("#other_reason").hide();
526 [% INCLUDE 'intranet-bottom.inc' %]