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>
108 <th class="title-string">Since</th>
109 <th>Claims count</th>
110 <th class="title-string">Claim date</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">
160 [% IF ( missingissue.planneddate ) %]
161 <span title="[% missingissue.planneddateISO | html %]">[% missingissue.planneddate | html %]</span>
163 <span title="0000-00-00"></span>
166 <td>[% missingissue.claims_count | html %]</td>
168 [% IF ( missingissue.claimdate ) %]
169 <span title="[% missingissue.claimdateISO | html %]">[% missingissue.claimdate | html %]</span>
171 <span title="0000-00-00"></span>
174 [% FOR field IN additional_fields_for_subscription %]
175 [% IF field.authorised_value_category %]
176 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td>
178 <td>[% missingissue.additional_fields.${field.name} | html %]</td>
185 [% IF csv_profiles %]
186 <fieldset class="action">
187 <label for="csv_code">Select CSV profile:</label>
188 <select id="csv_profile_for_export">
189 [% FOR csv IN csv_profiles %]
190 <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
193 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
197 <fieldset class="action">
198 <label for="letter_code">Select notice:</label>
199 <select name="letter_code" id="letter_code">
200 [% FOREACH letter IN letters %]
201 <option value="[% letter.code | html %]">[% letter.name | html %]</option>
204 <input type="hidden" name="op" value="send_alert" />
205 <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
206 <input type="submit" name="submit" class="button" value="Send notification" />
214 </div> <!-- /.col-sm-10.col-sm-push-2 -->
216 <div class="col-sm-2 col-sm-pull-10">
218 [% INCLUDE 'serials-menu.inc' %]
220 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
221 </div> <!-- /.row -->
223 [% MACRO jsinclude BLOCK %]
224 [% INCLUDE 'calendar.inc' %]
225 [% INCLUDE 'datatables.inc' %]
228 $(document).ready(function() {
229 sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
232 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
233 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] },
234 { 'sType': "title-string", 'aTargets' : [ 'title-string'] }
238 sTable.fnAddFilters("filter", "200");
239 $('#supplierid').change(function() {
240 $('#claims').submit();
243 // Checkboxes : Select All / None
244 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
246 $("#CheckAll").click(function() {
247 $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
250 // Generates a dynamic link for exporting the selections data as CSV
251 $("#ExportSelected").click(function() {
252 // 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.
253 var selected = $("input[name=serialid]:checked");
255 if (selected.length == 0) {
256 alert(_("Please select at least one item to export."));
260 // Building the url from currently checked boxes
261 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
262 for (var i = 0; i < selected.length; i++) {
263 url += '&serialid=' + selected[i].value;
265 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
266 // And redirecting to the CSV page
270 $("#filterByDate").on("click",function(e){
274 $("#clearfilter").on("click",function(e){
276 $("#from,#to").val("");
277 $("table#claimst tbody tr").show();
279 $("#claims_form").on("submit",function(){
282 $("#filter_claims_form").on("submit",function(){
287 // Checks if the form can be sent (at least one checkbox must be checked)
288 function checkForm() {
289 if ($("input:checked").length == 0) {
290 alert(_("Please select at least one issue."));
296 function filterByDate() {
297 var beginDate = Date_from_syspref($("#from").val()).getTime();
298 var endDate = Date_from_syspref($("#to").val()).getTime();
300 // Checks if the beginning date is valid
301 if (!parseInt(beginDate)) {
302 alert(_("The beginning date is missing or invalid."));
306 // Checks if the ending date is valid
307 if (!parseInt(endDate)) {
308 alert(_("The ending date is missing or invalid."));
312 // Checks if beginning date is before ending date
313 if (beginDate > endDate) {
314 // If not, we swap them
315 var tmpDate = endDate;
320 // We hide everything
321 $("table#claimst tbody tr").hide();
323 // For each date in the table
324 $(".planneddate").each(function() {
326 // We make a JS Date Object, according to the locale
327 var pdate = Date_from_syspref($(this).text()).getTime();
329 // And checks if the date is between the beginning and ending dates
330 if (pdate > beginDate &&
332 // If so, we can show the row
333 $(this).parent().show();
340 [% INCLUDE 'intranet-bottom.inc' %]