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