Bug 36175: Corrections to reduced due for booked items
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / circulation.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Context %]
4 [% USE Koha %]
5 [% USE Branches %]
6 [% USE KohaDates %]
7 [% USE Categories %]
8 [% USE TablesSettings %]
9 [% USE ItemTypes %]
10 [% USE Price %]
11 [% USE AuthorisedValues %]
12 [% PROCESS 'i18n.inc' %]
13 [% SET footerjs = 1 %]
14 [% INCLUDE 'doc-head-open.inc' %]
15 [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
16 [% SET destination = "circ" %]
17 <title>[% FILTER collapse %]
18     [% IF patron %]
19         [% patron_in_title = INCLUDE 'patron-title.inc' invert_name = 1 no_html = 1 %]
20         [% tx("Checking out to {patron}", { patron = patron_in_title }) | html %]  &rsaquo;
21     [% END %]
22     [% t("Circulation") | html %] &rsaquo;
23     [% t("Koha") | html %]
24 [% END %]</title>
25 [% INCLUDE 'doc-head-close.inc' %]
26 </head>
27
28 <body id="circ_circulation" class="circ">
29
30     [% WRAPPER 'header.inc' %]
31     [% INCLUDE 'circ-search.inc' %]
32 [% END %]
33
34     [% WRAPPER 'sub-header.inc' %]
35         [% WRAPPER breadcrumbs %]
36             [% WRAPPER breadcrumb_item %]
37                 <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a>
38             [% END %]
39             [% IF patron %]
40                 [% WRAPPER breadcrumb_item %]
41                     <a href="/cgi-bin/koha/circ/circulation.pl">Checkouts</a>
42                 [% END %]
43                 [% WRAPPER breadcrumb_item bc_active= 1 %]
44                     [% INCLUDE 'patron-title.inc' %]
45                 [% END %]
46             [% ELSE %]
47                 [% WRAPPER breadcrumb_item bc_active= 1 %]
48                     <span>Checkouts</span>
49                 [% END %]
50             [% END %]
51         [% END #/ WRAPPER breadcrumbs %]
52     [% END #/ WRAPPER sub-header.inc %]
53
54     <div class="main container-fluid">
55         <main>
56             <div class="row">
57                 <div class="col-sm-10 col-sm-push-2">
58                     [% INCLUDE 'messages.inc' %]
59
60                     [% IF patron %]
61                         [% INCLUDE 'members-toolbar.inc' %]
62                     [% END %]
63
64                     <h1>Checkouts</h1>
65
66                     <!--  INITIAL BLOC : PARAMETERS & BORROWER INFO -->
67                     [% IF ( was_renewed ) %]
68                         <div class="dialog message">Patron's account has been renewed until [% expiry | $KohaDates %]</div>
69                     [% END %]
70
71                     [% IF autoswitched %]
72                         <div id="autoswitched" class="dialog message">Patron was automatically switched by reading the patron card during checking out. Ensure you are working with the right patron.</div>
73                     [% END %]
74
75                     [% IF ADDITIONAL_MATERIALS && !NEEDSCONFIRMATION %]
76                         <div id="materials" class="dialog message">
77                             <span class="mats_spec_label">Note about the accompanying materials: </span>
78                             <span class="mats_spec_message">[% ADDITIONAL_MATERIALS | html %]</span>
79                         </div>
80                     [% END %]
81
82                     [% IF ( alert.ITEM_LOST ) %]
83                         <div class="dialog message">This item has been lost with a status of "[% alert.ITEM_LOST | html %]".</div>
84                     [% END %]
85
86                     [% IF ( alert.OTHER_CHARGES ) %]
87                         <div class="dialog message">The patron has unpaid charges for holds, rentals etc of [% alert.OTHER_CHARGES | $Price %]</div>
88                     [% END %]
89
90                     [% IF alert.HIGHHOLDS %]
91                         <div class="dialog message">High demand item. <strong>Loan period was not shortened due to override.</strong> Shortened due date would have been [% alert.HIGHHOLDS.returndate | $KohaDates %] ([% alert.HIGHHOLDS.duration  | html %] days).</div>
92                     [% END %]
93
94                     [% IF alert.RETURNED_FROM_ANOTHER %]
95                         <div class="dialog alert">Item was checked out to [% INCLUDE 'patron-title.inc' patron = alert.RETURNED_FROM_ANOTHER.patron %] and was returned automatically.</div>
96                     [% END %]
97
98                     [% IF alert.BOOKED %]
99                         <div class="dialog alert">Item is booked by this user</div>
100                     [% END %]
101
102                     [% IF ( nopermission ) %]
103                         <div class="dialog alert">Staff members are not allowed to discharge borrowers, nor borrowers to request a discharge.</div>
104                     [% END %]
105
106                     [% IF is_anonymous %]
107                         <div class="dialog alert">This is the anonymous patron, so circulation is disabled.</div>
108                     [% END %]
109
110                     [% IF ( NEEDSCONFIRMATION ) %]
111                         <div id="circ_needsconfirmation" class="dialog alert audio-alert-action focus" tabindex="-1">
112                             [% IF CAN_user_circulate_force_checkout or ADDITIONAL_MATERIALS %]
113                                 <h3>Please confirm checkout</h3>
114                             [% ELSE %]
115                               <h3>Cannot check out</h3>
116                             [% END %]
117
118                             <ul>
119                                 [%IF ( AGE_RESTRICTION ) %]
120                                     <li>
121                                         Age restriction [% AGE_RESTRICTION | html %].
122                                         [% IF CAN_user_circulate_force_checkout %]
123                                             Check out anyway?
124                                         [% END %]
125                                     </li>
126                                 [% END %]
127
128
129                                 [% IF ( DEBT ) %]
130                                     <li>The patron has a debt of [% DEBT | $Price %].</li>
131                                 [% END %]
132
133                                 [% IF ( DEBT_GUARANTEES ) %]
134                                     <li>The patron's guarantees collectively have a debt of [% DEBT_GUARANTEES | $Price %].</li>
135                                 [% END %]
136
137                                 [% IF ( DEBT_GUARANTORS ) %]
138                                     <li>The patron's guarantors and their other guarantees collectively have a debt of [% DEBT_GUARANTORS | $Price %].</li>
139                                 [% END %]
140
141                                 [% IF ( RENTALCHARGE && RENTALCHARGE > 0 ) %]
142                                     <li>Rental charge for this item: [% RENTALCHARGE | $Price %]</li>
143                                 [% END %]
144
145                                 [% IF ( RENEW_ISSUE ) %]
146                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is currently checked out to this patron.  Renew?</li>
147                                 [% END %]
148
149                                 [% IF ( RESERVE_WAITING ) %]
150                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %] since [% reswaitingdate | $KohaDates %]</li>
151                                 [% END %]
152
153                                 [% IF ( TRANSFERRED ) %]
154                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) and being transferred to [% Branches.GetName( resbranchcode ) | html %]</li>
155                                 [% END %]
156
157                                 [% IF ( PROCESSING ) %]
158                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is being processed for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %]</li>
159                                 [% END %]
160
161                                 [% IF ( RESERVED ) %]
162                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) has been on hold for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% resborrowernumber | uri %]">[% resfirstname | html %] [% ressurname | html %]</a> ([% rescardnumber | html %]) at [% Branches.GetName( resbranchcode ) | html %] since [% resreservedate | $KohaDates %]</li>
163                                 [% END %]
164
165                                 [% IF ( ISSUED_TO_ANOTHER ) %]
166                                     <li>Item <em>[% getTitleMessageIteminfo | html %]</em> ([% getBarcodeMessageIteminfo | html %]) is checked out to <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issued_borrowernumber | uri %]">[% issued_firstname | html %] [% issued_surname | html %]</a> ([% issued_cardnumber | html %]).
167                                         [% IF CAN_user_circulate_force_checkout %]
168                                             Check in and check out?
169                                         [% END %]
170                                     </li>
171                                 [% END %]
172
173                                 [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_CHECKOUTS' %]
174                                     <li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li>
175                                     <li>
176                                         Maximum checkouts calculated from the circulation rule for
177                                         [% INCLUDE circulation_rule_criteria rule=circulation_rule_TOO_MANY %]
178                                     </li>
179                                 [% END %]
180
181                                 [% IF TOO_MANY and TOO_MANY == 'TOO_MANY_ONSITE_CHECKOUTS' %]
182                                     <li>Too many on-site checked out. [% current_loan_count | html %] on-site checked out, only [% max_loans_allowed | html %] are allowed.</li>
183                                     <li>
184                                         Maximum checkouts calculated from the circulation rule for
185                                         [% INCLUDE circulation_rule_criteria rule=circulation_rule_TOO_MANY %]
186                                     </li>
187                                 [% END %]
188
189                                 [% IF ( BORRNOTSAMEBRANCH ) %]
190                                     <li>This patron is from a different library ([% Branches.GetName( BORRNOTSAMEBRANCH ) | html %])</li>
191                                 [% END %]
192
193                                 [% IF ( PATRON_CANT ) %]
194                                     <li>This patron can't check out this item per library circulation policy.</li>
195                                 [% END %]
196
197                                 [% IF ( TOO_MANY and TOO_MANY == 'NO_RULE_DEFINED' ) %]
198                                     <li>No circulation rule is defined for this patron and itemtype combination.</li>
199                                 [% END %]
200
201                                 [% IF ( NOT_FOR_LOAN_FORCING ) %]
202                                     <li>
203                                     [% IF ( itemtype_notforloan ) %]
204                                         <span>Item type is normally not for loan.</span>
205                                     [% ELSIF ( item_notforloan ) %]
206                                         [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
207                                         <span>Item is normally not for loan</span>[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
208                                     [% END %]
209                                         [% IF CAN_user_circulate_force_checkout %]
210                                             <span>Check out anyway?</span>
211                                         [% END %]
212                                     </li>
213                                 [% END %]
214
215                                 [% IF ( USERBLOCKEDOVERDUE ) %]
216                                     <li>Patron has [% USERBLOCKEDOVERDUE %] overdue item(s).
217                                         [% IF CAN_user_circulate_force_checkout %]
218                                             Check out anyway?
219                                         [% END %]
220                                     </li>
221                                 [% END %]
222
223                                 [% IF ( ITEM_LOST ) %]
224                                     <li>This item has been lost with a status of "[% ITEM_LOST | html %]".
225                                         [% IF CAN_user_circulate_force_checkout %]
226                                             Check out anyway?
227                                         [% END %]
228                                     </li>
229                                 [% END %]
230
231                                 [% IF HIGHHOLDS %]
232                                     <li>High demand item. Loan period shortened to [% HIGHHOLDS.duration | html %] days (due [% HIGHHOLDS.returndate | $KohaDates %]). Check out anyway?</li>
233                                 [% END %]
234
235                                 [% IF PREVISSUE %]
236                                     <li>Patron has previously checked out this title: <strong>[% biblio.title | html %] [% IF biblio.author %] by [% biblio.author | html %][% END %]</strong>. Check out anyway?</li>
237                                 [% END %]
238
239                                 [% IF BIBLIO_ALREADY_ISSUED %]
240                                     <li>
241                                         Patron has already checked out another item from this record.
242                                         [% IF CAN_user_circulate_force_checkout %]
243                                             Check out anyway?
244                                         [% END %]
245                                     </li>
246                                 [% END %]
247
248                                 [% IF ADDITIONAL_MATERIALS %]
249                                     <li>
250                                         Please confirm that the accompanying materials are present: [% ADDITIONAL_MATERIALS | html %]
251                                     </li>
252                                 [% END %]
253
254                                 [% IF RECALLED %]
255                                     [% IF RECALLED.waiting %]
256                                         <li>Item <i>[% RECALLED.biblio.title | html %]</i> ([% RECALLED.item.barcode | html %]) has been waiting for <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.patron_id | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.pickup_library_id ) | html %] since [% RECALLED.waiting_date | $KohaDates %]</li>
257                                     [% ELSIF RECALLED.requested or RECALLED.overdue %]
258                                         <li>Item <i>[% RECALLED.biblio.title | html %]</i> [% IF RECALLED.item %]([% RECALLED.item.barcode | html %])[% END %] has been recalled by <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% RECALLED.patron_id | uri %]">[% RECALLED.patron.firstname | html %] [% RECALLED.patron.surname | html %]</a> ([% RECALLED.patron.cardnumber | html %]) at [% Branches.GetName( RECALLED.pickup_library_id ) | html %] since [% RECALLED.created_date | $KohaDates %]</li>
259                                     [% END %]
260                                 [% END %]
261
262                                 [% IF ( BOOKED_TO_ANOTHER ) %]
263                                     <li>
264                                         Due for another patron booking by: [% BOOKED_TO_ANOTHER.start_date | $KohaDates %]
265                                     </li>
266                                 [% END %]
267
268                                 [% IF ( BOOKED_EARLY ) %]
269                                     <li>
270                                         Patron has this item booked for checkout on [% BOOKED_EARLY.start_date | $KohaDates %]
271                                     </li>
272                                 [% END %]
273                             </ul>
274
275                             [% IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
276                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
277                                     [% INCLUDE 'csrf-token.inc' %]
278                                     <fieldset>
279                                     <input type="hidden" name="restoreduedatespec" />
280                                     <input type="hidden" name="op" value="cud-checkout" />
281
282                                     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
283
284                                     [% IF HIGHHOLDS %]
285                                         <p class="circ-override-high-holds">
286                                             <input type="checkbox" name="override_high_holds_tmp" id="override_high_holds_tmp" value="1" />
287                                             <label for="override_high_holds_tmp">Don't decrease loan length based on holds</label>
288                                         </p>
289                                     [% END %]
290
291                                     [% IF ( RESERVED ) %]
292                                         <p>
293                                             <input type="checkbox" id="cancelreserve" name="cancelreserve" value="cancel" />
294                                             <label for="cancelreserve">Cancel hold</label>
295                                         </p>
296                                     [% END %]
297
298                                     [% IF ( RESERVE_WAITING ) %]
299                                         <p>
300                                             <label for="cancelreserve">Cancel hold</label>
301                                             <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
302                                             <label for="revertreserve">Revert waiting status</label>
303                                             <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
304                                         </p>
305                                     [% END %]
306
307                                     [% IF ( TRANSFERRED ) %]
308                                         <p>
309                                             <label for="cancelreserve">Cancel hold</label>
310                                             <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
311                                             <label for="revertreserve">Revert hold transfer status</label>
312                                             <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
313                                         </p>
314                                     [% END %]
315
316                                     [% IF ( PROCESSING ) %]
317                                         <p>
318                                             <label for="cancelreserve">Cancel hold</label>
319                                             <input type="radio" value="cancel" name="cancelreserve" id="cancelreserve" /><br />
320                                             <label for="revertreserve">Revert In Processing status</label>
321                                             <input type="radio" value="revert" name="cancelreserve" id="revertreserve" checked="checked"/>
322                                         </p>
323                                     [% END %]
324
325                                     [% IF ( RECALLED ) %]
326                                         <p>
327                                             <label for="cancelrecall">Cancel recall</label>
328                                             <input type="radio" value="cancel" name="cancel_recall" id="cancelrecall" />
329                                             <input type="hidden" value="[% RECALLED.id | html %]" name="recall_id" />
330                                         </p>
331                                         [% IF RECALLED.waiting %]
332                                             <p>
333                                                 <label for="revertrecall">Revert waiting status</label>
334                                                 <input type="radio" value="revert" name="cancel_recall" id="revertrecall" checked="checked"/>
335                                                 <input type="hidden" value="[% RECALLED.id | html %]" name="recall_id" />
336                                             </p>
337                                         [% END %]
338                                     [% END %]
339
340                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
341                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
342                                     <input type="hidden" name="issueconfirmed" value="1" />
343                                     <input type="hidden" name="override_high_holds" value="[% override_high_holds | html %]"/>
344
345                                     [% IF ( DEBT ) %]<input type="hidden" name="debt_confirmed" value="1" />[% END %]
346
347                                     [% IF ( INVALID_DATE ) %]
348                                         <p>
349                                           <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
350                                           <label for="duedatespec">Due date</label>
351                                         </p>
352                                     [% ELSE %]
353                                         <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
354                                     [% END %]
355
356                                     [% IF ( BOOKED_TO_ANOTHER ) %]
357                                         <p>
358                                             <label for="reduceddue">Reducing due date to: <label>
359                                             <input type="text" size="20" id="reduceddue" name="reduceddue" value="[% reduceddue | html %]" class="flatpickr" data-flatpickr-futuredate="true" data-flatpickr-maxdate="[% reduceddue | html %]" required="required">
360                                         </p>
361                                     [% END %]
362
363                                     [% IF ( BOOKED_EARLY ) %]
364                                         <p>
365                                             Allow early collection?
366                                         </p>
367                                     [% END %]
368
369                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
370                                     <input type="hidden" name="branch" value="[% branch | html %]" />
371
372                                     [% IF ( RENEW_ISSUE ) %]
373                                         <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
374                                     [% ELSE %]
375                                         <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, check out (Y)</button>
376                                     [% END %]
377
378                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
379                                     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
380                                     </fieldset>
381                                 </form>
382                             [% END # /IF CAN_user_circulate_force_checkout or HIGHHOLDS %]
383
384                             [% IF ADDITIONAL_MATERIALS && !CAN_user_circulate_force_checkout %]
385                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
386                                     [% INCLUDE 'csrf-token.inc' %]
387                                     <input type="hidden" name="op" value="cud-checkout" />
388                                     <input type="hidden" name="restoreduedatespec" />
389
390                                     [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
391
392                                     <input type="hidden" name="barcode" value="[% barcode | html %]" />
393                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
394                                     <input type="hidden" name="issueconfirmed" value="1" />
395                                     <input type="hidden" name="override_high_holds" value="[% override_high_holds | html %]"/>
396                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
397                                     <input type="hidden" name="branch" value="[% branch | html %]" />
398
399                                     [% IF ( RENEW_ISSUE ) %]
400                                         <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, renew (Y)</button>
401                                     [% ELSE %]
402                                         <button type="submit" class="approve" accesskey="y"><i class="fa fa-check"></i> Yes, check out (Y)</button>
403                                     [% END %]
404
405                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
406                                     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
407                                 </form>
408                             [% END # /IF ADDITIONAL_MATERIALS %]
409
410                             [% IF ( RESERVED or RESERVE_WAITING or TRANSFERRED or PROCESSING ) %]
411                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl">
412                                     [% INCLUDE 'csrf-token.inc' %]
413                                     <input type="hidden" name="op" value="cud-confirm_hold" />
414                                     <input type="hidden" name="restoreduedatespec" />
415                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
416                                     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
417                                     <input type="hidden" name="confirm_hold" value="[% reserve_id | html %]" />
418                                     <input type="hidden" name="hold_branch" value="[% resbranchcode | html %]" />
419                                     <input type="hidden" name="hold_borrower" value="[% resborrowernumber | html %]" />
420                                     <input type="hidden" name="hold_itemnumber" value="[% item.itemnumber | html %]" />
421                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
422                                     <button class="print" type="submit" onclick="Dopop('hold-transfer-slip.pl?reserve_id=[% reserve_id | uri %]&itemnumber=[% item.id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out, confirm hold, and print slip (P)</button>
423                                 </form>
424                             [% END %]
425
426                             [% IF ( RECALLED ) %]
427                                 <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
428                                     <button class="print" type="submit" onclick="Dopop('/cgi-bin/koha/recalls/recall_pickup_slip.pl?recall_id=[% RECALLED.id | html %]');this.form.submit();"><i class="fa fa-print"></i> Don't check out and print slip (P)</button>
429                                 </form>
430                             [% END %]
431
432                             <form method="get" action="/cgi-bin/koha/circ/circulation.pl">
433                                 [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
434                                 <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
435                                 <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
436                                 <input type="hidden" name="restoreduedatespec" />
437                                 <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
438                                 [% IF CAN_user_circulate_force_checkout or HIGHHOLDS or ADDITIONAL_MATERIALS %]
439                                     [% IF ( RENEW_ISSUE ) %]
440                                         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't renew (N)</button>
441                                     [% ELSE %]
442                                         <button type="submit" class="deny" accesskey="n"><i class="fa fa-times"></i> No, don't check out (N)</button>
443                                     [% END %]
444                                 [% ELSE %]
445                                     <button type="submit" class="deny"><i class="fa fa-times"></i> Continue</button>
446                                 [% END %]
447                             </form>
448
449                             [% IF ( RESERVED || ISSUED_TO_ANOTHER || RECALLED ) && (CAN_user_reserveforothers_place_holds ) %]
450                                 [% UNLESS noissues %]
451                                     <button type="submit" onclick="window.location.href='/cgi-bin/koha/reserve/request.pl?biblionumber=[% itembiblionumber | html %]&borrowernumber=[% patron.borrowernumber | html %]'"><i class="fa-solid fa-note-sticky"></i> Cancel checkout and place a hold for [% INCLUDE 'patron-title.inc' %]</button>
452                                 [% END %]
453                             [% END %]
454                         </div> <!-- /#circ_needsconfirmation -->
455                     [% END # /NEEDSCONFIRMATION %]
456
457                     [% IF ( IMPOSSIBLE ) %]
458                         <div id="circ_impossible" class="dialog alert audio-alert-warning focus" tabindex="-1">
459                             [% IF ( UNKNOWN_BARCODE ) %]
460                                 <h3>Barcode not found</h3>
461                             [% END %]
462
463                             <!-- RESULT OF ISSUING REQUEST -->
464                             <ul>
465                                 [% IF ( DEBT_GUARANTORS ) %]
466                                     <li>The patron's guarantors and their other guarantees collectively have a debt of [% DEBT_GUARANTORS | $Price %].</li>
467                                 [% END %]
468
469                                 [% IF ( STATS ) %]
470                                     <li>Local use recorded</li>
471                                     [% IF ( CHECKEDIN ) %]
472                                         <li>Item checked in from: [% INCLUDE 'patron-title.inc' patron=BORROWER %]</li>
473                                     [% END %]
474                                     [% IF ( MESSAGES.ResFound ) %]
475                                         <li>Item on hold, please checkin.</li>
476                                     [% END %]
477                                     [% IF ( MESSAGES.ReturnClaims ) %]
478                                         <li>Item claimed returned, please checkin.</li>
479                                     [% END %]
480                                     [% IF ( MESSAGES.RecallFound ) %]
481                                         <li>Item can fill a recall, please checkin.</li>
482                                     [% END %]
483                                     [% IF ( MESSAGES.WasLost ) %]
484                                         [% IF ( Koha.Preference('BlockReturnOfLostItems') ) %]
485                                             <li>Item was lost, cannot be returned.</li>
486                                         [% ELSE %]
487                                             <li>Item was lost, now found.</li>
488                                         [% END %]
489                                     [% END %]
490                                     [% IF ( MESSAGES.withdrawn ) %]
491                                         [% IF ( Koha.Preference('BlockReturnOfWithdrawnItems') ) %]
492                                             <li>Item was withdrawn, cannot be returned.</li>
493                                         [% ELSE %]
494                                             <li>Item was withdrawn</li>
495                                         [% END %]
496                                     [% END %]
497                                 [% END %]
498                                 [% IF ( INVALID_DATE ) %]
499                                     <li>The due date &quot;[% INVALID_DATE | $KohaDates %]&quot; is invalid</li>
500                                 [% END %]
501
502                                 [% IF ( UNKNOWN_BARCODE ) %]
503                                     <li>The barcode was not found: <span class="ex">[% barcode | html %]</span>
504                                         <div>
505                                             [% IF ( FALLBACK ) %]
506                                                 [% IF options %]
507                                                     <button type="button" class="approve" data-toggle="modal" data-target="#itemSearchFallback"><i class="fa fa-search"></i> Show matching titles</button>
508                                                 [% ELSE %]
509                                                     <div>No items were found by searching.</div>
510                                                 [% END %]
511                                             [% END %]
512
513                                             [% IF ( fast_cataloging ) %]
514                                                 [% IF ( CAN_user_editcatalogue_fast_cataloging ) %]
515                                                     <a class="approve" href="/cgi-bin/koha/cataloguing/addbiblio.pl?frameworkcode=FA&amp;barcode=[% barcode |uri %]&amp;circborrowernumber=[% patron.borrowernumber | html %]&amp;branch=[% branch | html %]&amp;duedatespec=[% duedatespec | html %]&amp;stickyduedate=[% stickyduedate | html %]"><i class="fa fa-plus"></i> Add record using fast cataloging</a>
516                                                 [% END %]
517                                             [% END %]
518                                         </div>
519                                     </li>
520                                 [% END %]
521
522                                 [% IF ( NOT_FOR_LOAN ) %]
523                                     <li>
524                                     [% IF ( itemtype_notforloan ) %]
525                                         Item type not for loan.
526                                     [% ELSIF ( item_notforloan ) %]
527                                         [% item_notforloan_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.notforloan', authorised_value => item.notforloan ) %]
528                                         Item not for loan[% IF (item_notforloan_lib) %] ([% item_notforloan_lib | html %])[% END %].
529                                     [% END %]
530                                     </li>
531                                 [% END %]
532
533                                 [% IF ( WTHDRAWN ) %]
534                                     <li>
535                                         <span>Item has been withdrawn</span>
536                                         [% item_withdrawn_lib = AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => item.withdrawn ) %]
537                                         [% IF (item_withdrawn_lib) %]<span class="co-withdrawn">([% item_withdrawn_lib | html %])</span>[% END %]
538                                     </li>
539                                 [% END %]
540
541                                 [% IF ( RESTRICTED ) %]
542                                     <li>Item is restricted</li>
543                                 [% END %]
544
545                                 [% IF ( GNA ) %]
546                                     <li>Patron's address is in doubt</li>
547                                 [% END %]
548
549                                 [% IF ( CARD_LOST ) %]
550                                     <li>Patron's card is lost</li>
551                                 [% END %]
552
553                                 [% IF ( DEBARRED ) %]
554                                     <li>Patron is restricted</li>
555                                 [% END %]
556
557                                 [% IF ( NO_MORE_RENEWALS ) %]
558                                     <li>No more renewals possible</li>
559                                 [% END %]
560
561                                 [% IF NO_RENEWAL_FOR_ONSITE_CHECKOUTS %]
562                                     <li>This item can not be renewed, it's an on-site checkout</li>
563                                 [% END %]
564
565                                 [%IF ( AGE_RESTRICTION ) %]
566                                     <li>Age restriction [% AGE_RESTRICTION | html %].</li>
567                                 [% END %]
568
569                                 [% IF ( EXPIRED ) %]
570                                     <li>Patron's card is expired</li>
571                                 [% END %]
572
573                                 [% IF ( TOO_MANY ) %]
574                                     <li>Too many checked out. [% current_loan_count | html %] checked out, only [% max_loans_allowed | html %] are allowed.</li>
575                                     <li>
576                                         Maximum checkouts calculated from the circulation rule for
577                                         [% INCLUDE circulation_rule_criteria rule=circulation_rule_TOO_MANY %]
578                                     </li>
579                                 [% END %]
580
581                                 [% IF ( ITEMNOTSAMEBRANCH ) %]
582                                     <li>This item belongs to [% Branches.GetName( itemhomebranch ) | html %] and cannot be checked out from this location.</li>
583                                 [% END %]
584
585                                 [% IF RETURN_IMPOSSIBLE %]
586                                     <li>This item must be returned to [% Branches.GetName( branch_to_return ) | html %].</li>
587                                 [% END %]
588
589                                 [% IF ( USERBLOCKEDWITHENDDATE ) %]
590                                     <li>Patron has a restriction until [% USERBLOCKEDWITHENDDATE | $KohaDates %].</li>
591                                 [% END %]
592
593                                 [% IF ( USERBLOCKEDNOENDDATE ) %]
594                                     <li>Patron has an indefinite restriction.</li>
595                                 [% END %]
596
597                                 [% IF ( USERBLOCKEDOVERDUE ) %]
598                                     <li>Checkouts are BLOCKED because patron has overdue items.</li>
599                                 [% END %]
600
601                                 [% IF ( RECALLED_INTRANSIT ) %]
602                                     <li>Item has been recalled and is in transit for pickup at [% Branches.GetName( RECALLED_INTRANSIT ) | html %].</li>
603                                 [% END %]
604
605                                 [% IF NO_OPEN_DAYS %]
606                                     <li>No open days found while calculating the due date. Check the library calendar.</li>
607                                 [% END %]
608                                 </ul>
609
610                                 [% IF (forceallow) %]
611                                     <li>Restriction overridden temporarily.</li>
612                                 [% END %]
613
614                                 [% IF ( BOOKED_TO_ANOTHER ) %]
615                                     <li>!!A booking exists!!</li>
616                                 [% END %]
617                             </ul>
618                         </div> <!-- /#circ_impossible -->
619
620                         [% IF ( FALLBACK ) %]
621                             [% IF options %]
622                                 <!-- Modal -->
623                                 <div class="modal" id="itemSearchFallback" tabindex="-1" role="dialog" aria-labelledby="itemSearchFallbackLabel">
624                                     <div class="modal-dialog modal-wide" role="document">
625                                         <div class="modal-content">
626                                             <div class="modal-header">
627                                                 <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
628                                                 <h3 id="itemSearchFallbackLabel"><h3>Barcode not found. The following items were found by searching:</h3>
629                                             </div>
630                                             <div class="modal-body">
631                                                 <table class="table_borrowers">
632                                                     <thead>
633                                                         <tr>
634                                                             <th>Title</th>
635                                                             <th>Barcode</th>
636                                                             <th>Call number</th>
637                                                             <th>Copy number</th>
638                                                             <th>Inventory number</th>
639                                                             <th>Serial enumeration</th>
640                                                             <th>Collection</th>
641                                                             [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
642                                                             <th>&nbsp;</th>
643                                                         </tr>
644                                                     </thead>
645                                                     <tbody>
646                                                     [% FOREACH item IN options %]
647                                                         <tr>
648                                                             <td>
649                                                                 <a target="_blank" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% item.biblionumber | html %]">[% item.biblio.title | html %] <i class="fa-solid fa-window-restore"></i></a>
650                                                                 [% IF item.onloan %]<span style="float: right; color: red; margin-left:5px;">Checked out</span>[% END %]
651                                                             </td>
652                                                             <td>
653                                                                 [% item.barcode | html %]
654                                                             </td>
655                                                             <td>[% item.itemcallnumber | html %]</th>
656                                                             <td>[% item.copynumber | html %]</th>
657                                                             <td>[% item.stocknumber| html %]</th>
658                                                             <td>[% item.enumchron| html %]</th>
659                                                             <td>
660                                                                 [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => item.ccode ) | html %]
661                                                             </td>
662                                                             [% IF ( item_level_itypes ) %]
663                                                                 <td>
664                                                                     [% ItemTypes.GetDescription( item.itype ) | html %]
665                                                                 </td>
666                                                             [% END %]
667                                                             <td>
668                                                                 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" autocomplete="off">
669                                                                     [% INCLUDE 'csrf-token.inc' %]
670                                                                     [% IF (forceallow) %]
671                                                                         <input type="hidden" name="forceallow" value="1">
672                                                                     [% END %]
673                                                                     <input type="hidden" name="restoreduedatespec" />
674                                                                     <input type="hidden" name="op" value="cud-checkout" />
675                                                                     <input type="hidden" name="borrowernumber" value="[% patron.borrowernumber | html %]" />
676                                                                     <input type="hidden" name="duedatespec" value="[% duedatespec | html %]" />
677                                                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
678                                                                     <input type="hidden" name="branch" value="[% branch | html %]" />
679                                                                     <input type="hidden" name="barcode" value="[% item.barcode | html %]" />
680                                                                     <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
681                                                                     <input type="hidden" name="auto_renew" value="[% auto_renew | html %]" />
682                                                                     <button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
683                                                                 </form>
684                                                             </td>
685                                                         </tr>
686                                                     [% END %]
687                                                     </tbody>
688                                                 </table>
689                                             </div> <!-- /.modal-body -->
690                                             <div class="modal-footer">
691                                                 <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
692                                             </div>
693                                         </div> <!-- /.modal-content -->
694                                     </div> <!-- /.modal-dialog.modal-wide -->
695                                 </div> <!-- /#itemSearchFallback -->
696                             [% END # /IF options %]
697                         [% END # /IF FALLBACK %]
698
699                     [% ELSE # IF IMPOSSIBLE %]
700                         [% IF (forceallow) %]
701                             <div id="overridden_debarment" class="dialog alert">Restriction overridden temporarily</div>
702                         [% END %]
703                     [% END # /IF IMPOSSIBLE %]
704
705                     <span class="audio-alert-success"></span>
706
707                     [% IF ( issued ) %]
708                         <p>Item checked out</p>
709                     [% END %]
710
711                     [% IF ( message ) %]
712                         [% INCLUDE 'patron-toolbar.inc' %]
713                         <h4>No patron matched <span class="ex">[% message | html %]</span></h4>
714                     [% END %]
715
716                     <!-- BARCODE ENTRY -->
717
718                     [% IF patron %]
719
720                         [% IF patron.privacy == 2 AND NOT Koha.Preference('AnonymousPatron') %]
721                             <div class="dialog alert">
722                                 <strong>Error:</strong> This patron has requested their circulation history be anonymized on check-in, but the AnonymousPatron system preference is empty or incorrect.
723                             </div>
724                         [% END %]
725
726                         <div class="row">
727                             [% IF ( !noissues ) || ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') )%]
728                                 <div class="col-sm-6">
729                                     <form method="post" action="/cgi-bin/koha/circ/circulation.pl" id="mainform" name="mainform" autocomplete="off">
730                                         [% INCLUDE 'csrf-token.inc' %]
731                                         <input type="hidden" name="op" value="cud-checkout" />
732                                         <input type="hidden" name="restoreduedatespec" />
733                                         [% IF ( issue ) %]
734                                             <fieldset id="circ_circulation_issue" class="lastchecked">
735                                         [% ELSE %]
736                                             <fieldset id="circ_circulation_issue">
737                                         [% END %]
738
739                                         [% IF Koha.Preference('DisplayClearScreenButton') == 'issueslip' %]
740                                             <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
741                                             <span class="printslip printclearscreen" data-clear="true" data-code="issueslip"><a href="#" title="Print slip and clear screen"><i class="fa fa-print"></i></a></span>
742                                         [% ELSIF Koha.Preference('DisplayClearScreenButton') == 'issueqslip' %]
743                                             <span id="clearscreen"><a href="/cgi-bin/koha/circ/circulation.pl" title="Clear screen">x</a></span>
744                                             <span class="printslip printclearscreen" data-clear="true" data-code="issueqslip"><a href="#" title="Print quick slip and clear screen"><i class="fa fa-print"></i></a></span>
745                                         [% END %]
746
747                                         [% IF (forceallow) %]<input type="hidden" name="forceallow" value="1">[% END %]
748
749                                         <label class="circ_barcode" for="barcode">Checking out to [% INCLUDE 'patron-title.inc' %]</label>
750
751                                         [% IF NEEDSCONFIRMATION %]
752                                             <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" disabled="disabled" />
753                                         [% ELSE %]
754                                             [% IF Koha.Preference('itemBarcodeFallbackSearch') %]
755                                                 <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" placeholder="Enter item barcode or keyword" />
756                                             [% ELSE %]
757                                                 <input type="text" name="barcode" id="barcode" class="barcode focus" size="14" placeholder="Enter item barcode" />
758                                             [% END %]
759                                         [% END %]
760
761                                         <div id="show-circ-settings">
762                                             <a href="#" title="Checkout settings"><i class="fa-solid fa-sliders"></i></a>
763                                         </div>
764
765                                         <button type="submit" class="btn btn-primary">Check out</button>
766
767                                         <div class="circ-settings">
768
769                                                 [% UNLESS ( noissues && Koha.Preference('OnSiteCheckoutsForce') ) %]
770                                                     [% IF ( SpecifyDueDate ) %]
771                                                         <div id="specify-due-date" class="circ-setting">
772                                                             <div class="hint">Specify due date [% INCLUDE 'date-format.inc' %]: </div>
773                                                             [% IF ( duedatespec ) %]
774                                                                 <input type="text" size="20" id="duedatespec" name="duedatespec" value="[% duedatespec | html %]" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
775                                                             [% ELSE %]
776                                                                 <input type="text" size="20" id="duedatespec" name="duedatespec" value="" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
777                                                             [% END %]
778                                                             <label for="stickyduedate"> Remember for session:</label>
779                                                             [% IF ( stickyduedate ) %]
780                                                                 <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" checked="checked" />
781                                                             [% ELSE %]
782                                                                 <input type="checkbox" id="stickyduedate" onclick="this.form.barcode.focus();" name="stickyduedate" />
783                                                             [% END %]
784                                                         </div>
785                                                     [% END %]
786                                                 [% END %]
787
788                                                 [% UNLESS ( noissues ) %]
789                                                     [% IF Koha.Preference('AllowSetAutomaticRenewal') %]
790                                                         <div id="set-automatic-renewal" class="circ-setting">
791                                                             [% IF NEEDSCONFIRMATION %]
792                                                                 [% IF auto_renew %]
793                                                                     [% IF patron.autorenew_checkouts %]
794                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
795                                                                         title="Patron has opted out of auto-renewal"/>
796                                                                     [% ELSE %]
797                                                                         <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" checked="checked" />
798                                                                     [% END %]
799                                                                 [% ELSE %]
800                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled" />
801                                                                 [% END %]
802                                                             [% ELSE %]
803                                                                 [% IF ( auto_renew && patron.autorenew_checkouts ) %]
804                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" checked="checked" />
805                                                                 [% ELSIF patron.autorenew_checkouts %]
806                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" class="circ_setting" />
807                                                                 [% ELSE %]
808                                                                     <input type="checkbox" name="auto_renew" id="auto_renew" value="auto_renew" disabled="disabled"
809                                                                     title="Patron has opted out of auto-renewal"/>
810                                                                 [% END %]
811                                                             [% END %]
812
813                                                             <label for="auto_renew">Automatic renewal</label>
814                                                         </div>
815                                                     [% END %]
816                                                     [% IF Koha.Preference('decreaseLoanHighHolds') %]
817                                                         <div id="set_high_holds_overrride" class="circ-setting">
818                                                             [% IF NEEDSCONFIRMATION %]
819                                                                 [% IF override_high_holds %]
820                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled" checked="checked"/>
821                                                                 [% ELSE %]
822                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" disabled="disabled"/>
823                                                                 [% END %]
824                                                             [% ELSE %]
825                                                                 [% IF override_high_holds %]
826                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" checked="checked" />
827                                                                 [% ELSE %]
828                                                                     <input type="checkbox" name="override_high_holds" id="override_high_holds" value="1" class="circ_setting" />
829                                                                 [% END %]
830                                                             [% END %]
831                                                             <label for="override_high_holds">Don't decrease checkout length based on holds</label>
832                                                         </div>
833                                                     [% END %]
834                                                 [% END %]
835
836                                                 [% IF Koha.Preference('OnSiteCheckouts') %]
837                                                     <div id="onsite_checkout-select" class="circ-setting">
838                                                         [% IF noissues %]
839                                                             <div class="onsite-checkout-only">
840                                                                 <input type="checkbox" id="onsite_checkout" name="onsite_checkout_forced" checked="checked" disabled="disabled" /> <label for="onsite_checkout">On-site checkouts only. Automatic due date: </label>
841                                                                 <input type="text" name="duedatespec" id="duedatespec" class="flatpickr" data-flatpickr-enable-time="true" data-flatpickr-on-close-focus="#barcode" />
842                                                                 <input type="hidden" name="onsite_checkout" checked="checked" value="1" />
843                                                             </div>
844                                                         [% ELSE %]
845                                                             [% IF Koha.Preference('OnSiteCheckoutAutoCheck') && onsite_checkout == "on" %]
846                                                             <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" checked="checked" /> <label for="onsite_checkout">On-site checkout</label>
847                                                             [% ELSE %]
848                                                             <input type="checkbox" id="onsite_checkout" name="onsite_checkout" class="circ_setting" /> <label for="onsite_checkout">On-site checkout</label>
849                                                             [% END %]
850                                                         [% END %]
851                                                     </div>
852                                                 [% END %]
853
854                                             </div> <!-- /.circ-settings -->
855
856                                             <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
857                                             <input type="hidden" name="branch" value="[% branch | html %]" />
858                                             <input type="hidden" name="debt_confirmed" value="[% debt_confirmed | html %]" />
859                                             [% IF ( CHARGES ) %]
860                                                     <input type="hidden" name="charges" value="yes" />
861                                             [% END %]
862                                         </fieldset> <!-- /#circ_circulation_issue -->
863
864                                         [% IF ( issue ) %]
865                                             <div class="lastchecked">
866                                                 <p>
867                                                     <strong>Checked out: </strong>
868                                                     [% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]).
869
870                                                     [% IF issue.item.is_bundle %]
871                                                         [% SET bundle_items_count = issue.item.bundle_items.count %]
872                                                         [% tnx('Bundle of {count} item', 'Bundle of {count} items', bundle_items_count, { count = bundle_items_count }) | html %].
873                                                     [% END %]
874
875                                                     Due on [% issue.date_due | $KohaDates as_due_date => 1 %]
876                                                 </p>
877                                             </div>
878                                         [% END %]
879                                     </form> <!-- /#mainform -->
880                                 </div> <!-- /.col-sm-6 -->
881
882                             [% END #/IF !noissues %]
883
884                             [% IF ( noissues ) %]
885                                 [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
886                                     <div class="col-sm-6">
887                                 [% ELSE %]
888                                     <div>
889                                 [% END %]
890                             [% ELSE %]
891                                 <div class="col-sm-6">
892                             [% END %]
893
894                             [% IF ( noissues ) %]
895                                 [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
896                                     <div id="circmessages" class="circmessage attention">
897                                 [% ELSE %]
898                                     <h4>Checking out to [% INCLUDE 'patron-title.inc' %]</h4>
899                                     <div id="circmessages" class="circmessage warning">
900                                 [% END %]
901                                 <h3>
902                                     Cannot check out!
903                                     [% IF ( Koha.Preference('OnSiteCheckouts') && Koha.Preference('OnSiteCheckoutsForce') ) %]
904                                         <span class="circ-hlt">Only on-site checkouts are allowed</span>
905                                     [% END %]
906                                 </h3>
907                             [% ELSE %]
908                                 <div id="circmessages" class="circmessage attention">
909                             [% END %]
910
911                             [% INCLUDE 'patron_messages.inc' %]
912
913                         </div> <!-- /#circmessages -->
914                     </div> <!-- /div or div.col-sm-6 -->
915                 </div> <!-- /.row -->
916
917                     [% INCLUDE 'patron-detail-tabs.inc' patronpage = "circ" %]
918
919                 [% ELSIF borrowernumber # IF patron %]
920                     <div class="dialog message">Patron not found. <a href="/cgi-bin/koha/members/members-home.pl">Return to search</a></div>
921                 [% END # /IF patron %]
922
923                 </div> <!-- /.col-sm-10.col-sm-push-2 -->
924
925                 [% IF Koha.Preference('CircSidebar') %]
926                     [% IF not( borrowernumber and patron ) %]
927                         <div class="col-sm-2 col-sm-pull-10">
928                             <aside>
929                                 [% INCLUDE 'circ-nav.inc' %]
930                             </aside>
931                         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
932                     [% END %]
933                 [% END %]
934
935                 [% IF borrowernumber and patron %]
936                         <div class="col-sm-2 col-sm-pull-10">
937                             <aside>
938                         [% INCLUDE 'circ-menu.inc' %]
939                             </aside>
940                         </div> <!-- /.col-sm-2 col-sm-pull-10 -->
941                 [% END %]
942
943             </div> <!-- /.row -->
944         </main>
945
946         [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
947             [% INCLUDE 'modals/resolve_return_claim.inc' %]
948         [% END %]
949
950 <!-- Modal -->
951 <div id="barcodeSubmittedModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="barcodeSubmittedModalLabel" aria-hidden="true">
952     <div class="modal-dialog">
953         <div class="modal-content">
954             <div class="modal-header">
955                 <h3 id="barcodeSubmittedModalLabel">Barcode submitted</h3>
956             </div>
957             <div class="modal-body">
958                 <p>You have already submitted a barcode, please wait for the checkout to process...</p>
959             </div>
960         </div> <!-- /.modal-content -->
961     </div> <!-- /.modal-dialog -->
962 </div> <!-- /#barcodeSubmittedModal -->
963
964 [% MACRO jsinclude BLOCK %]
965     [% INCLUDE 'datatables.inc' %]
966     [% INCLUDE 'columns_settings.inc' %]
967     [% INCLUDE 'select2.inc' %]
968     [% Asset.js("lib/jquery/plugins/rowGroup/dataTables.rowGroup.min.js") | $raw %]
969     [% PROCESS 'modal-claims.inc' %]
970     [% PROCESS 'modal-claims-js' %]
971     [% INCLUDE 'js-date-format.inc' %]
972
973     <script>
974         /* Set some variable needed in circulation.js */
975         const LoadCheckoutsTableDelay = [% Koha.Preference('LoadCheckoutsTableDelay') || 0 | html %];
976         var logged_in_user_borrowernumber = "[% logged_in_user.borrowernumber | html %]";
977         var ClaimReturnedLostValue = "[% Koha.Preference('ClaimReturnedLostValue') | html %]";
978         var ClaimReturnedChargeFee = "[% Koha.Preference('ClaimReturnedChargeFee') | html %]";
979         var UnseenRenewals = "[% Koha.Preference('UnseenRenewals') | html %]";
980         var ClaimReturnedWarningThreshold = "[% Koha.Preference('ClaimReturnedWarningThreshold') | html %]";
981         var interface = "[% interface | html %]";
982         var theme = "[% theme | html %]";
983         var borrowernumber = "[% patron.borrowernumber | html %]";
984         var branchcode = "[% branch | html %]";
985         var exports_enabled = "[% Koha.Preference('ExportCircHistory') | html %]";
986         var AllowRenewalLimitOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalLimitOverride') )? 1: 0 | html %];
987         var AllowRenewalOnHoldOverride = [% (CAN_user_circulate_override_renewals && Koha.Preference('AllowRenewalOnHoldOverride') )? 1: 0 | html %];
988         var AllowCirculate = [% (CAN_user_circulate_circulate_remaining_permissions)? 1 : 0 | html %];
989         var script = "circulation";
990         var relatives_borrowernumbers = new Array();
991         [% FOREACH b IN relatives_borrowernumbers %]
992             relatives_borrowernumbers.push("[% b | html %]");
993         [% END %]
994         var SuspendHoldsIntranet = [% ( Koha.Preference('SuspendHoldsIntranet') ) ? 1 : 0 | html %];
995     </script>
996     [% Asset.js("js/pages/circulation.js") | $raw %]
997     [% Asset.js("js/checkouts.js") | $raw %]
998     [% IF Koha.Preference('ClaimReturnedLostValue') || Koha.Preference('BundleLostValue') %]
999         [% Asset.js("js/resolve_claim_modal.js") | $raw %]
1000     [% END %]
1001     [% Asset.js("js/holds.js") | $raw %]
1002     [% INCLUDE 'calendar.inc' %]
1003     <script>
1004         table_settings_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'issues-table', 'json' ) | $raw %]
1005         table_settings_relatives_issues_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'relatives-issues-table', 'json' ) | $raw %]
1006         table_settings_borrowers_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'table_borrowers', 'json' ) | $raw %]
1007         table_settings_holds_table = [% TablesSettings.GetTableSettings( 'circ', 'circulation', 'holds-table', 'json' ) | $raw %]
1008
1009         [% IF borrowernumber and patron %]
1010             if( Cookies.get("holdfor") != [% patron.borrowernumber | html %]){
1011                 Cookies.remove("holdfor", { path: '/', SameSite: 'Lax' });
1012             }
1013         [% ELSE %]
1014             Cookies.remove("holdfor", { path: '/', SameSite: 'Lax' });
1015         [% END %]
1016
1017         [% UNLESS ( patron.borrowernumber ) %]window.onload=function(){ $('#findborrower').focus(); };[% END %]
1018
1019         // On-site checkout
1020         function toggle_onsite_checkout(){
1021             if ( $("#onsite_checkout").prop('checked') ) {
1022                 const duedatespec_fp = document.querySelector("#duedatespec")._flatpickr;
1023                 duedatespec_fp.setDate("[% today_due_date_and_time | $KohaDates dateformat => 'iso', with_hours => 1 %]");
1024             }
1025         }
1026
1027         function Dopop(link) {
1028             var newin = window.open(link, 'popup', 'width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
1029         }
1030         $(document).ready(function() {
1031             $('#mainform').on('submit',function() {
1032                 if ($("#barcode") && $("#barcode").val()) {
1033                     $('#barcode').on('keypress',function(event) {
1034                         $('#barcodeSubmittedModal').modal();
1035                         event.preventDefault(); }
1036                     );
1037                 }
1038             });
1039
1040             // listen submit to trigger qslip on empty checkout
1041             $('#mainform').bind('submit',function() {
1042                 if ($('#barcode').val() == '') {
1043                     [% IF ( CircAutoPrintQuickSlip == 'clear' ) %]
1044                         window.location='/cgi-bin/koha/circ/circulation.pl';
1045                         return false;
1046                     [% ELSE %]
1047                         window.open("/cgi-bin/koha/members/printslip.pl?borrowernumber=" + borrowernumber + "&amp;print=issue[% CircAutoPrintQuickSlip | html %]", "printwindow");
1048                         return false;
1049                     [% END %]
1050                 }
1051             });
1052             toggle_onsite_checkout();
1053             $("#onsite_checkout").click(function(){
1054                 toggle_onsite_checkout();
1055             });
1056
1057             [% IF HIGHHOLDS %]
1058                 [% IF !override_high_holds %]
1059                     $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]');
1060                     if ('[% duedatespec | html %]' === '') {
1061                         $("input[name=restoreduedatespec]:hidden").val('highholds_empty');
1062                     } else {
1063                         $("input[name=restoreduedatespec]:hidden").val('[% duedatespec | html %]');
1064                     }
1065                 [% END %]
1066
1067                 $("#override_high_holds_tmp").on( 'change', function() {
1068                     if ( this.checked ) {
1069                         $("input[name=duedatespec]:hidden").val('');
1070                     }
1071                 });
1072             [% END %]
1073         });
1074     </script>
1075     [% INCLUDE 'str/members-menu.inc' %]
1076     [% Asset.js("js/members-menu.js") | $raw %]
1077     [% Asset.js("js/recalls.js") | $raw %]
1078 [% END %]
1079
1080 [% INCLUDE 'intranet-bottom.inc' %]
1081
1082 [% BLOCK circulation_rule_criteria %]
1083     <ul>
1084         <li>
1085             Item type:
1086             [% IF rule.itemtype %]
1087                 [% ItemTypes.GetDescription( rule.itemtype ) | html %]
1088             [% ELSE %]
1089                 <i>All item types</i>
1090             [% END %]
1091         </li>
1092         <li>
1093             Patron category:
1094             [% IF rule.categorycode %]
1095                 [% Categories.GetName( rule.categorycode ) | html %]
1096             [% ELSE %]
1097                 <i>All patron categories</i>
1098             [% END %]
1099         </li>
1100         <li>
1101             Library:
1102             [% IF rule.branchcode %]
1103                 [% Branches.GetName( rule.branchcode ) | html %]
1104             [% ELSE %]
1105                 <i>All libraries</i>
1106             [% END %]
1107         </li>
1108     </ul>
1109 [% END %]