2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Acquisitions › Basket [% basketno %] › [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
6 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
7 <script type="text/javascript" src="[% themelang %]/js/additem.js"></script>
8 <script type="text/javascript">
14 var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
16 _alertString +="-------------------------------------------------------------------\n\n";
18 if ( isNull(ff.title,1) && isNull(ff.entertitle,1) ){
20 _alertString += "\n- " + _("Title cannot be empty");
23 if(isNull(ff.budget_id,1)){
25 _alertString += "\n- "+ _("You must select a budget");
28 if (!(isNum(ff.quantity,0))){
30 _alertString += "\n- " + _("Quantity must be greater than '0'");
33 if (!(isNum(ff.listprice,0))){
35 _alertString += "\n- " + _("Vendor price must be a number");
38 if (!(isNum(ff.total,0))){
40 _alertString += "\n- " + _("Total must be a number");
43 if (totalExceedsBudget(ff.budget_id.value, ff.total.value ) ) {
45 _alertString += "\n- " + _("Order total (") + ff.total.value +
46 _(") exceeds budget available (") + actTotal+")";
49 if ( ff.field_value ) {
51 var empty_item_mandatory = 0;
52 for (i = 0; i < ff.field_value.length; i++) {
53 //alert("i = " + i + " => " + ff.kohafield[i] );
54 if (ff.field_value[i].value.length == 0 && ff.mandatory[i].value == 1) {
55 empty_item_mandatory++;
57 if(ff.subfield[i].value === '[% barcode_subfield %]' && ff.field_value[i].value.length != 0) {
58 barcodes.push(ff.field_value[i].value);
61 if (empty_item_mandatory > 0) {
64 "\n- " + empty_item_mandatory + _(" item mandatory fields empty");
67 if(barcodes.length > 0) {
68 // Check for duplicate barcodes in the form
69 barcodes = barcodes.sort();
70 for(var i=0; i<barcodes.length-1; i++) {
71 if(barcodes[i] == barcodes[i+1]) {
73 _alertString += "\n- " + _("The barcode ") + barcodes[i] + _(" is used more than once in the form. Every barcode must be unique");
77 // Check for duplicate barcodes in the database via an ajax call
79 url: "/cgi-bin/koha/acqui/check_duplicate_barcode_ajax.pl",
82 data: {barcodes : barcodes},
85 error: function(xhr) {
86 alert("Error: \n" + xhr.responseText);
88 success: function(json) {
92 _alertString += "\n- " + _("Error: Duplicate barcode verification failed. Insufficient user permissions.");
96 $.each(json.barcodes, function(index, barcode) {
97 _alertString += "\n- " + _("The barcode ") + barcode + _(" already exists in the database");
115 $(document).ready(function()
117 //We apply the fonction only for modify option
118 [% IF ( quantityrec ) %]
119 $('#quantity').blur(function()
121 // if user decreases the quantity
122 if($(this).val() < [% quantityrec %])
124 alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
129 // if user increases the quantity
130 alert(_("You can't add a new item, please create a new order line"));
131 // and we replace the original value
132 $(this).val([% quantityrec %])
138 $('#showallbudgets').click(function() {
139 if ( $('#budget_id .b_inactive').is(":visible") )
141 $('#budget_id .b_inactive').hide();
144 $('#budget_id .b_inactive').show();
153 [% INCLUDE 'header.inc' %]
154 [% INCLUDE 'acquisitions-search.inc' %]
156 <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>
158 <div id="doc3" class="yui-t2">
165 [% IF ( ordernumber ) %]
172 [% IF ( basketno ) %]
173 <div id="acqui_basket_summary" class="yui-g">
174 <fieldset class="rows">
175 <legend>Basket details</legend>
177 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
178 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
179 [% IF ( basketcontractno ) %]
180 <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
181 <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
183 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span> [% authorisedbyname %]</li>[% END %]
184 [% IF ( creationdate ) %]<li><span class="label">Open on:</span> [% creationdate | $KohaDates %]</li>[% END %]
185 [% IF ( closedate ) %]
186 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
187 <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
188 [% IF ( basketgroups ) %]
189 <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
190 [% FOREACH basketgroup IN basketgroups %]
191 [% IF ( basketgroup.default ) %]
192 <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
194 <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
198 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
199 <input type="hidden" value="mod_basket" name="op" />
200 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
202 <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
211 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform">
213 <fieldset class="rows">
216 [% IF ( biblionumber ) %]
217 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]"> Edit record</a></span>
220 [% UNLESS ( existing ) %]
221 <input type="hidden" name="existing" value="no" />
223 <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
224 <input type="hidden" name="basketno" value="[% basketno %]" />
225 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
226 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
227 <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
228 <input type="hidden" name="discount" value="[% discount %]" />
229 <input type="hidden" name="listinc" value="[% listincgst %]" />
230 <!-- <input type="hidden" name="currency" value="[% currency %]" />-->
231 <input type="hidden" name="applygst" value="[% gstreg %]" />
232 <input type="hidden" name="invoiceincgst" value="[% invoiceincgst %]" />
233 <input type="hidden" name="gstrate" value="[% gstrate %]" />
234 <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
235 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
237 [% FOREACH loop_currencie IN loop_currencies %]
238 <input type="hidden" id="[% loop_currencie.currcode %]" name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" />
241 [% IF ( biblionumber ) %]
242 <span class="label">Title</span>
243 <input type="hidden" size="50" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
245 <label for="entertitle" class="required">Title: </label>
246 <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" />
250 [% IF ( biblionumber ) %]
251 <span class="label">Author: </span>
252 <input type="hidden" size="50" name="author" id="author" value="[% author %]" />[% author %]
254 <label for="author">Author: </label>
255 <input type="text" size="50" name="author" id="author" value="[% author %]" />
259 [% IF ( biblionumber ) %]
260 <span class="label">Publisher: </span>
261 <input type="hidden" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />[% publishercode %]
263 <label for="publishercode"> Publisher: </label>
264 <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />
268 [% IF ( biblionumber ) %]
269 <span class="label">Edition: </span>
270 <input type="hidden" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />[% editionstatement %]
273 <label for="editionstatement">Edition: </label>
274 <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />
278 [% IF ( biblionumber ) %]
279 <span class="label">Publication year: </span>
280 <input type="hidden" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
282 <label for="publicationyear">Publication year: </label>
283 <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
287 [% IF ( biblionumber ) %]
288 <span class="label">ISBN: </span>
289 <input type="hidden" size="50" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
291 <label for="ISBN">ISBN: </label>
292 <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
296 [% IF ( biblionumber ) %]
297 <span class="label">Series: </span>
298 <input type="hidden" size="50" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
300 <label for="series">Series: </label>
301 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
305 [% UNLESS ( biblionumber ) %]
306 [% IF ( itemtypeloop ) %]
308 <span class="label">Item type:</span>
309 <select name="itemtype" style="width:12em;">
310 [% FOREACH itemtype IN itemtypeloop %]
311 [% IF ( itemtype.selected ) %]
312 <option value="[% itemtype.itemtype %]" selected="selected">[% itemtype.description %]</option>
314 <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
324 [% IF ( suggestionid ) %]
325 <fieldset class="rows">
326 <legend>Suggestion</legend>
329 <span class="label">Suggested by: </span>
330 [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&op=show">suggestion #[% suggestionid %]</a>)
337 <fieldset class="rows">
338 <legend>Item</legend>
339 [% IF ( NoACQframework ) %]
340 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
343 [% FOREACH item IN items %]
344 <div id="outeritemblock">
346 <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
347 <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
349 <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
350 [% iteminformatio.marc_value %]
351 <input type="hidden" name="itemid" value="1" />
352 <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
353 <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
354 <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
355 <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
356 [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
357 <span class="buttonPlus" onclick="CloneSubfield('subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
363 <a class="addItem" onclick="cloneItemBlock('itemblock[% item.itemBlockIndex %]')">Add</a>
364 <a class="delItem" style="display:none;" onclick="deleteItemBlock('itemblock[% item.itemBlockIndex %]')">Delete</a>
365 </div><!-- /iteminformation -->
368 [% END %] <!-- /items -->
370 [% END %] <!-- items -->
371 <fieldset class="rows">
372 <legend>Accounting Details</legend>
376 <span class="label required">Quantity: </span>
377 <input type="hidden" size="20" name="quantity" value="[% quantity %]" />[% quantity %]
379 <label class="required" for="quantity">Quantity: </label>
381 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" onchange="calcNeworderTotal();" />
383 <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="calcNeworderTotal();" />
386 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
387 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
391 <span class="label required">Fund: </span>
392 <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
394 <label class="required" for="budget_id">Fund: </label>
395 <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
396 <option value="">Select a budget</option>
397 [% FOREACH budget_loo IN budget_loop %]
398 [% IF ( budget_loo.b_sel ) %]
399 <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
401 [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
402 [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive" style="display : none;">[% budget_loo.b_txt %]</option>
407 <label for="showallbudgets" style="float:none;width:auto;"> Show all:</label>
408 <input type="checkbox" id="showallbudgets" />
413 <span class="label">Currency: </span>
414 <input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
416 <label for="currency">Currency:</label>
417 <select name="currency" id="currency" onchange="calcNeworderTotal();">
418 [% FOREACH loop_currencie IN loop_currencies %]
419 [% 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 %]
425 <span class="label">Vendor price: </span>
426 <input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
428 <label for="listprice">Vendor price: </label>
429 <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="calcNeworderTotal()" />
432 [% UNLESS ( close ) %]
434 <label for="uncertainprice">Uncertain price: </label>
435 [% IF ( uncertainprice ) %]
436 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" checked="checked" />
438 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
444 <span class="label">Replacement cost: </span>
445 <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
447 <label for="rrp">Replacement cost: </label>
448 <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
453 <label for="ecost">Budgeted cost: </label>
454 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" />
456 <label for="ecost">Budgeted cost: </label>
457 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
459 [% IF ( discount_2dp ) %] (adjusted for [% discount_2dp %]% discount) [% END %]
465 <label for="GST">Budgeted GST: </label>
466 <input type="text" id="" size="20" name="gst" value="" id="GST" readonly="readonly" />
468 <label for="GST">Budgeted GST: </label>
469 <input type="text" size="20" name="gst" id="GST" value="" />
475 <label for="total">Total: </label>
476 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
478 <label for="total">Total: </label>
479 <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
484 <label for="cost">Actual cost: </label>
485 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
487 <label for="cost">Actual cost: </label>
488 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
492 <label for="notes">Notes: </label>
493 <textarea id="notes" cols="30" rows="3" name="notes" >[% notes %]</textarea>
495 <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
496 <label for="sort1">Statistic 1: </label>
499 <select id="sort1" size="1" name="sort1">
500 [% FOREACH sort_opt IN CGIsort1 %]
501 [% IF sort_opt.default %]
502 <option value="[% sort_opt.value %]" selected="selected">[% sort_opt.label %]</option>
504 <option value="[% sort_opt.value %]">[% sort_opt.label %]</option>
510 <input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
514 <label for="sort2">Statistic 2: </label>
517 <select id="sort2" size="1" name="sort2">
518 [% FOREACH sort_opt IN CGIsort2 %]
519 [% IF sort_opt.default %]
520 <option value="[% sort_opt.value %]" selected="selected">[% sort_opt.label %]</option>
522 <option value="[% sort_opt.value %]">[% sort_opt.label %]</option>
527 <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
532 <fieldset class="action">
533 <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 %]
539 [% INCLUDE 'acquisitions-menu.inc' %]
542 [% INCLUDE 'intranet-bottom.inc' %]