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