Fix for Bug 2941 Transfers cannot be canceled once initiated
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / circ / returns.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Circulation &rsaquo; Check In [% title |html %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/javascript">
5 //<![CDATA[
6 function Dopop(link) {
7     var newin=window.open(link,'popup','width=600,height=400,resizable=1,toolbar=0,scrollbars=1,top');
8 }
9          $(document).ready(function() {
10                 $("#exemptcheck").change(function(){
11                         if(this.checked == true) {
12                                 $("#barcode").addClass("alert");
13                                 $("#exemptfines").show();
14                         } else {
15                                 $("#barcode").removeClass("alert");
16                                 $("#exemptfines").hide();
17                         }
18                         $("#barcode").focus();
19                 });
20                 $("#dropboxcheck").change(function(){
21                         if (this.checked == true) {
22                                 $("#barcode").addClass("alert");
23                                 $("#dropboxmode").show();
24                         } else {
25                                 $("#barcode").removeClass("alert");
26                                 $("#dropboxmode").hide();
27                         }
28                         $("#barcode").focus();
29                 });
30                 [% IF ( overduecharges ) %]$("#barcode").focus(function(){
31                         if(($("#exemptcheck").attr("checked") == true)||($("#dropboxcheck").attr("checked") == true)){
32                                 $("#barcode").addClass("alert");
33                         } else {
34                                 $("#barcode").removeClass("alert");
35                         }
36                 });
37                 $("#barcode").blur(function(){
38                         $("#barcode").removeClass("alert");
39                 });[% END %]
40          });
41 //]]>
42 </script>
43 </head>
44 <body>
45 [% INCLUDE 'header.inc' %]
46 [% INCLUDE 'checkin-search.inc' %]
47
48 <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>
49
50 <div id="doc" class="yui-t7">
51
52    <div id="bd">
53         <div id="yui-main">
54
55 <div class="yui-g">
56
57 [% IF ( collectionItemNeedsTransferred ) %]
58         <div class="dialog message">This item is part of a Rotating Collection and needs to be Transferred to [% collectionBranch %]</div>
59 [% END %]
60
61 <!-- Patron has fines -->
62 [% IF ( fines ) %]
63     <div class="dialog alert">
64         <h3>Patron has outstanding fines of [% fines %].</h3>
65         <p><a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% fineborrowernumber %]">Make payment</a>.</p>
66     </div>
67 [% END %]
68
69 <!-- Patron has waiting holds -->
70 [% IF ( waiting_holds ) %]
71     <div class="dialog alert">
72         <h3>Patron has [% waiting_holds %] hold(s) waiting for pickup.</h3>
73         <p><a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% holdsborrowernumber %]">Checkout holds</a>.</p>
74     </div>
75 [% END %]
76
77
78 [% IF ( wrongbranch ) %]
79 <div class="dialog alert"><h3>Cannot Check In</h3><p>This item must be checked in at its home library. <strong>NOT CHECKED IN</strong></p>
80 </div>
81 [% END %]
82 <!-- case of a mistake in transfer loop -->
83 [% IF ( WrongTransfer ) %]<div class="dialog message"><!-- WrongTransfer --><h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a> to [% TransferWaitingAt %] or <a href="/cgi-bin/koha/circ/returns.pl?itemnumber=[% itemnumber %]&amp;canceltransfer=1">Cancel Transfer</a></h3>
84 [% IF ( wborcnum ) %]<h5>Hold for:</h5>
85         <ul><li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
86             [% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
87         <li>[% wboraddress %][% IF ( wboraddress2 ) %]<br />
88                 [% wboraddress2 %]<br />[% END %]
89         [% wborcity %]  [% wborzip %]</li>
90         [% IF ( wborphone ) %]<li>[% wborphone %]</li>[% END %]
91                 [% IF ( wboremail ) %]<li><a id="boremail" href="mailto:[% wboremail %]">[% wboremail %]</a></li>[% END %]
92         </ul>
93
94     <form method="post" action="returns.pl" class="confirm">
95             <input type="hidden" name="WT-itemNumber" value="[% WrongTransferItem %]" />
96             <input type="hidden" name="WT-waitingAt" value="[% TransferWaitingAt %]" />
97             <input type="hidden" name="WT-From" value="[% wtransfertFrom %]" />
98         <input type="submit" class="approve" value="Confirm" />
99                         <input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&amp;borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
100     </form>
101     [% END %]</div>
102 [% END %]
103
104 [% IF ( found ) %]
105 <!-- found -->
106 <!-- case of a reservation found, and display info -->
107     [% IF ( waiting ) %]
108         <!-- waiting -->
109
110 [% IF ( soundon ) %]
111 <audio src="/intranet-tmpl/prog/sound/ending.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
112 [% END %]       
113         
114 <div class="dialog message">
115         <h3>Hold Found (item is already waiting):  <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3>
116         [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %]
117         <h4>Hold for:</h4>
118                         <ul>
119             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
120             <li>[% boraddress %]<br />
121                         [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
122             [% borcity %] [% borzip %]</li>
123            [% IF ( borphone ) %]<li> [% borphone %]</li>[% END %]
124                    [% IF ( boremail ) %]<li><a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a></li>[% END %]
125 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
126 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]</ul>
127                 [% IF ( transfertodo ) %]
128             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
129                 [% ELSE %]
130                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
131         [% END %]
132         <form method="post" action="returns.pl" class="confirm">
133             <input type="submit" class="approve" value="Confirm" />
134
135                         <input type="submit" value="Print and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
136             [% FOREACH inputloo IN inputloop %]
137                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
138                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
139                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
140             [% END %]
141                 <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
142                 <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
143                 <input type="hidden" name="resbarcode" value="[% barcode %]" />
144                 <input type="hidden" name="diffBranch" value="[% destbranch %]" />
145                 <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
146                 <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
147                 </form>
148         </div>
149     [% END %]
150
151     [% IF ( diffbranch ) %]
152                 <!-- diffbranch -->
153         <div class="dialog message">
154                 <h3>Hold needing transfer found: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3>
155                 <h4>Hold for: </h4>
156                     <ul>
157                         <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% borsurname %], [% borfirstname %]</a> ([% borcnum %])</li>
158                         <li>[% boraddress %]<br />
159                                                 [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
160                                                 [% borcity %]  [% borzip %]</li>
161                         [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
162                         [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
163 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
164 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
165                     </ul>
166                 [% IF ( transfertodo ) %]
167             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
168                 [% ELSE %]
169                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
170         [% END %]
171
172         <form method="post" action="returns.pl" class="confirm">
173             <input type="submit" class="approve" value="Confirm" />
174                         <input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&amp;borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
175             [% FOREACH inputloo IN inputloop %]
176                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
177                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
178                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
179             [% END %]
180             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
181             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
182             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
183             <input type="hidden" name="barcode" value="0" />
184         </form>
185                 </div>
186     [% END %]
187
188     [% IF ( transfer ) %]
189     <!-- transfer: item with no reservation, must be returned to its homebranch -->
190         <div class="dialog message">
191           <h3>Please return <a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% DEFAULT title="item" |html %]</a> to [% homebranchname %]</h3></div>[% END %]
192
193     [% IF ( needstransfer ) %]
194         <!-- needstransfer -->
195         <div class="dialog message"><h3> This item needs to be transferred to [% homebranchname %]</h3>
196         Transfer Now?<br />
197     <form method="post" action="returns.pl" name="mainform" id="mainform">
198         <input type="submit" name="dotransfer" value="Yes" class="submit" />
199         <input type="submit" name="notransfer" value="No" class="submit" />
200         <input type="hidden" name="tobranch" value="[% homebranch %]" />
201         <input type="hidden" name="transferitem" value="[% itemnumber %]" />
202         <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
203         <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
204         [% FOREACH inputloo IN inputloop %]
205         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
206         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
207         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.bornum %]" />
208         [% END %]
209         <input type="hidden" name="barcode" value="0" />
210         </form>   </div>
211         [% END %]
212
213     [% IF ( diffbranch ) %]
214         <!-- diffbranch -->
215         <h3>Item Consigned:</h3>
216         <table>
217         <caption><a href="/cgi-bin/koha/catalogue/detail.pl?type=intra&amp;biblionumber=[% itembiblionumber %]">[% title |html %]</a></caption>
218         <tr>
219             <th>Hold for:</th>
220             <td>[% name %]</td>
221         </tr>
222         </table>
223         <form method="post" action="returns.pl"><input type="submit" value="OK" />
224             [% FOREACH inputloo IN inputloop %]
225                 [% UNLESS ( inputloo.first ) %]
226                     <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
227                     <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
228                     <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
229                 [% END %]
230             [% END %]
231             <input type="hidden" name="barcode" value="0" />
232         </form>
233     [% END %]
234
235
236     <!-- case of simple return no issue or transfer but with a reservation  -->
237     [% IF ( reserved ) %]
238         <!--  reserved  -->
239         
240 [% IF ( soundon ) %]
241 <audio src="/intranet-tmpl/prog/sound/opening.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
242 [% END %]
243         
244         <div class="dialog message">
245           <h3>Hold Found: <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itembiblionumber %]">[% title |html %]</a></h3>
246         [% IF ( reservenotes ) %]<h4>Notes: [% reservenotes %]</h4>[% END %]
247         <h5>Hold for:</h5>
248                 <ul>
249             <li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">
250                 [% borsurname %], [% borfirstname %]
251             </a> ([% borcnum %])</li>
252             <li>[% boraddress %]<br />
253                         [% IF ( boraddress2 ) %][% boraddress2 %]<br />[% END %]
254                         [% borcity %] [% borzip %]</li>
255             [% IF ( borphone ) %]<li>[% borphone %]</li>[% END %]
256             [% IF ( boremail ) %]<li>[% IF ( transfertodo ) %][% boremail %][% ELSE %]<a id="boremail" href="mailto:[% boremail %]">[% boremail %]</a>[% END %]</li>[% END %]
257 [% IF ( debarred ) %]<li class="error">Patron is RESTRICTED</li>[% END %]
258 [% IF ( gonenoaddress ) %]<li class="error">Patron's address is in doubt</li>[% END %]
259         </ul>
260         [% IF ( transfertodo ) %]
261             <h4><strong>Transfer to:</strong> [% destbranchname %]</h4>
262                 [% ELSE %]
263                 <h4><strong>Hold at</strong> [% destbranchname %]</h4>
264         [% END %]
265         <form method="post" action="returns.pl" class="confirm">
266             [% IF ( transfertodo ) %]
267                 <input type="submit" class="approve" value="Confirm hold and Transfer" />
268                 <input type="submit" value="Print slip, Transfer, and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?transfer=1&amp;borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
269             [% ELSE %]
270                 <input type="submit" class="approve" value="Confirm hold" />
271                 <input type="submit" value="Print Slip and Confirm" class="print" onclick="Dopop('hold-transfer-slip.pl?borrowernumber=[% borrowernumber %]&amp;biblionumber=[% itembiblionumber %]&amp;op=slip'); this.form.submit();" />
272             [% END %]
273                 <input type="submit" class="deny" value="Ignore" onclick="$('.dialog:visible').hide('slow'); $('#barcode').focus(); return false;" />
274             [% FOREACH inputloo IN inputloop %]
275         <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
276         <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
277         <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />[% END %]
278             <input type="hidden" name="itemnumber" value="[% itemnumber %]" />
279             <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
280             <input type="hidden" name="resbarcode" value="[% barcode %]" />
281             <input type="hidden" name="diffBranch" value="[% destbranch %]" />
282             <input type="hidden" name="exemptfine" value="[% exemptfine %]" />
283             <input type="hidden" name="dropboxmode" value="[% dropboxmode %]" />
284         </form>
285         </div>
286     [% END %]
287 [% ELSE %]
288
289 [% IF ( errmsgloop ) %]
290     <div class="dialog alert">
291         [% FOREACH errmsgloo IN errmsgloop %]
292                     [% IF ( errmsgloo.badbarcode ) %]
293                         <p class="problem">No Item with barcode: [% errmsgloo.msg %]</p>
294                     [% END %]
295                     [% IF ( errmsgloo.ispermanent ) %]
296                         <p class="problem">Please return to  [% errmsgloo.msg %]</p>
297                     [% END %]
298                     [% IF ( errmsgloo.notissued ) %]
299                         <p class="problem">Not checked out.</p>
300                     [% END %]
301                     [% IF ( errmsgloo.waslost ) %]
302                         <p class="problem">Item was lost, now found.</p>
303                     [% END %]
304                     [% IF ( errmsgloo.withdrawn ) %]
305                         <p class="problem">Item is withdrawn.</p>
306                     [% END %]
307             [% END %]
308 [% IF ( soundon ) %]
309 <audio src="/intranet-tmpl/prog/sound/critical.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
310 [% END %]
311         [% ELSE %]
312 [% IF ( soundon ) %]
313 <audio src="/intranet-tmpl/prog/sound/beep.ogg" autoplay="autoplay" autobuffer="autobuffer"></audio>
314 [% END %]
315         [% END %]
316     </div>
317 [% END %]
318
319     <div id="exemptfines" class="dialog message" style="display:none;">
320         <p>Fines for returned items are forgiven.</p>
321     </div>
322     <div id="dropboxmode" class="dialog message" style="display:none;">
323         <p>Dropbox Mode.  (Effective checkin date is [% dropboxdate %] ).</p>
324     </div>
325 </div>
326         <div class="yui-g">
327     <form method="post" action="/cgi-bin/koha/circ/returns.pl" >
328     <div class="yui-u first">
329             <fieldset>
330         <legend>Check In</legend>
331             <label for="barcode">Enter item barcode: </label>
332                         [% IF ( exemptfine ) %]
333                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
334                         [% ELSIF ( dropboxmode ) %]
335                         <input name="barcode" id="barcode" size="14" class="focus alert"/>
336                         [% ELSE %]
337                         <input name="barcode" id="barcode" size="14" class="focus"/>
338                         [% END %]
339             <input type="submit" class="submit" value="Submit" />
340             [% FOREACH inputloo IN inputloop %]
341                 <input type="hidden" name="ri-[% inputloo.counter %]" value="[% inputloo.barcode %]" />
342                 <input type="hidden" name="dd-[% inputloo.counter %]" value="[% inputloo.duedate %]" />
343                 <input type="hidden" name="bn-[% inputloo.counter %]" value="[% inputloo.borrowernumber %]" />
344             [% END %]
345
346
347             </fieldset>
348             </div>
349             <div class="yui-u">
350             <fieldset id="checkin_options">
351                 <legend>Options</legend>
352
353                 <ul>
354                     [% IF ( overduecharges ) %]
355                     <li>
356                         [% IF ( exemptfine ) %]
357                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" checked="checked" />
358                         [% ELSE %]
359                         <input type="checkbox" id="exemptcheck" name="exemptfine" value="exemptfine" />
360                         [% END %]
361                         <label for="exemptcheck">Forgive overdue charges</label>
362                     </li>
363                     [% END %] <!-- overduecharges -->
364                     <li>
365                         [% IF ( dropboxmode ) %]
366                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" checked="checked" />
367                         [% ELSE %]
368                         <input type="checkbox" id="dropboxcheck" name="dropboxmode" value="dropboxmode" />
369                         [% END %]
370                         <label for="dropboxcheck">Dropbox mode</label>
371                     </li>
372                 </ul>
373             </fieldset>
374         </div>
375     </form>
376 </div>
377
378 [% IF ( returned ) %]
379 <div class="yui-g">    <table>
380         <tr><th>Item Information</th><th>Patron Information</th></tr>
381         <tr>
382             <td>[% title |html %]</td>
383             <td>
384
385                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riborrowernumber %]">[% riborsurname %], [% ribortitle %] [% riborfirstname %]</a> ([% riborcnum %])
386                 [% IF ( flagset ) %]
387                 ([% FOREACH flagloo IN flagloop %]
388                 [% flagloo.flag %]
389                 [% IF ( flagloo.charges ) %] of [% flagloo.chargeamount %] [% END %]
390                 ,
391                 [% END %])[% END %]
392             </td>
393         </tr>
394     </table>
395 [% END %]
396 [% IF ( riloop ) %]
397     <h2>Checked-In items</h2>
398     <table>
399         <tr><th>Due Date</th><th>Title</th>     <th>Author</th> <th>Barcode</th><th>Call Number</th><th>Type</th>       <th>Patron</th><th>Note</th></tr>
400
401         [% FOREACH riloo IN riloop %]
402             <tr>
403             <td>[% IF ( riloo.duedate ) %]
404                     [% IF ( riloo.return_overdue ) %]
405                         <span class="overdue">[% riloo.duedate %] (overdue)</span>
406                     [% ELSE %][% riloo.duedate %]
407                     [% END %]
408                 [% ELSE %]Not checked out
409                 [% END %]
410             </td>
411             <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% riloo.itembiblionumber %]">
412                     [% riloo.itemtitle |html %]</a></td>
413                         <td>[% riloo.itemauthor %]</td>
414             <td><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% riloo.itembiblionumber %]&amp;itemnumber=[% riloo.itemnumber %]#item[% riloo.itemnumber %]">[% riloo.barcode %]</a></td>
415             <td>[% riloo.itemcallnumber %]</td>
416             <td>[% riloo.itemtype %] [% riloo.ccode %]</td>
417                         <td>[% IF ( riloo.duedate ) %]
418                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% riloo.borrowernumber %]">
419                     [% riloo.borsurname %], [% riloo.borfirstname %] ([% riloo.borcategorycode %])
420                 </a>
421             [% ELSE %]Not checked out[% END %]</td>
422             <td>[% IF ( riloo.bornote ) %]<span class="circ-hlt">[% riloo.bornote %]<br /></span>[% END %]
423             [% IF ( riloo.itemnote ) %]<span class="circ-hlt">[% riloo.itemnote %]</span>[% END %]
424             </td>
425            </tr>
426         [% END %]
427     </table></div>
428 [% END %]
429
430
431 </div>
432 [% INCLUDE 'intranet-bottom.inc' %]