Bug 20830: Make sure a fund is selected when ordering from a stage file
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / addorderiso2709.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Acquisitions &rsaquo; Order staged MARC records
7 [% IF ( batch_details ) %]
8  &rsaquo; Batch [% import_batch_id | html %]
9 [% ELSE %]
10  &rsaquo; Batch list
11 [% END %]
12 </title>
13 [% Asset.css("css/datatables.css") | $raw %]
14 <style>@media (max-width: 767px) { #dataPreview { margin: 0; width : auto; } }</style>
15 [% INCLUDE 'doc-head-close.inc' %]
16     [% Asset.js("js/acquisitions-menu.js") | $raw %]
17     [% INCLUDE 'datatables.inc' %]
18     [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %]
19     [% Asset.js("js/acq.js") | $raw %]
20     [% Asset.js("js/funds_sorts.js") | $raw %]
21     <script>
22         $(document).ready(function() {
23             $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
24                 "aoColumnDefs": [
25                     { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
26                     { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
27                     { "sType": "title-string", "aTargets" : [ "title-string" ] }
28                 ],
29                 "sPaginationType": "four_button",
30                 "aaSorting": []
31             } ) );
32
33             $("#records_to_import fieldset.rows div").hide();
34             $('input:checkbox[name="import_record_id"]').change(function(){
35                 var container = $(this).parents("fieldset");
36                 if ( $(this).is(':checked') ) {
37                     $(container).addClass("selected");
38                     $(container).removeClass("unselected");
39                     $(container).find("div").toggle(true);
40                 } else {
41                     $(container).addClass("unselected");
42                     $(container).removeClass("selected");
43                     $(container).find("div").toggle(false);
44                 }
45             } );
46
47             $("input:checkbox").prop("checked", false);
48             $("div.biblio.unselected select").prop('disabled', false);
49             $("div.biblio.unselected input").prop('disabled', false);
50
51             $("#checkAll").click(function(){
52                 $("#Aform").checkCheckboxes();
53                 $("input:checkbox[name='import_record_id']").change();
54                 return false;
55             });
56             $("#unCheckAll").click(function(){
57                 $("#Aform").unCheckCheckboxes();
58                 $("input:checkbox[name='import_record_id']").change();
59                 return false;
60             });
61
62             $("#Aform").on("submit", function(){
63                 if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) {
64                     alert(_("There is no record selected"));
65                     return false;
66                 }
67
68                 var error = 0;
69                 $("input:checkbox[name='import_record_id']:checked").parents('fieldset').find('input[name="quantity"]').each(function(){
70                     if ( $(this).val().length < 1 || isNaN( $(this).val() ) ) {
71                         error++;
72                     }
73                 });
74                 if ( error > 0 ) {
75                     alert(error + " " + _("quantity values are not filled in or are not numbers"));
76                     return false;
77
78                 }
79
80         if (! $("#all_budget_id").val() ) {
81             // If there is no default fund
82             var error = 0;
83             $(".selected [name='budget_id']").each(function(){
84             if (!$(this).val()) {
85                 error++;
86             }
87             });
88             if ( error > 0 ) {
89             alert(_("Some budgets are not defined in item records"));
90             return false;
91             }
92         }
93
94                 return disableUnchecked($(this));
95             });
96             $('#tabs').tabs();
97             $(".previewData").on("click", function(e){
98                 e.preventDefault();
99                 var ltitle = $(this).text();
100                 var page = $(this).attr("href");
101                 $("#dataPreviewLabel").text(ltitle);
102                 $("#dataPreview .modal-body").load(page + " div");
103                 $('#dataPreview').modal({show:true});
104             });
105             $("#dataPreview").on("hidden.bs.modal", function(){
106                 $("#dataPreviewLabel").html("");
107                 $("#dataPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface | html %]/[% theme | html %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>");
108             });
109         });
110
111         function disableUnchecked(form){
112             $("fieldset.biblio.unselected").each(function(){
113                 $(this).remove();
114             });
115             return 1;
116         }
117     </script>
118 </head>
119
120 <body id="acq_addorderiso2709" class="acq">
121 [% INCLUDE 'header.inc' %]
122 [% INCLUDE 'acquisitions-search.inc' %]
123 <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 | html %]">[% booksellername | html %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Basket [% basketno | html %]</a> &rsaquo; Add orders from MARC file</div>
124     <div class="container-fluid">
125         <div class="row">
126             <div class="col-sm-6 col-sm-offset-3 col-md-8 col-md-offset-2">
127              [% IF ( allmatch ) %]<div class="dialog alert">
128               <h4>No records imported</h4>
129              No record have been imported because they all match an existing record in your catalog.<br />You'll have to treat them individually.
130              </div>
131              [% END %]
132
133              [% IF ( batch_details ) %]
134                 <h1>Add orders from [% comments | html %]
135                     ([% file_name | html %] staged on [% upload_timestamp | $KohaDates  with_hours => 1 %])
136                 </h1>
137                 <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
138                 <div id="tabs" class="toptabs">
139                   <ul>
140                     <li><a href="#records_to_import">Select to import</a></li>
141                     <li><a href="#items_info" class="items_info">Item information</a></li>
142                     <li><a href="#accounting_details">Default accounting details</a></li>
143                   </ul>
144
145                   <div id="records_to_import">
146                     <div id="searchheader">
147                         <div>
148                             <span class="checkall"><a id="checkAll" href="#">Select all</a></span>
149                             |
150                             <span class="uncheckall"><a id="unCheckAll" href="#">Clear all</a></span>
151                             |
152                             <span>
153                                 <label for="matcher_id">Matching:</label>
154                                     <select name="matcher_id" id="matcher_id">
155                                         <option value="_TITLE_AUTHOR_">Title and author</option>
156                                         <option value="">Do not look for matching records</option>
157                                         [% FOREACH available_matcher IN available_matchers %]
158                                             [% IF ( available_matcher.code == current_matcher_code ) %]
159                                                 <option value="[% available_matcher.matcher_id | html %]" selected="selected">
160                                                     [% available_matcher.code | html %] ([% available_matcher.description | html %])
161                                                 </option>
162                                             [% ELSE %]
163                                                 <option value="[% available_matcher.matcher_id | html %]">
164                                                     [% available_matcher.code | html %] ([% available_matcher.description | html %])
165                                                 </option>
166                                             [% END %]
167                                         [% END %]
168                                     </select>
169                             </span>
170                             |
171                             <span>
172                                 <label for="showallbudgets" style="float:none;width:auto;">&nbsp;Show inactive funds:</label>
173                                 <input type="checkbox" id="showallbudgets" />
174                             </span>
175                         </div>
176                     </div>
177
178                         <input type="hidden" name="op" value="import_records"/>
179                         <input type="hidden" name="basketno" value="[% basketno | html %]" />
180                         <input type="hidden" name="booksellerid" value="[% booksellerid | html %]" />
181                         <input type="hidden" name="import_batch_id" value="[% import_batch_id | html %]" />
182                         <input type="hidden" name="ordernumber" value="[% ordernumber | html %]" />
183
184                         [% FOREACH biblio IN biblio_list %]
185                         <fieldset class="biblio unselected rows" style="float:none;">
186                           <legend>
187                             <label for="record_[% biblio.import_record_id | html %]" style="width:auto;">
188                               <input type="checkbox" name="import_record_id" id="record_[% biblio.import_record_id | html %]" value="[% biblio.import_record_id | html %]" />
189                               <span class="citation">[% biblio.citation | html %]</span>
190                             </label>
191                             <span class="links" style="font-weight: normal;">
192                               ( <a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=[% biblio.import_record_id | uri %]" class="previewData">MARC</a> | <a href="/cgi-bin/koha/catalogue/showmarc.pl?viewas=card&amp;importid=[% biblio.import_record_id | html %]" class="previewData">Card</a> | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid | html %]&amp;basketno=[% basketno | html %]&amp;breedingid=[% biblio.import_record_id | html %]&amp;import_batch_id=[% biblio.import_batch_id | html %]&amp;biblionumber=[% biblio.match_biblionumber | html %]">Add order</a> )
193                             </span>
194                           </legend>
195                           <div style="float:left">
196                           <ol>
197                             <li class="status">
198                               <span class="match">
199                                 [% IF ( biblio_lis.overlay_status == 'no_match' ) %]
200                                     No match
201                                 [% ELSIF ( biblio_lis.overlay_status == 'match_applied' ) %]
202                                     Match applied
203                                 [% ELSIF ( biblio_lis.overlay_status == 'auto_match' ) %]
204                                     Match found
205                                 [% ELSE %]
206                                     [% biblio_lis.overlay_status | html %]
207                                 [% END %]
208                                 [% IF ( biblio.match_biblionumber ) %]
209                                   Matches biblio [% biblio.match_biblionumber | uri %] (score = [% biblio.match_score | html %]): <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblio.match_biblionumber | uri %]">[% biblio.match_citation | html %]</a>
210                                 [% END %]
211                               </span>
212                             </li>
213                             <li class="quantity">
214                                 <label for="quantity_record_[% biblio.import_record_id | html %]" class="required">Quantity: </label>
215                                 <input id="quantity_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.quantity.length ? biblio.quantity : 1 | html %]" name="quantity" />
216                             </li>
217                             <li class="price">
218                                 <label for="price_record_[% biblio.import_record_id | html %]">Price: </label>
219                                 <input id="price_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.price | html %]" name="price" />
220                             </li>
221                             <li class="discount">
222                                 <label for="discount_record_[% biblio.import_record_id | html %]">Discount: </label>
223                                 <input id="discount_record_[% biblio.import_record_id | html %]" type="text" value="[% biblio.discount | html %]" name="discount" size="6" /> %
224                                 (If empty, discount rate from vendor will be used)
225                             </li>
226                             <li class="budget">
227                                 <label for="fund_record_[% biblio.import_record_id | html %]">Fund: </label>
228                                 [% IF ( close ) %]
229                                   <input type="hidden" size="20" name="budget_id" value="[% budget_id | html %]" />[% Budget_name | html %]
230                                 [% ELSE %]
231                                   <select id="fund_record_[% biblio.import_record_id | html %]" size="1" name="budget_id">
232                                     <option value="">Select a fund</option>
233                                     [% FOREACH budget IN budget_loop %]
234                                         [% IF ( budget.b_id == biblio.budget_id ) %]
235                                           [% IF budget.b_active %]
236                                             <option value="[% budget.b_id | html %]" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat | html %]" selected="selected">[% budget.b_txt | html %]</option>
237                                           [% ELSE %]
238                                             <option value="[% budget.b_id | html %]" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat | html %]" selected="selected">[% budget.b_txt | html %] (inactive)</option>
239                                           [% END %]
240                                         [% ELSE %]
241                                             [% IF budget.b_active %]<option value="[% budget.b_id | html %]" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat | html %]">[% budget.b_txt | html %]</option>
242                                             [% ELSE %]<option value="[% budget.b_id | html %]" class="b_inactive" data-sort1-authcat="[% budget.b_sort1_authcat | html %]" data-sort2-authcat="[% budget.b_sort2_authcat | html %]">[% budget.b_txt | html %] (inactive)</option>
243                                             [% END %]
244                                         [% END %]
245                                     [% END %]
246                                   </select>
247                                 [% END %]
248                             </li>
249                             <li class="sort1">
250                                 <label for="sort1_record_[% biblio.import_record_id | html %]">Statistic 1: </label>
251                                 <input id="sort1_record_[% biblio.import_record_id | html %]" type="text" id="sort1" size="20" name="sort1" value="[% biblio.sort1 | html %]" />
252                             </li>
253                             <li class="sort2">
254                                 <label for="sort2_record_[% biblio.import_record_id | html %]">Statistic 2: </label>
255                                 <input id="sort2_record_[% biblio.import_record_id | html %]" type="text" id="sort2" size="20" name="sort2" value="[% biblio.sort2 | html %]" />
256                             </li>
257                           </ol>
258                         </div>
259                         <div style="float:right">
260                         [% IF biblio.item_error %]Item records could not be processed because the number of item fields was uneven.[% END %]
261                         [% FOREACH item IN biblio.iteminfos %]
262                         <fieldset>
263                         <legend>Item Record [% item.item_id | html %]</legend>
264                         <ol>
265                         <li>
266                         <label for="homebranch_item_[% item.item_id | html %]">homebranch</label><select id="homebranch_item_[% item.item_id | html %]" name="homebranch_[% item.biblio_count | html %]">
267                         [% FOREACH l IN libraries %]
268                           [% IF l.branchcode == item.homebranch %]
269                             <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option>
270                           [% ELSE %]
271                             <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
272                           [% END %]
273                         [% END %]
274                         </select>
275                         </li>
276
277                         <li><label for="holdingbranch_item_[% item.item_id | html %]">holdingbranch</label><select id="holdingbranch_item_[% item.item_id | html %]" name="holdingbranch_[% item.biblio_count | html %]">
278                         [% FOREACH l IN libraries %]
279                           [% IF l.branchcode == item.holdingbranch %]
280                             <option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option>
281                           [% ELSE %]
282                             <option value="[% l.branchcode | html %]">[% l.branchname | html %]</option>
283                           [% END %]
284                         [% END %]
285                         </select>
286                         </li>
287                         <li><label for="itype_item_[% item.item_id | html %]">itype</label><select id="itype_item_[% item.item_id | html %]" name="itype_[% item.biblio_count | html %]">
288                         [% FOREACH itypeloo IN itypeloop %]
289                           [% IF ( itypeloo.itemtype ) == ( item.itype ) %]
290                             <option value="[% itypeloo.itemtype | html %]" selected="selected">[% itypeloo.description | html %]</option>
291                           [% ELSE %]
292                             <option value="[% itypeloo.itemtype | html %]">[% itypeloo.description | html %]</option>
293                           [% END %]
294                         [% END %]
295                         </select>
296                         </li>
297
298                         <li><label for="nonpublic_note_item_[% item.item_id | html %]">nonpublic_note</label><input type="text" id="nonpublic_note_item_[% item.item_id | html %]" name="nonpublic_note_[% item.biblio_count | html %]" value="[% item.nonpublic_note | html %]"></li>
299                         <li><label for="public_note_item_[% item.item_id | html %]">public_note</label><input type="text" id="public_note_item_[% item.item_id | html %]" name="public_note_[% item.biblio_count | html %]" value="[% item.public_note | html %]"></li>
300                         <li><label for="loc_item_[% item.item_id | html %]">loc</label><select id="loc_item_[% item.item_id | html %]" name="loc_[% item.biblio_count | html %]">
301                         <option value=""> </option>
302                         [% FOREACH locationloo IN locationloop %]
303                             [% IF ( locationloo.code ) == (item.loc) %]<option value="[% locationloo.code | html %]" selected="selected">[% locationloo.description | html %]</option>[% ELSE %]<option value="[% locationloo.code | html %]">[% locationloo.description | html %]</option>[% END %]
304                         [% END %]
305                        </select>
306                         </li>
307
308                         <li><label for="ccode_item_[% item.item_id | html %]">ccode</label><select id="ccode_item_[% item.item_id | html %]" name="ccode_[% item.biblio_count | html %]">
309                         [% FOREACH ccodeloo IN ccodeloop %]
310                             [% IF ( ccodeloo.code ) == (item.ccode) %]<option value="[% ccodeloo.code | html %]" selected="selected">[% ccodeloo.description | html %]</option>[% ELSE %]<option value="[% ccodeloo.code | html %]">[% ccodeloo.description | html %]</option>[% END %]
311                         [% END %]
312                         </select>
313                         </li>
314
315                         <li><label for="notforloan_item_[% item.item_id | html %]">notforloan</label><select id="notforloan_item_[% item.item_id | html %]" name="notforloan_[% item.biblio_count | html %]">
316                         [% FOREACH n IN notforloanloop %]
317                             [% IF n.code == item.notforloan %]
318                                 <option value="[% n.code | html %]" selected="selected">[% n.description | html %]</option>
319                             [% ELSE %]
320                                 <option value="[% n.code | html %]">[% n.description | html %]</option>
321                             [% END %]
322                         [% END %]
323                         </select>
324                         </li>
325                         <li><label for="uri_item_[% item.item_id | html %]">uri</label><input type="text" id="uri_item_[% item.item_id | html %]" name="uri_[% item.biblio_count | html %]" value="[% item.uri | html %]"></li>
326                         <li><label for="copyno_item_[% item.item_id | html %]">copyno</label><input type="text" id="copyno_item_[% item.item_id | html %]" name="copyno_[% item.biblio_count | html %]" value="[% item.copyno | html %]"></li>
327                         <li><label for="budget_code_item_[% item.item_id | html %]">budget_code</label><select id="budget_code_item_[% item.item_id | html %]" name="budget_code_[% item.biblio_count | html %]">
328                         <option value="">Select a fund</option>
329                         [% FOREACH budget_loo IN budget_loop %]
330                             [% IF ( budget_loo.b_id ) == ( item.budget_id ) %]<option value="[% budget_loo.b_id | html %]" selected="selected">[% budget_loo.b_txt | html %]</option>
331                             [% ELSE %]<option value="[% budget_loo.b_id | html %]">[% budget_loo.b_txt | html %]</option>
332                             [% END %]
333                         [% END %]
334                         </select>
335                         </li>
336                         <li><label for="price_item_[% item.item_id | html %]">price</label><input type="text" id="price_item_[% item.item_id | html %]" name="itemprice_[% item.biblio_count | html %]" value="[% item.itemprice | html %]"></li>
337                         <li><label for="replacementprice_item_[% item.item_id | html %]">replacement price</label><input type="text" id="replacementprice_item_[% item.item_id | html %]" name="replacementprice_[% item.biblio_count | html %]" value="[% item.replacementprice | html %]"></li>
338                         <li><label for="callnumber_item_[% item.item_id | html %]">callnumber</label><input type="text" id="callnumber_item_[% item.item_id | html %]" name="itemcallnumber_[% item.biblio_count | html %]" value="[% item.itemcallnumber | html %]"></li>
339                         </ol>
340                         </fieldset>
341                         [% END %]
342                         </div>
343                         </fieldset>
344                             <div id="dataPreview" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="dataPreviewLabel" aria-hidden="true">
345                                 <div class="modal-dialog">
346                                 <div class="modal-content">
347                                 <div class="modal-header">
348                                     <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
349                                     <h3 id="dataPreviewLabel">MARC preview</h3>
350                                 </div>
351                                 <div class="modal-body">
352                                     <div id="loading"> <img src="[% interface | html %]/[% theme | html %]/img/spinner-small.gif" alt="" /> Loading </div>
353                                 </div>
354                                 <div class="modal-footer">
355                                     <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
356                                 </div>
357                                 </div>
358                                 </div>
359                             </div>
360                         [% END %]
361                       </div>
362                       <div id="items_info">
363                         <h2>Item information</h2>
364                         <p>Import all the checked items in the basket with the following parameters:</p>
365
366                         [% IF ( items ) %]
367                         <fieldset class="rows" style="float:none;">
368                             <legend>Item</legend>
369                             [% IF ( NoACQframework ) %]
370                                 <div class="dialog message">No ACQ framework, using default. You should create a framework with code ACQ, the items framework would be used</div>
371                             [% END %]
372                             [% FOREACH item IN items %]
373                             <div id="outeritemblock">
374                             <div id="itemblock">
375                                 <ol>
376                                 [% FOREACH iteminformatio IN item.iteminformation %]<li style="[% iteminformatio.hidden | html %];">
377                                     <div class="subfield_line" id="subfield[% iteminformatio.serialid | html %][% iteminformatio.countitems | html %][% iteminformatio.subfield | html %][% iteminformatio.random | html %]">
378                                         [% IF (iteminformatio.mandatory) %]
379                                             <label class="required">[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label>
380                                         [% ELSE %]
381                                             <label>[% iteminformatio.subfield | html %] - [% iteminformatio.marc_lib | $raw %]</label>
382                                         [% END %]
383
384                                         [% IF ( iteminformatio.marc_value.type == 'select' ) %]
385                                             <select name="field_value" size="1">
386                                             [% FOREACH value IN iteminformatio.marc_value.values %]
387                                                 [% IF ( value == iteminformatio.marc_value.default ) %]
388                                                     <option value="[% value | html %]" selected="selected">[% iteminformatio.marc_value.labels.$value | html %]</option>
389                                                 [% ELSE %]
390                                                     <option value="[% value | html %]">[% iteminformatio.marc_value.labels.$value | html %]</option>
391                                                 [% END %]
392                                             [% END %]
393                                             </select>
394                                         [% ELSE %]
395                                         [% iteminformatio.marc_value | $raw %]
396                                         [% END %]
397                                         <input type="hidden" name="itemid" value="1" />
398                                         <input type="hidden" name="kohafield" value="[% iteminformatio.kohafield | html %]" />
399                                         <input type="hidden" name="tag" value="[% iteminformatio.tag | html %]" />
400                                         <input type="hidden" name="subfield" value="[% iteminformatio.subfield | html %]" />
401                                         <input type="hidden" name="mandatory" value="[% iteminformatio.mandatory | html %]" />
402                                         [% IF ( iteminformatio.mandatory ) %] <span class="required">Required</span>[% END %]
403                                     </div></li>
404                                 [% END %]
405                                 </ol>
406                             </div><!-- /iteminformation -->
407                             </div>
408                             [% END %] <!-- /items -->
409                         </fieldset>
410                         [% END %] <!-- items -->
411                       </div>
412                       <div id="accounting_details">
413                         <p>Import all the checked items in the basket with the following accounting details (used only if no information is filled for the item):</p>
414                         <fieldset class="rows" style="float:none;">
415                             <legend>Accounting details</legend>
416                             <ol>
417                                 <li>
418                                     <!-- origquantityrec only here for javascript compatibility (additem.js needs it, useless here, useful when receiveing an order -->
419                                     <input id="origquantityrec" readonly="readonly" type="hidden" name="origquantityrec" value="1" />
420                                 </li>
421                                 <li>
422                                     [% IF ( close ) %]
423                                         <span class="label">Fund: </span>
424                                         <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id | html %]" />[% Budget_name | html %]
425                                     [% ELSE %]
426                                         <li>
427                                             <label for="all_currency">Currency:</label>
428                                             <select name="all_currency" id="all_currency">
429                                             [% FOREACH currency IN currencies %]
430                                                 [% IF currency.currency == bookseller.listprice %]
431                                                     <option value="[% currency.currency | html %]" selected="selected">[% currency.currency | html %]</option>
432                                                 [% ELSIF not currency.archived %]
433                                                     <option value="[% currency.currency | html %]">[% currency.currency | html %]</option>
434                                                 [% END %]
435                                             [% END %]
436                                             </select>
437                                         </li>
438                                         <li>
439                                             <label for="all_budget_id">Fund: </label>
440                                             <select id="all_budget_id" size="1" name="all_budget_id">
441                                               <option value="">Select a fund</option>
442                                             [% FOREACH budget_loo IN budget_loop %]
443                                                 [% IF ( budget_loo.b_active ) %]<option value="[% budget_loo.b_id | html %]" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]">[% budget_loo.b_txt | html %]</option>
444                                                 [% ELSE %]<option value="[% budget_loo.b_id | html %]" class="b_inactive" data-sort1-authcat="[% budget_loo.b_sort1_authcat | html %]" data-sort2-authcat="[% budget_loo.b_sort2_authcat | html %]">[% budget_loo.b_txt | html %] (inactive)</option>
445                                                 [% END %]
446                                             [% END %]
447                                             </select>
448                                             <label for="all_showallbudgets" style="float:none;width:auto;">&nbsp;Show inactive:</label>
449                                             <input type="checkbox" id="all_showallbudgets" />
450                                         </li>
451                                     [% END %]
452                                 </li>
453                                 <li>
454                                     <label for="all_order_internalnote">Internal note: </label>
455                                     <textarea id="all_order_internalnote" cols="30" rows="3" name="all_order_internalnote"></textarea>
456                                 </li>
457                                 <li>
458                                     <label for="all_order_vendornote">Vendor note: </label>
459                                     <textarea id="all_order_vendornote" cols="30" rows="3" name="all_order_vendornote"></textarea>
460                                 </li>
461                                 <li>
462                                     <div class="hint">The 2 following fields are available for your own usage. They can be useful for statistical purposes</div>
463                                     <label for="all_sort1">Statistic 1: </label>
464                                     <input type="text" id="all_sort1" size="20" name="all_sort1" value="" />
465                                 </li>
466                                 <li>
467                                     <label for="all_sort2">Statistic 2: </label>
468                                     <input type="text" id="all_sort2" size="20" name="all_sort2" value="" />
469                                 </li>
470                             </ol>
471                         </fieldset>
472                       </div>
473                       </div>
474
475                       <fieldset class="action">
476                           <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | html %]">Cancel</a>
477                       </fieldset>
478                     </form>
479                 [% ELSE %]
480                 <div>
481                   <h1>Choose the file to add to the basket</h1>
482                   <table id="files">
483                     <thead>
484                       <tr>
485                         <th>File name</th>
486                         <th>Comments</th>
487                         <th>Status</th>
488                         <th class="title-string">Staged</th>
489                         <th># Bibliographic records</th>
490                         <th class="NoSort">&nbsp;</th>
491                       </tr>
492                     </thead>
493                     <tbody>
494                       [% FOREACH batch_lis IN batch_list %]
495                       <tr>
496                         <td>[% batch_lis.file_name | html %]</td>
497                         <td>[% batch_lis.comments | html %]</td>
498                         <td>
499                           [% IF ( batch_lis.import_status == 'cleaned' ) %]
500                             Cleaned
501                           [% ELSIF ( batch_lis.import_status == 'imported' ) %]
502                             Imported
503                           [% ELSIF ( batch_lis.import_status == 'importing' ) %]
504                             Importing
505                           [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
506                             Reverted
507                           [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
508                             Reverting
509                           [% ELSIF ( batch_lis.import_status == 'staged' ) %]
510                             Staged
511                           [% ELSE %]
512                             [% batch_lis.import_status | html %]
513                           [% END %]
514                         </td>
515                         <td><span title="[% batch_lis.staged_date | html %]">[% batch_lis.staged_date | $KohaDates  with_hours => 1 %]</span></td>
516                         <td>[% batch_lis.num_records | html %]</td>
517                         <td><a href="[% batch_lis.scriptname | url %]?import_batch_id=[% batch_lis.import_batch_id | uri %]&amp;basketno=[% basketno | uri %]&amp;booksellerid=[% booksellerid | uri %]">Add orders</a></td>
518                       </tr>
519                       [% END %]
520                     </tbody>
521                   </table>
522                 </div>
523                 [% END %]
524             </div> [% # /div.col-sm-6 %]
525        </div> [% # /div.row %]
526
527 [% INCLUDE 'intranet-bottom.inc' %]