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?supplierid=[% 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 ) %]
169 [% IF ( suggestionid ) %](defined from suggestion #[% suggestionid %])[% END %]
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 %]</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 %]</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">Publication year: </span>
270 <input type="hidden" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
272 <label for="publicationyear">Publication year: </label>
273 <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
277 [% IF ( biblionumber ) %]
278 <span class="label">ISBN: </span>
279 <input type="hidden" size="50" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
281 <label for="ISBN">ISBN: </label>
282 <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
286 [% IF ( biblionumber ) %]
287 <span class="label">Series: </span>
288 <input type="hidden" size="50" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
290 <label for="series">Series: </label>
291 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
295 [% UNLESS ( biblionumber ) %]
296 [% IF ( itemtypeloop ) %]
298 <span class="label">Item type:</span>
299 <select name="itemtype" style="width:12em;">
300 [% FOREACH itemtype IN itemtypeloop %]
301 [% IF ( itemtype.selected ) %]
302 <option value="[% itemtype.itemtype %]" selected="selected">[% itemtype.description %]</option>
304 <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
314 <fieldset class="rows">
315 <legend>Item</legend>
316 [% IF ( NoACQframework ) %]
317 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
320 [% FOREACH item IN items %]
321 <div id="outeritemblock">
323 <ol>[% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden %];">
324 <div class="subfield_line" id="subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]">
326 <label>[% iteminformatio.subfield %] - [% IF ( iteminformatio.mandatory ) %]<b>[% END %][% iteminformatio.marc_lib %][% IF ( iteminformatio.mandatory ) %] *</b>[% END %]</label>
327 [% iteminformatio.marc_value %]
328 <input type="hidden" name="itemid" value="1" />
329 <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield %]" />
330 <input type="hidden" name="tag" value="[% iteminformatio.tag %]" />
331 <input type="hidden" name="subfield" value="[% iteminformatio.subfield %]" />
332 <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory %]" />
333 [% IF ( iteminformatio.ITEM_SUBFIELDS_ARE_NOT_REPEATABLE ) %]
334 <span class="buttonPlus" onclick="CloneSubfield('subfield[% iteminformatio.serialid %][% iteminformatio.countitems %][% iteminformatio.subfield %][% iteminformatio.random %]')">+</span>
340 <a class="addItem" onclick="cloneItemBlock('itemblock[% item.itemBlockIndex %]')">Add</a>
341 <a class="delItem" style="display:none;" onclick="deleteItemBlock('itemblock[% item.itemBlockIndex %]')">Delete</a>
342 </div><!-- /iteminformation -->
345 [% END %] <!-- /items -->
347 [% END %] <!-- items -->
348 <fieldset class="rows">
349 <legend>Accounting Details</legend>
353 <span class="label required">Quantity: </span>
354 <input type="hidden" size="20" name="quantity" value="[% quantity %]" />[% quantity %]
356 <label class="required" for="quantity">Quantity: </label>
358 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" onchange="calcNeworderTotal();" />
360 <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="calcNeworderTotal();" />
363 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
364 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
368 <span class="label">Fund: </span>
369 <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
371 <label for="budget_id">Fund: </label>
372 <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
373 [% FOREACH budget_loo IN budget_loop %]
374 [% IF ( budget_loo.b_sel ) %]
375 <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
377 [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
378 [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive" style="display : none;">[% budget_loo.b_txt %]</option>
383 <label for="showallbudgets" style="float:none;width:auto;"> Show all:</label>
384 <input type="checkbox" id="showallbudgets" />
389 <span class="label">Currency: </span>
390 <input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
392 <label for="currency">Currency:</label>
393 <select name="currency" id="currency" onchange="calcNeworderTotal();">
394 [% FOREACH loop_currencie IN loop_currencies %]
395 [% 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 %]
401 <span class="label">Vendor price: </span>
402 <input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
404 <label for="listprice">Vendor price: </label>
405 <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="calcNeworderTotal()" />
408 [% UNLESS ( close ) %]
410 <label for="uncertainprice">Uncertain price: </label>
411 [% IF ( uncertainprice ) %]
412 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" checked="checked" />
414 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
420 <span class="label">Replacement cost: </span>
421 <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
423 <label for="rrp">Replacement cost: </label>
424 <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
429 <label for="ecost">Budgeted cost: </label>
430 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" />
432 <label for="ecost">Budgeted cost: </label>
433 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
435 [% IF ( discount_2dp ) %] (adjusted for [% discount_2dp %]% discount) [% END %]
441 <label for="GST">Budgeted GST: </label>
442 <input type="text" id="" size="20" name="gst" value="" id="GST" readonly="readonly" />
444 <label for="GST">Budgeted GST: </label>
445 <input type="text" size="20" name="gst" id="GST" value="" />
451 <label for="total">Total: </label>
452 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
454 <label for="total">Total: </label>
455 <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
460 <label for="cost">Actual cost: </label>
461 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
463 <label for="cost">Actual cost: </label>
464 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
468 <label for="notes">Notes: </label>
469 <textarea id="notes" cols="30" rows="3" name="notes" >[% notes %]</textarea>
471 <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
472 <label for="sort1">Statistic 1: </label>
475 <select id="sort1" size="1" name="sort1">
476 [% FOREACH sort_opt IN CGIsort1 %]
477 [% IF sort_opt.default %]
478 <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
480 <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
486 <input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
490 <label for="sort2">Statistic 2: </label>
493 <select id="sort2" size="1" name="sort1">
494 [% FOREACH sort_opt IN CGIsort2 %]
495 [% IF sort_opt.default %]
496 <option value="[% sort_opt.id %]" selected="selected">[% sort_opt.label %]</option>
498 <option value="[% sort_opt.id %]">[% sort_opt.label %]</option>
503 <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
508 <fieldset class="action">
509 <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 %]
515 [% INCLUDE 'acquisitions-menu.inc' %]
518 [% INCLUDE 'intranet-bottom.inc' %]