2 [% USE AuthorisedValues %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Serials › Claims</title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 [% Asset.css("css/datatables.css") %]
11 <body id="ser_claims" class="ser">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'serials-search.inc' %]
15 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Claims</div>
17 <div id="doc3" class="yui-t2">
26 [% IF error_claim == 'no_vendor_email' %]
27 <div class="dialog alert">This vendor has no email defined for late issues.</div>
28 [% ELSIF error_claim == 'bad_or_missing_sender' %]
29 <div class="dialog alert">Bad or missing sender address; check your branch email address or preference KohaAdminEmailAddress.</div>
31 <div class="dialog alert">[% error_claim %]</div>
35 <div class="dialog message">Email has been sent.</div>
38 [% IF letters %][% UNLESS ( missingissues ) %][% IF ( supplierid ) %] <div class="dialog alert">No missing issues found.</div>[% ELSE %]<div class="dialog message">Please choose a vendor.</div>[% END %][% END %][% END %]
40 [% IF ( SHOWCONFIRMATION ) %]
41 <div class="dialog alert">Your notification has been sent.</div>
43 [% UNLESS letters %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
44 <form id="claims" name="claims" action="claims.pl" method="post">
46 <label for="supplierid">Vendor: </label>
47 <select id="supplierid" name="supplierid">
48 [% FOREACH suploo IN suploop %]
49 [% IF ( suploo.selected ) %]
50 <option value="[% suploo.id %]" selected="selected" >
52 <option value="[% suploo.id %]">
59 <input type="submit" value="OK" />
63 [% IF ( missingissues ) %]
64 <h3>Missing issues</h3>
65 <form action="claims.pl" id="filter_claims_form">
66 <fieldset class="rows">
67 <legend>Filters :</legend>
71 <label for="from">From:</label>
72 <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
73 <label for="to" style="float:none;">To:</label>
74 <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
75 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
76 <input id="filterByDate" type="button" value="OK" />
77 <a href="#" id="clearfilter"><i class="fa fa-remove"></i> Clear filter</a>
84 <form action="claims.pl" method="post" id="claims_form">
88 <th><input type="checkbox" id="CheckAll"></th>
91 <th class="anti-the">Title</th>
95 <th class="title-string">Since</th>
97 <th class="title-string">Claim date</th>
98 [% FOR field IN additional_fields_for_subscription %]
99 <th>[% field.name %]</th>
106 <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
107 <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
108 <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
109 <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
110 <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
111 <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
112 <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
113 <td><input type="text" class="filter" data-column_num="8" placeholder="Search claim count" /></td>
114 <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim date" /></td>
115 [% FOR field IN additional_fields_for_subscription %]
116 <td><input type="text" class="filter" data-column_num="[% loop.count + 9 %]" placeholder="Search [% field.name %]" /></td>
120 <tbody>[% FOREACH missingissue IN missingissues %]
123 [% UNLESS missingissue.cannot_claim %]
124 <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
127 <td>[% missingissue.name %]</td>
129 <span class="branch-[% missingissue.branchcode %]">[% Branches.GetName( missingissue.branchcode ) %]</span>
132 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid %]">[% missingissue.title |html %]</a>
134 <td>[% missingissue.issn %]</td>
135 <td>[% missingissue.serialseq %]</td>
137 [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
138 [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
139 [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
140 [% IF ( missingissue.status41 ) %]<span class="status-missing_never_received">Missing (never received)</span>[% END %]
141 [% IF ( missingissue.status42 ) %]<span class="status-missing_sold_out">Missing (sold out)</span>[% END %]
142 [% IF ( missingissue.status43 ) %]<span class="status-missing_damaged">Missing (damaged)</span>[% END %]
143 [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
144 [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
146 <td class="planneddate">
147 [% IF ( missingissue.planneddate ) %]
148 <span title="[% missingissue.planneddateISO %]">[% missingissue.planneddate %]</span>
150 <span title="0000-00-00"></span>
153 <td>[% missingissue.claims_count %]</td>
155 [% IF ( missingissue.claimdate ) %]
156 <span title="[% missingissue.claimdateISO %]">[% missingissue.claimdate %]</span>
158 <span title="0000-00-00"></span>
161 [% FOR field IN additional_fields_for_subscription %]
162 [% IF field.authorised_value_category %]
163 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) %]</td>
165 <td>[% missingissue.additional_fields.${field.name} %]</td>
172 [% IF csv_profiles %]
173 <fieldset class="action">
174 <label for="csv_code">Select CSV profile:</label>
175 <select id="csv_profile_for_export">
176 [% FOR csv IN csv_profiles %]
177 <option value="[% csv.export_format_id %]">[% csv.profile %]</option>
180 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
184 <fieldset class="action">
185 <label for="letter_code">Select notice:</label>
186 <select name="letter_code" id="letter_code">
187 [% FOREACH letter IN letters %]
188 <option value="[% letter.code %]">[% letter.name %]</option>
191 <input type="hidden" name="op" value="send_alert" />
192 <input type="hidden" name="supplierid" value="[% supplierid %]" />
193 <input type="submit" name="submit" class="button" value="Send notification" />
204 [% INCLUDE 'serials-menu.inc' %]
208 [% MACRO jsinclude BLOCK %]
209 [% INCLUDE 'calendar.inc' %]
210 [% INCLUDE 'datatables.inc' %]
211 <script type="text/javascript">
213 $(document).ready(function() {
214 sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
217 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
218 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] },
219 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
223 sTable.fnAddFilters("filter", "200");
224 $('#supplierid').change(function() {
225 $('#claims').submit();
228 // Checkboxes : Select All / None
229 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
231 $("#CheckAll").click(function() {
232 $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
235 // Generates a dynamic link for exporting the selections data as CSV
236 $("#ExportSelected").click(function() {
237 // We need to use "input[name=serialid]:checked" instead of "input:checked". Otherwise, the "check all" box will pass the value of "on" as a serialid, which produces a SQL error.
238 var selected = $("input[name=serialid]:checked");
240 if (selected.length == 0) {
241 alert(_("Please select at least one item to export."));
245 // Building the url from currently checked boxes
246 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
247 for (var i = 0; i < selected.length; i++) {
248 url += '&serialid=' + selected[i].value;
250 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
251 // And redirecting to the CSV page
255 $("#filterByDate").on("click",function(e){
259 $("#clearfilter").on("click",function(e){
261 $("#from,#to").val("");
262 $("table#claimst tbody tr").show();
264 $("#claims_form").on("submit",function(){
267 $("#filter_claims_form").on("submit",function(){
272 // Checks if the form can be sent (at least one checkbox must be checked)
273 function checkForm() {
274 if ($("input:checked").length == 0) {
275 alert(_("Please select at least one issue."));
281 function filterByDate() {
282 var beginDate = Date_from_syspref($("#from").val()).getTime();
283 var endDate = Date_from_syspref($("#to").val()).getTime();
285 // Checks if the beginning date is valid
286 if (!parseInt(beginDate)) {
287 alert(_("The beginning date is missing or invalid."));
291 // Checks if the ending date is valid
292 if (!parseInt(endDate)) {
293 alert(_("The ending date is missing or invalid."));
297 // Checks if beginning date is before ending date
298 if (beginDate > endDate) {
299 // If not, we swap them
300 var tmpDate = endDate;
305 // We hide everything
306 $("table#claimst tbody tr").hide();
308 // For each date in the table
309 $(".planneddate").each(function() {
311 // We make a JS Date Object, according to the locale
312 var pdate = Date_from_syspref($(this).text()).getTime();
314 // And checks if the date is between the beginning and ending dates
315 if (pdate > beginDate &&
317 // If so, we can show the row
318 $(this).parent().show();
325 [% INCLUDE 'intranet-bottom.inc' %]