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