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