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