3 [% USE AuthorisedValues %]
6 [% INCLUDE 'doc-head-open.inc' %]
7 <title>Koha › Serials › Claims</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 [% Asset.css("css/datatables.css") | $raw %]
12 <body id="ser_claims" class="ser">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'serials-search.inc' %]
16 <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>
18 <div class="main container-fluid">
20 <div class="col-sm-10 col-sm-push-2">
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 | html %]</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 | html %]" selected="selected" >
52 <option value="[% suploo.id | html %]">
54 [% suploo.name | html %]
55 ([% suploo.count | html %])
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 | html %]" 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 | html %]" 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 | html %]</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 | html %]" placeholder="Search [% field.name | html %]" /></td>
120 <tbody>[% FOREACH missingissue IN missingissues %]
123 [% UNLESS missingissue.cannot_claim %]
124 <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
127 <td>[% missingissue.name | html %]</td>
129 <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
132 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
134 <td>[% missingissue.issn | html %]</td>
135 <td>[% missingissue.serialseq | html %]</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 | html %]">[% missingissue.planneddate | html %]</span>
150 <span title="0000-00-00"></span>
153 <td>[% missingissue.claims_count | html %]</td>
155 [% IF ( missingissue.claimdate ) %]
156 <span title="[% missingissue.claimdateISO | html %]">[% missingissue.claimdate | html %]</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} ) | html %]</td>
165 <td>[% missingissue.additional_fields.${field.name} | html %]</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 | html %]">[% csv.profile | html %]</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 | html %]">[% letter.name | html %]</option>
191 <input type="hidden" name="op" value="send_alert" />
192 <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
193 <input type="submit" name="submit" class="button" value="Send notification" />
201 </div> <!-- /.col-sm-10.col-sm-push-2 -->
203 <div class="col-sm-2 col-sm-pull-10">
205 [% INCLUDE 'serials-menu.inc' %]
207 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
208 </div> <!-- /.row -->
210 [% MACRO jsinclude BLOCK %]
211 [% INCLUDE 'calendar.inc' %]
212 [% INCLUDE 'datatables.inc' %]
215 $(document).ready(function() {
216 sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
219 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
220 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] },
221 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
225 sTable.fnAddFilters("filter", "200");
226 $('#supplierid').change(function() {
227 $('#claims').submit();
230 // Checkboxes : Select All / None
231 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
233 $("#CheckAll").click(function() {
234 $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
237 // Generates a dynamic link for exporting the selections data as CSV
238 $("#ExportSelected").click(function() {
239 // 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.
240 var selected = $("input[name=serialid]:checked");
242 if (selected.length == 0) {
243 alert(_("Please select at least one item to export."));
247 // Building the url from currently checked boxes
248 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
249 for (var i = 0; i < selected.length; i++) {
250 url += '&serialid=' + selected[i].value;
252 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
253 // And redirecting to the CSV page
257 $("#filterByDate").on("click",function(e){
261 $("#clearfilter").on("click",function(e){
263 $("#from,#to").val("");
264 $("table#claimst tbody tr").show();
266 $("#claims_form").on("submit",function(){
269 $("#filter_claims_form").on("submit",function(){
274 // Checks if the form can be sent (at least one checkbox must be checked)
275 function checkForm() {
276 if ($("input:checked").length == 0) {
277 alert(_("Please select at least one issue."));
283 function filterByDate() {
284 var beginDate = Date_from_syspref($("#from").val()).getTime();
285 var endDate = Date_from_syspref($("#to").val()).getTime();
287 // Checks if the beginning date is valid
288 if (!parseInt(beginDate)) {
289 alert(_("The beginning date is missing or invalid."));
293 // Checks if the ending date is valid
294 if (!parseInt(endDate)) {
295 alert(_("The ending date is missing or invalid."));
299 // Checks if beginning date is before ending date
300 if (beginDate > endDate) {
301 // If not, we swap them
302 var tmpDate = endDate;
307 // We hide everything
308 $("table#claimst tbody tr").hide();
310 // For each date in the table
311 $(".planneddate").each(function() {
313 // We make a JS Date Object, according to the locale
314 var pdate = Date_from_syspref($(this).text()).getTime();
316 // And checks if the date is between the beginning and ending dates
317 if (pdate > beginDate &&
319 // If so, we can show the row
320 $(this).parent().show();
327 [% INCLUDE 'intranet-bottom.inc' %]