Bug 10904: Limit patron update request management by branch
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / neworderempty.tt
1 [% USE KohaDates %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Acquisitions &rsaquo; Basket [% basketno %] &rsaquo; [% IF ( ordernumber ) %]Modify order details (line #[% ordernumber %])[% ELSE %]New order[% END %]</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5
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">
12 //<![CDATA[
13 actTotal = "";
14
15 function Check(ff) {
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')){
23                 tobedeleted = false;
24             }
25         });
26         if(tobedeleted){
27             $(lastitemblock).remove();
28         }
29     [% END %]
30
31     var ok=0;
32     var _alertString= _("Form not submitted because of the following problem(s)")+"\n";
33
34     _alertString +="-------------------------------------------------------------------\n\n";
35
36     if ( isNull(ff.title,1)  &&  isNull(ff.entertitle,1)   ){
37         ok=1;
38                     _alertString += "\n- " + _("Title cannot be empty");
39     }
40     
41     if(isNull(ff.budget_id,1)){
42                 ok=1;
43         _alertString += "\n- "+ _("You must select a fund");
44     }
45
46     if (!(isNum(ff.quantity,0)) || ff.quantity.value == 0){
47         ok=1;
48                     _alertString += "\n- " + _("Quantity must be greater than '0'");
49     }
50
51     if (!(isNum(ff.listprice,0))){
52         ok=1;
53                     _alertString += "\n- " + _("Vendor price must be a number");
54     }
55
56     if (!(isNum(ff.total,0))){
57         ok=1;
58                     _alertString += "\n- " + _("Total must be a number");
59     }
60
61     if (totalExceedsBudget(ff.budget_id.value, ff.total.value  )  ) {
62         ok=1;
63         _alertString += "\n- " + _("Order total (%s) exceeds budget available (%s)").format(ff.total.value, actTotal);
64     }
65
66     if ( ff.field_value ) {
67         var empty_item_mandatory = CheckMandatorySubfields(ff);
68         if (empty_item_mandatory > 0) {
69             ok = 1;
70             _alertString +=
71                 "\n- " + _("%s item mandatory fields empty").format(empty_item_mandatory);
72         }
73
74     }
75
76     if (ok) {
77         alert(_alertString);
78         [% IF (AcqCreateItemOrdering) %]
79             if(tobedeleted) {
80                 $(lastitemblock).appendTo('#outeritemblock');
81             }
82         [% END %]
83         return false;
84     }
85
86     [% IF (AcqCreateItemOrdering) %]
87         if(check_additem('[% UniqueItemFields %]') == false) {
88             alert(_("Duplicate values detected. Please correct the errors and resubmit.") );
89             if(tobedeleted) {
90                 $(lastitemblock).appendTo('#outeritemblock');
91             }
92             return false;
93         }
94     [% END %]
95 }
96
97 $(document).ready(function() 
98     {
99         [% IF (AcqCreateItemOrdering) %]
100             cloneItemBlock(0, '[% UniqueItemFields %]');
101         [% END %]
102
103         [% IF ( suggestionid ) %]updateCosts();[% END %]
104         $("#quantity").change(function() {
105             updateCosts();
106         });
107
108         //We apply the fonction only for modify option
109         [% IF ( quantityrec ) %]
110         [% IF ( acqcreate ) %]
111         $('#quantity').blur(function() 
112         {
113             // if user decreases the quantity
114             if($(this).val() < [% quantityrec %]) 
115             {
116                 alert(_("You have deleted item(s) in the order, don't forget to delete it(them) in the catalog"));
117                 return true;
118             } 
119             else 
120             {
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
126                 return false;
127             }
128         });
129         [% END %]
130         [% END %]
131         
132         //keep a copy of all budgets before removing the inactives
133         disabledBudgetsCopy = $('#budget_id').html();
134         $('#budget_id .b_inactive').remove();
135
136         $('#showallbudgets').click(function() {
137             if ($(this).is(":checked")) {
138                 $('#budget_id').html(disabledBudgetsCopy); //Puts back all the funds
139             }
140             else {
141                 $('#budget_id .b_inactive').remove();
142             }
143         });
144
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"]');
151             }
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"]');
157             }
158             getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
159             getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
160         });
161         $("#budget_id").change();
162     });
163
164     function UserSearchPopup(f) {
165         window.open(
166             "/cgi-bin/koha/acqui/add_user_search.pl",
167             'UserSearchPopup',
168             'width=740, height=450, scrollbars=yes, toolbar=no,'
169          );
170     }
171
172     function add_user(borrowernumber, borrowername) {
173         var ids = $("#users_ids").val();
174         if(ids.length > 0) {
175             ids = ids.split(':');
176         } else {
177             ids = new Array;
178         }
179         if (ids.indexOf(borrowernumber) < 0) {
180             ids.push(borrowernumber);
181             $("#users_ids").val(ids.join(':'));
182             var li = '<li id="user_'+borrowernumber+'">'+borrowername
183                 + ' [<a style="cursor:pointer" onclick="del_user('+borrowernumber+');">'
184                 + _("Delete user") + '</a>]</li>';
185             $("#users_names").append(li);
186             return 0;
187         }
188         return -1;
189     }
190
191     function del_user(borrowernumber) {
192       $("#user_"+borrowernumber).remove();
193       var ids = $("#users_ids").val().split(':');
194       ids.splice(ids.indexOf(borrowernumber.toString()), 1);
195       $("#users_ids").val(ids.join(':'));
196     }
197 //]]>
198 </script>
199 </head>
200 <body id="acq_neworderempty" class="acq">
201
202 [% INCLUDE 'header.inc' %]
203 [% INCLUDE 'acquisitions-search.inc' %]
204
205 <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>
206
207 <div id="doc3" class="yui-t2">
208
209 <div id="bd">
210     <div id="yui-main">
211     <div class="yui-b">
212
213 <h2>
214     [% IF ( ordernumber ) %]
215         Modify order line
216     [% ELSE %]
217         New order
218     [% END %]
219 </h2>
220
221 <div class="error" style="display:none"></div>
222
223 [% IF ( basketno ) %]
224     <div id="acqui_basket_summary"  class="yui-g">
225     <fieldset class="rows">
226         <legend>Basket details</legend>
227         <ol>
228         [% IF ( basketnote ) %]<li><span class="label">Internal note:</span> [% basketnote %]</li>[% END %]
229         [% IF ( basketbooksellernote ) %]<li><span class="label">Vendor note:</span> [% basketbooksellernote %]</li>[% END %]
230         [% IF ( basketcontractno ) %]
231             <li><span class="label">Contract number: </span>[% basketcontractno %]</li>
232             <li><span class="label">Contract name:</span> <a href="/cgi-bin/koha/admin/aqcontract.pl?op=add_form&amp;contractnumber=[% basketcontractno %]">[% basketcontractname %]</a></li>
233         [% END %]
234         [% IF ( authorisedbyname ) %]<li><span class="label">Managed by:</span>  [% authorisedbyname %]</li>[% END %]
235         [% IF ( creationdate ) %]<li><span class="label">Open on:</span>  [% creationdate | $KohaDates %]</li>[% END %]
236         [% IF ( closedate ) %]
237         <form action="/cgi-bin/koha/acqui/basketgroup.pl" method="post">
238         <li><span class="label">Closed on:</span>  [% closedate | $KohaDates %]</li>
239         [% IF ( basketgroups ) %]
240             <li>Basketgroup: <select id="basketgroupid" name="basketgroupid">
241                 [% FOREACH basketgroup IN basketgroups %]
242                     [% IF ( basketgroup.default ) %]
243                     <option value="[% basketgroup.id %]" selected="selected">[% basketgroup.name %]</option>
244                     [% ELSE %]
245                     <option value="[% basketgroup.id %]">[% basketgroup.name %]</option>
246                     [% END %]
247                 [% END %]
248                 </select>
249                 <input type="hidden" id="basketno" value="[% basketno %]" name="basketno" />
250                 <input type="hidden" value="mod_basket" name="op" />
251                 <input type="hidden" name="booksellerid" value="[% booksellerid %]" />
252             </li>
253             <fieldset class="action"><input type="submit" value="Change basketgroup" /></fieldset>
254         [% END %]
255         </form>
256         [% END %]
257         </ol>
258     </fieldset>
259     </div>
260 [% END %]
261
262 <form action="/cgi-bin/koha/acqui/addorder.pl" method="post" id="Aform" onsubmit="return Check(this);">
263
264     <fieldset class="rows">
265         <legend>Patrons</legend>
266         <ol>
267             <li>
268                 <span class="label">To notify on receiving:</span>
269                 <div style="float:left">
270                     <ul id="users_names" style="padding-left:0">
271                       [% FOREACH user IN users %]
272                         <li id="user_[% user.borrowernumber %]">
273                             [% user.firstname %] [% user.surname %]
274                             [<a onclick="del_user([% user.borrowernumber %]);" style="cursor:pointer">Delete user</a>]
275                         </li>
276                       [% END %]
277                     </ul>
278                     <input type="hidden" id="basketno" name="basketno" value="[% basketno %]" />
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 loop_currencie IN loop_currencies %]
307             <input type="hidden" id="currency_rate_[% loop_currencie.currcode %]"  name="[% loop_currencie.currcode %]" value="[% loop_currencie.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                     [% IF ( itemtype.selected ) %]
393                         <option value="[% itemtype.itemtype %]" selected="selected">[% itemtype.description %]</option>
394                     [% ELSE %]
395                         <option value="[% itemtype.itemtype %]">[% itemtype.description %]</option>
396                     [% END %]
397                 [% END %]
398                 </select>
399             </li>
400             [% END %]
401             [% END %]
402         </ol>
403     </fieldset>
404
405     [% IF ( suggestionid ) %]
406         <fieldset class="rows">
407         <legend>Suggestion</legend>
408         <ol>
409           <li>
410             <span class="label">Suggested by: </span>
411             [% surnamesuggestedby %][% IF ( firstnamesuggestedby ) %], [% firstnamesuggestedby %][% END %] (<a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% suggestionid %]&amp;op=show">suggestion #[% suggestionid %]</a>)
412           </li>
413         </ol>
414         </fieldset>
415     [% END %]
416
417     [% UNLESS subscriptionid %][% # it is a suggestion, we have not items %]
418       [% IF (AcqCreateItemOrdering) %]
419
420       <div id="items_list" style="display:none">
421           <p><b>Items list</b></p>
422           <div style="width:100%;overflow:auto;">
423               <table>
424                   <thead>
425                       <tr>
426                           <th>&nbsp;</th>
427                           <th>&nbsp;</th>
428                           <th>Barcode</th>
429                           <th>Home library</th>
430                           <th>Holding library</th>
431                           <th>Not for loan</th>
432                           <th>Restricted</th>
433                           <th>Location</th>
434                           <th>Call number</th>
435                           <th>Copy number</th>
436                           <th>Inventory number</th>
437                           <th>Collection code</th>
438                           <th>Item type</th>
439                           <th>Materials</th>
440                           <th>Notes</th>
441                       </tr>
442                   </thead>
443                   <tbody>
444                   </tbody>
445               </table>
446           </div>
447       </div>
448
449       <fieldset class="rows" id="itemfieldset">
450           <legend>Item</legend>
451           [% IF ( NoACQframework ) %]
452               <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</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 %]
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 %]
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                     [% ELSIF active_count==1 && budget_loo.b_active %]
506                         <option value="[% budget_loo.b_id %]" selected="selected" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
507                     [% ELSE %]
508                         [% bdgclass=budget_loo.b_active? "": "b_inactive" %]
509                         <option value="[% budget_loo.b_id %]" class="[% bdgclass %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat %]">
510                     [% END %]
511                     [% budget_loo.b_txt %][% IF !budget_loo.b_active %] (inactive)[% END %]
512                     </option>
513                 [% END %]
514                 </select>
515                 <span class="required">Required</span>
516                 <label for="showallbudgets" style="float:none;">&nbsp;Show inactive:</label>
517                 <input type="checkbox" id="showallbudgets" />
518                 [% END %]
519             </li>
520                 <li>
521                 [% IF ( close ) %]
522                         <span class="label">Currency: </span>
523             <input type="hidden" name="currency" id="currency" value="[% currency %]" />[% currency %]
524                 [% ELSE %]
525                         <label for="currency">Currency:</label>
526                         <select name="currency" id="currency" onchange="updateCosts();">
527                         [% FOREACH loop_currencie IN loop_currencies %]
528                         [% 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 %]
529                         </select>
530                 [% END %]
531                 </li>
532             <li>
533                 [% IF ( close ) %]
534                     <span class="label">Vendor price: </span>
535                     <input type="hidden" name="listprice" id="listprice" value="[% listprice %]" />[% listprice %] [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
536                 [% ELSE %]
537                 <label for="listprice">Vendor price: </label>
538                     <input type="text" size="20" name="listprice" id="listprice" value="[% listprice %]" onchange="updateCosts()" /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
539                 [% END %]
540             </li>
541             [% UNLESS ( close ) %]
542             <li>
543                     <label for="uncertainprice">Uncertain price: </label>
544                     [% IF ( uncertainprice ) %]
545                     <input type="checkbox" name="uncertainprice"  id="uncertainprice" value="1" checked="checked" />
546                     [% ELSE %]
547                     <input type="checkbox" name="uncertainprice" id="uncertainprice" value="1" />
548                 [% END %]
549             </li>
550             [% END %]
551             [% IF ( gst_values ) %]
552                 <li>
553                     [% IF ( close ) %]
554                         <span class="label">Tax rate: </span>
555                         <input type="hidden" name="gstrate" id="gstrate" value="[% gstrate %]" />[% gstrate %]%
556                     [% ELSE %]
557                         <label for="gstrate">Tax rate: </label>
558                         <select name="gstrate" id="gstrate" onchange="updateCosts();">
559                         [% FOREACH gst IN gst_values %]
560                           [% IF ( gst.option == gstrate ) %]
561                             <option value="[% gst.option %]" selected="selected">[% gst.option * 100 | format("%.1f") %]%</option>
562                           [% ELSE %]
563                             <option value="[% gst.option %]">[% gst.option * 100 | format("%.1f") %]%</option>
564                           [% END %]
565                         [% END %]
566                         </select>
567                     [% END %]
568                 [% ELSE %]
569                     <input type="hidden" name="gstrate" value="0" />
570                 </li>
571             [% END %]
572             <li>
573                 <label for="discount">Discount: </label>
574                 [% IF ( close ) %]
575                     [% IF ( orderdiscount ) %]
576                         <input type="hidden" name="discount" id="discount" value="[% orderdiscount %]" />[% orderdiscount_2dp %]%
577                     [% ELSE %]
578                         <input type="hidden" name="discount" id="discount" value="[% discount %]" />[% discount_2dp %]%
579                     [% END %]
580                 [% ELSE %]
581                     [% IF ( orderdiscount ) %]
582                         <input type="text" size="6" name="discount" id="discount" value="[% orderdiscount %]" onchange="updateCosts();" />%
583                     [% ELSE %]
584                         <input type="text" size="6" name="discount" id="discount" value="[% discount %]" onchange="updateCosts();" />%
585                     [% END %]
586                 [% END %]
587             </li>
588             <li>
589                 [% IF ( close ) %]
590                     <span class="label">Replacement cost: </span>
591                     <input type="hidden" name="rrp" id="rrp" value="[% rrp %]" />[% rrp %]  (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
592                 [% ELSE %]
593                     <label for="rrp">Replacement cost: </label>
594                     <input type="text" size="20" name="rrp" id="rrp" value="[% rrp %]" /> (adjusted for [% cur_active %], [% IF (listincgst == 1) %]tax inc.[% ELSE %]tax exc.[% END %])
595                 [% END %]
596             </li>
597             <li>
598                 <label for="ecost">Budgeted cost: </label>
599                 <input type="text" size="20" name="ecost" id="ecost" value="[% ecost %]" readonly="readonly"  /> [% IF (listincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
600             </li>
601             <li>
602                 <label for="total">Total: </label>
603                 <input type="text" id="total" size="20" name="total" value="[% total %]" readonly="readonly" /> (budgeted cost * quantity)
604             </li>
605             <li>
606                 [% IF ( close ) %]
607                     <label for="unitprice">Actual cost: </label>
608                     <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" readonly="readonly" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
609                 [% ELSE %]
610                     <label for="unitprice">Actual cost: </label>
611                     <input type="text" id="unitprice" size="20" name="unitprice" value="[% unitprice %]" /> [% IF (invoiceincgst == 1) %](tax inc.)[% ELSE %](tax exc.)[% END %]
612                 [% END %]
613             </li>
614             <li>
615                 <label for="order_internalnote">Internal note: </label>
616                 <textarea id="order_internalnote" cols="30" rows="3" name="order_internalnote" >[% IF ( order_internalnote ) %][% order_internalnote %][% END %]</textarea>
617             </li>
618             <li>
619                 <label for="order_vendornote">Vendor note: </label>
620                 <textarea id="order_vendornote" cols="30" rows="3" name="order_vendornote" >[% IF ( order_vendornote ) %][% order_vendornote %][% END %]</textarea>
621             </li>
622             <li><div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
623                 <label for="sort1">Statistic 1: </label>
624                 <input id="sort1" type="text" id="sort1" size="20" name="sort1" value="[% sort1 %]" />
625             <li>
626                 <label for="sort2">Statistic 2: </label>
627                 <input id="sort2" type="text" id="sort2" size="20" name="sort2" value="[% sort2 %]" />
628             </li>
629         </ol>
630     </fieldset>
631     <fieldset class="action">
632         <input type="hidden" name="subscriptionid" value="[% subscriptionid %]" />
633         <input type="submit" value="Save" />
634         [% IF (suggestionid) %]
635             <a class="cancel" href="/cgi-bin/koha/acqui/newordersuggestion.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Cancel</a>
636         [% ELSE %]
637             [% IF subscriptionid %]
638                 <a class="cancel" href="/cgi-bin/koha/acqui/newordersubscription.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]">Cancel</a>
639             [% ELSE %]
640                 <a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
641             [% END %]
642         [% END %]
643     </fieldset>
644 </form>
645 </div>
646 </div>
647 <div class="yui-b">
648 [% INCLUDE 'acquisitions-menu.inc' %]
649 </div>
650 </div>
651 [% INCLUDE 'intranet-bottom.inc' %]