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