3 [% USE AuthorisedValues %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>[% IF ( supplierid ) -%] Claims for [% suppliername | html %] › [% END %] Claims › Serials › Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
12 <body id="ser_claims" class="ser">
13 [% WRAPPER 'header.inc' %]
14 [% INCLUDE 'serials-search.inc' %]
16 [% WRAPPER 'sub-header.inc' %]
17 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
20 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
23 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
25 [% IF ( supplierid ) -%]
27 <a href="/cgi-bin/koha/serials/claims.pl">
32 <a href="#" aria-current="page">Claims for [% suppliername | html %]</a>
36 <a href="#" aria-current="page">
45 <div class="main container-fluid">
47 <div class="col-sm-10 col-sm-push-2">
50 <h1>Claims [% IF ( suppliername ) %] for [% suppliername | html %] [% END %]</h1>
53 [% IF error_claim == 'no_vendor_email' %]
54 <div class="dialog alert">This vendor has no email defined for late issues.</div>
55 [% ELSIF error_claim == 'bad_or_missing_sender' %]
56 <div class="dialog alert">Bad or missing sender address; check your branch email address or preference KohaAdminEmailAddress.</div>
58 <div class="dialog alert">[% error_claim | html %]</div>
62 <div class="dialog message">Email has been sent.</div>
66 [% UNLESS ( missingissues ) %]
67 [% IF ( supplierid ) %]
68 <div class="dialog alert">No missing issues found.</div>
70 <div class="dialog message">Please choose a vendor.</div>
75 [% IF ( SHOWCONFIRMATION ) %]
76 <div class="dialog alert">Your notification has been sent.</div>
80 <div class="dialog alert">
81 No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.
85 <form id="claims" name="claims" action="claims.pl" method="post">
87 <label for="supplierid">Vendor: </label>
88 <select id="supplierid" name="supplierid">
89 [% FOREACH suploo IN suploop %]
90 [% IF ( suploo.selected ) %]
91 <option value="[% suploo.id | html %]" selected="selected" >
93 <option value="[% suploo.id | html %]">
95 [% suploo.name | html %]
96 ([% suploo.count | html %])
100 <input type="submit" class="btn btn-primary" value="OK" />
102 </form> <!-- /#claims -->
104 [% IF ( missingissues ) %]
105 <h3>Missing issues</h3>
106 <form action="claims.pl" id="filter_claims_form">
107 <fieldset class="rows">
108 <legend>Filters:</legend>
111 <label for="from">From:</label>
112 <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/>
113 <label for="to" style="float:none;">To:</label>
114 <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" />
115 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
116 <input id="filterByDate" type="button" value="OK" />
117 <a href="#" id="clearfilter"><i class="fa fa-remove"></i> Clear filter</a>
124 <form action="claims.pl" method="post" id="claims_form">
128 <th><input type="checkbox" id="CheckAll"></th>
131 <th class="anti-the">Title</th>
133 <th>Issue number</th>
136 <th>Publication date</th>
137 <th>Claims count</th>
139 [% FOR field IN additional_fields_for_subscription %]
140 <th>[% field.name | html %]</th>
145 [% FOREACH missingissue IN missingissues %]
148 [% UNLESS missingissue.cannot_claim %]
149 <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
152 <td>[% missingissue.name | html %]</td>
154 <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
157 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
159 <td>[% missingissue.issn | html %]</td>
160 <td>[% missingissue.serialseq | html %]</td>
162 [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
163 [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
164 [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
165 [% IF ( missingissue.status41 ) %]<span class="status-missing_never_received">Missing (never received)</span>[% END %]
166 [% IF ( missingissue.status42 ) %]<span class="status-missing_sold_out">Missing (sold out)</span>[% END %]
167 [% IF ( missingissue.status43 ) %]<span class="status-missing_damaged">Missing (damaged)</span>[% END %]
168 [% IF ( missingissue.status44 ) %]<span class="status-missing_lost">Missing (lost)</span>[% END %]
169 [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
171 <td class="planneddate" data-order="[% missingissue.planneddate | html %]">
172 [% missingissue.planneddate | $KohaDates %]
174 <td class="publisheddate" data-order="[% missingissue.publisheddate | html %]">
175 [% missingissue.publisheddate | $KohaDates %]
177 <td>[% missingissue.claims_count | html %]</td>
178 <td data-order="[% missingissue.claimdate | html %]">
179 [% missingissue.claimdate | $KohaDates %]
181 [% FOR field IN additional_fields_for_subscription %]
182 [% IF field.authorised_value_category %]
183 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td>
185 <td>[% missingissue.additional_fields.${field.name} | html %]</td>
189 [% END # /FOREACH missingissue %]
194 <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
195 <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
196 <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
197 <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
198 <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
199 <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
200 <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
201 <td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td>
202 <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td>
203 <td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td>
204 [% FOR field IN additional_fields_for_subscription %]
205 <td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td>
209 </table> <!-- /#claimst -->
211 [% IF csv_profiles.count %]
212 <fieldset class="action">
213 <label for="csv_code">Select CSV profile:</label>
214 <select id="csv_profile_for_export">
215 [% FOR csv IN csv_profiles %]
216 <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
219 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
224 <fieldset class="action">
225 <label for="letter_code">Select notice:</label>
226 <select name="letter_code" id="letter_code">
227 [% FOREACH letter IN letters %]
228 <option value="[% letter.code | html %]">[% letter.name | html %]</option>
231 <input type="hidden" name="op" value="send_alert" />
232 <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
233 <input type="submit" name="submit" class="btn btn-primary" value="Send notification" />
236 </form> <!-- /#claims_form -->
238 [% END # /missingissues %]
241 </div> <!-- /.col-sm-10.col-sm-push-2 -->
243 <div class="col-sm-2 col-sm-pull-10">
245 [% INCLUDE 'serials-menu.inc' %]
247 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
248 </div> <!-- /.row -->
250 [% MACRO jsinclude BLOCK %]
251 [% INCLUDE 'calendar.inc' %]
252 [% INCLUDE 'datatables.inc' %]
255 $(document).ready(function() {
256 sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
259 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
260 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
264 sTable.fnAddFilters("filter", "200");
265 $('#supplierid').change(function() {
266 $('#claims').submit();
269 // Checkboxes : Select All / None
270 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>");
272 $("#CheckAll").click(function() {
273 $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
276 // Generates a dynamic link for exporting the selections data as CSV
277 $("#ExportSelected").click(function() {
278 // 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.
279 var selected = $("input[name=serialid]:checked");
281 if (selected.length == 0) {
282 alert(_("Please select at least one item to export."));
286 // Building the url from currently checked boxes
287 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
288 for (var i = 0; i < selected.length; i++) {
289 url += '&serialid=' + selected[i].value;
291 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
292 // And redirecting to the CSV page
296 $("#filterByDate").on("click",function(e){
300 $("#clearfilter").on("click",function(e){
302 $("#from,#to").val("");
303 $("table#claimst tbody tr").show();
305 $("#claims_form").on("submit",function(){
308 $("#filter_claims_form").on("submit",function(){
313 // Checks if the form can be sent (at least one checkbox must be checked)
314 function checkForm() {
315 if ($("input:checked").length == 0) {
316 alert(_("Please select at least one issue."));
322 function filterByDate() {
323 var beginDate = new Date($("#from").val()).getTime();
324 var endDate = new Date($("#to").val()).getTime();
326 // Checks if the beginning date is valid
327 if (!parseInt(beginDate)) {
328 alert(_("The beginning date is missing or invalid."));
332 // Checks if the ending date is valid
333 if (!parseInt(endDate)) {
334 alert(_("The ending date is missing or invalid."));
338 // Checks if beginning date is before ending date
339 if (beginDate > endDate) {
340 // If not, we swap them
341 var tmpDate = endDate;
346 // We hide everything
347 $("table#claimst tbody tr").hide();
349 // For each date in the table
350 $(".planneddate").each(function() {
352 // We make a JS Date Object, according to the locale
353 var pdate = Date_from_syspref($(this).text()).getTime();
355 // And checks if the date is between the beginning and ending dates
356 if (pdate > beginDate &&
358 // If so, we can show the row
359 $(this).parent().show();
366 [% INCLUDE 'intranet-bottom.inc' %]