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' %]
17 [% WRAPPER 'sub-header.inc' %]
18 [% WRAPPER breadcrumbs %]
19 [% WRAPPER breadcrumb_item %]
20 <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a>
22 [% IF ( supplierid ) -%]
23 [% WRAPPER breadcrumb_item %]
24 <a href="/cgi-bin/koha/serials/claims.pl">
28 [% WRAPPER breadcrumb_item bc_active= 1 %]
29 <span>Claims for [% suppliername | html %]</span>
32 [% WRAPPER breadcrumb_item bc_active= 1 %]
36 [% END #/ WRAPPER breadcrumbs %]
37 [% END #/ WRAPPER sub-header.inc %]
39 <div class="main container-fluid">
41 <div class="col-sm-10 col-sm-push-2">
43 [% INCLUDE 'messages.inc' %]
45 <h1>Claims [% IF ( suppliername ) %] for [% suppliername | html %] [% END %]</h1>
48 [% IF error_claim == 'no_vendor_email' %]
49 <div class="dialog alert">This vendor has no email defined for late issues.</div>
50 [% ELSIF error_claim == 'bad_or_missing_sender' %]
51 <div class="dialog alert">Bad or missing sender address; check your branch email address or preference KohaAdminEmailAddress.</div>
53 <div class="dialog alert">[% error_claim | html %]</div>
57 <div class="dialog message">Email has been sent.</div>
61 [% UNLESS ( missingissues ) %]
62 [% IF ( supplierid ) %]
63 <div class="dialog alert">No missing issues found.</div>
65 <div class="dialog message">Please choose a vendor.</div>
70 [% IF ( SHOWCONFIRMATION ) %]
71 <div class="dialog alert">Your notification has been sent.</div>
75 <div class="dialog alert">
76 No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.
80 <form id="claims" name="claims" action="claims.pl" method="get">
82 <label for="supplierid">Vendor: </label>
83 <select id="supplierid" name="supplierid">
84 [% FOREACH suploo IN suploop %]
85 [% IF ( suploo.selected ) %]
86 <option value="[% suploo.id | html %]" selected="selected" >
88 <option value="[% suploo.id | html %]">
90 [% suploo.name | html %]
91 ([% suploo.count | html %])
95 <input type="submit" class="btn btn-primary" value="OK" />
97 </form> <!-- /#claims -->
99 [% IF ( missingissues ) %]
100 <h3>Missing issues</h3>
101 <form method="get" action="claims.pl" id="filter_claims_form">
102 <fieldset class="rows">
103 <legend>Filters:</legend>
106 <label for="from">From:</label>
107 <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/>
108 <label for="to" style="float:none;">To:</label>
109 <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" />
110 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
111 <input id="filterByDate" type="button" value="OK" />
112 <a href="#" id="clearfilter"><i class="fa fa-times"></i> Clear filter</a>
119 <form action="claims.pl" method="post" id="claims_form">
120 [% INCLUDE 'csrf-token.inc' %]
124 <th><input type="checkbox" id="CheckAll"></th>
127 <th class="anti-the">Title</th>
129 <th>Issue number</th>
132 <th>Publication date</th>
133 <th>Claims count</th>
135 [% FOR field IN additional_fields_for_subscription %]
136 <th>[% field.name | html %]</th>
141 [% FOREACH missingissue IN missingissues %]
144 [% UNLESS missingissue.cannot_claim %]
145 <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
148 <td>[% missingissue.name | html %]</td>
150 <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
153 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
155 <td>[% missingissue.issn | html %]</td>
156 <td>[% missingissue.serialseq | html %]</td>
158 [% INCLUDE 'serial-status.inc' serial = missingissue %]
160 <td class="planneddate" data-order="[% missingissue.planneddate | html %]">
161 [% missingissue.planneddate | $KohaDates %]
163 <td class="publisheddate" data-order="[% missingissue.publisheddate | html %]">
164 [% missingissue.publisheddate | $KohaDates %]
166 <td>[% missingissue.claims_count | html %]</td>
167 <td data-order="[% missingissue.claimdate | html %]">
168 [% missingissue.claimdate | $KohaDates %]
170 [% FOR field IN additional_fields_for_subscription %]
171 [% IF field.authorised_value_category %]
172 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td>
174 <td>[% missingissue.additional_fields.${field.name} | html %]</td>
178 [% END # /FOREACH missingissue %]
183 <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
184 <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
185 <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
186 <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
187 <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
188 <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
189 <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
190 <td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td>
191 <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td>
192 <td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td>
193 [% FOR field IN additional_fields_for_subscription %]
194 <td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td>
198 </table> <!-- /#claimst -->
200 [% IF csv_profiles.count %]
201 <fieldset class="action">
202 <label for="csv_code">Select CSV profile:</label>
203 <select id="csv_profile_for_export">
204 [% FOR csv IN csv_profiles %]
205 <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
208 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
213 <fieldset class="action">
214 <label for="letter_code">Select notice:</label>
215 <select name="letter_code" id="letter_code">
216 [% FOREACH letter IN letters %]
217 <option value="[% letter.code | html %]">[% letter.name | html %]</option>
220 <input type="hidden" name="op" value="cud-send_alert" />
221 <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
222 <input type="submit" name="submit" class="btn btn-primary" value="Send notification" />
225 </form> <!-- /#claims_form -->
227 [% END # /missingissues %]
230 </div> <!-- /.col-sm-10.col-sm-push-2 -->
232 <div class="col-sm-2 col-sm-pull-10">
234 [% INCLUDE 'serials-menu.inc' %]
236 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
237 </div> <!-- /.row -->
239 [% MACRO jsinclude BLOCK %]
240 [% INCLUDE 'calendar.inc' %]
241 [% INCLUDE 'datatables.inc' %]
244 $(document).ready(function() {
245 sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
248 { "targets": [ 0 ], "orderable": false, "searchable": false },
249 { "type": "anti-the", "targets": [ 'anti-the'] }
253 sTable.fnAddFilters("filter", "200");
254 $('#supplierid').change(function() {
255 $('#claims').submit();
258 // Checkboxes : Select All / None
259 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>");
261 $("#CheckAll").click(function() {
262 $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
265 // Generates a dynamic link for exporting the selections data as CSV
266 $("#ExportSelected").click(function() {
267 // 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.
268 var selected = $("input[name=serialid]:checked");
270 if (selected.length == 0) {
271 alert(_("Please select at least one item to export."));
275 // Building the url from currently checked boxes
276 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
277 for (var i = 0; i < selected.length; i++) {
278 url += '&serialid=' + selected[i].value;
280 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
281 // And redirecting to the CSV page
285 $("#filterByDate").on("click",function(e){
289 $("#clearfilter").on("click",function(e){
291 $("#from").flatpickr().clear();
292 $("#to").flatpickr().clear();
293 $("table#claimst tbody tr").show();
295 $("#claims_form").on("submit",function(){
298 $("#filter_claims_form").on("submit",function(){
303 // Checks if the form can be sent (at least one checkbox must be checked)
304 function checkForm() {
305 if ($("input:checked").length == 0) {
306 alert(_("Please select at least one issue."));
312 function filterByDate() {
313 var beginDate = new Date($("#from").val()).getTime();
314 var endDate = new Date($("#to").val()).getTime();
316 // Checks if the beginning date is valid
317 if (!parseInt(beginDate)) {
318 alert(_("The beginning date is missing or invalid."));
322 // Checks if the ending date is valid
323 if (!parseInt(endDate)) {
324 alert(_("The ending date is missing or invalid."));
328 // Checks if beginning date is before ending date
329 if (beginDate > endDate) {
330 // If not, we swap them
331 var tmpDate = endDate;
336 // We hide everything
337 $("table#claimst tbody tr").hide();
339 // For each date in the table
340 $(".planneddate").each(function() {
342 // We make a JS Date Object, according to the locale
343 var pdate = Date_from_syspref($(this).text()).getTime();
345 // And checks if the date is between the beginning and ending dates
346 if (pdate > beginDate &&
348 // If so, we can show the row
349 $(this).parent().show();
356 [% INCLUDE 'intranet-bottom.inc' %]