eb027621eefdccf87550da3d7bfa2db87d1f6134
[koha-equinox.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / returns.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% USE Branches %]
5 [% USE Koha %]
6 [% USE ItemTypes %]
7 [% USE AuthorisedValues %]
8 [% USE TablesSettings %]
9 [% PROCESS 'member-display-address-style.inc' %]
10 [% SET footerjs = 1 %]
11 [% BLOCK display_bormessagepref %]
12     [% IF ( bormessagepref ) %]
13         <li class="notification_method">Patron notification:
14             [% FOREACH mtt IN bormessagepref.keys %]
15                 [%~ IF ( mtt == 'email' ) %] Email[% END ~%]
16                 [%~ IF ( mtt == 'phone' ) %] Phone[% END ~%]
17                 [%~ IF ( mtt == 'sms' ) %] SMS[% END ~%]
18                 [%~ UNLESS loop.last %], [% ELSE %].[% END ~%]
19             [% END %]
20         </li>
21            [% ELSE %]
22         <li class="notification_method none">Patron is not notified.</li>
23     [% END %]
24 [% END %]
25
26 [% BLOCK display_holdpatron_address %]
27     [% PROCESS 'display-address-style' %]
28 [% END %]
29
30 [% INCLUDE 'doc-head-open.inc' %]
31 <title>Koha &rsaquo; Circulation &rsaquo; Check in [% title | html %]</title>
32 [% INCLUDE 'doc-head-close.inc' %]
33 </head>
34
35 <body id="circ_returns" class="circ">
36     <span class="audio-alert-success"></span>
37
38     [% INCLUDE 'header.inc' %]
39     [% INCLUDE 'checkin-search.inc' %]
40
41     <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>
42
43     <div class="main container-fluid">
44         <div class="row">
45             <div class="col-sm-12">
46                 <main>
47                     <div class="row">
48
49                         [% IF Koha.Preference('CircSidebar') %]
50                             <div class="col-sm-10 col-sm-push-2">
51                         [% ELSE %]
52                             <div class="col-md-10 col-md-offset-1 col-lg-8 col-lg-offset-2">
53                         [% END %]
54
55                         [% BLOCK all_checkin_messages %]
56                             [% IF hold_auto_filled %]
57                                 <div class="dialog message hold-auto-filled">
58                                     [% IF ( reservenotes ) %]
59                                         <h4>Notes: [% reservenotes | html %]</h4>
60                                     [% END %]
61                                     <h3>Hold filled for:</h3>
62                                     <ul>
63                                         <li>
64                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 %]
65                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
66                                         </li>
67
68                                         [% INCLUDE display_holdpatron_address %]
69
70                                         [% IF ( patron.phone ) %]
71                                             <li>[% patron.phone | html %]</li>
72                                         [% END %]
73
74                                         [% IF ( patron.email ) %]
75                                             <li>
76                                                 [% IF ( transfertodo ) %]
77                                                     [% patron.email | html %]
78                                                 [% ELSE %]
79                                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
80                                                 [% END %]
81                                             </li>
82                                         [% END %]
83
84                                         [% UNLESS ( transfertodo) %]
85                                             [% INCLUDE display_bormessagepref %]
86                                         [% END %]
87
88                                         [% IF ( patron.is_debarred ) %]
89                                             <li class="error">Patron is RESTRICTED</li>
90                                         [% END %]
91
92                                         [% IF ( patron.gonenoaddress ) %]
93                                             <li class="error">Patron's address is in doubt</li>
94                                         [% END %]
95                                     </ul>
96
97                                     [% IF ( transfertodo ) %]
98                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
99                                     [% ELSE %]
100                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
101                                     [% END %]
102
103                                     <a href="#" class="btn btn-default print print-slip">
104                                         <i class="fa fa-print"></i> Print
105                                     </a>
106                                 </div> <!-- /.hold-auto-filled -->
107                             [% END # /IF hold_auto_filled %]
108
109                             [% IF privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
110                                 <div class="dialog alert">
111                                     <strong>Error:</strong>
112                                     This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
113                                 </div>
114                             [% ELSIF NOT Koha.Preference('AnonymousPatron') AND Koha.Preference('OPACPrivacy') %]
115                                 <div class="dialog alert">
116                                     <strong>Error:</strong>
117                                     The system preference OPACPrivacy is set but AnonymousPatron is not! Please correct this before continuing circulation.
118                                 </div>
119                             [% END %]
120
121                             [% IF additional_materials %]
122                                 <div class="dialog message" id="materials">
123                                     Note about the accompanying materials: <br />
124                                     [% additional_materials | html %]
125                                 </div>
126                             [% END %]
127
128                             [% IF ( collectionItemNeedsTransferred ) %]
129                                  <div id="rotating-collection" class="dialog message">
130                                     <h3>Please transfer item to: [% Branches.GetName( collectionBranch ) | html %]</h3>
131                                     <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
132                                     <p>This item is part of a rotating collection.</p>
133                                     <p><button type="button" class="openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;branchcode=[% collectionBranch | uri %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button></p>
134                                 </div>
135                             [% END %]
136
137                             <!-- Patron has added an issue note -->
138                             [% IF ( issue.note) %]
139                                 <div class="dialog message">
140                                     <h1>Patron note</h1>
141                                     <p>[% issue.notedate | $KohaDates %]</p>
142                                     <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber | uri %]"> [% title | html %]</a> [% author | html %]</p>
143                                     <p>[% issue.note | html %]</p>
144                                 </div>
145                             [% END %]
146
147                             <!-- Patron has fines -->
148                             [% IF ( fines ) %]
149                                 <div class="dialog alert">
150                                     <h3>Patron has outstanding fines of [% fines | html %].</h3>
151                                     <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber | uri %]">Make payment</a>.</p>
152                                 </div>
153                             [% END %]
154
155                             <!-- Item has return claim(s) -->
156                             [% IF ( ReturnClaims ) %]
157                                 <div class="dialog alert return-claim">
158                                     <h3>This item has been claimed as returned by:</h3>
159                                     <ul>
160                                         [% FOREACH rc IN ReturnClaims %]
161                                             <li>
162                                                 [% INCLUDE 'patron-title.inc' patron=rc.patron hide_patron_infos_if_needed=1 invert_name=1 %]
163                                             </li>
164                                         [% END %]
165                                     </ul>
166                                 </div>
167                             [% END %]
168
169                             <!-- Patron has waiting holds -->
170                             [% IF ( waiting_holds ) %]
171                                 <div id="awaiting-pickup" class="dialog message">
172                                     <h3>[% INCLUDE 'patron-title.inc' patron=issue.patron hide_patron_infos_if_needed=1 invert_name=1 %] has [% waiting_holds | html %] hold(s) waiting for pickup.</h3>
173                                     <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber | uri %]">Check out to this patron</a>.</p>
174                                 </div>
175                             [% END %]
176
177                             <!-- Patron is restricted and checkin was backdated -->
178                             [% IF return_date_was_overriden && issue.patron.is_debarred %]
179                                 <div id="restricted_backdated" class="dialog message">
180                                     <h3>
181                                         [% INCLUDE 'patron-title.inc' patron=issue.patron hide_patron_infos_if_needed=1 invert_name=1 %]
182                                         is restricted. Please verify this patron should still be restricted.
183                                     </h3>
184                                 </div>
185                             [% END %]
186
187
188                             [% IF ( errmsgloop ) %]
189                                 <div class="dialog alert audio-alert-warning">
190                                     <h3>Check in message</h3>
191                                     [% IF itembiblionumber %]
192                                         <p><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% itembarcode | html %]: [% title | html %]</a></p>
193                                     [% END %]
194                                     [% FOREACH errmsgloo IN errmsgloop %]
195                                         [% IF ( errmsgloo.NotForLoanStatusUpdated ) %]
196                                             <p class="problem">
197                                                 Not for loan status updated.
198                                                 <br />Old value:
199                                                 [% IF errmsgloo.NotForLoanStatusUpdated.from %]
200                                                     [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.from ) | html %].
201                                                 [% ELSE %]
202                                                     Available for loan.
203                                                 [% END %]
204                                                 <br />New value:
205                                                 [% IF errmsgloo.NotForLoanStatusUpdated.to %]
206                                                     [% AuthorisedValues.GetByCode( 'NOT_LOAN', errmsgloo.NotForLoanStatusUpdated.to ) | html %].
207                                                 [% ELSE %]
208                                                     Available for loan.
209                                                 [% END %]
210                                             </p>
211                                         [% END %]
212                                         [% IF ( errmsgloo.ItemLocationUpdated ) %]
213                                              <p class="problem">
214                                                  Item shelving location updated.
215                                                 <br />Old value:
216                                                 [% IF errmsgloo.ItemLocationUpdated.from %]
217                                                     [% IF errmsgloo.ItemLocationUpdated.from == '' %]
218                                                         empty
219                                                     [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) == '' %]
220                                                         [% errmsgloo.ItemLocationUpdated.from | html %] (No description available)
221                                                     [% ELSE %]
222                                                         [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.from ) | html %]
223                                                     [% END %]
224                                                 [% ELSE %]
225                                                     "Blank"
226                                                 [% END %]
227                                                 <br />New value:
228                                                 [% IF errmsgloo.ItemLocationUpdated.to %]
229                                                     [% IF errmsgloo.ItemLocationUpdated.to == '' %]
230                                                         empty
231                                                     [% ELSIF AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) == '' %]
232                                                         [% errmsgloo.ItemLocationUpdated.to | html %] (Not an authorized value)
233                                                     [% ELSE %]
234                                                         [% AuthorisedValues.GetByCode( 'LOC', errmsgloo.ItemLocationUpdated.to ) | html %]
235                                                     [% END %]
236                                                 [% ELSE %]
237                                                     "Blank"
238                                                 [% END %]
239                                              </p>
240                                         [% END %]
241                                         [% IF ( errmsgloo.badbarcode ) %]
242                                             <p class="problem">No item with barcode: [% errmsgloo.msg | html %]</p>
243                                         [% END %]
244                                         [% IF ( errmsgloo.ispermanent ) %]
245                                             <p class="problem">Please return item to: [% Branches.GetName( errmsgloo.msg ) | html %]</p>
246                                         [% END %]
247                                         [% IF ( errmsgloo.notissued ) %]
248                                             <p class="problem">Not checked out.</p>
249                                         [% END %]
250                                         [% IF ( errmsgloo.localuse) %]
251                                             <p class="problem">Local use recorded</p>
252                                         [% END %]
253                                         [% IF ( errmsgloo.waslost ) %]
254                                             [% IF Koha.Preference('BlockReturnOfLostItems') %]
255                                                 <p class="problem">Item is lost, cannot be checked in.</p>
256                                             [% ELSE %]
257                                                 <p class="problem">Item was lost, now found.</p>
258                                             [% END %]
259                                             [% IF LostItemFeeRefunded and not Koha.Preference('BlockReturnOfLostItems') %]
260                                                 <p class="problem">A refund has been applied to the borrowing patron's account.</p>
261                                             [% ELSIF Koha.Preference('BlockReturnOfLostItems') %]
262                                                <h5>Cannot check in</h5>
263                                                <p><strong>NOT CHECKED IN</strong></p>
264                                             [% ELSE %]
265                                                 <p class="problem">Any lost item fees for this item will remain on the patron's account.</p>
266                                             [% END %]
267                                         [% END %]
268                                         [% IF ( errmsgloo.withdrawn ) %]
269                                             [% IF Koha.Preference('BlockReturnOfWithdrawnItems') %]
270                                                <h5>Cannot check in</h5>
271                                                <p><strong>NOT CHECKED IN</strong></p>
272                                             [% END %]
273                                            <p class="problem">Item is withdrawn.</p>
274                                         [% END %]
275                                         [% IF ( errmsgloo.debarred ) %]
276                                             <p class="problem"><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% errmsgloo.debarborrowernumber | uri %]">[% errmsgloo.debarname | html %]([% errmsgloo.debarcardnumber | html %])</a> is now debarred until [% errmsgloo.debarred | $KohaDates %].</p>
277                                         [% END %]
278                                         [% IF ( errmsgloo.prevdebarred ) %]
279                                             <p class="problem"><b>Reminder: </b>Patron was earlier restricted until [% errmsgloo.prevdebarred | $KohaDates %].</p>
280                                         [% END %]
281                                         [% IF ( errmsgloo.foreverdebarred ) %]
282                                             <p class="problem"><b>Reminder: </b>Patron has an indefinite restriction.</p>
283                                         [% END %]
284                                         [% IF errmsgloo.data_corrupted %]
285                                             <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>
286                                         [% END %]
287                                     [% END # /FOREACH errmsgloo %]
288                                 </div> <!-- /.dialog.dialog-alert -->
289                             [% END #/IF errmsgloop %]
290
291                             [% IF ( checkinmsg ) %]
292                                 [% IF ( checkinmsgtype == 'alert' ) %]
293                                     <div class="dialog alert">
294                                 [% ELSE %]
295                                     <div class="dialog message">
296                                 [% END %]
297                                         <p class="problem">[% checkinmsg | html_line_break %]</p>
298                                     </div>
299                             [% END # /IF checkinmsg %]
300                         [% END # /BLOCK all_checkin_messages %]
301
302                         [% IF wrongbranch %]
303                             <div id="wrong-branch-modal" class="modal fade audio-alert-action block">
304                                 <div class="modal-dialog">
305                                     <div class="modal-content">
306                                         <form method="post" action="returns.pl" name="mainform" id="mainform">
307                                             <div class="modal-header">
308                                                 <h3>
309                                                     Cannot check in
310                                                 </h3>
311                                             </div>
312                                             <div class="modal-body">
313                                                 <p>
314                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
315                                                         [% itembarcode | html %]: [% title | html %]
316                                                     </a>
317                                                 </p>
318                                                 <p>
319                                                     <strong>
320                                                         NOT CHECKED IN
321                                                     </strong>
322                                                 </p>
323                                                 <p>
324                                                     This item must be checked in at following library:
325                                                     <strong>
326                                                         [% Branches.GetName( rightbranch ) | html %]
327                                                     </strong>
328                                                 </p>
329                                                 [% INCLUDE all_checkin_messages %]
330                                             </div> <!-- /.modal-body -->
331                                             <div class="modal-footer">
332                                                 <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
333                                             </div>
334                                         </form> <!-- /#mainform -->
335                                     </div> <!-- /.modal-content -->
336                                 </div> <!-- /.modal-dialog -->
337                             </div> <!-- /#wrong-branch-modal -->
338                         [% END # /IF wrongbranch %]
339
340                         <!-- case of a mistake in transfer loop -->
341                         [% UNLESS ( hold_auto_filled && diffbranch ) %]
342                             [% IF WrongTransfer && !transfertodo %]
343                                 [% IF Koha.Preference('TransfersBlockCirc') %]
344                                     <div id="wrong-transfer-modal" class="modal fade audio-alert-action block">
345                                 [% ELSE %]
346                                     <div id="wrong-transfer-modal" class="modal fade audio-alert-action noblock">
347                                 [% END %]
348                                     <div class="modal-dialog">
349                                         <div class="modal-content">
350                                             <div class="modal-header">
351                                                 <h3>
352                                                     Please return item to: [% Branches.GetName( TransferWaitingAt ) | html %]
353                                                 </h3>
354                                             </div>
355                                             <div class="modal-body">
356                                                 <p>
357                                                     <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
358                                                         [% itembarcode | html %]: [% title | html %]
359                                                     </a>
360                                                 </p>
361                                                 [% INCLUDE all_checkin_messages %]
362                                             </div>
363                                             <div class="modal-footer">
364                                                 <!-- CONFIRM -->
365                                                 <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
366                                                 <!-- PRINT SLIP -->
367                                                 <button type="button" data-dismiss="modal" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;&amp;branchcode=[% TransferWaitingAt | uri %]&amp;op=slip"><i class="fa fa-print"></i> Print transfer slip</button>
368                                                 <!-- CANCEL TRANSFER -->
369                                                 <form method="post" action="returns.pl" name="mainform">
370                                                     <button class="btn btn-default deny" type="submit"><i class="fa fa-times"></i> Cancel transfer</button>
371                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
372                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
373                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
374                                                     <input type="hidden" name="canceltransfer" value="1" />
375                                                     [% FOREACH inputloo IN inputloop %]
376                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
377                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
378                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
379                                                     [% END %]
380                                                 </form> <!-- /mainform -->
381                                             </div> <!-- /.modal-footer -->
382                                         </div> <!-- /.modal-content -->
383                                     </div> <!-- /.modal-dialog -->
384                                 </div> <!-- /#wrong-transfer-modal -->
385                             [% END # /IF WrongTransfer && !transfertodo %]
386                         [% END # /UNLESS hold_auto_filled && diffbranch %]
387
388                         [% IF ( found ) %]
389                             [% IF ( waiting ) %]
390                                 <div id="hold-found1" class="modal fade audio-alert-action block">
391                                     <div class="modal-dialog">
392                                         <div class="modal-content">
393                                             <form method="post" action="returns.pl" class="confirm">
394                                                 <div class="modal-header">
395                                                     <h3>
396                                                         Hold found (item is already waiting):
397                                                         <br/>
398                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
399                                                         <div class="hold-found-barcode">
400                                                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% itembarcode | html %]</a>
401                                                         </div>
402                                                     </h3>
403                                                 </div>
404
405                                                 <div class="modal-body">
406                                                     [% IF ( reservenotes ) %]
407                                                         <h4>Notes: [% reservenotes | html %]</h4>
408                                                     [% END %]
409
410                                                     <h4>Hold for:</h4>
411                                                     <ul>
412                                                         <li>
413                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
414                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
415                                                         </li>
416                                                         [% INCLUDE display_holdpatron_address %]
417                                                         [% IF ( patron.phone ) %]
418                                                             <li> [% patron.phone | html %]</li>
419                                                         [% END %]
420
421                                                         [% IF ( patron.email ) %]
422                                                             <li><a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a></li>
423                                                         [% END %]
424
425                                                         [% IF ( patron.is_debarred ) %]
426                                                             <li class="error">Patron is RESTRICTED</li>
427                                                         [% END %]
428
429                                                         [% IF ( patron.gonenoaddress ) %]
430                                                             <li class="error">Patron's address is in doubt</li>
431                                                         [% END %]
432                                                     </ul>
433
434                                                     [% IF ( transfertodo ) %]
435                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
436                                                     [% ELSE %]
437                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
438                                                     [% END %]
439
440                                                     [% FOREACH inputloo IN inputloop %]
441                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
442                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
443                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
444                                                     [% END %]
445
446                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
447                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
448                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
449                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
450                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
451                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
452                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
453                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
454
455                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
456                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
457                                                     [% INCLUDE all_checkin_messages %]
458                                                 </div> <!-- /.modal-body -->
459
460                                                 <div class="modal-footer">
461                                                     <input type="hidden" name="cancel_reserve" value="0" />
462                                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
463
464                                                     <button type="submit" class="btn btn-default approve" data-dismiss="modal">
465                                                         <i class="fa fa-check"></i> Confirm hold
466                                                     </button>
467
468                                                     <input type="hidden" name="print_slip" value="0" />
469                                                     <button type="button" class="btn btn-default print">
470                                                         <i class="fa fa-print"></i> Print slip and confirm
471                                                     </button>
472
473                                                     <button type="button" class="btn btn-default deny cancel-hold">
474                                                         <i class="fa fa-times"></i> Cancel hold
475                                                     </button>
476                                                 </div> <!-- /.modal-footer -->
477                                             </form> <!-- /.confirm -->
478                                         </div> <!-- /.modal-content -->
479                                     </div> <!-- /.modal-dialog -->
480                                 </div> <!-- /#hold-found1 -->
481                             [% END # /IF waiting %]
482
483                             [% IF transfer || needstransfer %]
484                                 [% IF Koha.Preference('TransfersBlockCirc') %]
485                                     <div id="item-transfer-modal" class="modal fade audio-alert-action block">
486                                 [% ELSE %]
487                                     <div id="item-transfer-modal" class="modal fade audio-alert-action noblock">
488                                 [% END %]1
489                                     <div class="modal-dialog">
490                                         <div class="modal-content">
491                                             <form method="post" action="returns.pl" name="mainform" id="mainform">
492
493                                                 <input type="hidden" name="print_slip" value="0" />
494
495                                                 <div class="modal-header">
496                                                     <h3>
497                                                         Please return this item to [% Branches.GetName( returnbranch ) | html %]
498                                                     </h3>
499                                                 </div>
500                                                 <div class="modal-body">
501                                                     <p>
502                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">
503                                                             [% itembarcode | html %]: [% title | html %]
504                                                         </a>
505                                                     </p>
506                                                     [% IF !transfer %]
507                                                         <p>
508                                                             Transfer now?
509                                                         </p>
510                                                     [% END %]
511                                                     <input type="hidden" name="tobranch" value="[% returnbranch | html %]" />
512                                                     <input type="hidden" name="transferitem" value="[% itemnumber | html %]" />
513                                                     <input type="hidden" name="barcode" value="0" />
514                                                     <input type="hidden" name="trigger" value="[% trigger | html %]" />
515                                                     [% INCLUDE all_checkin_messages %]
516                                                 </div>
517                                                 <div class="modal-footer">
518                                                     [% IF !transfer %]
519                                                         <button type="submit" name="dotransfer" value="Yes" class="btn btn-default approve"><i class="fa fa-check"></i> Yes</button>
520                                                         <button type="button" name="dotransfer" value="Yes" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;&amp;branchcode=[% returnbranch | uri %]&amp;op=slip"><i class="fa fa-print"></i> Yes, print slip</button>
521                                                         <button type="button" data-dismiss="modal" class="btn btn-default deny" name="notransfer" value="No"><i class="fa fa-times"></i> No</button>
522                                                     [% ELSE %]
523                                                         <button type="button" data-dismiss="modal" class="btn btn-default approve"><i class="fa fa-check"></i> OK</button>
524                                                         <button type="button" data-dismiss="modal" name="dotransfer" class="btn btn-default print openWin" data-url="transfer-slip.pl?transferitem=[% itemnumber | uri %]&amp;branchcode=[% returnbranch | uri %]&amp;op=slip"><i class="fa fa-print"></i> Print slip</button>
525                                                     [% END %]
526                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
527                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
528                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
529                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
530                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
531                                                     [% FOREACH inputloo IN inputloop %]
532                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
533                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
534                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
535                                                     [% END %]
536                                                 </div> <!-- /.modal-footer -->
537                                             </form> <!-- /#mainform -->
538                                         </div> <!-- /.modal-content -->
539                                     </div> <!-- /.modal-dialog -->
540                                 </div> <!-- /#item-transfer-modal -->
541                             [% END # /IF transfer || needstransfer %]
542
543                             <!-- case of simple return no issue or transfer but with a reservation  -->
544                             [% IF ( reserved ) %]
545                                 <!-- reserved -->
546                                 <div id="hold-found2" class="modal fade audio-alert-action block">
547                                     <div class="modal-dialog">
548                                         <div class="modal-content">
549                                             <form method="post" action="returns.pl" class="confirm">
550
551                                                 <input type="hidden" name="print_slip" value="0" />
552
553                                                 <div class="modal-header">
554                                                     <h3>
555                                                         Hold found:
556                                                         <br/>
557                                                         <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber | uri %]">[% title | html %]</a>
558                                                         <div class="hold-found-barcode">
559                                                             (<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% itembiblionumber | uri %]&amp;itemnumber=[% itemnumber | uri %]">[% itembarcode | html %]</a>)
560                                                         </div>
561                                                     </h3>
562                                                 </div>
563
564                                                 <div class="modal-body">
565                                                     [% IF ( reservenotes ) %]
566                                                         <h4>Notes:</h4>
567                                                         <p>[% reservenotes | html %]</p>
568                                                         <hr />
569                                                     [% END %]
570                                                     <h5>Hold for:</h5>
571                                                     <ul>
572                                                         <li>
573                                                             [% INCLUDE 'patron-title.inc' patron=patron hide_patron_infos_if_needed=1 invert_name=1 link_to="circulation_reserves" %]
574                                                             <span class="patron-category"> - [% patron.category.description | html %]</span>
575                                                         </li>
576
577                                                         [% INCLUDE display_holdpatron_address %]
578
579                                                         [% IF ( patron.phone ) %]
580                                                             <li>[% patron.phone | html %]</li>
581                                                         [% END %]
582
583                                                         [% IF ( patron.email ) %]
584                                                             <li>
585                                                                 [% IF ( transfertodo ) %]
586                                                                     [% patron.email | html %]
587                                                                 [% ELSE %]
588                                                                     <a id="boremail" href="mailto:[% patron.email | html %]">[% patron.email | html %]</a>
589                                                                 [% END %]
590                                                             </li>
591                                                         [% END %]
592
593                                                         [% UNLESS ( transfertodo) %]
594                                                             [% INCLUDE display_bormessagepref %]
595                                                         [% END %]
596
597                                                         [% IF ( patron.is_debarred ) %]
598                                                             <li class="error">Patron is RESTRICTED</li>
599                                                         [% END %]
600
601                                                         [% IF ( patron.gonenoaddress ) %]
602                                                             <li class="error">Patron's address is in doubt</li>
603                                                         [% END %]
604                                                     </ul>
605                                                     [% IF ( transfertodo ) %]
606                                                         <h4><strong>Transfer to:</strong> [% Branches.GetName( destbranch ) | html %]</h4>
607                                                     [% ELSE %]
608                                                         <h4><strong>Hold at</strong> [% Branches.GetName( destbranch ) | html %]</h4>
609                                                     [% END %]
610
611                                                     [% FOREACH inputloo IN inputloop %]
612                                                         <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
613                                                         <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
614                                                         <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
615                                                     [% END %]
616
617                                                     <input type="hidden" name="itemnumber" value="[% itemnumber | html %]" />
618                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
619                                                     <input type="hidden" name="biblionumber" value="[% itembiblionumber | html %]" />
620                                                     <input type="hidden" name="reserve_id" value="[% reserve_id | html %]" />
621                                                     <input type="hidden" name="diffBranch" value="[% destbranch | html %]" />
622                                                     <input type="hidden" name="exemptfine" value="[% exemptfine | html %]" />
623                                                     <input type="hidden" name="dropboxmode" value="[% dropboxmode | html %]" />
624                                                     <input type="hidden" name="forgivemanualholdsexpire" value="[% forgivemanualholdsexpire | html %]" />
625                                                     <input type="hidden" name="return_date_override" value="[% return_date_override | html %]" />
626                                                     <input type="hidden" name="return_date_override_remember" value="[% return_date_override_remember | html %]" />
627                                                     [% INCLUDE all_checkin_messages %]
628                                                 </div>
629
630                                                 <div class="modal-footer">
631                                                     [% IF ( transfertodo ) %]
632                                                         <button type="submit" class="btn btn-default approve">
633                                                             <i class="fa fa-check"></i> Confirm hold and transfer
634                                                         </button>
635                                                         <button type="button" class="btn btn-default print">
636                                                             <i class="fa fa-print"></i> Print slip, transfer, and confirm
637                                                         </button>
638                                                     [% ELSE %]
639                                                         <button type="submit" class="btn btn-default approve">
640                                                             <i class="fa fa-check"></i> Confirm hold
641                                                         </button>
642                                                         <button type="button" class="btn btn-default print">
643                                                             <i class="fa fa-print"></i> Print slip and confirm
644                                                         </button>
645                                                     [% END %]
646
647                                                     <button data-dismiss="modal" aria-hidden="true" type="submit" class="btn btn-default deny">
648                                                         <i class="fa fa-times"></i> Ignore
649                                                     </button>
650                                                 </div> <!-- /.modal-footer -->
651                                             </form> <!-- /.confirm -->
652                                         </div> <!-- /.modal-content -->
653                                     </div> <!-- /.modal-dialog -->
654                                 </div> <!-- /#hold-found2 -->
655                             [% END #/IF reserved %]
656                         [% END # /IF found %]
657
658                         <div class="static_checkin_messages">
659                             [% INCLUDE all_checkin_messages %]
660                         </div>
661
662                         <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
663                             <fieldset id="circ_returns_checkin">
664                                 <div class="show_checkin_dialog" style="float:right;display:none"><button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="Show the last checkin message"><i class="fa fa-info"></i></button></div>
665                                 <h3>Check in</h3>
666                                 <div class="row">
667                                     <div class="col-sm-6">
668                                         <div class="hint">Enter item barcode:</div>
669                                             <div class="form-control-group">
670                                                 [% IF ( exemptfine ) %]
671                                                     <input name="barcode" id="barcode" size="14" class="focus input-warning" type="text" />
672                                                 [% ELSIF ( dropboxmode ) %]
673                                                     <input name="barcode" id="barcode" size="14" class="barcode focus input-warning" />
674                                                 [% ELSE %]
675                                                     <input name="barcode" id="barcode" size="14" class="barcode focus" />
676                                                 [% END %]
677                                                 <button type="submit" class="btn btn-default">Check in</button>
678                                                 [% FOREACH inputloo IN inputloop %]
679                                                     <input type="hidden" name="ri-[% inputloo.counter | html %]" value="[% inputloo.barcode | html %]" />
680                                                     <input type="hidden" name="dd-[% inputloo.counter | html %]" value="[% inputloo.duedate | html %]" />
681                                                     <input type="hidden" name="bn-[% inputloo.counter | html %]" value="[% inputloo.borrowernumber | html %]" />
682                                                 [% END %]
683                                             </div>
684                                         <div id="show-circ-settings">
685                                             <a href="#"><i class="fa circ-settings-icon fa-caret-down"></i> Checkin settings</a>
686                                         </div>
687                                     </div>
688                                     <div class="col-sm-6">
689                                         [% IF ( exemptfine ) %]
690                                             <div id="exemptfines" class="checkin-active-setting">
691                                         [% ELSE %]
692                                             <div id="exemptfines" class="checkin-active-setting" style="display:none;">
693                                         [% END %]
694                                             <p><i class="fa fa-check"></i> Fines for returned items are forgiven.</p>
695                                         </div>
696
697                                         [% IF ( forgivemanualholdsexpire ) %]
698                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting">
699                                         [% ELSE %]
700                                             <div id="forgivemanualholdsexpire-alert" class="checkin-active-setting" style="display:none;">
701                                         [% END %]
702                                                 <p><i class="fa fa-check"></i> Fines are not charged for manually cancelled holds.</p>
703                                             </div>
704
705                                         [% IF ( dropboxmode ) %]
706                                             <div id="dropboxmode" class="checkin-active-setting">
707                                         [% ELSE %]
708                                             <div id="dropboxmode" class="checkin-active-setting" style="display:none;">
709                                         [% END %]
710                                             <p><i class="fa fa-check"></i> Book drop mode. <span class="single-line">( Effective checkin date is [% dropboxdate | $KohaDates with_hours => 1 %] )</span></p>
711                                         </div>
712                                         [% IF ( return_date_override_remember ) %]
713                                             <div id="return_date_remember" class="checkin-active-setting">
714                                         [% ELSE %]
715                                             <div id="return_date_remember" class="checkin-active-setting" style="display:none;">
716                                         [% END %]
717                                             <p><i class="fa fa-check"></i> Saved check-in date: <span id="saved_return_date" class="single-line">[% return_date_override | html %]</span></p>
718                                         </div>
719                                     </div>
720                                 </div>
721
722                                 <div class="circ-settings">
723                                     [% IF Koha.Preference('SpecifyReturnDate') %]
724                                         <div class="date-select" id="return_date_override_fields">
725                                             <div class="hint">Specify return date [% INCLUDE 'date-format.inc' %]: </div>
726
727                                             <input type="text" size="13" id="return_date_override" name="return_date_override" value="[% return_date_override | html %]" />
728
729
730
731                                             <button type="button" class="action btn btn-default btn-xs" id="cleardate" name="cleardate">Clear</button>
732                                             <div class="circ-setting">
733                                                 [% IF ( return_date_override_remember ) %]
734                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" checked="checked" />
735                                                 [% ELSE %]
736                                                     <input type="checkbox" id="return_date_override_remember" name="return_date_override_remember" />
737                                                 [% END %]
738                                                 <label for="return_date_override_remember"> Remember due date for next check in</label>
739                                             </div>
740                                         </div> <!-- /.date-select -->
741                                     [% END %]
742
743                                     [% IF ( CAN_user_updatecharges_writeoff && overduecharges ) %]
744                                         <div id="forgive-overdue-fines" class="circ-setting">
745                                             [% IF ( exemptfine ) %]
746                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
747                                             [% ELSE %]
748                                                 <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
749                                             [% END %]
750                                             <label for="exemptcheck">Forgive overdue charges</label>
751                                         </div>
752                                     [% END %] <!-- overduecharges -->
753
754                                     <div id="book-drop-mode" class="circ-setting">
755                                         [% IF ( dropboxmode ) %]
756                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
757                                         [% ELSE %]
758                                             <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
759                                         [% END %]
760                                         <label for="dropboxcheck">Book drop mode</label>
761                                     </div>
762
763                                     [% IF Koha.Preference('ExpireReservesMaxPickUpDelayCharge') %]
764                                         <div class="forgive-manual-hold-fees circ-setting">
765                                             [% IF ( forgivemanualholdsexpire ) %]
766                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" checked="checked" />
767                                             [% ELSE %]
768                                                 <input type="checkbox" id="forgivemanualholdsexpire" name="forgivemanualholdsexpire" value="forgivemanualholdsexpire" />
769                                             [% END %]
770                                             <label for="forgivemanualholdsexpire">Forgive fees for manually expired holds</label>
771                                         </div>
772                                     [% END %] <!-- overduecharges -->
773
774                                 </div> <!-- /.circ-settings -->
775                             </fieldset> <!-- /#circ_returns_checkin -->
776                         </form> <!-- /#checkin-form -->
777
778                         [% IF ( riloop ) %]
779                             <h2>Checked-in items</h2>
780                             <table id="checkedintable">
781                                 <thead>
782                                     <tr>
783                                         <th class="ci-duedate">Due date</th>
784                                         <th class="ci-title">Title</th>
785                                         <th class="ci-author">Author</th>
786                                         <th class="ci-barcode">Barcode</th>
787                                         <th class="ci-homelibrary">Home library</th>
788                                         <th class="ci-holdinglibrary">Holding library</th>
789                                         <th class="ci-shelvinglocation">Shelving location</th>
790                                         <th class="ci-callnumber">Call number</th>
791                                         <th class="ci-dateaccessioned">Date acquired</th>
792                                         <th class="ci-recordlevelitemtype">Record-level itemtype</th>
793                                         <th class="ci-itemtype">Item type</th>
794                                         <th class="ci-patron">Patron</th>
795                                         <th class="ci-note">Note</th>
796                                     </tr>
797                                 </thead>
798
799                                 [% FOREACH riloo IN riloop %]
800                                     <tr>
801                                         <td class="ci-duedate">
802                                             [% IF ( riloo.duedate ) %]
803                                                 [% IF ( riloo.return_overdue ) %]
804                                                     <span class="overdue">[% riloo.duedate | html %] (overdue)</span>
805                                                 [% ELSE %]
806                                                     [% riloo.duedate | html %]
807                                                 [% END %]
808                                             [% ELSE %]
809                                                 Not checked out
810                                             [% END %]
811                                         </td>
812                                         <td class="ci-title">
813                                             <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber | uri %]">
814                                                 [% riloo.itemtitle | html %]
815                                                 [% FOREACH subtitle IN riloo.subtitle.split(' \\| ') %] <span class="subtitle">[% subtitle | html %]</span>[% END %]
816                                                 [% FOREACH part_number IN riloo.part_number.split(' \\| ') %] <span class="part_number">[% part_number | html %]</span>[% END %]
817                                                 [% FOREACH part_name IN riloo.part_name.split(' \\| ') %] <span class="part_name">[% part_name | html %]<span>[% END %]
818                                             </a>
819                                             [% IF ( riloo.enumchron ) %]
820                                                 <br/>
821                                                 <span class="item_enumeration" style="white-space: nowrap;">[% riloo.enumchron | html %]</span>
822                                             [% END %]
823                                         </td>
824                                         <td class="ci-author">[% riloo.itemauthor | html %]</td>
825                                         <td class="ci-barcode">
826                                             <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% riloo.itembiblionumber | uri %]&amp;itemnumber=[% riloo.itemnumber | uri %]#item[% riloo.itemnumber | uri %]">[% riloo.barcode | html %]</a>
827                                         </td>
828                                         <td class="ci-homelibrary">
829                                             [% Branches.GetName( riloo.homebranch ) | html %]
830                                         </td>
831                                         <td class="ci-holdinglibrary">
832                                             [% Branches.GetName( riloo.holdingbranch ) | html %]
833                                         </td>
834                                         <td class="ci-shelvinglocation">
835                                             <span class="shelvingloc">[% riloo.location | html %]</span>
836                                         </td>
837                                         <td class="ci-callnumber">
838                                             [% riloo.itemcallnumber | html %]
839                                         </td>
840                                         <td class="ci-dateaccessioned">
841                                             [% riloo.dateaccessioned | $KohaDates %]
842                                         </td>
843                                         <td class="ci-recordlevelitemtype">
844                                             [% ItemTypes.GetDescription( riloo.recordtype ) | html %]
845                                         </td>
846                                         <td class="ci-itemtype">
847                                             [% ItemTypes.GetDescription( riloo.itemtype ) | html %] [% AuthorisedValues.GetByCode('CCODE', riloo.ccode) | html %]
848                                         </td>
849                                         <td class="ci-patron">
850                                             [% IF ( riloo.duedate ) %]
851                                                 [% INCLUDE 'patron-title.inc' patron=riloo.patron hide_patron_infos_if_needed=1 invert_name=1 %]
852                                                 [% IF riloo.borissuescount %]
853                                                     <span class="results_summary nowrap">
854                                                         <span class="label">Checkouts:</span>
855                                                         <span class="number_box">
856                                                             <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% riloo.patron.borrowernumber | uri %]">[% riloo.borissuescount | html %]</a>
857                                                         </span>
858                                                     </span>
859                                                 [% END %]
860                                             [% ELSE %]
861                                                 Not checked out
862                                             [% END %]
863                                         </td>
864                                         <td class="ci-note">
865                                             [% IF ( riloo.patron.borrowernotes ) %]
866                                                 <p><span class="circ-hlt patron-note">[% riloo.patron.borrowernotes | html %]</span></p>
867                                             [% END %]
868                                             [% IF ( riloo.itemnote ) %]
869                                                 <p><span class="circ-hlt item-note-public">[% riloo.itemnote | html %]</span></p>
870                                             [% END %]
871                                             [% IF ( riloo.itemnotes_nonpublic ) %]
872                                                 <p><span class="circ-hlt item-note-nonpublic">[% riloo.itemnotes_nonpublic | html %]</span></p>
873                                             [% END %]
874                                         </td>
875                                     </tr>
876                                 [% END # /FOREACH riloo %]
877                             </table> <!-- /#checkedintable -->
878                         [% END # /IF riloop %]
879
880                     [% IF Koha.Preference('CircSidebar') %]
881                             </div> <!-- /.col-sm-10.col-sm-push-2 -->
882                             <div class="col-sm-2 col-sm-pull-10">
883                                 <aside>
884                                     [% INCLUDE 'circ-nav.inc' %]
885                                 </aside>
886                             </div> <!-- /.col-sm-2.col-sm-pull-10 -->
887                         </div> <!-- /.row -->
888                     [% ELSE %]
889                             </div> <!-- /.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 -->
890                         </div> <!-- /.row -->
891                     [% END %]
892
893                 </main>
894             </div> <!-- /.col-sm-12 -->
895         </div> <!-- /.row -->
896
897 [% MACRO jsinclude BLOCK %]
898     [% INCLUDE 'datatables.inc' %]
899     [% INCLUDE 'columns_settings.inc' %]
900     [% INCLUDE 'calendar.inc' %]
901     [% Asset.js("lib/jquery/plugins/jquery-ui-timepicker-addon.min.js") | $raw %]
902     [% Asset.js("js/pages/circulation.js") | $raw %]
903     [% INCLUDE 'timepicker.inc' %]
904
905     <script>
906         function Dopop(link) {
907             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
908             $("#barcode").focus();
909         }
910         $(document).ready(function () {
911             $("#checkin-form").preventDoubleFormSubmit();
912             $(".modal.block").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
913                 $("#barcode").prop("disabled", true);
914                 $(".show_checkin_dialog").show();
915             }).on('hidden.bs.modal', function() {
916                 $("#barcode").prop("disabled", false).focus();
917             });
918             $(".modal.noblock").modal({ backdrop: 'static'}).on('shown.bs.modal', function() {
919                 $("#barcode").prop("disabled", false).focus();
920             }).on('hidden.bs.modal', function() {
921                 $("#barcode").prop("disabled", false).focus();
922             });
923
924             $("body").on("click", ".show_checkin_dialog button", function(e){
925                 e.preventDefault();
926                 $(".modal").modal("show");
927             });
928             [% IF reserve_id %]
929                 $(".print-slip").on('click', function(e) {
930                     e.preventDefault();
931                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
932                 });
933                 [% IF print_slip %]
934                     Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]');
935                 [% END %]
936             [% END %]
937             var columns_settings = [% TablesSettings.GetColumns( 'circ', 'returns', 'checkedintable', 'json' ) | $raw %]
938             var returns_table = KohaTable("checkedintable", {
939                     "bFilter":false,
940                     "bPaginate":false,
941                     "bInfo":false,
942                     "bSort":false,
943                     "dom": 'B<"clearfix">t',
944                     }, columns_settings);
945
946             $("#return_date_override").datetimepicker({
947                 onClose: function(dateText, inst) {
948                     if (validate_date(dateText, inst) ) {
949                         $("#barcode").focus();
950                     }
951                 },
952                 defaultDate: -1,
953                 hour: 23,
954                 minute: 59,
955                 maxDate: 0
956             }).on("change", function(e, value) {
957                 if ( ! is_valid_date( $(this).val() ) ) {$(this).val("");}
958             });
959             $("#return_date_override").on("blur", function() {
960                 check_valid_return_date();
961             });
962             $("#checkin-form").submit(function( event ) {
963                 if ( !check_valid_return_date() ) {
964                     event.preventDefault();
965                 }
966             });
967
968             function check_valid_return_date() {
969                 if ( $("#return_date_override").val() ) {
970                     var datetime = DateTime_from_syspref( $("#return_date_override").val() );
971                     var now = new Date();
972                     if ( !datetime || datetime > now ) {
973                         alert("Invalid return date/time!");
974                         $("#return_date_override").val("")
975                         return false;
976                     }
977                 }
978                 // Add saved date information to onscreen message, which
979                 // may or may not be hidden
980                 $("#saved_return_date").text( $("#return_date_override").val() );
981                 return true;
982             }
983
984             $("#exemptcheck").change(function () {
985                 if (this.checked == true) {
986                     $("#barcode").addClass("input-warning");
987                     $("#exemptfines").show();
988                 } else {
989                     $("#barcode").removeClass("input-warning");
990                     $("#exemptfines").hide();
991                 }
992                 $("#barcode").focus();
993             });
994             $("#dropboxcheck").change(function () {
995                 if (this.checked == true) {
996                     $("#barcode").addClass("input-warning");
997                     $("#dropboxmode").show();
998
999                     $("#return_date_override_fields :input").prop('disabled', true);
1000                     $("#return_date_override").datetimepicker("disable");
1001                 } else {
1002                     $("#barcode").removeClass("input-warning");
1003                     $("#dropboxmode").hide();
1004
1005                     $("#return_date_override_fields :input").prop('disabled', false);
1006                     $("#return_date_override").datetimepicker("enable");
1007                 }
1008                 $("#barcode").focus();
1009             });
1010             $("#forgivemanualholdsexpire").change(function () {
1011                 if (this.checked == true) {
1012                     $("#barcode").addClass("input-warning");
1013                     $("#forgivemanualholdsexpire-alert").show();
1014                 } else {
1015                     $("#barcode").removeClass("input-warning");
1016                     $("#forgivemanualholdsexpire-alert").hide();
1017                 }
1018                 $("#barcode").focus();
1019             });
1020
1021             [% IF(overduecharges) %]
1022                 $("#barcode").focus(function () {
1023                     if (($("#exemptcheck").prop("checked") == true) || ($("#dropboxcheck").prop("checked") == true)) {
1024                         $("#barcode").addClass("input-warning");
1025                     } else {
1026                         $("#barcode").removeClass("input-warning");
1027                     }
1028                 });
1029                 $("#barcode").blur(function () {
1030                     $("#barcode").removeClass("input-warning");
1031                 });
1032             [% END %]
1033
1034             $('.openWin').on("click",function(e){
1035                 Dopop( $(this).data("url") );
1036             });
1037
1038             $('.print').on("click",function(e){
1039                 this.form.print_slip.value = 1;
1040                 this.form.submit();
1041             });
1042
1043             $('.cancel-hold').on("click",function(e){
1044                 this.form.cancel_reserve.value = 1;
1045                 this.form.submit();
1046             });
1047
1048             $('.action').on("click",function(e){
1049                 this.checked = false;
1050                 this.form.return_date_override.value = '';
1051                 this.form.return_date_override_remember.checked = false;
1052                 this.form.barcode.focus();
1053                 $("#return_date_remember").hide();
1054                 return false;
1055             });
1056
1057             $("#return_date_override_remember").on("change", function(){
1058                 if( $(this).prop("checked" ) ){
1059                     if( $("#return_date_override").val() == "" ){
1060                         $("#saved_return_date").text( _("No date selected") );
1061                     } else {
1062                         $("#saved_return_date").text( $("#return_date_override").val() );
1063                     }
1064                     $("#return_date_remember").show();
1065                 } else {
1066                     $("#return_date_remember").hide();
1067                 }
1068             });
1069             $('[data-toggle="tooltip"]').tooltip();
1070         });
1071     </script>
1072 [% END %]
1073
1074 [% INCLUDE 'intranet-bottom.inc' %]