3 [% USE AuthorisedValues %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Serials › Claims</title>
8 [% INCLUDE 'doc-head-close.inc' %]
11 <body id="ser_claims" class="ser">
12 [% INCLUDE 'header.inc' %]
13 [% INCLUDE 'serials-search.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
24 <a href="#" aria-current="page">
31 <div class="main container-fluid">
33 <div class="col-sm-10 col-sm-push-2">
39 [% IF error_claim == 'no_vendor_email' %]
40 <div class="dialog alert">This vendor has no email defined for late issues.</div>
41 [% ELSIF error_claim == 'bad_or_missing_sender' %]
42 <div class="dialog alert">Bad or missing sender address; check your branch email address or preference KohaAdminEmailAddress.</div>
44 <div class="dialog alert">[% error_claim | html %]</div>
48 <div class="dialog message">Email has been sent.</div>
51 [% 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 %]
53 [% IF ( SHOWCONFIRMATION ) %]
54 <div class="dialog alert">Your notification has been sent.</div>
56 [% UNLESS letters %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
57 <form id="claims" name="claims" action="claims.pl" method="post">
59 <label for="supplierid">Vendor: </label>
60 <select id="supplierid" name="supplierid">
61 [% FOREACH suploo IN suploop %]
62 [% IF ( suploo.selected ) %]
63 <option value="[% suploo.id | html %]" selected="selected" >
65 <option value="[% suploo.id | html %]">
67 [% suploo.name | html %]
68 ([% suploo.count | html %])
72 <input type="submit" value="OK" />
76 [% IF ( missingissues ) %]
77 <h3>Missing issues</h3>
78 <form action="claims.pl" id="filter_claims_form">
79 <fieldset class="rows">
80 <legend>Filters :</legend>
84 <label for="from">From:</label>
85 <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="datepickerfrom" />
86 <label for="to" style="float:none;">To:</label>
87 <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="datepickerto" />
88 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
89 <input id="filterByDate" type="button" value="OK" />
90 <a href="#" id="clearfilter"><i class="fa fa-remove"></i> Clear filter</a>
97 <form action="claims.pl" method="post" id="claims_form">
101 <th><input type="checkbox" id="CheckAll"></th>
104 <th class="anti-the">Title</th>
106 <th>Issue number</th>
109 <th>Claims count</th>
111 [% FOR field IN additional_fields_for_subscription %]
112 <th>[% field.name | html %]</th>
119 <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
120 <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
121 <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
122 <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
123 <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
124 <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
125 <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
126 <td><input type="text" class="filter" data-column_num="8" placeholder="Search claim count" /></td>
127 <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim date" /></td>
128 [% FOR field IN additional_fields_for_subscription %]
129 <td><input type="text" class="filter" data-column_num="[% loop.count + 9 | html %]" placeholder="Search [% field.name | html %]" /></td>
133 <tbody>[% FOREACH missingissue IN missingissues %]
136 [% UNLESS missingissue.cannot_claim %]
137 <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
140 <td>[% missingissue.name | html %]</td>
142 <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
145 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
147 <td>[% missingissue.issn | html %]</td>
148 <td>[% missingissue.serialseq | html %]</td>
150 [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
151 [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
152 [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
153 [% IF ( missingissue.status41 ) %]<span class="status-missing_never_received">Missing (never received)</span>[% END %]
154 [% IF ( missingissue.status42 ) %]<span class="status-missing_sold_out">Missing (sold out)</span>[% END %]
155 [% IF ( missingissue.status43 ) %]<span class="status-missing_damaged">Missing (damaged)</span>[% END %]
156 [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
157 [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
159 <td class="planneddate" data-order="[% missingissue.planneddateISO | html %]">
160 [% missingissue.planneddate | html %]
162 <td>[% missingissue.claims_count | html %]</td>
163 <td data-order="[% missingissue.claimdateISO | html %]">
164 [% missingissue.claimdate | html %]
166 [% FOR field IN additional_fields_for_subscription %]
167 [% IF field.authorised_value_category %]
168 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td>
170 <td>[% missingissue.additional_fields.${field.name} | html %]</td>
177 [% IF csv_profiles %]
178 <fieldset class="action">
179 <label for="csv_code">Select CSV profile:</label>
180 <select id="csv_profile_for_export">
181 [% FOR csv IN csv_profiles %]
182 <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
185 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
189 <fieldset class="action">
190 <label for="letter_code">Select notice:</label>
191 <select name="letter_code" id="letter_code">
192 [% FOREACH letter IN letters %]
193 <option value="[% letter.code | html %]">[% letter.name | html %]</option>
196 <input type="hidden" name="op" value="send_alert" />
197 <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
198 <input type="submit" name="submit" class="button" value="Send notification" />
206 </div> <!-- /.col-sm-10.col-sm-push-2 -->
208 <div class="col-sm-2 col-sm-pull-10">
210 [% INCLUDE 'serials-menu.inc' %]
212 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
213 </div> <!-- /.row -->
215 [% MACRO jsinclude BLOCK %]
216 [% INCLUDE 'calendar.inc' %]
217 [% INCLUDE 'datatables.inc' %]
220 $(document).ready(function() {
221 sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
224 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
225 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] },
226 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
230 sTable.fnAddFilters("filter", "200");
231 $('#supplierid').change(function() {
232 $('#claims').submit();
235 // Checkboxes : Select All / None
236 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
238 $("#CheckAll").click(function() {
239 $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
242 // Generates a dynamic link for exporting the selections data as CSV
243 $("#ExportSelected").click(function() {
244 // 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.
245 var selected = $("input[name=serialid]:checked");
247 if (selected.length == 0) {
248 alert(_("Please select at least one item to export."));
252 // Building the url from currently checked boxes
253 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
254 for (var i = 0; i < selected.length; i++) {
255 url += '&serialid=' + selected[i].value;
257 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
258 // And redirecting to the CSV page
262 $("#filterByDate").on("click",function(e){
266 $("#clearfilter").on("click",function(e){
268 $("#from,#to").val("");
269 $("table#claimst tbody tr").show();
271 $("#claims_form").on("submit",function(){
274 $("#filter_claims_form").on("submit",function(){
279 // Checks if the form can be sent (at least one checkbox must be checked)
280 function checkForm() {
281 if ($("input:checked").length == 0) {
282 alert(_("Please select at least one issue."));
288 function filterByDate() {
289 var beginDate = Date_from_syspref($("#from").val()).getTime();
290 var endDate = Date_from_syspref($("#to").val()).getTime();
292 // Checks if the beginning date is valid
293 if (!parseInt(beginDate)) {
294 alert(_("The beginning date is missing or invalid."));
298 // Checks if the ending date is valid
299 if (!parseInt(endDate)) {
300 alert(_("The ending date is missing or invalid."));
304 // Checks if beginning date is before ending date
305 if (beginDate > endDate) {
306 // If not, we swap them
307 var tmpDate = endDate;
312 // We hide everything
313 $("table#claimst tbody tr").hide();
315 // For each date in the table
316 $(".planneddate").each(function() {
318 // We make a JS Date Object, according to the locale
319 var pdate = Date_from_syspref($(this).text()).getTime();
321 // And checks if the date is between the beginning and ending dates
322 if (pdate > beginDate &&
324 // If so, we can show the row
325 $(this).parent().show();
332 [% INCLUDE 'intranet-bottom.inc' %]