4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Acquisitions › Basket [% basketno %] › [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
6 [% INCLUDE 'doc-head-close.inc' %]
9 <body id="acq_neworderempty" class="acq">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'acquisitions-search.inc' %]
14 <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>
16 <div id="doc3" class="yui-t2">
23 [% IF ( ordernumber ) %]
30 <div class="error" style="display:none"></div>
33 <div id="acqui_basket_summary" class="yui-g">
34 <fieldset class="rows">
35 <legend>Basket details</legend>
37 [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
38 [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
39 [% IF ( basketcontractno ) %]
40 <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
41 <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
43 [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span> [% authorisedbyname %]</li>[% END %]
44 [% IF ( creationdate ) %]<li><span class="label">Open on:</span> [% creationdate | $KohaDates %]</li>[% END %]
45 [% IF ( closedate ) %]
46 <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
47 <li><span class="label">Closed on:</span> [% closedate | $KohaDates %]</li>
48 [% IF ( basketgroups ) %]
49 <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
50 [% FOREACH basketgroup IN basketgroups %]
51 [% IF ( basketgroup.default ) %]
52 <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
54 <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
58 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
59 <input type="hidden" value="mod_basket" name="op" />
60 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
62 <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
71 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform" onsubmit="return Check(this);">
73 <fieldset class="rows">
74 <legend>Patrons</legend>
77 <span class="label">To notify on receiving:</span>
78 <div style="float:left">
79 <ul id="users_names" style="padding-left:0">
80 [% FOREACH user IN users %]
81 <li id="user_[% user.borrowernumber %]">
82 [% user.firstname %] [% user.surname %]
83 [<a onclick="del_user([% user.borrowernumber %]);" style="cursor:pointer">Delete user</a>]
87 <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids %]" />
88 <input type="hidden" id="op" name="op" value="mod_users" />
89 <input type="button" id="add_user" onclick="UserSearchPopup();" value="Add user" />
95 <fieldset class="rows">
98 [% IF ( biblionumber ) %]
99 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]"> Edit record</a></span>
102 [% UNLESS ( existing ) %]
103 <input type="hidden" name="existing" value="no" />
105 <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
106 <input type="hidden" name="basketno" value="[% basketno %]" />
107 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
108 <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
109 <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
110 <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
111 <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
112 <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
114 [% FOREACH c IN currencies %]
115 <input type="hidden" id="currency_rate_[% c.currency %]" name="[% c.currency %]" value="[% c.rate %]" />
119 [% IF ( biblionumber ) %]
120 <span class="label">Title</span>
121 <input type="hidden" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
123 <label for="entertitle" class="required">Title: </label>
124 <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" class="focus" />
125 <span class="required">Required</span>
129 [% IF ( biblionumber ) %]
130 <span class="label">Author: </span>
131 <input type="hidden" name="author" id="author" value="[% author %]" />[% author %]
133 <label for="author">Author: </label>
134 <input type="text" size="50" name="author" id="author" value="[% author %]" />
138 [% IF ( biblionumber ) %]
139 <span class="label">Publisher: </span>
140 <input type="hidden" name="publishercode" id="publishercode" value="[% publishercode %]" />[% publishercode %]
142 <label for="publishercode"> Publisher: </label>
143 <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />
147 [% IF ( biblionumber ) %]
148 <span class="label">Edition: </span>
149 <input type="hidden" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />[% editionstatement %]
152 <label for="editionstatement">Edition: </label>
153 <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />
157 [% IF ( biblionumber ) %]
158 <span class="label">Publication year: </span>
159 <input type="hidden" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
161 <label for="publicationyear">Publication year: </label>
162 <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
166 [% IF ( biblionumber ) %]
167 <span class="label">ISBN: </span>
168 <input type="hidden" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
170 <label for="ISBN">ISBN: </label>
171 <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
176 [% IF ( biblionumber ) %]
177 <span class="label">EAN: </span>
178 <input type="hidden" name="ean" id="EAN" value="[% ean %]" />[% ean %]
180 <label for="EAN">EAN: </label>
181 <input type="text" size="20" name="ean" id="EAN" value="[% ean %]" />
186 [% IF ( biblionumber ) %]
187 <span class="label">Series: </span>
188 <input type="hidden" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
190 <label for="series">Series: </label>
191 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
194 [% UNLESS ( biblionumber ) %]
195 [% IF ( itemtypeloop ) %]
197 <span class="label">Item type:</span>
198 <select name="itemtype" style="width:12em;">
199 [% FOREACH itemtype IN itemtypeloop %]
200 <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
209 [% IF ( suggestionid ) %]
210 <fieldset class="rows">
211 <legend>Suggestion</legend>
214 <span class="label">Suggested by: </span>
215 [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&op=show">suggestion #[% suggestionid %]</a>)
221 [% UNLESS subscriptionid || basket.is_standing %][% # it is a suggestion, we have not items %]
222 [% IF (AcqCreateItemOrdering) %]
224 <div id="items_list" style="display:none">
225 <p><b>Items list</b></p>
226 <div style="width:100%;overflow:auto;">
233 <th>Home library</th>
234 <th>Holding library</th>
235 <th>Not for loan</th>
240 <th>Inventory number</th>
241 <th>Collection code</th>
253 <fieldset class="rows" id="itemfieldset">
254 <legend>Item</legend>
255 [% IF ( NoACQframework ) %]
256 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
259 [% UNLESS Koha.Preference('autoBarcode') == 'OFF' %]
260 <div class="dialog message">The autoBarcode system preference is set to [% Koha.Preference('autoBarcode') %] and items with blank barcodes will have barcodes generated upon save to database</div>
263 <div id="outeritemblock"></div>
266 [% END %][%# UNLESS subscriptionid %]
267 [% END %][%# IF (AcqCreateItemOrdering) %]
268 <fieldset class="rows">
269 <legend>Accounting details</legend>
273 <span class="label required">Quantity: </span>
274 <input type="hidden" name="quantity" value="[% quantity %]" />[% quantity %]
276 <label class="required" for="quantity">Quantity: </label>
277 [% IF (AcqCreateItemOrdering) %]
278 [% IF subscriptionid || basket.is_standing %]
279 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
281 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
284 [% IF subscriptionid || basket.is_standing %]
285 <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
287 <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
290 <span class="required">Required</span>
292 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
293 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
297 <span class="label required">Fund: </span>
298 <input type="hidden" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
300 <label class="required" for="budget_id">Fund: </label>
301 [% active_count = 0 %]
302 [% IF !ordernumber %]
303 [% FOREACH budget_loo IN budget_loop %]
304 [% active_count= active_count + budget_loo.b_active %]
307 <select id="budget_id" size="1" name="budget_id">
308 <option value="">Select a fund</option>
309 [% FOREACH budget_loo IN budget_loop %]
310 [% IF ( budget_loo.b_sel ) %]
311 [% active_count = 0 #select no other fund %]
312 <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
313 style="padding-left:[% budget_loo.b_level %]em;"
315 [% ELSIF active_count==1 && budget_loo.b_active %]
316 <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
317 style="padding-left:[% budget_loo.b_level %]em;"
320 [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
321 <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
322 style="padding-left:[% budget_loo.b_level %]em;"
325 [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
329 <span class="required">Required</span>
330 <label for="showallbudgets" style="float:none;"> Show inactive:</label>
331 <input type="checkbox" id="showallbudgets" />
336 <span class="label">Currency: </span>
337 <input type="hidden" name="currency" id="currency" value="[% currency %]" />[% currency %]
339 <label for="currency">Currency:</label>
340 <select name="currency" id="currency" onchange="updateCosts();">
341 [% FOREACH c IN currencies %]
342 [% IF ordernumber and c.currency == currency or not ordernumber and c.currency == vendor_currency %]
343 <option value="[% c.currency %]" selected="selected">[% c.currency %]</option>
344 [% ELSIF not c.archived %]
345 <option value="[% c.currency %]">[% c.currency %]</option>
353 <span class="label">Vendor price: </span>
354 <input type="hidden" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %] [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
356 <label for="listprice">Vendor price: </label>
357 <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
360 [% UNLESS ( close ) %]
362 <label for="uncertainprice">Uncertain price: </label>
363 [% IF ( uncertainprice ) %]
364 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" checked="checked" />
366 <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
370 [% IF ( gst_values ) %]
373 <span class="label">Tax rate: </span>
374 <input type="hidden" name="tax_rate" id="tax_rate" value="[% tax_rate %]" />[% tax_rate %]%
376 <label for="tax_rate">Tax rate: </label>
377 <select name="tax_rate" id="tax_rate" onchange="updateCosts();">
378 [% FOREACH gst IN gst_values %]
379 [% IF ( gst.option == tax_rate ) %]
380 <option value="[% gst.option %]" selected="selected">[% gst.option * 100 %]%</option>
382 <option value="[% gst.option %]">[% gst.option * 100 %]%</option>
388 <input type="hidden" name="tax_rate" value="0" />
392 <label for="discount">Discount: </label>
394 [% IF ( orderdiscount ) %]
395 <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
397 <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
400 [% IF ( orderdiscount ) %]
401 <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
403 <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
409 <span class="label">Replacement cost: </span>
410 <input type="hidden" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %] (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
412 <label for="rrp">Replacement cost: </label>
413 <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
417 <label for="ecost">Budgeted cost: </label>
418 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly" /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
421 <label for="total">Total: </label>
422 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" /> (budgeted cost * quantity)
426 <label for="unitprice">Actual cost: </label>
427 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
429 <label for="unitprice">Actual cost: </label>
430 <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
434 <label for="order_internalnote">Internal note: </label>
435 <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote %][% END %]</textarea>
438 <label for="order_vendornote">Vendor note: </label>
439 <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote %][% END %]</textarea>
441 <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
442 <label for="sort1">Statistic 1: </label>
443 <input id="sort1" type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
445 <label for="sort2">Statistic 2: </label>
446 <input id="sort2" type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
450 <fieldset class="action">
451 <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
452 <input type="submit" value="Save" />
453 [% IF (suggestionid) %]
454 <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a>
456 [% IF subscriptionid %]
457 <a class="cancel" href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]">Cancel</a>
459 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
465 <div id="procModal" data-backdrop="static" class="modal fade" aria-labelledby="procModal" aria-hidden="true">
466 <div class="modal-dialog">
467 <div class="modal-content">
468 <div class="modal-body">
469 <h3>Processing multiple items</h3>
475 <div id="multiCountModal" class="modal fade" aria-labelledby="multiCountModal" aria-hidden="true">
476 <div class="modal-dialog">
477 <div class="modal-content">
478 <h3>Invalid number of copies</h3>
479 <p>Please enter a <b>number</b>, greater than or equal to 1</p>
487 [% INCLUDE 'acquisitions-menu.inc' %]
491 [% MACRO jsinclude BLOCK %]
492 <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
493 <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq_[% KOHA_VERSION %].js"></script>
494 [% INCLUDE 'additem.js.inc' %]
495 <script type="text/javascript" src="[% interface %]/[% theme %]/js/additem_[% KOHA_VERSION %].js"></script>
496 <script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging_[% KOHA_VERSION %].js"></script>
497 <script type="text/javascript" src="[% interface %]/[% theme %]/js/prevent_submit_[% KOHA_VERSION %].js"></script>
498 <script type="text/javascript">
502 [% IF (AcqCreateItemOrdering) %]
503 // Remove last itemblock if it is not in items_list
504 var lastitemblock = $("#outeritemblock > div:last");
505 var tobedeleted = true;
506 var listitems = $("#items_list tr");
507 $(listitems).each(function(){
508 if($(this).attr('idblock') == $(lastitemblock).attr('id')){
513 $(lastitemblock).remove();
518 var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
520 _alertString +="-------------------------------------------------------------------\n\n";
522 if ( isNull(ff.title,1) && isNull(ff.entertitle,1) ){
524 _alertString += "\n- " + _("Title cannot be empty");
527 if(isNull(ff.budget_id,1)){
529 _alertString += "\n- "+ _("You must select a fund");
532 if (!(isNum(ff.quantity,0)) || ff.quantity.value == 0){
534 _alertString += "\n- " + _("Quantity must be greater than '0'");
537 if (!(isNum(ff.listprice,0))){
539 _alertString += "\n- " + _("Vendor price must be a number");
542 if (!(isNum(ff.total,0))){
544 _alertString += "\n- " + _("Total must be a number");
547 if (totalExceedsBudget(ff.budget_id.value, ff.total.value ) ) {
549 _alertString += "\n- " + _("Order total (%s) exceeds budget available (%s)").format(ff.total.value, actTotal);
552 if ( ff.field_value ) {
553 var empty_item_mandatory = CheckMandatorySubfields(ff);
554 if (empty_item_mandatory > 0) {
557 "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
564 [% IF (AcqCreateItemOrdering) %]
566 $(lastitemblock).appendTo('#outeritemblock');
572 [% IF (AcqCreateItemOrdering) %]
573 if(check_additem('[% UniqueItemFields %]') == false) {
574 alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
576 $(lastitemblock).appendTo('#outeritemblock');
583 $(document).ready(function(){
584 [% IF AcqCreateItemOrdering and not basket.is_standing %]
585 cloneItemBlock(0, '[% UniqueItemFields %]');
588 [% IF ( suggestionid ) %]updateCosts();[% END %]
589 $("#quantity").change(function() {
593 //We apply the fonction only for modify option
594 [% IF ( quantityrec ) %]
595 [% IF ( acqcreate ) %]
596 $('#quantity').blur(function(){
597 // if user decreases the quantity
598 if($(this).val() < [% quantityrec %]){
599 alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
602 // if user increases the quantity
603 alert(_("You can't add a new item, please create a new order line"));
604 // and we replace the original value
605 $(this).val([% quantityrec %])
606 updateCosts(); // blur is invoked after change which updated values
613 //keep a copy of all budgets before removing the inactives
614 disabledBudgetsCopy = $('#budget_id').html();
615 $('#budget_id .b_inactive').remove();
617 $('#showallbudgets').click(function() {
618 if ($(this).is(":checked")) {
619 $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
622 $('#budget_id .b_inactive').remove();
626 $("#budget_id").change(function(){
627 var destination_sort1 = $(this).parents('fieldset.rows').find('input[name="sort1"]');
628 var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
629 var sort1 = $(destination_sort1).val() || "";
630 if ( destination_sort1.length < 1 ) {
631 destination_sort1 = $(this).parents('fieldset.rows').find('select[name="sort1"]');
633 var destination_sort2 = $(this).parents('fieldset.rows').find('input[name="sort2"]');
634 var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
635 var sort2 = $(destination_sort2).val() || "";
636 if ( destination_sort2.length < 1 ) {
637 destination_sort2 = $(this).parents('fieldset.rows').find('select[name="sort2"]');
639 getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
640 getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
642 $("#budget_id").change();
645 function UserSearchPopup(f) {
647 "/cgi-bin/koha/acqui/add_user_search.pl",
649 'width=740, height=450, scrollbars=yes, toolbar=no,'
653 function add_user(borrowernumber, borrowername) {
654 var ids = $("#users_ids").val();
656 ids = ids.split(':');
660 if (ids.indexOf(borrowernumber.toString()) < 0) {
661 ids.push(borrowernumber);
662 $("#users_ids").val(ids.join(':'));
663 var li = '<li id="user_'+borrowernumber+'">'+borrowername
664 + ' [<a style="cursor:pointer" onclick="del_user('+borrowernumber+');">'
665 + _("Delete user") + '</a>]</li>';
666 $("#users_names").append(li);
672 function del_user(borrowernumber) {
673 $("#user_"+borrowernumber).remove();
674 var ids = $("#users_ids").val().split(':');
675 ids.splice(ids.indexOf(borrowernumber.toString()), 1);
676 $("#users_ids").val(ids.join(':'));
681 [% INCLUDE 'intranet-bottom.inc' %]