3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Serials › Claims</title>
5 [% INCLUDE 'doc-head-close.inc' %]
6 [% INCLUDE 'calendar.inc' %]
7 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" />
8 <script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
9 [% INCLUDE 'datatables-strings.inc' %]
10 <script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script>
11 <script type="text/javascript">
13 [% IF (dateformat == 'metric') %]dt_add_type_uk_date();[% END %]
14 $(document).ready(function() {
15 [% UNLESS ( preview ) %]
16 var sTable = $("#claimst").dataTable($.extend(true, {}, dataTablesDefaults, {
19 { "aTargets": [ 0,1 ], "bSortable": false, "bSearchable": false }
24 $('#supplierid').change(function() {
25 $('#claims').submit();
28 // Checkboxes : Select All / None
29 $("span.checkall").html("<input type=\"checkbox\" name=\"CheckAll\"> "+_("Check All")+"</input>");
31 $("#CheckAll").click(function() {
32 $("#claimst tr:visible :checkbox").attr('checked', $("#CheckAll").is(':checked'));
35 // Generates a dynamic link for exporting the selection's data as CSV
36 $("#ExportSelected").click(function() {
37 // 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.
38 var selected = $("input[name=serialid]:checked");
40 if (selected.length == 0) {
41 alert(_("Please select at least one item to export."));
45 // Building the url from currently checked boxes
46 var url = '/cgi-bin/koha/serials/lateissues-export.pl?supplierid=&op=claims';
47 for (var i = 0; i < selected.length; i++) {
48 url += '&serialid=' + selected[i].value;
50 url += '&csv_profile=' + $("#csv_profile_for_export option:selected").val();
51 // And redirecting to the CSV page
56 $("#titlefilter").keyup( function () {
57 sTable.fnFilter( this.value, 3 ); // 3 is position of title column
60 $("#branchfilter").keyup(function() {
61 sTable.fnFilter( this.value, 2 ); // 2 is the position of the author column
65 // Checks if the form can be sent (at least one checkbox must be checked)
66 function checkForm() {
67 if ($("input:checked").length == 0) {
68 alert(_("Please select at least one item."));
74 function filterByStatus() {
75 selectedStatus = $("#statusfilter").val();
76 if (selectedStatus == "all") {
79 $("table#claimst tbody tr").hide();
80 $("table#claimst tbody tr").each( function() {
81 if ( $(this).find("span.status-" + selectedStatus).size() > 0 ) {
89 function filterByBranch() {
90 selectedBranch = $("#branchfilter").val();
91 if (selectedBranch == "all") {
94 $("table#claimst tbody tr").hide();
95 $("table#claimst tbody tr").each( function() {
96 if ( $(this).find("span.branch-" + selectedBranch).size() > 0 ) {
104 function filterByDate() {
105 var beginDate = Date_from_syspref($("#from").val()).getTime();
106 var endDate = Date_from_syspref($("#to").val()).getTime();
108 // Checks if the beginning date is valid
109 if (!parseInt(beginDate)) {
110 alert(_("The beginning date is missing or invalid."));
114 // Checks if the ending date is valid
115 if (!parseInt(endDate)) {
116 alert(_("The ending date is missing or invalid."));
120 // Checks if beginning date is before ending date
121 if (beginDate > endDate) {
122 // If not, we swap them
123 var tmpDate = endDate;
128 // We hide everything
129 $("table#claimst tbody tr").hide();
131 // For each date in the table
132 $(".planneddate").each(function() {
134 // We make a JS Date Object, according to the locale
135 var pdate = Date_from_syspref($(this).text()).getTime();
137 // And checks if the date is between the beginning and ending dates
138 if (pdate > beginDate &&
140 // If so, we can show the row
141 $(this).parent().show();
147 // Clears filters : shows everything
148 function clearFilters() {
149 $("table#claimst tbody tr").show();
152 function popup(supplierid,serialid){
153 window.open('claims.pl?supplierid='+ supplierid +'&serialid='+ serialid +'&op=preview' ,'popup', 'width=600,height=400,toolbar=no,scrollbars=yes');
159 <body id="ser_claims" class="ser">
160 [% INCLUDE 'header.inc' %]
161 [% UNLESS ( preview ) %]
162 [% INCLUDE 'serials-search.inc' %]
165 <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>
167 [% UNLESS ( preview ) %]
169 <div id="doc3" class="yui-t2">
177 [% 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 %]
179 [% IF ( SHOWCONFIRMATION ) %]
180 <div class="dialog alert">Your notification has been sent.</div>
182 [% UNLESS ( letter ) %]<div class="dialog alert">No claims notice defined. <a href="/cgi-bin/koha/tools/letter.pl">Please define one</a>.</div>[% END %]
183 <form id="claims" name="claims" action="claims.pl" method="post">
185 <label for="supplierid">Vendor: </label>
186 <select id="supplierid" name="supplierid">
187 [% FOREACH suploo IN suploop %]
188 [% IF ( suploo.selected ) %]
189 <option value="[% suploo.id %]" selected="selected" >
191 <option value="[% suploo.id %]">
198 <input type="submit" value="OK" />
199 [% IF ( phone ) %]Phone: [% phone %][% END %]
200 [% IF ( booksellerfax ) %]Fax: [% booksellerfax %][% END %]
201 [% IF ( bookselleremail ) %]</p><p><a href="mailto:[% bookselleremail %]">[% bookselleremail %]</a>[% END %]
205 [% IF ( missingissues ) %]
206 <h3>Missing issues</h3>
207 <form action="claims.pl" onsubmit="return false;">
208 <fieldset class="rows">
209 <legend>Filters :</legend>
213 <label for="statusfilter">Status : </label>
214 <select id="statusfilter" onchange="filterByStatus();">
215 <option value="all" selected="selected">(All)</option>
216 <option value="expected">Expected</option>
217 <option value="late">Late</option>
218 <option value="missing">Missing</option>
219 <option value="claimed">Claimed</option>
224 <label for="titlefilter">Title : </label>
225 <input id="titlefilter" type="text" />
228 <label for="branchfilter">Library: </label>
229 <select id="branchfilter" onchange="filterByBranch();">
230 <option value="all" selected="selected">(All)</option>
231 [% FOREACH branchloo IN branchloop %]
232 <option value="[% branchloo.value %]">[% branchloo.branchname %]</option>
238 <label for="from">From:</label>
239 <input type="text" name="begindate" id="from" value="[% begindate %]" size="10" maxlength="10" class="datepickerfrom" />
240 <label for="to" style="float:none;">To:</label>
241 <input type="text" name="enddate" id="to" value="[% enddate %]" size="10" maxlength="10" class="datepickerto" />
242 <span class="hint">[% INCLUDE 'date-format.inc' %]</span>
243 <input type="button" value="OK" onclick="filterByDate();" />
247 <input type="reset" value="Clear filters" onclick="clearFilters();" />
254 <form action="claims.pl" method="post" class="checkboxed" onsubmit="return checkForm()">
255 <input type="hidden" name="order" value="[% order %]" />
259 <th><input type="checkbox" id="CheckAll"></th>
264 <th>Issue number</th>
269 <tbody>[% FOREACH missingissue IN missingissues %]
273 <input type="checkbox" name="serialid" value="[% missingissue.serialid %]" />
277 [% missingissue.name %]
280 <span class="branch-[% missingissue.branchcode %]">[% Branches.GetName( missingissue.branchcode ) %]</span>
283 <a href="/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=[% missingissue.subscriptionid %]">[% missingissue.title |html %]</a>
286 [% missingissue.serialseq %]
289 [% IF ( missingissue.status1 ) %]<span class="status-expected">Expected</span>[% END %]
290 [% IF ( missingissue.status3 ) %]<span class="status-late">Late</span>[% END %]
291 [% IF ( missingissue.status4 ) %]<span class="status-missing">Missing</span>[% END %]
292 [% IF ( missingissue.status7 ) %]<span class="status-claimed">Claimed</span>[% END %]
294 <td class="planneddate">
295 [% missingissue.planneddate %]
298 [% missingissue.claimdate %]
304 [% IF csv_profiles %]
305 <fieldset class="action">
306 <label for="csv_code">Select CSV profile:</label>
307 <select id="csv_profile_for_export">
308 [% FOR csv IN csv_profiles %]
309 <option value="[% csv.export_format_id %]">[% csv.profile %]</option>
312 <span class="exportSelected"><a id="ExportSelected" href="/cgi-bin/koha/serials/claims.pl">Download selected claims</a></span>
316 <fieldset class="action"> <label for="letter_code">Select notice:</label>
317 <select name="letter_code" id="letter_code">
318 [% FOREACH letter IN letters %]
319 <option value="[% letter.code %]">[% letter.name %]</option>
322 <input type="hidden" name="op" value="send_alert" /><input type="submit" name="submit" class="button" value="Send notification" /></fieldset>
330 <div id="doc" class="yui-t7">
333 [% IF ( supplierloop ) %]
334 [% FOREACH supplierloo IN supplierloop %]
335 [% IF ( supplierloo.name ) %]
336 <p><b>[% supplierloo.name %]</b><br />
338 [% IF ( supplierloo.postal ) %]
339 [% supplierloo.postal %]<br />
341 [% IF ( supplierloo.contphone ) %]
342 Ph: [% supplierloo.contphone %]<br />
344 [% IF ( supplierloo.contfax ) %]
345 Fax: [% supplierloo.contfax %]<br />
347 [% IF ( supplierloo.contemail ) %]
348 Email: [% supplierloo.contemail %]<br />
350 [% IF ( supplierloo.accountnumber ) %]
351 A/C: [% supplierloo.accountnumber %]</p>
353 [% IF ( supplierloo.contact ) %]
354 <p>Dear [% supplierloo.contact %]</p>
356 <p>To whom it may concern</p>
358 <p>The following items have not been received from you and are now considered missing:</p>
361 [% IF ( missingissues ) %]
362 <h3>Missing issues</h3>
365 <td><b>Vendor<b></td>
366 <td><b>Title</b></td>
367 <td><b>Issue number</b></td>
368 <td><b>Missing since</b></td>
370 [% FOREACH missingissue IN missingissues %]
373 [% missingissue.name %]
376 [% missingissue.Title |html %]
379 [% missingissue.serialseq %]
382 [% missingissue.planneddate %]
389 <p class="noprint"><a href="#" onclick="window.print(); return false;">Print</a> <a href="#" class="close">Close</a></p>
395 [% UNLESS ( preview ) %]
397 [% INCLUDE 'serials-menu.inc' %]
401 [% INCLUDE 'intranet-bottom.inc' %]