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" src="[% themelang %]/js/cataloging.js"></script>
10 <script type="text/javascript" src="[% themelang %]/js/prevent_submit.js"></script>
11 <script type="text/javascript">
16 [% IF (AcqCreateItemOrdering) %]
17 // Remove last itemblock if it is not in items_list
18 var lastitemblock = $("#outeritemblock > div:last");
19 var tobedeleted = true;
20 var listitems = $("#items_list tr");
21 $(listitems).each(function(){
22 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
27 $(lastitemblock).remove();
32 var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
34 _alertString +="-------------------------------------------------------------------\n\n";
36 if ( isNull(ff.title,1) && isNull(ff.entertitle,1) ){
38 _alertString += "\n- " + _("Title cannot be empty");
41 if(isNull(ff.budget_id,1)){
43 _alertString += "\n- "+ _("You must select a fund");
46 if (!(isNum(ff.quantity,0)) || ff.quantity.value == 0){
48 _alertString += "\n- " + _("Quantity must be greater than '0'");
51 if (!(isNum(ff.listprice,0))){
53 _alertString += "\n- " + _("Vendor price must be a number");
56 if (!(isNum(ff.total,0))){
58 _alertString += "\n- " + _("Total must be a number");
61 if (totalExceedsBudget(ff.budget_id.value, ff.total.value ) ) {
63 _alertString += "\n- " + _("Order total (%s) exceeds budget available (%s)").format(ff.total.value, actTotal);
66 if ( ff.field_value ) {
67 var empty_item_mandatory = CheckMandatorySubfields(ff);
68 if (empty_item_mandatory > 0) {
71 "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
78 [% IF (AcqCreateItemOrdering) %]
80 $(lastitemblock).appendTo('#outeritemblock');
86 [% IF (AcqCreateItemOrdering) %]
87 if(check_additem('[% UniqueItemFields %]') == false) {
88 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
90 $(lastitemblock).appendTo('#outeritemblock');
97 $(document).ready(function()
99 [% IF (AcqCreateItemOrdering) %]
100 cloneItemBlock(0, '[% UniqueItemFields %]');
103 [% IF ( suggestionid ) %]updateCosts();[% END %]
104 $("#quantity").change(function() {
108 //We apply the fonction only for modify option
109 [% IF ( quantityrec ) %]
110 [% IF ( acqcreate ) %]
111 $('#quantity').blur(function()
113 // if user decreases the quantity
114 if($(this).val() < [% quantityrec %])
116 alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
121 // if user increases the quantity
122 alert(_("You can't add a new item, please create a new order line"));
123 // and we replace the original value
124 $(this).val([% quantityrec %])
125 updateCosts(); // blur is invoked after change which updated values
132 //keep a copy of all budgets before removing the inactives
133 disabledBudgetsCopy = $('#budget_id').html();
134 $('#budget_id .b_inactive').remove();
136 $('#showallbudgets').click(function() {
137 if ($(this).is(":checked")) {
138 $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
141 $('#budget_id .b_inactive').remove();
145 $("#budget_id").change(function(){
146 var destination_sort1 = $(this).parents('fieldset.rows').find('input[name="sort1"]');
147 var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
148 var sort1 = $(destination_sort1).val() || "";
149 if ( destination_sort1.length < 1 ) {
150 destination_sort1 = $(this).parents('fieldset.rows').find('select[name="sort1"]');
152 var destination_sort2 = $(this).parents('fieldset.rows').find('input[name="sort2"]');
153 var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
154 var sort2 = $(destination_sort2).val() || "";
155 if ( destination_sort2.length < 1 ) {
156 destination_sort2 = $(this).parents('fieldset.rows').find('select[name="sort2"]');
158 getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
159 getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
161 $("#budget_id").change();
166 <body id="acq_neworderempty" class="acq">
168 [% INCLUDE 'header.inc' %]
169 [% INCLUDE 'acquisitions-search.inc' %]
171 <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>
173 <div id="doc3" class="yui-t2">
180 [% IF ( ordernumber ) %]
187 <div class="error" style="display:none"></div>
189 [% IF ( basketno ) %]
190 <div id="acqui_basket_summary" class="yui-g">
191 <fieldset class="rows">
192 <legend>Basket details</legend>
194 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
195 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
196 [% IF ( basketcontractno ) %]
197 <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
198 <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
200 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span> [% authorisedbyname %]</li>[% END %]
201 [% IF ( creationdate ) %]<li><span class="label">Open on:</span> [% creationdate | $KohaDates %]</li>[% END %]
202 [% IF ( closedate ) %]
203 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
204 <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
205 [% IF ( basketgroups ) %]
206 <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
207 [% FOREACH basketgroup IN basketgroups %]
208 [% IF ( basketgroup.default ) %]
209 <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
211 <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
215 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
216 <input type="hidden" value="mod_basket" name="op" />
217 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
219 <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
228 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform" onsubmit="return Check(this);">
230 <fieldset class="rows">
233 [% IF ( biblionumber ) %]
234 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]"> Edit record</a></span>
237 [% UNLESS ( existing ) %]
238 <input type="hidden" name="existing" value="no" />
240 <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
241 <input type="hidden" name="basketno" value="[% basketno %]" />
242 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
243 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
244 <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
245 <input type="hidden" name="applygst" id="applygst" value="[% gstreg %]" />
246 <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
247 <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
248 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
250 [% FOREACH loop_currencie IN loop_currencies %]
251 <input type="hidden" id="currency_rate_[% loop_currencie.currcode %]" name="[% loop_currencie.currcode %]" value="[% loop_currencie.rate %]" />
255 [% IF ( biblionumber ) %]
256 <span class="label">Title</span>
257 <input type="hidden" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
259 <label for="entertitle" class="required">Title: </label>
260 <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" class="focus" />
261 <span class="required">Required</span>
265 [% IF ( biblionumber ) %]
266 <span class="label">Author: </span>
267 <input type="hidden" name="author" id="author" value="[% author %]" />[% author %]
269 <label for="author">Author: </label>
270 <input type="text" size="50" name="author" id="author" value="[% author %]" />
274 [% IF ( biblionumber ) %]
275 <span class="label">Publisher: </span>
276 <input type="hidden" name="publishercode" id="publishercode" value="[% publishercode %]" />[% publishercode %]
278 <label for="publishercode"> Publisher: </label>
279 <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />
283 [% IF ( biblionumber ) %]
284 <span class="label">Edition: </span>
285 <input type="hidden" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />[% editionstatement %]
288 <label for="editionstatement">Edition: </label>
289 <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />
293 [% IF ( biblionumber ) %]
294 <span class="label">Publication year: </span>
295 <input type="hidden" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
297 <label for="publicationyear">Publication year: </label>
298 <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
302 [% IF ( biblionumber ) %]
303 <span class="label">ISBN: </span>
304 <input type="hidden" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
306 <label for="ISBN">ISBN: </label>
307 <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
312 [% IF ( biblionumber ) %]
313 <span class="label">EAN: </span>
314 <input type="hidden" name="ean" id="EAN" value="[% ean %]" />[% ean %]
316 <label for="EAN">EAN: </label>
317 <input type="text" size="20" name="ean" id="EAN" value="[% ean %]" />
322 [% IF ( biblionumber ) %]
323 <span class="label">Series: </span>
324 <input type="hidden" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
326 <label for="series">Series: </label>
327 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
330 [% UNLESS ( biblionumber ) %]
331 [% IF ( itemtypeloop ) %]
333 <span class="label">Item type:</span>
334 <select name="itemtype" style="width:12em;">
335 [% FOREACH itemtype IN itemtypeloop %]
336 [% IF ( itemtype.selected ) %]
337 <option value="[% itemtype.itemtype %]" selected="selected">[% itemtype.description %]</option>
339 <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
349 [% IF ( suggestionid ) %]
350 <fieldset class="rows">
351 <legend>Suggestion</legend>
354 <span class="label">Suggested by: </span>
355 [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&op=show">suggestion #[% suggestionid %]</a>)
361 [% UNLESS subscriptionid %][% # it is a suggestion, we have not items %]
362 [% IF (AcqCreateItemOrdering) %]
364 <div id="items_list" style="display:none">
365 <p><b>Items list</b></p>
366 <div style="width:100%;overflow:auto;">
373 <th>Home library</th>
374 <th>Holding library</th>
375 <th>Not for loan</th>
380 <th>Stock number</th>
381 <th>Collection code</th>
393 <fieldset class="rows" id="itemfieldset">
394 <legend>Item</legend>
395 [% IF ( NoACQframework ) %]
396 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
399 <div id="outeritemblock"></div>
402 [% END %][%# UNLESS subscriptionid %]
403 [% END %][%# IF (AcqCreateItemOrdering) %]
404 <fieldset class="rows">
405 <legend>Accounting details</legend>
409 <span class="label required">Quantity: </span>
410 <input type="hidden" name="quantity" value="[% quantity %]" />[% quantity %]
412 <label class="required" for="quantity">Quantity: </label>
413 [% IF (AcqCreateItemOrdering) %]
414 [% IF subscriptionid %]
415 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
417 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
420 [% IF subscriptionid %]
421 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
423 <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
426 <span class="required">Required</span>
428 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
429 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
433 <span class="label required">Fund: </span>
434 <input type="hidden" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
436 <label class="required" for="budget_id">Fund: </label>
437 [% active_count = 0 %]
438 [% IF !ordernumber %]
439 [% FOREACH budget_loo IN budget_loop %]
440 [% active_count= active_count + budget_loo.b_active %]
443 <select id="budget_id" size="1" name="budget_id">
444 <option value="">Select a fund</option>
445 [% FOREACH budget_loo IN budget_loop %]
446 [% IF ( budget_loo.b_sel ) %]
447 [% active_count = 0 #select no other fund %]
448 <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
449 [% ELSIF active_count==1 && budget_loo.b_active %]
450 <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
452 [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
453 <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
455 [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
459 <span class="required">Required</span>
460 <label for="showallbudgets" style="float:none;width:auto;"> Show all:</label>
461 <input type="checkbox" id="showallbudgets" />
466 <span class="label">Currency: </span>
467 <input type="hidden" name="currency" id="currency" value="[% currency %]" />[% currency %]
469 <label for="currency">Currency:</label>
470 <select name="currency" id="currency" onchange="updateCosts();">
471 [% FOREACH loop_currencie IN loop_currencies %]
472 [% 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 %]
478 <span class="label">Vendor price: </span>
479 <input type="hidden" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %] [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
481 <label for="listprice">Vendor price: </label>
482 <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
485 [% UNLESS ( close ) %]
487 <label for="uncertainprice">Uncertain price: </label>
488 [% IF ( uncertainprice ) %]
489 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" checked="checked" />
491 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
495 [% IF ( gst_values ) %]
498 <span class="label">Tax rate: </span>
499 <input type="hidden" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
501 <label for="gstrate">Tax rate: </label>
502 <select name="gstrate" id="gstrate" onchange="updateCosts();">
503 [% FOREACH gst IN gst_values %]
504 [% IF ( gst.option == gstrate ) %]
505 <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
507 <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
513 <input type="hidden" name="gstrate" value="0" />
517 <label for="discount">Discount: </label>
519 [% IF ( orderdiscount ) %]
520 <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
522 <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
525 [% IF ( orderdiscount ) %]
526 <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
528 <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
534 <span class="label">Replacement cost: </span>
535 <input type="hidden" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %] (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
537 <label for="rrp">Replacement cost: </label>
538 <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
542 <label for="ecost">Budgeted cost: </label>
543 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
546 <label for="total">Total: </label>
547 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" /> (budgeted cost * quantity)
551 <label for="unitprice">Actual cost: </label>
552 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
554 <label for="unitprice">Actual cost: </label>
555 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
559 <label for="order_internalnote">Internal note: </label>
560 <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote %][% END %]</textarea>
563 <label for="order_vendornote">Vendor note: </label>
564 <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote %][% END %]</textarea>
566 <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
567 <label for="sort1">Statistic 1: </label>
568 <input id="sort1" type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
570 <label for="sort2">Statistic 2: </label>
571 <input id="sort2" type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
575 <fieldset class="action">
576 <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
577 <input type="submit" value="Save" />
578 [% IF (suggestionid) %]
579 <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a>
581 [% IF subscriptionid %]
582 <a class="cancel" href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a>
584 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
592 [% INCLUDE 'acquisitions-menu.inc' %]
595 [% INCLUDE 'intranet-bottom.inc' %]