2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Acquisitions › Order staged MARC records
4 [% IF ( batch_details ) %]
5 › Batch [% import_batch_id %]
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">
18 $(document).ready(function() {
19 $("#files").dataTable($.extend(true, {}, dataTablesDefaults, {
21 { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] },
22 { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
23 { "sType": "title-string", "aTargets" : [ "title-string" ] }
25 "sPaginationType": "four_button",
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)
39 $("select[name='budget_id'] .b_inactive").remove();
43 $("#all_showallbudgets").click(function() {
44 if ($(this).is(":checked")) {
45 $("select[name='all_budget_id']").html(disabledBudgetsCopy);
48 $("select[name='all_budget_id'] .b_inactive").remove();
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"]');
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"]');
65 getAuthValueDropbox( 'sort1', sort1_authcat, destination_sort1, sort1 );
67 getAuthValueDropbox( 'sort2', sort2_authcat, destination_sort2, sort2 );
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"]');
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"]');
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');
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);
101 $(container).addClass("unselected");
102 $(container).removeClass("selected");
103 $(container).find("div").toggle(false);
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();
116 $("#unCheckAll").click(function(){
117 $("#Aform").unCheckCheckboxes();
118 $("input:checkbox[name='import_record_id']").change();
122 $("#Aform").on("submit", function(){
123 if ( $("input:checkbox[name='import_record_id']:checked").length < 1 ) {
124 alert(_("There is no record selected"));
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() ) ) {
135 alert(error + " " + _("quantity values are not filled in or are not numbers"));
140 $("select[name='budget_code']").each(function() {
141 if (!$(this).val()) {
146 alert(_("Some budgets are not defined in item records"));
150 return disableUnchecked($(this));
153 $(".previewData").on("click", function(e){
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});
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>");
167 function disableUnchecked(form){
168 $("fieldset.biblio.unselected").each(function(){
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> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% booksellername %]</a> › <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> › Add orders from iso2709 file</div>
180 <div id="doc3" class="yui-t2">
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.
190 [% IF ( batch_details ) %]
191 <h1>Add orders from [% comments %]
192 ([% file_name %] staged on [% upload_timestamp | $KohaDates with_hours => 1 %])
194 <form action="/cgi-bin/koha/acqui/addorderiso2709.pl" method="post" id="Aform">
195 <div id="tabs" class="toptabs">
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>
202 <div id="records_to_import">
203 <div id="searchheader">
205 <span class="checkall"><a id="checkAll" href="#">Select all</a></span>
207 <span class="uncheckall"><a id="unCheckAll" href="#">Clear all</a></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 %])
220 <option value="[% available_matcher.matcher_id %]">
221 [% available_matcher.code %] ([% available_matcher.description %])
229 <label for="showallbudgets" style="float:none;width:auto;"> Show inactive funds:</label>
230 <input type="checkbox" id="showallbudgets" />
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;">
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>
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&importid=[% biblio.import_record_id %]" class="previewData">Card</a> | <a href="/cgi-bin/koha/acqui/neworderempty.pl?booksellerid=[% booksellerid %]&basketno=[% basketno %]&breedingid=[% biblio.import_record_id %]&import_batch_id=[% biblio.import_batch_id %]&biblionumber=[% biblio.match_biblionumber %]">Add order</a> )
252 <div style="float:left">
256 [% IF ( biblio_lis.overlay_status == 'no_match' ) %]
258 [% ELSIF ( biblio_lis.overlay_status == 'match_applied' ) %]
260 [% ELSIF ( biblio_lis.overlay_status == 'auto_match' ) %]
263 [% biblio_lis.overlay_status %]
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>
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" />
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" />
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)
284 <label for="fund_record_[% biblio.import_record_id %]">Fund: </label>
286 <input type="hidden" size="20" name="budget_id" value="[% budget_id %]" />[% Budget_name %]
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>
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>
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>
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 %]" />
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 %]" />
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 %]
320 <legend>Item Record [% item.item_id %]</legend>
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>
328 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
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>
339 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
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>
349 <option value="[% itypeloo.itemtype %]">[% itypeloo.description |html %]</option>
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 %]
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 %]
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>
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>
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>
397 <div class="modal-body">
398 <div id="loading"> <img src="[% interface %]/[% theme %]/img/spinner-small.gif" alt="" /> Loading </div>
400 <div class="modal-footer">
401 <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
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>
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>
418 [% FOREACH item IN items %]
419 <div id="outeritemblock">
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>
427 <label>[% iteminformatio.subfield %] - [% iteminformatio.marc_lib %]</label>
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>
436 <option value="[% value %]">[% iteminformatio.marc_value.labels.$value %]</option>
441 [% iteminformatio.marc_value %]
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 %]
452 </div><!-- /iteminformation -->
454 [% END %] <!-- /items -->
456 [% END %] <!-- items -->
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>
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" />
469 <span class="label">Fund: </span>
470 <input type="hidden" size="20" name="budget_id" id="budget_id" value="[% budget_id %]" />[% Budget_name %]
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>
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>
494 <label for="all_showallbudgets" style="float:none;width:auto;"> Show inactive:</label>
495 <input type="checkbox" id="all_showallbudgets" />
500 <label for="all_order_internalnote">Internal note: </label>
501 <textarea id="all_order_internalnote" cols="30" rows="3" name="all_order_internalnote"></textarea>
504 <label for="all_order_vendornote">Vendor note: </label>
505 <textarea id="all_order_vendornote" cols="30" rows="3" name="all_order_vendornote"></textarea>
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="" />
513 <label for="all_sort2">Statistic 2: </label>
514 <input type="text" id="all_sort2" size="20" name="all_sort2" value="" />
521 <fieldset class="action">
522 <input type="submit" value="Save" /><a class="cancel" href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Cancel</a>
527 <h1>Choose the file to add to the basket</h1>
534 <th class="title-string">Staged</th>
536 <th class="NoSort"> </th>
540 [% FOREACH batch_lis IN batch_list %]
542 <td>[% batch_lis.file_name %]</td>
543 <td>[% batch_lis.comments %]</td>
545 [% IF ( batch_lis.import_status == 'cleaned' ) %]
547 [% ELSIF ( batch_lis.import_status == 'imported' ) %]
549 [% ELSIF ( batch_lis.import_status == 'importing' ) %]
551 [% ELSIF ( batch_lis.import_status == 'reverted' ) %]
553 [% ELSIF ( batch_lis.import_status == 'reverting' ) %]
555 [% ELSIF ( batch_lis.import_status == 'staged' ) %]
558 [% batch_lis.import_status %]
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 %]&basketno=[% basketno %]&booksellerid=[% booksellerid %]">Add orders</a></td>