1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Acquisitions › Basket [% basketno %] › [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
5 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
6 <script type="text/javascript" src="[% themelang %]/js/additem.js"></script>
7 <script type="text/javascript">
13 var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
15 _alertString +="-------------------------------------------------------------------\n\n";
17 if ( isNull(ff.title,1) && isNull(ff.entertitle,1) ){
19 _alertString += "\n- " + _("Title cannot be empty");
22 if(isNull(ff.budget_id,1)){
24 _alertString += "\n- "+ _("You must select a budget");
27 if (!(isNum(ff.quantity,0))){
29 _alertString += "\n- " + _("Quantity must be greater than '0'");
32 if (!(isNum(ff.listprice,0))){
34 _alertString += "\n- " + _("Vendor price must be a number");
37 if (!(isNum(ff.total,0))){
39 _alertString += "\n- " + _("Total must be a number");
42 if (totalExceedsBudget(ff.budget_id.value, ff.total.value ) ) {
44 _alertString += "\n- " + _("Order total (") + ff.total.value +
45 _(") exceeds budget available (") + actTotal+")";
48 if ( ff.field_value ) {
50 var empty_item_mandatory = 0;
51 for (i = 0; i < ff.field_value.length; i++) {
52 //alert("i = " + i + " => " + ff.kohafield[i] );
53 if (ff.field_value[i].value.length == 0 && ff.mandatory[i].value == 1) {
54 empty_item_mandatory++;
56 if(ff.subfield[i].value === '[% barcode_subfield %]' && ff.field_value[i].value.length != 0) {
57 barcodes.push(ff.field_value[i].value);
60 if (empty_item_mandatory > 0) {
63 "\n- " + empty_item_mandatory + _(" item mandatory fields empty");
66 if(barcodes.length > 0) {
67 // Check for duplicate barcodes in the form
68 barcodes = barcodes.sort();
69 for(var i=0; i<barcodes.length-1; i++) {
70 if(barcodes[i] == barcodes[i+1]) {
72 _alertString += "\n- " + _("The barcode ") + barcodes[i] + _(" is used more than once in the form. Every barcode must be unique");
76 // Check for duplicate barcodes in the database via an ajax call
78 url: "/cgi-bin/koha/acqui/check_duplicate_barcode_ajax.pl",
81 data: {barcodes : barcodes},
84 error: function(xhr) {
85 alert("Error: \n" + xhr.responseText);
87 success: function(json) {
91 _alertString += "\n- " + _("Error: Duplicate barcode verification failed. Insufficient user permissions.");
95 $.each(json.barcodes, function(index, barcode) {
96 _alertString += "\n- " + _("The barcode ") + barcode + _(" already exists in the database");
114 $(document).ready(function()
116 //We apply the fonction only for modify option
117 [% IF ( quantityrec ) %]
118 $('#quantity').blur(function()
120 // if user decreases the quantity
121 if($(this).val() < [% quantityrec %])
123 alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
128 // if user increases the quantity
129 alert(_("You can't add a new item, please create a new order line"));
130 // and we replace the original value
131 $(this).val([% quantityrec %])
137 $('#showallbudgets').click(function() {
138 if ( $('#budget_id .b_inactive').is(":visible") )
140 $('#budget_id .b_inactive').hide();
143 $('#budget_id .b_inactive').show();
152 [% INCLUDE 'header.inc' %]
153 [% INCLUDE 'acquisitions-search.inc' %]
155 <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 %]">[% name %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> › [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</div>
157 <div id="doc3" class="yui-t2">
164 [% IF ( ordernumber ) %]
171 [% IF ( basketno ) %]
172 <div id="acqui_basket_summary" class="yui-g">
173 <fieldset class="rows">
174 <legend>Basket details</legend>
176 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
177 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
178 [% IF ( basketcontractno ) %]
179 <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
180 <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
182 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span> [% authorisedbyname %]</li>[% END %]
183 [% IF ( creationdate ) %]<li><span class="label">Open on:</span> [% creationdate %]</li>[% END %]
184 [% IF ( closedate ) %]
185 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
186 <li><span class="label">Closed on:</span> [% closedate %]</li>
187 [% IF ( basketgroups ) %]
188 <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
189 [% FOREACH basketgroup IN basketgroups %]
190 [% IF ( basketgroup.default ) %]
191 <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
193 <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
197 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
198 <input type="hidden" value="mod_basket" name="op" />
199 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
201 <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
210 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform">
212 <fieldset class="rows">
215 [% IF ( biblionumber ) %]
216 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]"> Edit record</a></span>
219 [% UNLESS ( existing ) %]
220 <input type="hidden" name="existing" value="no" />
222 <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
223 <input type="hidden" name="basketno" value="[% basketno %]" />
224 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
225 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
226 <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
227 <input type="hidden" name="discount" value="[% discount %]" />
228 <input type="hidden" name="listinc" value="[% listincgst %]" />
229 <!-- <input type="hidden" name="currency" value="[% currency %]" />-->
230 <input type="hidden" name="applygst" value="[% gstreg %]" />
231 <input type="hidden" name="invoiceincgst" value="[% invoiceincgst %]" />
232 <input type="hidden" name="gstrate" value="[% gstrate %]" />
233 <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
234 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
236 [% FOREACH loop_currencie IN loop_currencies %]
237 <input type="hidden" id="[% loop_currencie.currcode %]" name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" />
240 [% IF ( biblionumber ) %]
241 <span class="label">Title</span>
242 <input type="hidden" size="50" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
244 <label for="entertitle" class="required">Title: </label>
245 <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" />
249 [% IF ( biblionumber ) %]
250 <span class="label">Author: </span>
251 <input type="hidden" size="50" name="author" id="author" value="[% author %]" />[% author %]
253 <label for="author">Author: </label>
254 <input type="text" size="50" name="author" id="author" value="[% author %]" />
258 [% IF ( biblionumber ) %]
259 <span class="label">Publisher: </span>
260 <input type="hidden" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />[% publishercode %]
262 <label for="publishercode"> Publisher: </label>
263 <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />
267 [% IF ( biblionumber ) %]
268 <span class="label">Edition: </span>
269 <input type="hidden" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />[% editionstatement %]
272 <label for="editionstatement">Edition: </label>
273 <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />
277 [% IF ( biblionumber ) %]
278 <span class="label">Publication year: </span>
279 <input type="hidden" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
281 <label for="publicationyear">Publication year: </label>
282 <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
286 [% IF ( biblionumber ) %]
287 <span class="label">ISBN: </span>
288 <input type="hidden" size="50" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
290 <label for="ISBN">ISBN: </label>
291 <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
295 [% IF ( biblionumber ) %]
296 <span class="label">Series: </span>
297 <input type="hidden" size="50" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
299 <label for="series">Series: </label>
300 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
304 [% UNLESS ( biblionumber ) %]
305 [% IF ( itemtypeloop ) %]
307 <span class="label">Item type:</span>
308 <select name="itemtype" style="width:12em;">
309 [% FOREACH itemtype IN itemtypeloop %]
310 [% IF ( itemtype.selected ) %]
311 <option value="[% itemtype.itemtype %]" selected="selected">[% itemtype.description %]</option>
313 <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
323 [% IF ( suggestionid ) %]
324 <fieldset class="rows">
325 <legend>Suggestion</legend>
328 <span class="label">Suggested by: </span>
329 [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]">suggestion #[% suggestionid %]</a>)
336 <fieldset class="rows">
337 <legend>Item</legend>
338 [% IF ( NoACQframework ) %]
339 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
342 [% FOREACH item IN items %]
343 <div id="outeritemblock">
345 <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
346 <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
348 <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
349 [% iteminformatio.marc_value %]
350 <input type="hidden" name="itemid" value="1" />
351 <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
352 <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
353 <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
354 <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
355 [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
356 <span class="buttonPlus" onclick="CloneSubfield('subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
362 <a class="addItem" onclick="cloneItemBlock('itemblock[% item.itemBlockIndex %]')">Add</a>
363 <a class="delItem" style="display:none;" onclick="deleteItemBlock('itemblock[% item.itemBlockIndex %]')">Delete</a>
364 </div><!-- /iteminformation -->
367 [% END %] <!-- /items -->
369 [% END %] <!-- items -->
370 <fieldset class="rows">
371 <legend>Accounting Details</legend>
375 <span class="label required">Quantity: </span>
376 <input type="hidden" size="20" name="quantity" value="[% quantity %]" />[% quantity %]
378 <label class="required" for="quantity">Quantity: </label>
380 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" onchange="calcNeworderTotal();" />
382 <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="calcNeworderTotal();" />
385 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
386 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
390 <span class="label required">Fund: </span>
391 <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
393 <label class="required" for="budget_id">Fund: </label>
394 <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
395 <option value="">Select a budget</option>
396 [% FOREACH budget_loo IN budget_loop %]
397 [% IF ( budget_loo.b_sel ) %]
398 <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
400 [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
401 [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive" style="display : none;">[% budget_loo.b_txt %]</option>
406 <label for="showallbudgets" style="float:none;width:auto;"> Show all:</label>
407 <input type="checkbox" id="showallbudgets" />
412 <span class="label">Currency: </span>
413 <input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
415 <label for="currency">Currency:</label>
416 <select name="currency" id="currency" onchange="calcNeworderTotal();">
417 [% FOREACH loop_currencie IN loop_currencies %]
418 [% IF ( loop_currencie.selected ) %]<option value="[% loop_currencie.currcode %]" selected="selected">[% loop_currencie.currcode %]</option>[% ELSE %]<option value="[% loop_currencie.currcode %]">[% loop_currencie.currcode %]</option>[% END %][% END %]
424 <span class="label">Vendor price: </span>
425 <input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
427 <label for="listprice">Vendor price: </label>
428 <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="calcNeworderTotal()" />
431 [% UNLESS ( close ) %]
433 <label for="uncertainprice">Uncertain price: </label>
434 [% IF ( uncertainprice ) %]
435 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" checked="checked" />
437 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
443 <span class="label">Replacement cost: </span>
444 <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
446 <label for="rrp">Replacement cost: </label>
447 <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
452 <label for="ecost">Budgeted cost: </label>
453 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" />
455 <label for="ecost">Budgeted cost: </label>
456 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
458 [% IF ( discount_2dp ) %] (adjusted for [% discount_2dp %]% discount) [% END %]
464 <label for="GST">Budgeted GST: </label>
465 <input type="text" id="" size="20" name="gst" value="" id="GST" readonly="readonly" />
467 <label for="GST">Budgeted GST: </label>
468 <input type="text" size="20" name="gst" id="GST" value="" />
474 <label for="total">Total: </label>
475 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
477 <label for="total">Total: </label>
478 <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
483 <label for="cost">Actual cost: </label>
484 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
486 <label for="cost">Actual cost: </label>
487 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
491 <label for="notes">Notes: </label>
492 <textarea id="notes" cols="30" rows="3" name="notes" >[% notes %]</textarea>
494 <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
495 <label for="sort1">Statistic 1: </label>
498 <select id="sort1" size="1" name="sort1">
499 [% FOREACH sort_opt IN CGIsort1 %]
500 [% IF sort_opt.default %]
501 <option value="[% sort_opt.value %]" selected="selected">[% sort_opt.label %]</option>
503 <option value="[% sort_opt.value %]">[% sort_opt.label %]</option>
509 <input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
513 <label for="sort2">Statistic 2: </label>
516 <select id="sort2" size="1" name="sort2">
517 [% FOREACH sort_opt IN CGIsort2 %]
518 [% IF sort_opt.default %]
519 <option value="[% sort_opt.value %]" selected="selected">[% sort_opt.label %]</option>
521 <option value="[% sort_opt.value %]">[% sort_opt.label %]</option>
526 <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
531 <fieldset class="action">
532 <input type="button" value="Save" onclick="Check(this.form)" /> [% IF ( suggestionid ) %]<a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a>[% ELSE %]<a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>[% END %]
538 [% INCLUDE 'acquisitions-menu.inc' %]
541 [% INCLUDE 'intranet-bottom.inc' %]