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 [% INCLUDE 'additem.js.inc' %]
8 <script type="text/javascript" src="[% themelang %]/js/additem.js"></script>
9 <script type="text/javascript">
10 var nav = window.Event ? true : false;
12 window.captureEvents(Event.KEYDOWN);
13 window.onkeydown = NetscapeEventHandler_KeyDown;
15 document.onkeydown = IEEventHandler_KeyDown;
18 function NetscapeEventHandler_KeyDown(e) {
19 if (e.which == 13 && e.target.type != 'textarea' && e.target.type != 'submit') { return false; }
23 function IEEventHandler_KeyDown() {
24 if (event.keyCode == 13 && event.srcElement.type != 'textarea' && event.srcElement.type != 'submit')
32 [% IF (AcqCreateItemOrdering) %]
33 // Remove last itemblock if it is not in items_list
34 var lastitemblock = $("#outeritemblock > div:last");
35 var tobedeleted = true;
36 var listitems = $("#items_list tr");
37 $(listitems).each(function(){
38 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
43 $(lastitemblock).remove();
48 var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
50 _alertString +="-------------------------------------------------------------------\n\n";
52 if ( isNull(ff.title,1) && isNull(ff.entertitle,1) ){
54 _alertString += "\n- " + _("Title cannot be empty");
57 if(isNull(ff.budget_id,1)){
59 _alertString += "\n- "+ _("You must select a budget");
62 if (!(isNum(ff.quantity,0)) || ff.quantity.value == 0){
64 _alertString += "\n- " + _("Quantity must be greater than '0'");
67 if (!(isNum(ff.listprice,0))){
69 _alertString += "\n- " + _("Vendor price must be a number");
72 if (!(isNum(ff.total,0))){
74 _alertString += "\n- " + _("Total must be a number");
77 if (totalExceedsBudget(ff.budget_id.value, ff.total.value ) ) {
79 _alertString += "\n- " + _("Order total (") + ff.total.value +
80 _(") exceeds budget available (") + actTotal+")";
83 if ( ff.field_value ) {
84 var empty_item_mandatory = 0;
85 for (i = 0; i < ff.field_value.length; i++) {
86 //alert("i = " + i + " => " + ff.kohafield[i] );
87 if (ff.field_value[i].value.length == 0 && ff.mandatory[i].value == 1) {
88 empty_item_mandatory++;
91 if (empty_item_mandatory > 0) {
94 "\n- " + empty_item_mandatory + _(" item mandatory fields empty");
101 [% IF (AcqCreateItemOrdering) %]
103 $(lastitemblock).appendTo('#outeritemblock');
109 [% IF (AcqCreateItemOrdering) %]
110 if(check_additem('[% UniqueItemFields %]') == false) {
111 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
113 $(lastitemblock).appendTo('#outeritemblock');
120 $(document).ready(function()
122 [% IF (AcqCreateItemOrdering) %]
123 cloneItemBlock(0, '[% UniqueItemFields %]');
126 $("#quantity").change(function() {
130 //We apply the fonction only for modify option
131 [% IF ( quantityrec ) %]
132 $('#quantity').blur(function()
134 // if user decreases the quantity
135 if($(this).val() < [% quantityrec %])
137 alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
142 // if user increases the quantity
143 alert(_("You can't add a new item, please create a new order line"));
144 // and we replace the original value
145 $(this).val([% quantityrec %])
146 updateCosts(); // blur is invoked after change which updated values
152 //keep a copy of all budgets before removing the inactives
153 disabledBudgetsCopy = $('#budget_id').html();
154 $('#budget_id .b_inactive').remove();
156 $('#showallbudgets').click(function() {
157 if ($(this).is(":checked")) {
158 $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
161 $('#budget_id .b_inactive').remove();
168 <body id="acq_neworderempty" class="acq">
170 [% INCLUDE 'header.inc' %]
171 [% INCLUDE 'acquisitions-search.inc' %]
173 <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>
175 <div id="doc3" class="yui-t2">
182 [% IF ( ordernumber ) %]
189 <div class="error" style="display:none"></div>
191 [% IF ( basketno ) %]
192 <div id="acqui_basket_summary" class="yui-g">
193 <fieldset class="rows">
194 <legend>Basket details</legend>
196 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
197 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
198 [% IF ( basketcontractno ) %]
199 <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
200 <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
202 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span> [% authorisedbyname %]</li>[% END %]
203 [% IF ( creationdate ) %]<li><span class="label">Open on:</span> [% creationdate | $KohaDates %]</li>[% END %]
204 [% IF ( closedate ) %]
205 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
206 <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
207 [% IF ( basketgroups ) %]
208 <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
209 [% FOREACH basketgroup IN basketgroups %]
210 [% IF ( basketgroup.default ) %]
211 <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
213 <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
217 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
218 <input type="hidden" value="mod_basket" name="op" />
219 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
221 <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
230 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform" onsubmit="return Check(this);">
232 <fieldset class="rows">
235 [% IF ( biblionumber ) %]
236 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]"> Edit record</a></span>
239 [% UNLESS ( existing ) %]
240 <input type="hidden" name="existing" value="no" />
242 <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
243 <input type="hidden" name="basketno" value="[% basketno %]" />
244 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
245 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
246 <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
247 <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
248 <input type="hidden" name="applygst" id="applygst" value="[% gstreg %]" />
249 <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
250 <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
251 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
253 [% FOREACH loop_currencie IN loop_currencies %]
254 <input type="hidden" id="currency_rate_[% loop_currencie.currcode %]" name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" />
258 [% IF ( biblionumber ) %]
259 <span class="label">Title</span>
260 <input type="hidden" size="50" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
262 <label for="entertitle" class="required">Title: </label>
263 <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" />
267 [% IF ( biblionumber ) %]
268 <span class="label">Author: </span>
269 <input type="hidden" size="50" name="author" id="author" value="[% author %]" />[% author %]
271 <label for="author">Author: </label>
272 <input type="text" size="50" name="author" id="author" value="[% author %]" />
276 [% IF ( biblionumber ) %]
277 <span class="label">Publisher: </span>
278 <input type="hidden" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />[% publishercode %]
280 <label for="publishercode"> Publisher: </label>
281 <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />
285 [% IF ( biblionumber ) %]
286 <span class="label">Edition: </span>
287 <input type="hidden" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />[% editionstatement %]
290 <label for="editionstatement">Edition: </label>
291 <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />
295 [% IF ( biblionumber ) %]
296 <span class="label">Publication year: </span>
297 <input type="hidden" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
299 <label for="publicationyear">Publication year: </label>
300 <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
304 [% IF ( biblionumber ) %]
305 <span class="label">ISBN: </span>
306 <input type="hidden" size="50" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
308 <label for="ISBN">ISBN: </label>
309 <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
314 [% IF ( biblionumber ) %]
315 <span class="label">EAN: </span>
316 <input type="hidden" size="20" name="ean" id="EAN" value="[% ean %]" />[% ean %]
318 <label for="EAN">EAN: </label>
319 <input type="text" size="20" name="ean" id="EAN" value="[% ean %]" />
324 [% IF ( biblionumber ) %]
325 <span class="label">Series: </span>
326 <input type="hidden" size="50" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
328 <label for="series">Series: </label>
329 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
333 [% UNLESS ( biblionumber ) %]
334 [% IF ( itemtypeloop ) %]
336 <span class="label">Item type:</span>
337 <select name="itemtype" style="width:12em;">
338 [% FOREACH itemtype IN itemtypeloop %]
339 [% IF ( itemtype.selected ) %]
340 <option value="[% itemtype.itemtype %]" selected="selected">[% itemtype.description %]</option>
342 <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
352 [% IF ( suggestionid ) %]
353 <fieldset class="rows">
354 <legend>Suggestion</legend>
357 <span class="label">Suggested by: </span>
358 [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&op=show">suggestion #[% suggestionid %]</a>)
364 [% IF (AcqCreateItemOrdering) %]
366 <div id="items_list" style="display:none">
367 <p><b>Items list</b></p>
368 <div style="width:100%;overflow:auto;">
375 <th>Home library</th>
376 <th>Holding library</th>
377 <th>Not for loan</th>
382 <th>Stock number</th>
383 <th>Collection code</th>
395 <fieldset class="rows" id="itemfieldset">
396 <legend>Item</legend>
397 [% IF ( NoACQframework ) %]
398 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
401 <div id="outeritemblock"></div>
404 [% END %][%# IF (AcqCreateItemOrdering) %]
405 <fieldset class="rows">
406 <legend>Accounting Details</legend>
410 <span class="label required">Quantity: </span>
411 <input type="hidden" size="20" name="quantity" value="[% quantity %]" />[% quantity %]
413 <label class="required" for="quantity">Quantity: </label>
414 [% IF (AcqCreateItemOrdering) %]
415 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
417 <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
420 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
421 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
425 <span class="label required">Fund: </span>
426 <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
428 <label class="required" for="budget_id">Fund: </label>
429 <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
430 <option value="">Select a budget</option>
431 [% FOREACH budget_loo IN budget_loop %]
432 [% IF ( budget_loo.b_sel ) %]
433 <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
435 [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
436 [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option>
441 <label for="showallbudgets" style="float:none;width:auto;"> Show all:</label>
442 <input type="checkbox" id="showallbudgets" />
447 <span class="label">Currency: </span>
448 <input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
450 <label for="currency">Currency:</label>
451 <select name="currency" id="currency" onchange="updateCosts();">
452 [% FOREACH loop_currencie IN loop_currencies %]
453 [% 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 %]
459 <span class="label">Vendor price: </span>
460 <input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
462 <label for="listprice">Vendor price: </label>
463 <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" />
466 [% UNLESS ( close ) %]
468 <label for="uncertainprice">Uncertain price: </label>
469 [% IF ( uncertainprice ) %]
470 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" checked="checked" />
472 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
476 [% IF ( gst_values ) %]
479 <span class="label">Tax rate: </span>
480 <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
482 <label for="gst">Tax rate: </label>
483 <select name="gstrate" id="gstrate" onchange="updateCosts();">
484 [% FOREACH gst IN gst_values %]
485 [% IF ( gst.option == gstrate ) %]
486 <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
488 <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
494 <input type="hidden" name="gstrate" value="0" />
498 <label for="discount">Discount: </label>
500 [% IF ( orderdiscount ) %]
501 <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
503 <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
506 [% IF ( orderdiscount ) %]
507 <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
509 <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
515 <span class="label">Replacement cost: </span>
516 <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
518 <label for="rrp">Replacement cost: </label>
519 <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
524 <label for="ecost">Budgeted cost: </label>
525 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" />
527 <label for="ecost">Budgeted cost: </label>
528 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
533 <label for="total">Total: </label>
534 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
536 <label for="total">Total: </label>
537 <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
542 <label for="unitprice">Actual cost: </label>
543 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
545 <label for="unitprice">Actual cost: </label>
546 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
550 <label for="notes">Notes: </label>
551 <textarea id="notes" cols="30" rows="3" name="notes" >[% notes %]</textarea>
553 <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
554 <label for="sort1">Statistic 1: </label>
555 <span id="sort1_zone">
557 <select id="sort1" size="1" name="sort1">
558 [% FOREACH sort_opt IN CGIsort1 %]
559 [% IF sort_opt.default %]
560 <option value="[% sort_opt.value %]" selected="selected">[% sort_opt.label %]</option>
562 <option value="[% sort_opt.value %]">[% sort_opt.label %]</option>
567 <input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
572 <label for="sort2">Statistic 2: </label>
573 <span id="sort2_zone">
575 <select id="sort2" size="1" name="sort2">
576 [% FOREACH sort_opt IN CGIsort2 %]
577 [% IF sort_opt.default %]
578 <option value="[% sort_opt.value %]" selected="selected">[% sort_opt.label %]</option>
580 <option value="[% sort_opt.value %]">[% sort_opt.label %]</option>
585 <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
591 <fieldset class="action">
592 <input type="submit" value="Save" />
593 [% IF (suggestionid) %]
594 <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a>
596 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
603 [% INCLUDE 'acquisitions-menu.inc' %]
606 [% INCLUDE 'intranet-bottom.inc' %]