7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha › Acquisitions › Receipt summary for : [% name | html %] [% IF ( invoice ) %]invoice, [% invoice | html %][% END %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="acq_orderreceive" class="acq">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'acquisitions-search.inc' %]
16 <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>
18 <div class="main container-fluid">
20 <div class="col-sm-10 col-sm-push-2">
23 <h1>Receive items from : [% name | html %] [% IF ( invoice ) %][[% invoice | html %]] [% END %] (order #[% ordernumber | html %])</h1>
26 <form action="/cgi-bin/koha/acqui/finishreceive.pl" class="noEnterSubmit" method="post" onsubmit="return Check(this);">
28 <div class="col-sm-6">
29 <div class="dialog alert order_error" style="display:none"></div>
31 <fieldset class="rows">
32 <legend>Catalog details</legend>
33 <ol><li><span class="label">Title: </span><span class="title">[% title | html %]</span></li>
34 <li> <span class="label">Author: </span>
35 [% author | html %]</li>
36 <li><span class="label">Copyright: </span>
37 [% copyrightdate | html %]</li>
38 <li> <span class="label">ISBN: </span>
39 [% isbn | html %]</li>
40 <li> <span class="label">Series: </span>
41 [% seriestitle | html %]</li>
45 [% IF ( suggestionid ) %]
46 <fieldset class="rows">
47 <legend>Suggestion</legend>
50 <span class="label">Suggested by: </span>
51 [% surnamesuggestedby | html %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby | html %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid | uri %]&op=show">suggestion #[% suggestionid | html %]</a>)
57 [% IF subscriptionid and orders.count %]
58 <fieldset class="rows">
59 <legend>Receipt history for this subscription</legend>
65 <th class="title-string">Creation date</th>
66 <th class="title-string">Receive date</th>
67 <th>Quantity received</th>
68 <th class="title-string">Status</th>
69 <th title="Actual cost tax exc. / Actual cost tax inc.">Spent</th>
70 <th>Internal note</th>
74 [% FOR order IN orders %]
77 [% IF order.invoice %]
78 [% IF CAN_user_acquisition %]
79 <a href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% order.invoiceid | uri %]" title="Invoice detail page">
80 [% order.invoice.invoicenumber | html %]</a>
82 [% order.invoice.invoicenumber | html %]
86 <td>[% order.ordernumber | html %]</td>
87 <td><span title="[% order.basket.creationdate | uri %]">[% order.basket.creationdate | $KohaDates%]</span></td>
88 <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
89 <td>[% order.quantityreceived | html %]</td>
91 [% SWITCH order.orderstatus %]
92 [%# FIXME We should only see/display Complete here, right? %]
93 [% CASE 'new' %]<span title="status_1">New</span>
94 [% CASE 'ordered' %]<span title="status_2">Ordered</span>
95 [% CASE 'partial' %]<span title="status_3">Partial</span>
96 [% CASE 'complete' %]<span title="status_4">Complete</span>
97 [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
101 [% IF order.datereceived %][%# FIXME Should only be true, right? %]
102 [%# FIXME What if unitprice has not been filled? %]
103 [% order.unitprice_tax_excluded * order.quantity | $Price %] / [% order.unitprice_tax_included * order.quantity | $Price %]
106 <td>[% order.order_internalnote | html %]</td>
112 [% ELSIF (AcqCreateItemReceiving) %]
113 <div id="items_list" style="display:none">
114 <p><b>Items list</b></p>
115 <div style="width:100%;overflow:auto;">
121 <th>Home library</th>
122 <th>Holding library</th>
123 <th>Not for loan</th>
128 <th>Inventory number</th>
129 <th>Collection code</th>
141 [% UNLESS subscriptionid %]
142 <fieldset class="rows" id="itemfieldset">
143 <legend>Item</legend>
144 [% IF ( NoACQframework ) %]
146 No ACQ framework, using default. You should create a
147 framework with code ACQ, the items framework would be
151 <div id="outeritemblock"></div>
154 [% ELSIF (AcqCreateItem == 'ordering') %]
155 [% IF (items.size) %]
157 <div style="width:100%;overflow:auto">
164 <th>Home library</th>
165 <th>Current location</th>
166 <th>Not for loan</th>
171 <th>Inventory number</th>
172 <th>Collection code</th>
179 [% FOREACH item IN items %]
180 <tr id="item_[% item.itemnumber | html %]">
181 <td style="text-align:center"><input type="checkbox" name="items_to_receive" value="[% item.itemnumber | html %]" /></td>
182 <td><a style="cursor:pointer" onclick="PopupEditPage([% item.biblionumber | html %],[% item.itemnumber | html %]);">Edit</a></td>
183 <td>[% item.barcode | html %]</td>
184 <td>[% Branches.GetName( item.homebranch ) | html %]</td>
185 <td>[% Branches.GetName( item.holdingbranch ) | html %]</td>
186 <td>[% item.notforloan | html %]</td>
187 <td>[% item.restricted | html %]</td>
188 <td><span class="shelvingloc">[% item.location | html %]</span></td>
189 <td>[% item.itemcallnumber | html %]</td>
190 <td>[% item.copynumber | html %]</td>
191 <td>[% item.stocknumber | html %]</td>
192 <td>[% item.collection | html %]</td>
193 <td>[% item.itemtype | html %]</td>
194 <td>[% item.materials | html %]</td>
195 <td>[% item.itemnotes | html %]</td>
203 <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
204 <input type="hidden" name="invoiceid" value="[% invoiceid | html %]" />
205 <input type="hidden" name="ordernumber" value="[% ordernumber | html %]" />
206 <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
208 <div class="col-sm-6">
209 <fieldset class="rows">
210 <legend>Accounting details</legend>
213 <label for="datereceived">Date received: </label>
214 <input type="text" size="10" id="datereceived" name="datereceived" value="[% datereceived | $KohaDates %]" class="datepicker" />
216 <li><label for="bookfund">Fund: </label><select id="bookfund" name="bookfund">
217 <option value="">Keep current ([% budget_period_description | html %] - [% bookfund | html %])</option>
218 [% FOREACH period IN budget_loop %]
219 <optgroup label="[% period.description | html %]">
220 [% FOREACH fund IN period.funds %]
221 [% IF ( fund.b_sel ) %]
222 <option value="[% fund.b_id | html %]" selected="selected">[% fund.b_txt | html %]</option>
224 <option value="[% fund.b_id | html %]">[% fund.b_txt | html %]</option>
230 <li><label> </label><span>(Current: [% budget_period_description | html %] - [% bookfund | html %])</span></li>
232 <label for="creator">Ordered by: </label>
234 [% INCLUDE 'patron-title.inc' patron = creator %]
237 <li><label for="quantity_to_receive">Quantity ordered: </label><span class="label">
238 [% IF edit or subscriptionid %]
239 <input type="text" id="quantity_to_receive" name="quantity" value="[% quantity | html %]" />
241 <input type="text" readonly="readonly" id="quantity_to_receive" name="quantity" value="[% quantity | html %]" />
244 <li><label for="quantity">Quantity received: </label>
245 [% IF subscriptionid %]
246 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantity | html %]" />
247 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
248 [% ELSIF AcqCreateItemReceiving %]
249 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="0" />
251 [% IF ( quantityreceived ) %]
253 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceived | html %]" />
254 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
257 <input readonly="readonly" type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceivedplus1 | html %]" />
259 <input type="text" size="20" name="quantityrec" id="quantity" value="[% quantityreceivedplus1 | html %]" />
261 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="[% quantityreceived | html %]" />
264 <input type="text" id="quantity" size="20" name="quantityrec" value="1" />
265 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="0" />
267 <div id="qtyrecerror" style="display:none">
268 <p class="error">Warning, you have entered more items than expected.
269 Items will not be created.</p>
271 [% END %][%# IF (subscriptionid) ELSIF (AcqCreateItemReceiving) %]
274 [% IF ( gst_values ) %]
276 <label for="tax_rate">Tax rate: </label>
277 <select name="tax_rate" id="tax_rate">
278 [% FOREACH gst IN gst_values %]
279 [% IF gst.option == tax_rate %]
280 <option value="[% gst.option | html %]" selected="selected">[% gst.option * 100 | html %]%</option>
282 <option value="[% gst.option | html %]">[% gst.option * 100 | html %]%</option>
288 <input type="hidden" name="tax_rate" value="0" />
291 <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>
293 <label for="replacementprice">Replacement price:</label>
294 <input type="text" size="20" name="replacementprice" id="replacementprice" value="[% replacementprice | $Price on_editing => 1 %]" />
296 <li><label for="ecost">Budgeted cost: </label>[% ecost | $Price %] <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span></li>
298 <label for="unitprice">Actual cost:</label>
299 <input type="text" size="20" name="unitprice" id="unitprice" value="[% unitprice | $Price on_editing => 1 %]" />
300 <span class="hint">[% IF (invoiceincgst == 1) %](tax inclusive)[% ELSE %](tax exclusive)[% END %]</span>
301 <label style="font-weight: inherit; float:none;"><input type="checkbox" name="change_currency">Change currency</label>
303 <li id="select_currency">
304 <label for="unitprice_currency"></label>
305 <input type="text" size="20" name="unitprice" id="unitprice_currency" value="" />
306 [% IF currencies.count %]
307 <select name="currency">
308 <option value="[% active_currency.rate %]" selected="selected">[% active_currency.currency %] ([% active_currency.symbol %])</option>
309 [% FOR currency IN currencies %]
310 <option value="[% currency.rate %]">[% currency.currency %] ([% currency.symbol %])</option>
315 <li><label for="order_internalnote">Internal note: </label><textarea name="order_internalnote" width="40" rows="8" >[% order_internalnote | html %]</textarea></li>
316 [% IF order_vendornote %]
317 <li><label for="order_vendornote">Vendor note: </label><span>[% order_vendornote | html %]</span></li>
323 </div><div class="row"><fieldset class="action">
324 <input type="submit" value="Save" class="button" accesskey="w" />
325 <a class="cancel" href="/cgi-bin/koha/acqui/parcel.pl?invoiceid=[% invoiceid | html %]&sticky_filters=1">Cancel</a>
326 </fieldset></div> </form>
328 This ordernumber does not exist.
332 </div> <!-- /.col-sm-10.col-sm-push-2 -->
334 <div class="col-sm-2 col-sm-pull-10">
336 [% INCLUDE 'acquisitions-menu.inc' %]
338 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
339 </div> <!-- /.row -->
340 [% MACRO jsinclude BLOCK %]
341 [% Asset.js("js/acquisitions-menu.js") | $raw %]
342 [% INCLUDE 'calendar.inc' %]
343 [% INCLUDE 'additem.js.inc' %]
344 [% Asset.js("js/additem.js") | $raw %]
345 [% Asset.js("js/cataloging.js") | $raw %]
347 function Check(form) {
348 [% IF (AcqCreateItemReceiving) %]
349 var total_errors = CheckMandatorySubfields(form);
350 if (total_errors != 0) {
351 var alertString = _("Form not submitted because of the following problem(s)");
352 alertString += "\n------------------------------------------------------------------------------------\n";
353 alertString += "\n- " + _("%s mandatory fields empty (highlighted)").format(total_errors);
358 if(check_additem('[% UniqueItemFields | html %]') == false){
359 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
363 // Remove last itemblock if it is not in items_list
364 var lastitemblock = $("#outeritemblock > div:last");
365 var tobedeleted = true;
366 var listitems = $("#items_list tr");
367 $(listitems).each(function(){
368 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
373 $(lastitemblock).remove();
376 if(check_additem('[% UniqueItemFields | html %]') == false){
377 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
379 $(lastitemblock).appendTo("#outeritemblock");
388 [% IF (AcqCreateItem == 'ordering') %]
389 var items_columns = [null, null, 'barcode', 'homebranchname',
390 'holdingbranchname', 'notforloan', 'restricted', 'location',
391 'itemcallnumber', 'copynumber', 'stocknumber', 'collection',
392 'itemtype', 'materials', 'itemnotes'];
394 function PopupEditPage(biblionumber, itemnumber) {
395 var url = "/cgi-bin/koha/cataloguing/additem.pl?op=edititem&biblionumber="
396 + biblionumber + "&itemnumber=" + itemnumber + "&popup=1#edititem";
397 var w = window.open(url);
398 var watchClose = setInterval(function() {
400 clearTimeout(watchClose);
401 $.getJSON('/cgi-bin/koha/catalogue/getitem-ajax.pl',
403 'itemnumber': itemnumber
406 var tds = $("#item_"+itemnumber+" td");
407 for(var i=2; i<tds.length; i++) {
408 var column = items_columns[i];
409 var text = item[column];
410 if ( text == null ) text = '';
411 $(tds[i]).text(text);
419 function CalcQtyToReceive() {
420 var qty = $("input[name='items_to_receive']:checked").length;
421 $("#quantity").val(qty);
424 function CheckNItems(n) {
425 $("input[name='items_to_receive']").each(function() {
426 $(this).prop('checked', false);
428 $("input[name='items_to_receive']:lt("+n+")").each(function () {
429 $(this).prop('checked', true);
434 $(document).ready(function() {
435 [% IF (AcqCreateItemReceiving) %]
436 cloneItemBlock(0, '[% UniqueItemFields | html %]');
437 [% ELSIF (AcqCreateItem == 'ordering') && not subscriptionid %]
438 $("input[name='items_to_receive']").change(function() {
442 $("#quantity").keyup(function() {
443 var qty = parseInt($("#quantity").val());
444 var qtyto = parseInt($("#quantity_to_receive").val());
446 $("#qtyrecerror").show();
448 $("#qtyrecerror").hide();
450 CheckNItems($(this).val());
454 $("input[name='change_currency']").on("change", function(){
455 if ( $(this).is(":checked") ) {
456 $("#select_currency").show();
457 $("#unitprice").prop("readonly", "true");
459 $("#select_currency").hide();
460 $("#unitprice").prop("readonly", "");
464 function update_unitprice() {
465 var rate = Number($("select[name='currency'] option:selected").val());
466 var unitprice = $("#unitprice_currency").val();
467 var new_unitprice = Number( unitprice * rate ).toFixed(2);
468 $("#unitprice").val(new_unitprice);
470 $("select[name='currency']").on("change", function(){update_unitprice()} );
471 $("#unitprice_currency").on("change", function(){update_unitprice()} );
476 [% INCLUDE 'intranet-bottom.inc' %]