Bug 10442: Remove references to non-standard "error" class
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / neworderempty.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 [% USE Koha %]
4 <title>Koha &rsaquo; Acquisitions &rsaquo; Basket [% basketno %] &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6
7 <script type="text/javascript" src="[% interface %]/[% theme %]/js/acq.js"></script>
8 [% INCLUDE 'additem.js.inc' %]
9 <script type="text/javascript" src="[% interface %]/[% theme %]/js/additem.js"></script>
10 <script type="text/javascript" src="[% interface %]/[% theme %]/js/cataloging.js"></script>
11 <script type="text/javascript" src="[% interface %]/[% theme %]/js/prevent_submit.js"></script>
12 <script type="text/javascript">
13 //<![CDATA[
14 actTotal = "";
15
16 function Check(ff) {
17     [% IF (AcqCreateItemOrdering) %]
18         // Remove last itemblock if it is not in items_list
19         var lastitemblock = $("#outeritemblock > div:last");
20         var tobedeleted = true;
21         var listitems = $("#items_list tr");
22         $(listitems).each(function(){
23             if($(this).attr('idblock') == $(lastitemblock).attr('id')){
24                 tobedeleted = false;
25             }
26         });
27         if(tobedeleted){
28             $(lastitemblock).remove();
29         }
30     [% END %]
31
32     var ok=0;
33     var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
34
35     _alertString +="-------------------------------------------------------------------\n\n";
36
37     if ( isNull(ff.title,1)  &&  isNull(ff.entertitle,1)   ){
38         ok=1;
39                     _alertString += "\n- " + _("Title cannot be empty");
40     }
41     
42     if(isNull(ff.budget_id,1)){
43                 ok=1;
44         _alertString += "\n- "+ _("You must select a fund");
45     }
46
47     if (!(isNum(ff.quantity,0)) || ff.quantity.value == 0){
48         ok=1;
49                     _alertString += "\n- " + _("Quantity must be greater than '0'");
50     }
51
52     if (!(isNum(ff.listprice,0))){
53         ok=1;
54                     _alertString += "\n- " + _("Vendor price must be a number");
55     }
56
57     if (!(isNum(ff.total,0))){
58         ok=1;
59                     _alertString += "\n- " + _("Total must be a number");
60     }
61
62     if (totalExceedsBudget(ff.budget_id.value, ff.total.value  )  ) {
63         ok=1;
64         _alertString += "\n- " + _("Order total (%s) exceeds budget available (%s)").format(ff.total.value, actTotal);
65     }
66
67     if ( ff.field_value ) {
68         var empty_item_mandatory = CheckMandatorySubfields(ff);
69         if (empty_item_mandatory > 0) {
70             ok = 1;
71             _alertString +=
72                 "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
73         }
74
75     }
76
77     if (ok) {
78         alert(_alertString);
79         [% IF (AcqCreateItemOrdering) %]
80             if(tobedeleted) {
81                 $(lastitemblock).appendTo('#outeritemblock');
82             }
83         [% END %]
84         return false;
85     }
86
87     [% IF (AcqCreateItemOrdering) %]
88         if(check_additem('[% UniqueItemFields %]') == false) {
89             alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
90             if(tobedeleted) {
91                 $(lastitemblock).appendTo('#outeritemblock');
92             }
93             return false;
94         }
95     [% END %]
96 }
97
98 $(document).ready(function() 
99     {
100         [% IF AcqCreateItemOrdering and not basket.is_standing %]
101             cloneItemBlock(0, '[% UniqueItemFields %]');
102         [% END %]
103
104         [% IF ( suggestionid ) %]updateCosts();[% END %]
105         $("#quantity").change(function() {
106             updateCosts();
107         });
108
109         //We apply the fonction only for modify option
110         [% IF ( quantityrec ) %]
111         [% IF ( acqcreate ) %]
112         $('#quantity').blur(function() 
113         {
114             // if user decreases the quantity
115             if($(this).val() < [% quantityrec %]) 
116             {
117                 alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
118                 return true;
119             } 
120             else 
121             {
122                 // if user increases the quantity
123                 alert(_("You can't add a new item, please create a new order line"));
124                 // and we replace the original value
125                 $(this).val([% quantityrec %])
126                 updateCosts(); // blur is invoked after change which updated values
127                 return false;
128             }
129         });
130         [% END %]
131         [% END %]
132         
133         //keep a copy of all budgets before removing the inactives
134         disabledBudgetsCopy = $('#budget_id').html();
135         $('#budget_id .b_inactive').remove();
136
137         $('#showallbudgets').click(function() {
138             if ($(this).is(":checked")) {
139                 $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
140             }
141             else {
142                 $('#budget_id .b_inactive').remove();
143             }
144         });
145
146         $("#budget_id").change(function(){
147             var destination_sort1 = $(this).parents('fieldset.rows').find('input[name="sort1"]');
148             var sort1_authcat = $(this).find("option:selected").attr('data-sort1-authcat');
149             var sort1 = $(destination_sort1).val() || "";
150             if ( destination_sort1.length < 1 ) {
151                 destination_sort1 = $(this).parents('fieldset.rows').find('select[name="sort1"]');
152             }
153             var destination_sort2 = $(this).parents('fieldset.rows').find('input[name="sort2"]');
154             var sort2_authcat = $(this).find("option:selected").attr('data-sort2-authcat');
155             var sort2 = $(destination_sort2).val() || "";
156             if ( destination_sort2.length < 1 ) {
157                 destination_sort2 = $(this).parents('fieldset.rows').find('select[name="sort2"]');
158             }
159             getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
160             getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
161         });
162         $("#budget_id").change();
163     });
164
165     function UserSearchPopup(f) {
166         window.open(
167             "/cgi-bin/koha/acqui/add_user_search.pl",
168             'UserSearchPopup',
169             'width=740, height=450, scrollbars=yes, toolbar=no,'
170          );
171     }
172
173     function add_user(borrowernumber, borrowername) {
174         var ids = $("#users_ids").val();
175         if(ids.length > 0) {
176             ids = ids.split(':');
177         } else {
178             ids = new Array;
179         }
180         if (ids.indexOf(borrowernumber.toString()) < 0) {
181             ids.push(borrowernumber);
182             $("#users_ids").val(ids.join(':'));
183             var li = '<li id="user_'+borrowernumber+'">'+borrowername
184                 + ' [<a style="cursor:pointer" onclick="del_user('+borrowernumber+');">'
185                 + _("Delete user") + '</a>]</li>';
186             $("#users_names").append(li);
187             return 0;
188         }
189         return -1;
190     }
191
192     function del_user(borrowernumber) {
193       $("#user_"+borrowernumber).remove();
194       var ids = $("#users_ids").val().split(':');
195       ids.splice(ids.indexOf(borrowernumber.toString()), 1);
196       $("#users_ids").val(ids.join(':'));
197     }
198 //]]>
199 </script>
200 </head>
201 <body id="acq_neworderempty" class="acq">
202
203 [% INCLUDE 'header.inc' %]
204 [% INCLUDE 'acquisitions-search.inc' %]
205
206 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</div>
207
208 <div id="doc3" class="yui-t2">
209
210 <div id="bd">
211     <div id="yui-main">
212     <div class="yui-b">
213
214 <h2>
215     [% IF ( ordernumber ) %]
216         Modify order line
217     [% ELSE %]
218         New order
219     [% END %]
220 </h2>
221
222 <div class="dialog alert order_error" style="display:none"></div>
223
224 [% IF ( basketno ) %]
225     <div id="acqui_basket_summary"  class="yui-g">
226     <fieldset class="rows">
227         <legend>Basket details</legend>
228         <ol>
229         [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
230         [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
231         [% IF ( basketcontractno ) %]
232             <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
233             <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
234         [% END %]
235         [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
236         [% IF ( creationdate ) %]<li><span class="label">Open on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
237         [% IF ( closedate ) %]
238         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
239         <li><span class="label">Closed on:</span>  [% closedate | $KohaDates %]</li>
240         [% IF ( basketgroups ) %]
241             <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
242                 [% FOREACH basketgroup IN basketgroups %]
243                     [% IF ( basketgroup.default ) %]
244                     <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
245                     [% ELSE %]
246                     <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
247                     [% END %]
248                 [% END %]
249                 </select>
250                 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
251                 <input type="hidden" value="mod_basket" name="op" />
252                 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
253             </li>
254             <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
255         [% END %]
256         </form>
257         [% END %]
258         </ol>
259     </fieldset>
260     </div>
261 [% END %]
262
263 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform" onsubmit="return Check(this);">
264
265     <fieldset class="rows">
266         <legend>Patrons</legend>
267         <ol>
268             <li>
269                 <span class="label">To notify on receiving:</span>
270                 <div style="float:left">
271                     <ul id="users_names" style="padding-left:0">
272                       [% FOREACH user IN users %]
273                         <li id="user_[% user.borrowernumber %]">
274                             [% user.firstname %] [% user.surname %]
275                             [<a onclick="del_user([% user.borrowernumber %]);" style="cursor:pointer">Delete user</a>]
276                         </li>
277                       [% END %]
278                     </ul>
279                     <input type="hidden" id="users_ids" name="users_ids" value="[% users_ids %]" />
280                     <input type="hidden" id="op" name="op" value="mod_users" />
281                     <input type="button" id="add_user" onclick="UserSearchPopup();" value="Add user" />
282                 </div>
283             </li>
284         </ol>
285     </fieldset>
286
287 <fieldset class="rows">
288         <legend>
289             Catalog details
290             [% IF ( biblionumber ) %]
291                 <span><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber %]"> Edit record</a></span>
292             [% END %]
293         </legend>
294         [% UNLESS ( existing ) %]
295         <input type="hidden" name="existing" value="no" />
296         [% END %]
297         <input type="hidden" name="ordernumber" value="[% ordernumber %]" />
298         <input type="hidden" name="basketno" value="[% basketno %]" />
299         <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
300         <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
301         <input type="hidden" name="listinc" id="listinc" value="[% listincgst %]" />
302         <input type="hidden" name="invoiceincgst" id="invoiceincgst" value="[% invoiceincgst %]" />
303         <input type="hidden" name="suggestionid" value="[% suggestionid %]" />
304         <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" />
305
306         [% FOREACH c IN currencies %]
307             <input type="hidden" id="currency_rate_[% c.currency %]"  name="[% c.currency %]" value="[% c.rate %]" />
308         [% END %]
309
310         <ol><li>
311             [% IF ( biblionumber ) %]
312             <span class="label">Title</span>
313                 <input type="hidden" name="title" value="[% title |html %]" /> <span class="title">[% title |html %]</span>
314             [% ELSE %]
315             <label for="entertitle" class="required">Title: </label>
316                 <input type="text" id="entertitle" size="50" name="title" value="[% title |html %]" class="focus" />
317                 <span class="required">Required</span>
318             [% END %]
319         </li>
320         <li>
321             [% IF ( biblionumber ) %]
322             <span class="label">Author: </span>
323                 <input type="hidden" name="author" id="author" value="[% author %]" />[% author %]
324             [% ELSE %]
325             <label for="author">Author: </label>
326                 <input type="text" size="50" name="author" id="author" value="[% author %]" />
327             [% END %]
328         </li>
329         <li>
330             [% IF ( biblionumber ) %]
331             <span class="label">Publisher: </span>
332                 <input type="hidden" name="publishercode" id="publishercode" value="[% publishercode %]" />[% publishercode %]
333             [% ELSE %]
334             <label for="publishercode"> Publisher: </label>
335                 <input type="text" size="50" name="publishercode" id="publishercode" value="[% publishercode %]" />
336             [% END %]
337         </li>
338         <li>
339             [% IF ( biblionumber ) %]
340             <span class="label">Edition: </span>
341                 <input type="hidden" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />[% editionstatement %]
342
343             [% ELSE %]
344             <label for="editionstatement">Edition: </label>
345                 <input type="text" size="20" name="editionstatement" id="editionstatement" value="[% editionstatement %]" />
346             [% END %]
347         </li>
348         <li>
349             [% IF ( biblionumber ) %]
350             <span class="label">Publication year: </span>
351                 <input type="hidden" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />[% publicationyear %]
352             [% ELSE %]
353             <label for="publicationyear">Publication year: </label>
354                 <input type="text" size="10" name="publicationyear" id="publicationyear" value="[% publicationyear %]" />
355             [% END %]
356         </li>
357         <li>
358             [% IF ( biblionumber ) %]
359             <span class="label">ISBN: </span>
360                 <input type="hidden" name="isbn" id="ISBN" value="[% isbn %]" />[% isbn %]
361             [% ELSE %]
362             <label for="ISBN">ISBN: </label>
363                 <input type="text" size="50" name="isbn" id="ISBN" value="[% isbn %]" />
364             [% END %]
365         </li>
366         [% IF (UNIMARC) %]
367         <li>
368             [% IF ( biblionumber ) %]
369             <span class="label">EAN: </span>
370                 <input type="hidden" name="ean" id="EAN" value="[% ean %]" />[% ean %]
371             [% ELSE %]
372             <label for="EAN">EAN: </label>
373                 <input type="text" size="20" name="ean" id="EAN" value="[% ean %]" />
374             [% END %]
375         </li>
376         [% END %]
377         <li>
378             [% IF ( biblionumber ) %]
379             <span class="label">Series: </span>
380                 <input type="hidden" name="series" id="series" value="[% seriestitle %]" />[% seriestitle %]
381             [% ELSE %]
382             <label for="series">Series: </label>
383                 <input type="text" size="50" name="series" id="series" value="[% seriestitle %]" />
384             [% END %]
385         </li>
386             [% UNLESS ( biblionumber ) %]
387             [% IF ( itemtypeloop ) %]
388             <li>
389                 <span class="label">Item type:</span>
390                 <select name="itemtype" style="width:12em;">
391                 [% FOREACH itemtype IN itemtypeloop %]
392                     <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
393                 [% END %]
394                 </select>
395             </li>
396             [% END %]
397             [% END %]
398         </ol>
399     </fieldset>
400
401     [% IF ( suggestionid ) %]
402         <fieldset class="rows">
403         <legend>Suggestion</legend>
404         <ol>
405           <li>
406             <span class="label">Suggested by: </span>
407             [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&amp;op=show">suggestion #[% suggestionid %]</a>)
408           </li>
409         </ol>
410         </fieldset>
411     [% END %]
412
413     [% UNLESS subscriptionid || basket.is_standing %][% # it is a suggestion, we have not items %]
414       [% IF (AcqCreateItemOrdering) %]
415
416       <div id="items_list" style="display:none">
417           <p><b>Items list</b></p>
418           <div style="width:100%;overflow:auto;">
419               <table>
420                   <thead>
421                       <tr>
422                           <th>&nbsp;</th>
423                           <th>&nbsp;</th>
424                           <th>Barcode</th>
425                           <th>Home library</th>
426                           <th>Holding library</th>
427                           <th>Not for loan</th>
428                           <th>Restricted</th>
429                           <th>Location</th>
430                           <th>Call number</th>
431                           <th>Copy number</th>
432                           <th>Inventory number</th>
433                           <th>Collection code</th>
434                           <th>Item type</th>
435                           <th>Materials</th>
436                           <th>Notes</th>
437                       </tr>
438                   </thead>
439                   <tbody>
440                   </tbody>
441               </table>
442           </div>
443       </div>
444
445       <fieldset class="rows" id="itemfieldset">
446           <legend>Item</legend>
447           [% IF ( NoACQframework ) %]
448               <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
449           [% END %]
450
451           [% UNLESS Koha.Preference('autoBarcode') == 'OFF' %]
452               <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>
453           [% END %]
454
455           <div id="outeritemblock"></div>
456
457       </fieldset>
458       [% END %][%# UNLESS subscriptionid %]
459     [% END %][%# IF (AcqCreateItemOrdering) %]
460     <fieldset class="rows">
461         <legend>Accounting details</legend>
462         <ol>
463             <li>
464                 [% IF ( close ) %]
465                     <span class="label required">Quantity: </span>
466                     <input type="hidden" name="quantity" value="[% quantity %]" />[% quantity %]
467                 [% ELSE %]
468                     <label class="required" for="quantity">Quantity: </label>
469                     [% IF (AcqCreateItemOrdering) %]
470                         [% IF subscriptionid || basket.is_standing %]
471                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
472                         [% ELSE %]
473                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="0" />
474                         [% END %]
475                     [% ELSE %]
476                         [% IF subscriptionid || basket.is_standing %]
477                             <input type="text" readonly="readonly" size="20" id="quantity" name="quantity" value="1" />
478                         [% ELSE %]
479                             <input type="text" size="20" id="quantity" name="quantity" value="[% quantityrec %]" onchange="updateCosts();" />
480                         [% END %]
481                     [% END %]
482                     <span class="required">Required</span>
483                 [% END %]
484                 <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, usefull when receiveing an order -->
485                 <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
486             </li>
487             <li>
488                 [% IF ( close ) %]
489             <span class="label required">Fund: </span>
490                     <input type="hidden" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
491                 [% ELSE %]
492                 <label class="required" for="budget_id">Fund: </label>
493                 [% active_count = 0 %]
494                 [% IF !ordernumber %]
495                     [% FOREACH budget_loo IN budget_loop %]
496                         [% active_count= active_count + budget_loo.b_active %]
497                     [% END %]
498                 [% END %]
499                 <select id="budget_id" size="1" name="budget_id">
500                     <option value="">Select a fund</option>
501                 [% FOREACH budget_loo IN budget_loop %]
502                     [% IF ( budget_loo.b_sel ) %]
503                         [% active_count = 0 #select no other fund %]
504                         <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
505                                 style="padding-left:[% budget_loo.b_level %]em;"
506                         >
507                     [% ELSIF active_count==1 && budget_loo.b_active %]
508                         <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
509                                 style="padding-left:[% budget_loo.b_level %]em;"
510                         >
511                     [% ELSE %]
512                         [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
513                         <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]"
514                                 style="padding-left:[% budget_loo.b_level %]em;"
515                         >
516                     [% END %]
517                     [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
518                     </option>
519                 [% END %]
520                 </select>
521                 <span class="required">Required</span>
522                 <label for="showallbudgets" style="float:none;">&nbsp;Show inactive:</label>
523                 <input type="checkbox" id="showallbudgets" />
524                 [% END %]
525             </li>
526                 <li>
527                 [% IF ( close ) %]
528                         <span class="label">Currency: </span>
529             <input type="hidden" name="currency" id="currency" value="[% currency %]" />[% currency %]
530                 [% ELSE %]
531                         <label for="currency">Currency:</label>
532             <select name="currency" id="currency" onchange="updateCosts();">
533                 [% FOREACH c IN currencies %]
534                     [% IF ordernumber and c.currency == currency or not ordernumber and c.currency == vendor_currency %]
535                         <option value="[% c.currency %]" selected="selected">[% c.currency %]</option>
536                     [% ELSIF not c.archived %]
537                         <option value="[% c.currency %]">[% c.currency %]</option>
538                     [% END %]
539                 [% END %]
540             </select>
541                 [% END %]
542                 </li>
543             <li>
544                 [% IF ( close ) %]
545                     <span class="label">Vendor price: </span>
546                     <input type="hidden" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %] [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
547                 [% ELSE %]
548                 <label for="listprice">Vendor price: </label>
549                     <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
550                 [% END %]
551             </li>
552             [% UNLESS ( close ) %]
553             <li>
554                     <label for="uncertainprice">Uncertain price: </label>
555                     [% IF ( uncertainprice ) %]
556                     <input type="checkbox" name="uncertainprice"  id="uncertainprice" value="1" checked="checked" />
557                     [% ELSE %]
558                     <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
559                 [% END %]
560             </li>
561             [% END %]
562             [% IF ( gst_values ) %]
563                 <li>
564                     [% IF ( close ) %]
565                         <span class="label">Tax rate: </span>
566                         <input type="hidden" name="tax_rate" id="tax_rate" value="[% tax_rate %]" />[% tax_rate %]%
567                     [% ELSE %]
568                         <label for="tax_rate">Tax rate: </label>
569                         <select name="tax_rate" id="tax_rate" onchange="updateCosts();">
570                         [% FOREACH gst IN gst_values %]
571                           [% IF ( gst.option == tax_rate ) %]
572                             <option value="[% gst.option %]" selected="selected">[% gst.option * 100 %]%</option>
573                           [% ELSE %]
574                             <option value="[% gst.option %]">[% gst.option * 100 %]%</option>
575                           [% END %]
576                         [% END %]
577                         </select>
578                     [% END %]
579                 [% ELSE %]
580                     <input type="hidden" name="tax_rate" value="0" />
581                 </li>
582             [% END %]
583             <li>
584                 <label for="discount">Discount: </label>
585                 [% IF ( close ) %]
586                     [% IF ( orderdiscount ) %]
587                         <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
588                     [% ELSE %]
589                         <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
590                     [% END %]
591                 [% ELSE %]
592                     [% IF ( orderdiscount ) %]
593                         <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
594                     [% ELSE %]
595                         <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
596                     [% END %]
597                 [% END %]
598             </li>
599             <li>
600                 [% IF ( close ) %]
601                     <span class="label">Replacement cost: </span>
602                     <input type="hidden" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]  (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
603                 [% ELSE %]
604                     <label for="rrp">Replacement cost: </label>
605                     <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
606                 [% END %]
607             </li>
608             <li>
609                 <label for="ecost">Budgeted cost: </label>
610                 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
611             </li>
612             <li>
613                 <label for="total">Total: </label>
614                 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" /> (budgeted cost * quantity)
615             </li>
616             <li>
617                 [% IF ( close ) %]
618                     <label for="unitprice">Actual cost: </label>
619                     <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
620                 [% ELSE %]
621                     <label for="unitprice">Actual cost: </label>
622                     <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
623                 [% END %]
624             </li>
625             <li>
626                 <label for="order_internalnote">Internal note: </label>
627                 <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote %][% END %]</textarea>
628             </li>
629             <li>
630                 <label for="order_vendornote">Vendor note: </label>
631                 <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote %][% END %]</textarea>
632             </li>
633             <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
634                 <label for="sort1">Statistic 1: </label>
635                 <input id="sort1" type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
636             <li>
637                 <label for="sort2">Statistic 2: </label>
638                 <input id="sort2" type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
639             </li>
640         </ol>
641     </fieldset>
642     <fieldset class="action">
643         <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
644         <input type="submit" value="Save" />
645         [% IF (suggestionid) %]
646             <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Cancel</a>
647         [% ELSE %]
648             [% IF subscriptionid %]
649                 <a class="cancel" href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Cancel</a>
650             [% ELSE %]
651                 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
652             [% END %]
653         [% END %]
654     </fieldset>
655 </form>
656
657 <div id="procModal" data-backdrop="static" class="modal fade" aria-labelledby="procModal" aria-hidden="true">
658     <div class="modal-dialog">
659     <div class="modal-content">
660     <div class="modal-body">
661     <h3>Processing multiple items</h3>
662     </div>
663     </div>
664     </div>
665 </div>
666
667 <div id="multiCountModal" class="modal fade" aria-labelledby="multiCountModal" aria-hidden="true">
668     <div class="modal-dialog">
669     <div class="modal-content">
670     <h3>Invalid number of copies</h3>
671     <p>Please enter a <b>number</b>, greater than or equal to 1</p>
672     </div>
673     </div>
674 </div>
675
676 </div>
677 </div>
678 <div class="yui-b">
679 [% INCLUDE 'acquisitions-menu.inc' %]
680 </div>
681 </div>
682 [% INCLUDE 'intranet-bottom.inc' %]