1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Serials › Claims</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" />
6 <script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
7 [% INCLUDE 'datatables-strings.inc' %]
8 <script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script>
9 <script type="text/javascript">
11 [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
12 $(document).ready(function() {
13 [% UNLESS ( preview ) %]
14 var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
17 { "aTargets": [ 0,1 ], "bSortable": false, "bSearchable": false }
22 $('#supplierid').change(function() {
23 $('#claims').submit();
26 // Checkboxes : Select All / None
27 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
29 $("#CheckAll").click(function() {
30 $("#claimst tr:visible :checkbox").attr('checked', $("#CheckAll").is(':checked'));
33 // Generates a dynamic link for exporting the selection's data as CSV
34 $("#ExportSelected").click(function() {
35 // 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.
36 var selected = $("input[name=serialid]:checked");
38 if (selected.length == 0) {
39 alert(_("Please select at least one item to export."));
43 // Building the url from currently checked boxes
44 var url = '/cgi-bin/koha/serials/lateissues-excel.pl?supplierid=&op=claims';
45 for (var i = 0; i < selected.length; i++) {
46 url += '&serialid=' + selected[i].value;
48 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
49 // And redirecting to the CSV page
54 $("#titlefilter").keyup( function () {
55 sTable.fnFilter( this.value, 3 ); // 3 is position of title column
58 $("#branchfilter").keyup(function() {
59 sTable.fnFilter( this.value, 2 ); // 2 is the position of the author column
63 // Checks if the form can be sent (at least one checkbox must be checked)
64 function checkForm() {
65 if ($("input:checked").length == 0) {
66 alert(_("Please select at least one item."));
72 function filterByStatus() {
73 selectedStatus = $("#statusfilter").val();
74 if (selectedStatus == "all") {
77 $("table#claimst tbody tr").hide();
78 $("table#claimst tbody tr").each( function() {
79 if ( $(this).find("span.status-" + selectedStatus).size() > 0 ) {
87 function filterByBranch() {
88 selectedBranch = $("#branchfilter").val();
89 if (selectedBranch == "all") {
92 $("table#claimst tbody tr").hide();
93 $("table#claimst tbody tr:contains(" + selectedBranch + ")").show();
97 function filterByDate() {
98 var beginDate = Date_from_syspref($("#from").val()).getTime();
99 var endDate = Date_from_syspref($("#to").val()).getTime();
101 // Checks if the beginning date is valid
102 if (!parseInt(beginDate)) {
103 alert(_("The beginning date is missing or invalid."));
107 // Checks if the ending date is valid
108 if (!parseInt(endDate)) {
109 alert(_("The ending date is missing or invalid."));
113 // Checks if beginning date is before ending date
114 if (beginDate > endDate) {
115 // If not, we swap them
116 var tmpDate = endDate;
121 // We hide everything
122 $("table#claimst tbody tr").hide();
124 // For each date in the table
125 $(".planneddate").each(function() {
127 // We make a JS Date Object, according to the locale
128 var pdate = Date_from_syspref($(this).text()).getTime();
130 // And checks if the date is between the beginning and ending dates
131 if (pdate > beginDate &&
133 // If so, we can show the row
134 $(this).parent().show();
140 // Clears filters : shows everything
141 function clearFilters() {
142 $("table#claimst tbody tr").show();
145 function popup(supplierid,serialid){
146 window.open('claims.pl?supplierid='+ supplierid +'&serialid='+ serialid +'&op=preview' ,'popup', 'width=600,height=400,toolbar=no,scrollbars=yes');
152 <body id="ser_claims" class="ser">
153 [% INCLUDE 'header.inc' %]
154 [% UNLESS ( preview ) %]
155 [% INCLUDE 'serials-search.inc' %]
158 <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>
160 [% UNLESS ( preview ) %]
162 <div id="doc3" class="yui-t2">
170 [% IF ( letter ) %][% 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 %]
172 [% IF ( SHOWCONFIRMATION ) %]
173 <div class="dialog alert">Your notification has been sent.</div>
175 [% UNLESS ( letter ) %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
176 <form id="claims" name="claims" action="claims.pl" method="post">
178 <label for="supplierid">Vendor: </label>
179 <select id="supplierid" name="supplierid">
180 [% FOREACH suploo IN suploop %]
181 [% IF ( suploo.selected ) %]
182 <option value="[% suploo.id %]" selected="selected" >
184 <option value="[% suploo.id %]">
191 <input type="submit" value="OK" />
192 [% IF ( phone ) %]Phone: [% phone %][% END %]
193 [% IF ( booksellerfax ) %]Fax: [% booksellerfax %][% END %]
194 [% IF ( bookselleremail ) %]</p><p><a href="mailto:[% bookselleremail %]">[% bookselleremail %]</a>[% END %]
198 [% IF ( missingissues ) %]
199 <h3>Missing issues</h3>
200 <form action="claims.pl" onsubmit="return false;">
201 <fieldset class="rows">
202 <legend>Filters :</legend>
206 <label for="statusfilter">Status : </label>
207 <select id="statusfilter" onchange="filterByStatus();">
208 <option value="all" selected="selected">(All)</option>
209 <option value="expected">Expected</option>
210 <option value="late">Late</option>
211 <option value="missing">Missing</option>
212 <option value="claimed">Claimed</option>
217 <label for="titlefilter">Title : </label>
218 <input id="titlefilter" type="text" />
221 <label for="branchfilter">Library: </label>
222 <select id="branchfilter" onchange="filterByBranch();">
223 [% FOREACH branchloo IN branchloop %]
224 [% IF ( branchloo.selected ) %]
225 <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>
227 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
234 <label for="from">From:</label>
235 <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
236 <label for="to" style="float:none;">To:</label>
237 <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
238 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
239 <input type="button" value="OK" onclick="filterByDate();" />
243 <input type="reset" value="Clear filters" onclick="clearFilters();" />
250 <form action="claims.pl" method="post" class="checkboxed" onsubmit="return checkForm()">
251 <input type="hidden" name="order" value="[% order %]" />
255 <th><input type="checkbox" id="CheckAll"></th>
260 <th>Issue number</th>
265 <tbody>[% FOREACH missingissue IN missingissues %]
269 <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
273 [% missingissue.name %]
276 [% missingissue.branchcode %]
279 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid %]">[% missingissue.title |html %]</a>
282 [% missingissue.serialseq %]
285 [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
286 [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
287 [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
288 [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
290 <td class="planneddate">
291 [% missingissue.planneddate %]
294 [% missingissue.claimdate %]
300 [% IF csv_profiles %]
301 <fieldset class="action">
302 <label for="csv_code">Select CSV profile:</label>
303 <select id="csv_profile_for_export">
304 [% FOR csv IN csv_profiles %]
305 <option value="[% csv.export_format_id %]">[% csv.profile %]</option>
308 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
312 <fieldset class="action"> <label for="letter_code">Select notice:</label>
313 <select name="letter_code" id="letter_code">
314 [% FOREACH letter IN letters %]
315 <option value="[% letter.code %]">[% letter.name %]</option>
318 <input type="hidden" name="op" value="send_alert" /><input type="submit" name="submit" class="button" value="Send notification" /></fieldset>
326 <div id="doc" class="yui-t7">
329 [% IF ( supplierloop ) %]
330 [% FOREACH supplierloo IN supplierloop %]
331 [% IF ( supplierloo.name ) %]
332 <p><b>[% supplierloo.name %]</b><br />
334 [% IF ( supplierloo.postal ) %]
335 [% supplierloo.postal %]<br />
337 [% IF ( supplierloo.contphone ) %]
338 Ph: [% supplierloo.contphone %]<br />
340 [% IF ( supplierloo.contfax ) %]
341 Fax: [% supplierloo.contfax %]<br />
343 [% IF ( supplierloo.contemail ) %]
344 Email: [% supplierloo.contemail %]<br />
346 [% IF ( supplierloo.accountnumber ) %]
347 A/C: [% supplierloo.accountnumber %]</p>
349 [% IF ( supplierloo.contact ) %]
350 <p>Dear [% supplierloo.contact %]</p>
352 <p>To whom it may concern</p>
354 <p>The following items have not been received from you and are now considered missing:</p>
357 [% IF ( missingissues ) %]
358 <h3>Missing issues</h3>
361 <td><b>Vendor<b></td>
362 <td><b>Title</b></td>
363 <td><b>Issue number</b></td>
364 <td><b>Missing since</b></td>
366 [% FOREACH missingissue IN missingissues %]
369 [% missingissue.name %]
372 [% missingissue.Title |html %]
375 [% missingissue.serialseq %]
378 [% missingissue.planneddate %]
385 <p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> <a href="#" class="close">Close</a></p>
391 [% UNLESS ( preview ) %]
393 [% INCLUDE 'serials-menu.inc' %]
397 [% INCLUDE 'intranet-bottom.inc' %]