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">
44 <h1>Claims [% IF ( suppliername ) %] for [% suppliername | html %] [% END %]</h1>
47 [% IF error_claim == 'no_vendor_email' %]
48 <div class="dialog alert">This vendor has no email defined for late issues.</div>
49 [% ELSIF error_claim == 'bad_or_missing_sender' %]
50 <div class="dialog alert">Bad or missing sender address; check your branch email address or preference KohaAdminEmailAddress.</div>
52 <div class="dialog alert">[% error_claim | html %]</div>
56 <div class="dialog message">Email has been sent.</div>
60 [% UNLESS ( missingissues ) %]
61 [% IF ( supplierid ) %]
62 <div class="dialog alert">No missing issues found.</div>
64 <div class="dialog message">Please choose a vendor.</div>
69 [% IF ( SHOWCONFIRMATION ) %]
70 <div class="dialog alert">Your notification has been sent.</div>
74 <div class="dialog alert">
75 No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.
79 <form id="claims" name="claims" action="claims.pl" method="post">
81 <label for="supplierid">Vendor: </label>
82 <select id="supplierid" name="supplierid">
83 [% FOREACH suploo IN suploop %]
84 [% IF ( suploo.selected ) %]
85 <option value="[% suploo.id | html %]" selected="selected" >
87 <option value="[% suploo.id | html %]">
89 [% suploo.name | html %]
90 ([% suploo.count | html %])
94 <input type="submit" class="btn btn-primary" value="OK" />
96 </form> <!-- /#claims -->
98 [% IF ( missingissues ) %]
99 <h3>Missing issues</h3>
100 <form action="claims.pl" id="filter_claims_form">
101 <fieldset class="rows">
102 <legend>Filters:</legend>
105 <label for="from">From:</label>
106 <input type="text" name="begindate" id="from" value="[% begindate | html %]" size="10" maxlength="10" class="flatpickr" data-date_to="to"/>
107 <label for="to" style="float:none;">To:</label>
108 <input type="text" name="enddate" id="to" value="[% enddate | html %]" size="10" maxlength="10" class="flatpickr" />
109 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
110 <input id="filterByDate" type="button" value="OK" />
111 <a href="#" id="clearfilter"><i class="fa fa-times"></i> Clear filter</a>
118 <form action="claims.pl" method="post" id="claims_form">
122 <th><input type="checkbox" id="CheckAll"></th>
125 <th class="anti-the">Title</th>
127 <th>Issue number</th>
130 <th>Publication date</th>
131 <th>Claims count</th>
133 [% FOR field IN additional_fields_for_subscription %]
134 <th>[% field.name | html %]</th>
139 [% FOREACH missingissue IN missingissues %]
142 [% UNLESS missingissue.cannot_claim %]
143 <input type="checkbox" name="serialid" value="[% missingissue.serialid | html %]" />
146 <td>[% missingissue.name | html %]</td>
148 <span class="branch-[% missingissue.branchcode | html %]">[% Branches.GetName( missingissue.branchcode ) | html %]</span>
151 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid | uri %]">[% missingissue.title | html %]</a>
153 <td>[% missingissue.issn | html %]</td>
154 <td>[% missingissue.serialseq | html %]</td>
156 [% INCLUDE 'serial-status.inc' serial = missingissue %]
158 <td class="planneddate" data-order="[% missingissue.planneddate | html %]">
159 [% missingissue.planneddate | $KohaDates %]
161 <td class="publisheddate" data-order="[% missingissue.publisheddate | html %]">
162 [% missingissue.publisheddate | $KohaDates %]
164 <td>[% missingissue.claims_count | html %]</td>
165 <td data-order="[% missingissue.claimdate | html %]">
166 [% missingissue.claimdate | $KohaDates %]
168 [% FOR field IN additional_fields_for_subscription %]
169 [% IF field.authorised_value_category %]
170 <td>[% AuthorisedValues.GetByCode( field.authorised_value_category, missingissue.additional_fields.${field.name} ) | html %]</td>
172 <td>[% missingissue.additional_fields.${field.name} | html %]</td>
176 [% END # /FOREACH missingissue %]
181 <td><input type="text" class="filter" data-column_num="1" placeholder="Search vendor" /></td>
182 <td><input type="text" class="filter" data-column_num="2" placeholder="Search library" /></td>
183 <td><input type="text" class="filter" data-column_num="3" placeholder="Search title" /></td>
184 <td><input type="text" class="filter" data-column_num="4" placeholder="Search ISSN" /></td>
185 <td><input type="text" class="filter" data-column_num="5" placeholder="Search issue number" /></td>
186 <td><input type="text" class="filter" data-column_num="6" placeholder="Search status" /></td>
187 <td><input type="text" class="filter" data-column_num="7" placeholder="Search since" /></td>
188 <td><input type="text" class="filter" data-column_num="8" placeholder="Search publication date" /></td>
189 <td><input type="text" class="filter" data-column_num="9" placeholder="Search claim count" /></td>
190 <td><input type="text" class="filter" data-column_num="10" placeholder="Search claim date" /></td>
191 [% FOR field IN additional_fields_for_subscription %]
192 <td><input type="text" class="filter" data-column_num="[% loop.count + 10 | html %]" placeholder="Search [% field.name | html %]" /></td>
196 </table> <!-- /#claimst -->
198 [% IF csv_profiles.count %]
199 <fieldset class="action">
200 <label for="csv_code">Select CSV profile:</label>
201 <select id="csv_profile_for_export">
202 [% FOR csv IN csv_profiles %]
203 <option value="[% csv.export_format_id | html %]">[% csv.profile | html %]</option>
206 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
211 <fieldset class="action">
212 <label for="letter_code">Select notice:</label>
213 <select name="letter_code" id="letter_code">
214 [% FOREACH letter IN letters %]
215 <option value="[% letter.code | html %]">[% letter.name | html %]</option>
218 <input type="hidden" name="op" value="send_alert" />
219 <input type="hidden" name="supplierid" value="[% supplierid | html %]" />
220 <input type="submit" name="submit" class="btn btn-primary" value="Send notification" />
223 </form> <!-- /#claims_form -->
225 [% END # /missingissues %]
228 </div> <!-- /.col-sm-10.col-sm-push-2 -->
230 <div class="col-sm-2 col-sm-pull-10">
232 [% INCLUDE 'serials-menu.inc' %]
234 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
235 </div> <!-- /.row -->
237 [% MACRO jsinclude BLOCK %]
238 [% INCLUDE 'calendar.inc' %]
239 [% INCLUDE 'datatables.inc' %]
242 $(document).ready(function() {
243 sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
246 { "aTargets": [ 0 ], "bSortable": false, "bSearchable": false },
247 { 'sType': "anti-the", 'aTargets' : [ 'anti-the'] }
251 sTable.fnAddFilters("filter", "200");
252 $('#supplierid').change(function() {
253 $('#claims').submit();
256 // Checkboxes : Select All / None
257 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check all")+"</input>");
259 $("#CheckAll").click(function() {
260 $("#claimst tr:visible :checkbox").prop('checked', $("#CheckAll").is(':checked'));
263 // Generates a dynamic link for exporting the selections data as CSV
264 $("#ExportSelected").click(function() {
265 // 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.
266 var selected = $("input[name=serialid]:checked");
268 if (selected.length == 0) {
269 alert(_("Please select at least one item to export."));
273 // Building the url from currently checked boxes
274 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
275 for (var i = 0; i < selected.length; i++) {
276 url += '&serialid=' + selected[i].value;
278 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
279 // And redirecting to the CSV page
283 $("#filterByDate").on("click",function(e){
287 $("#clearfilter").on("click",function(e){
289 $("#from,#to").val("");
290 $("table#claimst tbody tr").show();
292 $("#claims_form").on("submit",function(){
295 $("#filter_claims_form").on("submit",function(){
300 // Checks if the form can be sent (at least one checkbox must be checked)
301 function checkForm() {
302 if ($("input:checked").length == 0) {
303 alert(_("Please select at least one issue."));
309 function filterByDate() {
310 var beginDate = new Date($("#from").val()).getTime();
311 var endDate = new Date($("#to").val()).getTime();
313 // Checks if the beginning date is valid
314 if (!parseInt(beginDate)) {
315 alert(_("The beginning date is missing or invalid."));
319 // Checks if the ending date is valid
320 if (!parseInt(endDate)) {
321 alert(_("The ending date is missing or invalid."));
325 // Checks if beginning date is before ending date
326 if (beginDate > endDate) {
327 // If not, we swap them
328 var tmpDate = endDate;
333 // We hide everything
334 $("table#claimst tbody tr").hide();
336 // For each date in the table
337 $(".planneddate").each(function() {
339 // We make a JS Date Object, according to the locale
340 var pdate = Date_from_syspref($(this).text()).getTime();
342 // And checks if the date is between the beginning and ending dates
343 if (pdate > beginDate &&
345 // If so, we can show the row
346 $(this).parent().show();
353 [% INCLUDE 'intranet-bottom.inc' %]