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 [% IF ( acqcreate ) %]
133 $('#quantity').blur(function()
135 // if user decreases the quantity
136 if($(this).val() < [% quantityrec %])
138 alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
143 // if user increases the quantity
144 alert(_("You can't add a new item, please create a new order line"));
145 // and we replace the original value
146 $(this).val([% quantityrec %])
147 updateCosts(); // blur is invoked after change which updated values
154 //keep a copy of all budgets before removing the inactives
155 disabledBudgetsCopy = $('#budget_id').html();
156 $('#budget_id .b_inactive').remove();
158 $('#showallbudgets').click(function() {
159 if ($(this).is(":checked")) {
160 $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
163 $('#budget_id .b_inactive').remove();
170 <body id="acq_neworderempty" class="acq">
172 [% INCLUDE 'header.inc' %]
173 [% INCLUDE 'acquisitions-search.inc' %]
175 <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>
177 <div id="doc3" class="yui-t2">
184 [% IF ( ordernumber ) %]
191 <div class="error" style="display:none"></div>
193 [% IF ( basketno ) %]
194 <div id="acqui_basket_summary" class="yui-g">
195 <fieldset class="rows">
196 <legend>Basket details</legend>
198 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
199 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
200 [% IF ( basketcontractno ) %]
201 <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
202 <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
204 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span> [% authorisedbyname %]</li>[% END %]
205 [% IF ( creationdate ) %]<li><span class="label">Open on:</span> [% creationdate | $KohaDates %]</li>[% END %]
206 [% IF ( closedate ) %]
207 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
208 <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
209 [% IF ( basketgroups ) %]
210 <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
211 [% FOREACH basketgroup IN basketgroups %]
212 [% IF ( basketgroup.default ) %]
213 <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
215 <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
219 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
220 <input type="hidden" value="mod_basket" name="op" />
221 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
223 <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
232 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform" onsubmit="return Check(this);">
234 <fieldset class="rows">
237 [% IF ( biblionumber ) %]
238 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]"> Edit record</a></span>
241 [% UNLESS ( existing ) %]
242 <input type="hidden" name="existing" value="no" />
244 <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
245 <input type="hidden" name="basketno" value="[% basketno %]" />
246 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
247 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
248 <input type="hidden" name="biblioitemnumber" value="[% biblioitemnumber %]" />
249 <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
250 <input type="hidden" name="applygst" id="applygst" value="[% gstreg %]" />
251 <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
252 <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
253 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
255 [% FOREACH loop_currencie IN loop_currencies %]
256 <input type="hidden" id="currency_rate_[% loop_currencie.currcode %]" name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" />
260 [% IF ( biblionumber ) %]
261 <span class="label">Title</span>
262 <input type="hidden" size="50" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
264 <label for="entertitle" class="required">Title: </label>
265 <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" />
269 [% IF ( biblionumber ) %]
270 <span class="label">Author: </span>
271 <input type="hidden" size="50" name="author" id="author" value="[% author %]" />[% author %]
273 <label for="author">Author: </label>
274 <input type="text" size="50" name="author" id="author" value="[% author %]" />
278 [% IF ( biblionumber ) %]
279 <span class="label">Publisher: </span>
280 <input type="hidden" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />[% publishercode %]
282 <label for="publishercode"> Publisher: </label>
283 <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />
287 [% IF ( biblionumber ) %]
288 <span class="label">Edition: </span>
289 <input type="hidden" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />[% editionstatement %]
292 <label for="editionstatement">Edition: </label>
293 <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />
297 [% IF ( biblionumber ) %]
298 <span class="label">Publication year: </span>
299 <input type="hidden" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
301 <label for="publicationyear">Publication year: </label>
302 <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
306 [% IF ( biblionumber ) %]
307 <span class="label">ISBN: </span>
308 <input type="hidden" size="50" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
310 <label for="ISBN">ISBN: </label>
311 <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
316 [% IF ( biblionumber ) %]
317 <span class="label">EAN: </span>
318 <input type="hidden" size="20" name="ean" id="EAN" value="[% ean %]" />[% ean %]
320 <label for="EAN">EAN: </label>
321 <input type="text" size="20" name="ean" id="EAN" value="[% ean %]" />
326 [% IF ( biblionumber ) %]
327 <span class="label">Series: </span>
328 <input type="hidden" size="50" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
330 <label for="series">Series: </label>
331 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
335 [% UNLESS ( biblionumber ) %]
336 [% IF ( itemtypeloop ) %]
338 <span class="label">Item type:</span>
339 <select name="itemtype" style="width:12em;">
340 [% FOREACH itemtype IN itemtypeloop %]
341 [% IF ( itemtype.selected ) %]
342 <option value="[% itemtype.itemtype %]" selected="selected">[% itemtype.description %]</option>
344 <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
354 [% IF ( suggestionid ) %]
355 <fieldset class="rows">
356 <legend>Suggestion</legend>
359 <span class="label">Suggested by: </span>
360 [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&op=show">suggestion #[% suggestionid %]</a>)
366 [% UNLESS subscriptionid %][% # it is a suggestion, we have not items %]
367 [% IF (AcqCreateItemOrdering) %]
369 <div id="items_list" style="display:none">
370 <p><b>Items list</b></p>
371 <div style="width:100%;overflow:auto;">
378 <th>Home library</th>
379 <th>Holding library</th>
380 <th>Not for loan</th>
385 <th>Stock number</th>
386 <th>Collection code</th>
398 <fieldset class="rows" id="itemfieldset">
399 <legend>Item</legend>
400 [% IF ( NoACQframework ) %]
401 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
404 <div id="outeritemblock"></div>
407 [% END %][%# UNLESS subscriptionid %]
408 [% END %][%# IF (AcqCreateItemOrdering) %]
409 <fieldset class="rows">
410 <legend>Accounting Details</legend>
414 <span class="label required">Quantity: </span>
415 <input type="hidden" size="20" name="quantity" value="[% quantity %]" />[% quantity %]
417 <label class="required" for="quantity">Quantity: </label>
418 [% IF (AcqCreateItemOrdering) %]
419 [% IF subscriptionid %]
420 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
422 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
425 [% IF subscriptionid %]
426 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
428 <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
432 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
433 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
437 <span class="label required">Fund: </span>
438 <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
440 <label class="required" for="budget_id">Fund: </label>
441 <select id="budget_id" onchange="fetchSortDropbox(this.form)" size="1" name="budget_id">
442 <option value="">Select a budget</option>
443 [% FOREACH budget_loo IN budget_loop %]
444 [% IF ( budget_loo.b_sel ) %]
445 <option value="[% budget_loo.b_id %]" selected="selected">[% budget_loo.b_txt %]</option>
447 [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id %]">[% budget_loo.b_txt %]</option>
448 [% ELSE %]<option value="[% budget_loo.b_id %]" class="b_inactive">[% budget_loo.b_txt %]</option>
453 <label for="showallbudgets" style="float:none;width:auto;"> Show all:</label>
454 <input type="checkbox" id="showallbudgets" />
459 <span class="label">Currency: </span>
460 <input type="hidden" size="10" name="currency" id="currency" value="[% currency %]" />[% currency %]
462 <label for="currency">Currency:</label>
463 <select name="currency" id="currency" onchange="updateCosts();">
464 [% FOREACH loop_currencie IN loop_currencies %]
465 [% 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 %]
471 <span class="label">Vendor price: </span>
472 <input type="hidden" size="20" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %]
474 <label for="listprice">Vendor price: </label>
475 <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" />
478 [% UNLESS ( close ) %]
480 <label for="uncertainprice">Uncertain price: </label>
481 [% IF ( uncertainprice ) %]
482 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" checked="checked" />
484 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
488 [% IF ( gst_values ) %]
491 <span class="label">Tax rate: </span>
492 <input type="hidden" size="20" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
494 <label for="gst">Tax rate: </label>
495 <select name="gstrate" id="gstrate" onchange="updateCosts();">
496 [% FOREACH gst IN gst_values %]
497 [% IF ( gst.option == gstrate ) %]
498 <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
500 <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
506 <input type="hidden" name="gstrate" value="0" />
510 <label for="discount">Discount: </label>
512 [% IF ( orderdiscount ) %]
513 <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
515 <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
518 [% IF ( orderdiscount ) %]
519 <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
521 <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
527 <span class="label">Replacement cost: </span>
528 <input type="hidden" size="20" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]
530 <label for="rrp">Replacement cost: </label>
531 <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %])
536 <label for="ecost">Budgeted cost: </label>
537 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" />
539 <label for="ecost">Budgeted cost: </label>
540 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" />
545 <label for="total">Total: </label>
546 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" />
548 <label for="total">Total: </label>
549 <input type="text" id="total" size="20" name="total" value="[% total %]" /> (budgeted cost * quantity)
554 <label for="unitprice">Actual cost: </label>
555 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" />
557 <label for="unitprice">Actual cost: </label>
558 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" />
562 <label for="notes">Notes: </label>
563 <textarea id="notes" cols="30" rows="3" name="notes" >[% IF ( notes ) %][% notes %][% END %]</textarea>
565 <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
566 <label for="sort1">Statistic 1: </label>
567 <span id="sort1_zone">
569 <select id="sort1" size="1" name="sort1">
570 [% FOREACH sort_opt IN CGIsort1 %]
571 [% IF sort_opt.default %]
572 <option value="[% sort_opt.value %]" selected="selected">[% sort_opt.label %]</option>
574 <option value="[% sort_opt.value %]">[% sort_opt.label %]</option>
579 <input type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
584 <label for="sort2">Statistic 2: </label>
585 <span id="sort2_zone">
587 <select id="sort2" size="1" name="sort2">
588 [% FOREACH sort_opt IN CGIsort2 %]
589 [% IF sort_opt.default %]
590 <option value="[% sort_opt.value %]" selected="selected">[% sort_opt.label %]</option>
592 <option value="[% sort_opt.value %]">[% sort_opt.label %]</option>
597 <input type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
603 <fieldset class="action">
604 <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
605 <input type="submit" value="Save" />
606 [% IF (suggestionid) %]
607 <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a>
609 [% IF subscriptionid %]
610 <a class="cancel" href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a>
612 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
620 [% INCLUDE 'acquisitions-menu.inc' %]
623 [% INCLUDE 'intranet-bottom.inc' %]