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