Bug 18966: Do not deal with duplicate issue_id on checkin
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / returns.tt
1 [% USE KohaDates %]
2 [% USE Branches %]
3 [% USE Koha %]
4 [% USE Borrowers %]
5 [% USE ItemTypes %]
6 [% USE AuthorisedValues %]
7 [% USE ColumnsSettings %]
8
9 [% BLOCK display_bormessagepref %]
10     [% IF ( bormessagepref ) %]
11         <li>Patron notification:
12             [% FOREACH mtt IN bormessagepref.keys %]
13                 [%~ IF ( mtt == 'email' ) %] Email[% END ~%]
14                 [%~ IF ( mtt == 'phone' ) %] Phone[% END ~%]
15                 [%~ IF ( mtt == 'sms' ) %] SMS[% END ~%]
16                 [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
17             [% END %]
18         </li>
19            [% ELSE %]
20         <li>Patron is not notified.</li>
21     [% END %]
22 [% END %]
23
24 [% BLOCK display_holdpatron_address %]
25     [% IF Koha.Preference( 'AddressFormat' ) %]
26         [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
27     [% ELSE %]
28         [% INCLUDE 'member-display-address-style-us.inc' %]
29     [% END %]
30 [% END %]
31
32 [% INCLUDE 'doc-head-open.inc' %]
33 <title>Koha &rsaquo; Circulation &rsaquo; Check in [% title |html %]</title>
34 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
35 [% INCLUDE 'doc-head-close.inc' %]
36 [% INCLUDE 'datatables.inc' %]
37 [% INCLUDE 'columns_settings.inc' %]
38 [% INCLUDE 'calendar.inc' %]
39 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script>
40 [% INCLUDE 'timepicker.inc' %]
41
42 <script type="text/javascript">
43 //<![CDATA[
44 function Dopop(link) {
45     var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
46     $("#barcode").focus();
47 }
48 $(document).ready(function () {
49     $(".modal").modal({ backdrop: 'static' }).on('shown', function() {
50         $("#barcode").prop("disabled", true);
51     }).on('hidden', function() {
52         $("#barcode").prop("disabled", false).focus();
53     });
54
55     $(".modal").on('hidden.bs.modal', function (e) { $("#barcode").focus(); });
56
57     [% IF print_slip %]
58         Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% biblionumber %]');
59     [% END %]
60
61     var columns_settings = [% ColumnsSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) %]
62     var returns_table = KohaTable("#checkedintable", {
63             "bFilter":false,
64             "bPaginate":false,
65             "bInfo":false,
66             "bSort":false,
67             "dom": 'B<"clearfix">t',
68             }, columns_settings);
69
70     $("#return_date_override").datetimepicker({
71         onClose: function(dateText, inst) {
72             if (validate_date(dateText, inst) ) {
73                 $("#barcode").focus();
74             }
75         },
76         defaultDate: -1,
77         hour: 23,
78         minute: 59,
79         maxDate: 0
80     }).on("change", function(e, value) {
81         if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
82     });
83     $("#return_date_override").on("blur", function() {
84             check_valid_return_date();
85     });
86     $("#checkin-form").submit(function( event ) {
87         if ( !check_valid_return_date() ) {
88             event.preventDefault();
89         }
90     });
91
92     function check_valid_return_date() {
93         if ( $("#return_date_override").val() ) {
94             var datetime = DateTime_from_syspref( $("#return_date_override").val() );
95             var now = new Date();
96             if ( !datetime || datetime > now ) {
97                 alert("Invalid return date/time!");
98                 $("#return_date_override").val("")
99                 return false;
100             }
101         }
102         return true;
103     }
104
105     $("#exemptcheck").change(function () {
106         if (this.checked == true) {
107             $("#barcode").addClass("alert");
108             $("#exemptfines").show();
109         } else {
110             $("#barcode").removeClass("alert");
111             $("#exemptfines").hide();
112         }
113         $("#barcode").focus();
114     });
115     $("#dropboxcheck").change(function () {
116         if (this.checked == true) {
117             $("#barcode").addClass("alert");
118             $("#dropboxmode").show();
119
120             $("#return_date_override_fields :input").prop('disabled', true);
121             $("#return_date_override").datetimepicker("disable");
122         } else {
123             $("#barcode").removeClass("alert");
124             $("#dropboxmode").hide();
125
126             $("#return_date_override_fields :input").prop('disabled', false);
127             $("#return_date_override").datetimepicker("enable");
128         }
129         $("#barcode").focus();
130     });
131     $("#forgivemanualholdsexpire").change(function () {
132         if (this.checked == true) {
133             $("#barcode").addClass("alert");
134             $("#forgivemanualholdsexpire-alert").show();
135         } else {
136             $("#barcode").removeClass("alert");
137             $("#forgivemanualholdsexpire-alert").hide();
138         }
139         $("#barcode").focus();
140     });
141     [% IF(overduecharges) %] $("#barcode").focus(function () {
142         if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
143             $("#barcode").addClass("alert");
144         } else {
145             $("#barcode").removeClass("alert");
146         }
147     });
148     $("#barcode").blur(function () {
149         $("#barcode").removeClass("alert");
150     });
151     [% END %]
152     $('.openWin').on("click",function(e){
153         Dopop( $(this).data("url") );
154     });
155 });
156 //]]>
157 </script>
158 </head>
159 <body id="circ_returns" class="circ">
160 <span class="audio-alert-success"></span>
161
162 [% INCLUDE 'header.inc' %]
163 [% INCLUDE 'checkin-search.inc' %]
164
165 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Check in</div>
166
167 [% IF Koha.Preference('CircSidebar') %]<div id="doc3" class="yui-t2">[% ELSE %]<div id="doc" class="yui-t7">[% END %]
168
169 <div id="bd">
170 <div id="yui-main">
171 [% IF Koha.Preference('CircSidebar') %]<div class="yui-b">[% END %]
172 <div class="yui-g">
173
174 [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
175     <div class="dialog alert"><strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.</div>
176 [% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
177     <div class="dialog alert"><strong>Error:</strong> The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.</div>
178 [% END %]
179
180 [% IF additional_materials %]
181     <div class="dialog message" id="materials">Note about the accompanying materials: <br />
182     [% additional_materials %]
183     </div>
184 [% END %]
185
186 [% IF ( collectionItemNeedsTransferred ) %]
187  <div id="rotating-collection" class="dialog message">
188         <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) %]</h3>
189             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
190             <p>This item is part of a rotating collection.</p>
191             <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% collectionBranch %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
192 </div>
193 [% END %]
194
195 <!-- Patron has added an issue note -->
196 [% IF ( issue.note) %]
197     <div class="dialog message">
198         <h1>Patron note</h1>
199         <p>[% issue.notedate | $KohaDates %]</p>
200         <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]"> [% title |html %]</a> [% author %]</p>
201         <p>[% issue.note %]</p>
202     </div>
203 [% END %]
204
205 <!-- Patron has fines -->
206 [% IF ( fines ) %]
207     <div class="dialog alert">
208         <h3>Patron has outstanding fines of [% fines %].</h3>
209         <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber %]">Make payment</a>.</p>
210     </div>
211 [% END %]
212
213 <!-- Patron has waiting holds -->
214 [% IF ( waiting_holds ) %]
215     <div id="awaiting-pickup" class="dialog message">
216         <h3>[% holdsfirstname %] [% holdssurname %] has [% waiting_holds %] hold(s) waiting for pickup.</h3>
217         <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber %]">Check out to this patron</a>.</p>
218     </div>
219 [% END %]
220
221 <!-- Patron is restricted and checkin was backdated -->
222 [% IF return_date_was_overriden && Borrowers.IsDebarred( borrower ) %]
223     <div id="restricted_backdated" class="dialog message">
224         <h3>
225             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrower.borrowernumber %]">
226                 [% borrower.firstname %] [% borrower.surname %]
227             </a>
228             is restricted. Please verify this patron should still be restricted.
229         </h3>
230     </div>
231 [% END %]
232
233 [% IF ( wrongbranch ) %]
234     <div class="dialog alert"><h3>Cannot check in</h3>
235         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
236         </p><strong>NOT CHECKED IN</strong></p>
237         <p>This item must be checked in at following library: <strong>[% Branches.GetName( rightbranch ) %]</strong></p>
238     </div>
239 [% END %]
240
241 <!-- case of a mistake in transfer loop -->
242 [% IF ( WrongTransfer ) %]
243     <div id="return2" class="dialog message">
244         <!-- WrongTransfer -->
245         <h3>Please return item to: [% Branches.GetName( TransferWaitingAt ) %]</h3>
246             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
247         <button type="submit" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% TransferWaitingAt %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
248         <button class="deny" type="submit" onclick="window.location.href='/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&amp;canceltransfer=1'"><i class="fa fa-times"></i> Cancel transfer</button>
249 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
250         <ul>
251             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
252             [% borsurname %], [% borfirstname %]</a> ([% borcnum %]) <span class="patron-category"> - [% wborcategory %]</span> </li>
253             [% INCLUDE display_holdpatron_address %]
254             [% IF ( wborphone ) %]<li>[% wborphone %]</li>[% END %]
255             [% IF ( wboremail ) %]<li><a id="boremail" href="mailto:[% wboremail %]">[% wboremail %]</a></li>[% END %]
256         </ul>
257
258     <form method="post" action="returns.pl" class="confirm">
259             <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem %]" />
260             <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt %]" />
261             <input type="hidden" name="WT-From" value="[% wtransfertFrom %]" />
262             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
263             <input type="hidden" name="print_slip" value="0" />
264             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
265             <input type="hidden" name="biblionumber" value="[% biblionumber %]" />
266             <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and confirm</button>
267         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
268         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
269     </form>
270     [% END %]</div>
271 [% END %]
272
273 [% IF ( found ) %]
274     [% IF ( waiting ) %]
275         <div id="hold-found1" class="modal fade audio-alert-action">
276             <div class="modal-dialog">
277             <div class="modal-content">
278             <form method="post" action="returns.pl" class="confirm">
279                 <div class="modal-header">
280                     <h3>
281                         Hold found (item is already waiting):
282                         <br/>
283                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
284                             [% itembarcode |html %]: [% title |html %]
285                         </a>
286                     </h3>
287                 </div>
288
289                 <div class="modal-body">
290                     [% IF ( reservenotes ) %]
291                         <h4>Notes: [% reservenotes %]</h4>
292                     [% END %]
293
294                     <h4>Hold for:</h4>
295                     <ul>
296                     <li>
297                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])
298                         <span class="patron-category"> - [% borcategory %]</span>
299                     </li>
300                     [% INCLUDE display_holdpatron_address %]
301                     [% IF ( borphone ) %]
302                         <li> [% borphone %]</li>
303                     [% END %]
304
305                     [% IF ( boremail ) %]
306                         <li><a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a></li>
307                     [% END %]
308
309                     [% IF ( debarred ) %]
310                         <li class="error">Patron is RESTRICTED</li>
311                     [% END %]
312
313                     [% IF ( gonenoaddress ) %]
314                         <li class="error">Patron's address is in doubt</li>
315                     [% END %]
316                     </ul>
317
318                     [% IF ( transfertodo ) %]
319                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
320                     [% ELSE %]
321                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
322                     [% END %]
323
324                     [% FOREACH inputloo IN inputloop %]
325                         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
326                         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
327                         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
328                     [% END %]
329
330                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
331                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
332                     <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
333                     <input type="hidden" name="reserve_id" value="[% reserve_id %]" />
334                     <input type="hidden" name="diffBranch" value="[% destbranch %]" />
335                     <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
336                     <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
337                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
338
339                     <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
340                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
341                 </div>
342
343                 <div class="modal-footer">
344                     <input type="hidden" name="cancel_reserve" value="0" />
345
346                     <button type="submit" class="btn btn-default approve" data-dismiss="modal">
347                         <i class="fa fa-check"></i> Confirm
348                     </button>
349
350                     <input type="hidden" name="print_slip" value="0" />
351                     <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit();">
352                         <i class="fa fa-print"></i> Print and confirm
353                     </button>
354
355                     <button type="submit" class="btn btn-default deny" onclick="this.form.cancel_reserve.value = 1; this.form.submit();">
356                         <i class="fa fa-times"></i> Cancel hold
357                     </button>
358                 </div>
359             </form>
360            </div>
361            </div>
362         </div>
363     [% END %]
364
365     [% IF ( diffbranch ) %]
366                 <!-- diffbranch -->
367         <div id="transfer-needed" class="dialog message audio-alert-action">
368             <h3>Hold needing transfer found</h3>
369                 <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
370                 <h4>Hold for: </h4>
371                     <ul>
372                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %]) <span class="patron-category"> - [% wborcategory %]</span> </li>
373                         [% INCLUDE display_holdpatron_address %]
374                         [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
375                         [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
376 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
377 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
378                     </ul>
379         [% IF ( transfertodo ) %]
380             <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
381         [% ELSE %]
382             <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
383         [% END %]
384
385         <form method="post" action="returns.pl" class="confirm">
386             <button type="submit" class="approve"><i class="fa fa-check"></i> Confirm</button>
387             <input type="hidden" name="print_slip" value="0" />
388             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
389             <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
390             <button type="submit" class="print" onclick="this.form.print_slip.value = 1; this.form.submit();"><i class="fa fa-print"></i> Print slip and continue</button>
391             [% FOREACH inputloo IN inputloop %]
392                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
393                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
394                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
395             [% END %]
396             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
397             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
398             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
399             <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
400             <input type="hidden" name="barcode" value="0" />
401
402             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
403             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
404         </form>
405                 </div>
406     [% END %]
407
408     [% IF ( transfer ) %]
409     <!-- transfer: item with no reservation, must be returned according to home library circulation rules -->
410         <div id="return1" class="dialog message audio-alert-action">
411             <h3>Please return item to: [% Branches.GetName( returnbranch ) %]</h3>
412             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
413             <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;branchcode=[% returnbranch %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
414         </div>
415     [% END %]
416
417     [% IF ( needstransfer ) %]
418         <!-- needstransfer -->
419     <div id="item-transfer" class="dialog message audio-alert-action"><h3> This item needs to be transferred to [% Branches.GetName( returnbranch ) %]</h3>
420     Transfer now?<br />
421     <form method="post" action="returns.pl" name="mainform" id="mainform">
422     [% IF itemnumber %]
423         <button type="submit" name="dotransfer" value="Yes" class="print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber %]&amp;&amp;branchcode=[% returnbranch %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button>
424     [% END %]
425     <button type="submit" name="dotransfer" value="Yes" class="submit"><i class="fa fa-check"></i> Yes</button>
426     <button type="submit" name="notransfer" value="No" class="submit"><i class="fa fa-times"></i> No</button>
427     <input type="hidden" name="tobranch" value="[% returnbranch %]" />
428         <input type="hidden" name="transferitem" value="[% itemnumber %]" />
429         <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
430         <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
431         <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
432         [% FOREACH inputloo IN inputloop %]
433         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
434         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
435         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
436         [% END %]
437         <input type="hidden" name="barcode" value="0" />
438         <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
439         <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
440         </form>   </div>
441     [% END %]
442
443     [% IF ( diffbranch ) %]
444         <!-- diffbranch -->
445         <h3 class="audio-alert-action">Item consigned:</h3>
446         <table>
447         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a></caption>
448         <tr>
449             <th>Hold for:</th>
450             <td>[% name %]</td>
451         </tr>
452         </table>
453         <form method="post" action="returns.pl"><input type="submit" value="OK" />
454             [% FOREACH inputloo IN inputloop %]
455                 [% UNLESS ( inputloo.first ) %]
456                     <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
457                     <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
458                     <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
459                 [% END %]
460             [% END %]
461
462             <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
463             <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
464
465             <input type="hidden" name="barcode" value="0" />
466         </form>
467     [% END %]
468
469
470     <!-- case of simple return no issue or transfer but with a reservation  -->
471     [% IF ( reserved ) %]
472         <!--  reserved  -->
473         <div id="hold-found2" class="modal fade audio-alert-action">
474             <div class="modal-dialog">
475             <div class="modal-content">
476             <form method="post" action="returns.pl" class="confirm">
477                 <div class="modal-header">
478                     <h3>
479                         Hold found:
480                         <br/>
481                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">
482                             [% itembarcode |html %]: [% title |html %]
483                         </a>
484                 </div>
485
486                 <div class="modal-body">
487                     [% IF ( reservenotes ) %]
488                         <h4>Notes: [% reservenotes %]</h4>
489                     [% END %]
490                     <h5>Hold for:</h5>
491                         <li>
492                             <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
493                                 [% borsurname %], [% borfirstname %]
494                             </a>
495                             ([% borcnum %])
496                             <span class="patron-category"> - [% borcategory %]</span>
497                         </li>
498
499                         [% INCLUDE display_holdpatron_address %]
500
501                         [% IF ( borphone ) %]
502                             <li>[% borphone %]</li>
503                         [% END %]
504
505                         [% IF ( boremail ) %]
506                             <li>
507                                 [% IF ( transfertodo ) %]
508                                     [% boremail %]
509                                 [% ELSE %]
510                                     <a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>
511                                 [% END %]
512                             </li>
513                         [% END %]
514
515                         [% UNLESS ( transfertodo) %]
516                             [% INCLUDE display_bormessagepref %]
517                         [% END %]
518
519                         [% IF ( debarred ) %]
520                             <li class="error">Patron is RESTRICTED</li>
521                         [% END %]
522
523                         [% IF ( gonenoaddress ) %]
524                             <li class="error">Patron's address is in doubt</li>
525                         [% END %]
526
527                     [% IF ( transfertodo ) %]
528                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) %]</h4>
529                     [% ELSE %]
530                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) %]</h4>
531                     [% END %]
532
533                     <input type="hidden" name="print_slip" value="0" />
534
535
536                     [% FOREACH inputloo IN inputloop %]
537                         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
538                         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
539                         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
540                     [% END %]
541
542                     <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
543                     <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
544                     <input type="hidden" name="biblionumber" value="[% itembiblionumber %]" />
545                     <input type="hidden" name="reserve_id" value="[% reserve_id %]" />
546                     <input type="hidden" name="diffBranch" value="[% destbranch %]" />
547                     <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
548                     <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
549                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire %]" />
550                     <input type="hidden" name="return_date_override" value="[% return_date_override %]" />
551                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember %]" />
552                 </div>
553
554                 <div class="modal-footer">
555                     [% IF ( transfertodo ) %]
556                         <button type="submit" class="btn btn-default approve">
557                             <i class="fa fa-check"></i> Confirm hold and transfer
558                         </button>
559                         <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit()">
560                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
561                         </button>
562                     [% ELSE %]
563                         <button type="submit" class="btn btn-default approve">
564                             <i class="fa fa-check"></i> Confirm hold
565                         </button>
566                         <button type="submit" class="btn btn-default print" onclick="this.form.print_slip.value = 1; this.form.submit();">
567                             <i class="fa fa-print"></i> Print slip and confirm
568                         </button>
569                     [% END %]
570
571                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-danger deny" onclick="$('#barcode').focus(); return false;">
572                         <i class="fa fa-times"></i> Ignore
573                     </button>
574                 </div>
575             </form>
576             </div>
577             </div>
578         </div>
579     [% END %]
580 [% END %]
581
582 [% IF ( errmsgloop ) %]
583     <div class="dialog alert audio-alert-warning">
584         <h3>Check in message</h3>
585         [% IF itembiblionumber %]
586             <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% itembarcode |html %]: [% title |html %]</a></p>
587         [% END %]
588         [% FOREACH errmsgloo IN errmsgloop %]
589             [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
590                 <p class="problem">
591                     Not for loan status updated.
592                     <br />Old value:
593                     [% IF errmsgloo.NotForLoanStatusUpdated.from %]
594                         [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) %].
595                     [% ELSE %]
596                         Available for loan.
597                     [% END %]
598                     <br />New value:
599                     [% IF errmsgloo.NotForLoanStatusUpdated.to %]
600                         [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) %].
601                     [% ELSE %]
602                         Available for loan.
603                     [% END %]
604                 </p>
605             [% END %]
606             [% IF ( errmsgloo.badbarcode ) %]
607                 <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
608             [% END %]
609             [% IF ( errmsgloo.ispermanent ) %]
610                 <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) %]</p>
611             [% END %]
612             [% IF ( errmsgloo.notissued ) %]
613                 <p class="problem">Not checked out.</p>
614             [% END %]
615             [% IF ( errmsgloo.localuse) %]
616                 <p class="problem">Local use recorded</p>
617             [% END %]
618             [% IF ( errmsgloo.waslost ) %]
619                 <p class="problem">Item was lost, now found.</p>
620                 [% IF ( LostItemFeeRefunded ) %]
621                     <p class="problem">A refund has been applied to the borrowing patron's account.</p>
622                 [% ELSE %]
623                     <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
624                 [% END %]
625             [% END %]
626             [% IF ( errmsgloo.withdrawn ) %]
627                 [% IF BlockReturnOfWithdrawnItems %]
628                    <h5>Cannot check in</h5>
629                    <p><strong>NOT CHECKED IN</strong></p>
630                    <p class="problem">Item is withdrawn.</p>
631                 [% ELSE %]
632                    <p class="problem">Item is withdrawn.</p>
633                 [% END %]
634             [% END %]
635             [% IF ( errmsgloo.debarred ) %]
636                 <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber %]">[% errmsgloo.debarname %]([% errmsgloo.debarcardnumber %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %].</p>
637             [% END %]
638             [% IF ( errmsgloo.prevdebarred ) %]
639                 <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
640             [% END %]
641             [% IF ( errmsgloo.foreverdebarred ) %]
642                 <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction.</p>
643             [% END %]
644
645             [% IF errmsgloo.data_corrupted %]
646                 <p class="problem">The item has not been checked in due to a configuration issue in your system. You must ask an administrator to take a look at the <a href="/cgi-bin/koha/about.pl#sysinfo">about page</a> and search for the "data problems" section</p>
647             [% END %]
648         [% END %]
649     </div>
650 [% END %]
651
652 [% IF ( checkinmsg ) %]
653     [% IF ( checkinmsgtype == 'alert' ) %]
654         <div class="dialog alert">
655     [% ELSE %]
656         <div class="dialog message">
657     [% END %]
658             <p class="problem">[% checkinmsg | html_line_break %]</p>
659         </div>
660 [% END%]
661
662     <div id="exemptfines" class="dialog message" style="display:none;">
663         <p>Fines for returned items are forgiven.</p>
664     </div>
665     <div id="forgivemanualholdsexpire-alert" class="dialog message" style="display:none;">
666         <p>Fines are not charged for manually cancelled holds.</p>
667     </div>
668     <div id="dropboxmode" class="dialog message" style="display:none;">
669         <p>Book drop mode.  (Effective checkin date is [% dropboxdate %] ).</p>
670     </div>
671 </div>
672 <div class="yui-g">
673     <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
674     <div class="yui-u first">
675             <fieldset>
676         <legend>Check in</legend>
677             <label for="barcode">Enter item barcode: </label>
678                         [% IF ( exemptfine ) %]
679                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
680                         [% ELSIF ( dropboxmode ) %]
681                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
682                         [% ELSE %]
683                         <input name="barcode" id="barcode" size="14" class="focus"/>
684                         [% END %]
685             <input type="submit" class="submit" value="Submit" />
686
687             [% IF Koha.Preference('SpecifyReturnDate') %]
688                 <div class="date-select" id="return_date_override_fields">
689                     <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
690
691                     <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override %]" />
692
693                     <label for="return_date_override_remember"> Remember for next check in:</label>
694                     [% IF ( return_date_override_remember ) %]
695                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" checked="checked" />
696                     [% ELSE %]
697                         <input type="checkbox" id="return_date_override_remember" onclick="this.form.barcode.focus();" name="return_date_override_remember" />
698                     [% END %]
699
700                     <input type="button" class="action" id="cleardate" value="Clear" name="cleardate" onclick="this.checked = false; this.form.return_date_override.value = ''; this.form.return_date_override_remember.checked = false; this.form.barcode.focus(); return false;" />
701             </div>
702         [% END %]
703             [% FOREACH inputloo IN inputloop %]
704                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
705                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
706                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
707             [% END %]
708
709
710             </fieldset>
711             </div>
712             <div class="yui-u">
713             <fieldset id="checkin_options">
714                 <legend>Options</legend>
715                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
716                     <p>
717                         [% IF ( exemptfine ) %]
718                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
719                         [% ELSE %]
720                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
721                         [% END %]
722                         <label for="exemptcheck">Forgive overdue charges</label>
723                     </p>
724                     [% END %] <!-- overduecharges -->
725                     <p>
726                         [% IF ( dropboxmode ) %]
727                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
728                         [% ELSE %]
729                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
730                         [% END %]
731                         <label for="dropboxcheck">Book drop mode</label>
732                     </p>
733                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
734                     <p>
735                         [% IF ( forgivemanualholdsexpire ) %]
736                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
737                         [% ELSE %]
738                         <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
739                         [% END %]
740                         <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
741                     </p>
742                     [% END %] <!-- overduecharges -->
743             </fieldset>
744         </div>
745     </form>
746 </div>
747
748 [% IF ( riloop ) %]
749     <h2>Checked-in items</h2>
750     <table id="checkedintable">
751     <thead><tr><th class="ci-duedate">Due date</th><th class="ci-title">Title</th><th class="ci-author">Author</th><th class="ci-barcode">Barcode</th><th class="ci-homelibrary">Home library</th><th class="ci-holdinglibrary">Holding library</th><th class="ci-shelvinglocation">Shelving location</th><th class="ci-callnumber">Call number</th><th class="ci-dateaccessioned">Date acquired</th><th class="ci-type">Type</th><th class="ci-patron">Patron</th><th class="ci-note">Note</th></tr></thead>
752
753         [% FOREACH riloo IN riloop %]
754             <tr>
755             <td class="ci-duedate">[% IF ( riloo.duedate ) %]
756                     [% IF ( riloo.return_overdue ) %]
757                         <span class="overdue">[% riloo.duedate %] (overdue)</span>
758                     [% ELSE %][% riloo.duedate %]
759                     [% END %]
760                 [% ELSE %]Not checked out
761                 [% END %]
762             </td>
763             <td class="ci-title"><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber %]">
764                     [% riloo.itemtitle |html %]
765                 </a>
766                 [% IF ( riloo.enumchron ) %]
767                     <br/>
768                     <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron %]</span>
769                 [% END %]
770             </td>
771             <td class="ci-author">[% riloo.itemauthor %]</td>
772             <td class="ci-barcode"><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% riloo.itembiblionumber %]&amp;itemnumber=[% riloo.itemnumber %]#item[% riloo.itemnumber %]">[% riloo.barcode %]</a></td>
773             <td class="ci-homelibrary">[% Branches.GetName( riloo.homebranch ) %]</td>
774             <td class="ci-holdinglibrary">[% Branches.GetName( riloo.holdingbranch ) %]</td>
775             <td class="ci-shelvinglocation">[% riloo.location %]</td>
776             <td class="ci-callnumber">[% riloo.itemcallnumber %]</td>
777             <td class="ci-dateaccessioned">[% riloo.dateaccessioned | $KohaDates %]</td>
778             <td class="ci-type">[% ItemTypes.GetDescription( riloo.itemtype ) %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) %]</td>
779             <td class="ci-patron">[% IF ( riloo.duedate ) %]
780                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.borrowernumber %]">
781                     [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
782                 </a>
783                 [% IF riloo.borissuescount %]
784                     <span class="results_summary nowrap">
785                         <span class="label">Checkouts:</span>
786                         <span class="number_box">
787                             <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.borrowernumber %]">[% riloo.borissuescount %]</a>
788                         </span>
789                     </span>
790                 [% END %]
791             [% ELSE %]Not checked out[% END %]</td>
792             <td class="ci-note">
793                 [% IF ( riloo.bornote ) %]<p><span class="circ-hlt patron-note">[% riloo.bornote %]</p></span>[% END %]
794                 [% IF ( riloo.itemnote ) %]<p><span class="circ-hlt item-note-public">[% riloo.itemnote %]</p></span>[% END %]
795                 [% IF ( riloo.itemnotes_nonpublic ) %]<p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic %]</p></span>[% END %]
796             </td>
797            </tr>
798         [% END %]
799     </table>
800 [% END %]
801 </div>
802 [% IF Koha.Preference('CircSidebar') %]
803 </div>
804 <div class="yui-b noprint">
805     [% INCLUDE 'circ-nav.inc' %]
806 </div>
807 [% END %]
808 </div>
809 </div>
810 </div>
811 [% INCLUDE 'intranet-bottom.inc' %]