2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Administration › Circulation and fine rules</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 [% INCLUDE 'calendar.inc' %]
7 <script type="text/javascript">
10 function clear_edit(){
11 var cancel = confirm(_("Are you sure you want to cancel your changes?"));
12 if ( !cancel ) return;
13 $('#default-circulation-rules td').removeClass('highlighted-row');
14 var edit_row = $("#edit_row");
15 $(edit_row).find("input").each(function(){
16 var type = $(this).attr("type");
17 if (type != "button" && type != "submit" ) {
19 $(this).prop('disabled', false);
21 if ( type == "checkbox" ) {
22 $(this).prop('checked', false);
25 $(edit_row).find("select").prop('disabled', false);
26 $(edit_row).find("select option:first").attr("selected", "selected");
27 $(edit_row).find("td:last input[name='clear']").remove();
30 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone.");
32 $(document).ready(function() {
33 $(".delete").on("click",function(){
34 return confirmDelete(MSG_CONFIRM_DELETE);
37 $('#cap_fine_to_replacement_price').on('change', function(){
38 $('#overduefinescap').prop('disabled', $(this).is(':checked') );
40 $('#selectlibrary').find("input:submit").hide();
41 $('#branch').change(function() {
42 $('#selectlibrary').submit();
44 $(".editrule").click(function(){
45 if ( $(edit_row).find("input[type='text'][value!='']").length > 0 ) {
46 var edit = confirm(_("Are you sure you want to edit another rule?"));
47 if (!edit) return false;
49 $('#default-circulation-rules td').removeClass('highlighted-row');
50 $(this).parent().parent().find("td").each(function (i) {
51 $(this).addClass('highlighted-row');
53 itm = itm.replace(/^\s*|\s*$/g,'');
54 var current_column = $("#edit_row td:eq("+i+")");
56 // specific processing for the Hard due date column
57 var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
59 if (typeof select_value === 'undefined'){
62 input_value = itm.split(' ')[1];
64 $(current_column).find("input[type='text']").val(input_value);
65 $(current_column).find("select").val(select_value);
66 } else if ( i == 12 ) {
67 // specific processing for cap_fine_to_replacement_price
68 var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
69 $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
70 $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
72 $(current_column).find("input[type='text']").val(itm);
73 // select the corresponding option
74 $(current_column).find("select option").each(function(){
75 opt = $(this).text().toLowerCase();
76 opt = opt.replace(/^\s*|\s*$/g,'');
77 if ( opt == itm.toLowerCase() ) {
78 $(this).attr('selected', 'selected');
81 if ( i == 0 || i == 1 ) {
82 // Disable the 2 first columns, we cannot update them.
83 var val = $(current_column).find("select option:selected").val();
84 var name = "categorycode";
88 // Remove potential previous input added
89 $(current_column).find("input").remove();
90 $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
91 } else if ( i == 2 || i == 3 ) {
92 // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
93 // The value is "Unlimited" (or an equivalent translated string)
94 // an it should be set to an empty string
95 if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
96 $(current_column).find("input[type='text']").val("");
101 $("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true);
102 $("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true);
109 <body id="admin_smart-rules" class="admin">
110 [% INCLUDE 'header.inc' %]
111 [% INCLUDE 'cat-search.inc' %]
113 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> › Circulation and fine rules</div>
115 <div id="doc3" class="yui-t1">
120 <h1 class="parameters">
122 Defining circulation and fine rules for "[% Branches.GetName( humanbranch ) %]"
124 Defining circulation and fine rules for all libraries
128 <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
130 <li>same library, same patron type, same item type</li>
131 <li>same library, same patron type, all item types</li>
132 <li>same library, all patron types, same item type</li>
133 <li>same library, all patron types, all item types</li>
134 <li>default (all libraries), same patron type, same item type</li>
135 <li>default (all libraries), same patron type, all item types</li>
136 <li>default (all libraries), all patron types, same item type</li>
137 <li>default (all libraries), all patron types, all item types</li>
139 <p>To modify a rule, create a new one with the same patron type and item type.</p>
142 <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
144 <select name="branch" id="branch" style="width:20em;">
145 <option value="*">All libraries</option>
146 [% PROCESS options_for_libraries libraries => Branches.all( selected => current_branch ) %]
149 [% IF ( definedbranch ) %]
150 <form action="/cgi-bin/koha/admin/clone-rules.pl" method="post">
151 <label for="tobranch"><strong>Clone these rules to:</strong></label>
152 <input type="hidden" name="frombranch" value="[% current_branch %]" />
153 <select name="tobranch" id="tobranch">
154 [% FOREACH l IN Branches.all() %]
155 <option value="[% l.value %]">[% l.branchname %]</option>
158 <input type="submit" value="Clone" />
162 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
163 <input type="hidden" name="op" value="add" />
164 <input type="hidden" name="branch" value="[% current_branch %]"/>
165 <table id="default-circulation-rules">
168 <th>Patron category</th>
170 <th>Current checkouts allowed</th>
171 <th>Current on-site checkouts allowed</th>
174 <th>Hard due date</th>
176 <th>Fine charging interval</th>
177 <th>When to charge</th>
178 <th>Fine grace period</th>
179 <th>Overdue fines cap (amount)</th>
180 <th>Cap fine at replacement price</th>
181 <th>Suspension in days (day)</th>
182 <th>Max. suspension duration (day)</th>
183 <th>Renewals allowed (count)</th>
184 <th>Renewal period</th>
185 <th>No renewal before</th>
186 <th>Automatic renewal</th>
187 <th>Holds allowed (count)</th>
188 <th>Holds per record (count)</th>
189 <th>On shelf holds allowed</th>
190 <th>Item level holds</th>
191 <th>Rental discount (%)</th>
196 [% FOREACH rule IN rules %]
197 <tr id="row_[% loop.count %]">
198 <td>[% IF ( rule.default_humancategorycode ) %]
201 [% rule.humancategorycode %]
204 <td>[% IF rule.default_translated_description %]
207 [% rule.translated_description %]
210 <td>[% IF ( rule.unlimited_maxissueqty ) %]
213 [% rule.maxissueqty %]
216 <td>[% IF rule.unlimited_maxonsiteissueqty %]
219 [% rule.maxonsiteissueqty %]
222 <td>[% rule.issuelength %]</td>
224 [% rule.lengthunit %]
227 [% IF ( rule.hardduedate ) %]
228 [% IF ( rule.hardduedatebefore ) %]
229 before [% rule.hardduedate %]
230 <input type="hidden" name="hardduedatecomparebackup" value="-1" />
231 [% ELSIF ( rule.hardduedateexact ) %]
232 on [% rule.hardduedate %]
233 <input type="hidden" name="hardduedatecomparebackup" value="0" />
234 [% ELSIF ( rule.hardduedateafter ) %]
235 after [% rule.hardduedate %]
236 <input type="hidden" name="hardduedatecomparebackup" value="1" />
242 <td>[% rule.fine %]</td>
243 <td>[% rule.chargeperiod %]</td>
244 <td>[% IF rule.chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
245 <td>[% rule.firstremind %]</td>
246 <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
248 [% IF rule.cap_fine_to_replacement_price %]
249 <input type="checkbox" checked="checked" disabled="disabled" />
251 <input type="checkbox" disabled="disabled" />
254 <td>[% rule.finedays %]</td>
255 <td>[% rule.maxsuspensiondays %]</td>
256 <td>[% rule.renewalsallowed %]</td>
257 <td>[% rule.renewalperiod %]</td>
258 <td>[% rule.norenewalbefore %]</td>
260 [% IF ( rule.auto_renew ) %]
266 <td>[% rule.reservesallowed %]</td>
267 <td>[% rule.holds_per_record %]</td>
269 [% IF rule.onshelfholds == 1 %]
271 [% ELSIF rule.onshelfholds == 2 %]
276 <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
277 <td>[% rule.rentaldiscount %]</td>
279 <a href="#" class="editrule btn btn-mini"><i class="fa fa-pencil"></i> Edit</a>
280 <a class="btn btn-mini delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype %]&categorycode=[% rule.categorycode %]&branch=[% rule.current_branch %]"><i class="fa fa-trash"></i> Delete</a>
286 <select name="categorycode" id="categorycode">
287 <option value="*">All</option>
288 [% FOREACH patron_category IN patron_categories%]
289 <option value="[% patron_category.categorycode %]">[% patron_category.description %]</option>
294 <select name="itemtype" id="matrixitemtype" style="width:13em;">
295 <option value="*">All</option>
296 [% FOREACH itemtypeloo IN itemtypeloop %]
297 <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
301 <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
302 <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
303 <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
305 <select name="lengthunit" id="lengthunit">
306 <option value="days" selected="selected">Days</option>
307 <option value="hours">Hours</option>
311 <select name="hardduedatecompare" id="hardduedatecompare">
312 <option value="-1">Before</option>
313 <option value="0">Exactly on</option>
314 <option value="1">After</option>
316 <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate %]" class="datepicker" />
317 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
319 <td><input type="text" name="fine" id="fine" size="4" /></td>
320 <td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td>
322 <select name="chargeperiod_charge_at" id="chargeperiod_charge_at">
323 <option value="0">End of interval</option>
324 <option value="1">Start of interval</option>
327 <td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
328 <td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td>
329 <td><input type="checkbox" name="cap_fine_to_replacement_price" id="cap_fine_to_replacement_price" /></td>
330 <td><input type="text" name="finedays" id="fined" size="3" /> </td>
331 <td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td>
332 <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
333 <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
334 <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td>
336 <select name="auto_renew" id="auto_renew">
337 <option value="no" selected>No</option>
338 <option value="yes">Yes</option>
341 <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
342 <td><input type="text" name="holds_per_record" id="holds_per_record" size="2" /></td>
344 <select name="onshelfholds" id="onshelfholds">
345 <option value="1">Yes</option>
346 <option value="0">If any unavailable</option>
347 <option value="2">If all unavailable</option>
351 <select id="opacitemholds" name="opacitemholds">
352 <option value="N">Don't allow</option>
353 <option value="Y">Allow</option>
354 <option value="F">Force</option>
357 <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
359 <input type="hidden" name="branch" value="[% current_branch %]"/>
360 <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
361 <button name="cancel" onclick="clear_edit();return false;" class="btn btn-mini"><i class="fa fa-undo"></i> Clear</button>
366 <th>Patron category</th>
368 <th>Current checkouts allowed</th>
369 <th>Current on-site checkouts allowed</th>
372 <th>Hard due date</th>
374 <th>Fine charging interval</th>
375 <th>Charge when?</th>
376 <th>Fine grace period</th>
377 <th>Overdue fines cap (amount)</th>
378 <th>Cap fine at replacement price</th>
379 <th>Suspension in days (day)</th>
380 <th>Max. suspension duration (day)</th>
381 <th>Renewals allowed (count)</th>
382 <th>Renewal period</th>
383 <th>No renewal before</th>
384 <th>Automatic renewal</th>
385 <th>Holds allowed (count)</th>
386 <th>Holds per record (count)</th>
387 <th>On shelf holds allowed</th>
388 <th>Item level holds</th>
389 <th>Rental discount (%)</th>
390 <th colspan="2"> </th>
397 <div id="defaults-for-this-library" class="container">
398 <h3>Default checkout, hold and return policy[% IF humanbranch %] for [% Branches.GetName( humanbranch ) %][% END %]</h3>
399 <p>You can set a default maximum number of checkouts, hold policy and return policy that will be used if none is defined below for a particular item type or category.</p>
400 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
401 <input type="hidden" name="op" value="set-branch-defaults" />
402 <input type="hidden" name="branch" value="[% current_branch %]"/>
406 <th>Total current checkouts allowed</th>
407 <th>Total current on-site checkouts allowed</th>
409 <th>Hold pickup library match</th>
410 <th>Return policy</th>
414 <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
415 <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
416 <td><input type="text" name="maxonsiteissueqty" size="3" value="[% default_maxonsiteissueqty %]"/></td>
418 <select name="holdallowed">
419 [% IF ( default_holdallowed_any ) %]
420 <option value="2" selected="selected">
426 [% IF ( default_holdallowed_same ) %]
427 <option value="1" selected="selected">
433 [% IF ( default_holdallowed_none ) %]
434 <option value="0" selected="selected">
443 <select name="hold_fulfillment_policy">
444 [% IF default_hold_fulfillment_policy == 'any' %]
445 <option value="any" selected="selected">
454 [% IF default_hold_fulfillment_policy == 'homebranch' %]
455 <option value="homebranch" selected="selected">
459 <option value="homebranch">
464 [% IF default_hold_fulfillment_policy == 'holdingbranch' %]
465 <option value="holdingbranch" selected="selected">
466 item's holding library
469 <option value="holdingbranch">
470 item's holding library
476 <select name="returnbranch">
477 [% IF ( default_returnbranch == 'homebranch' ) %]
478 <option value="homebranch" selected="selected">
480 <option value="homebranch">
484 [% IF ( default_returnbranch == 'holdingbranch' ) %]
485 <option value="holdingbranch" selected="selected">
487 <option value="holdingbranch">
489 Item returns to issuing library
491 [% IF ( default_returnbranch == 'noreturn' ) %]
492 <option value="noreturn" selected="selected">
494 <option value="noreturn">
501 <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
502 <a class="btn btn-mini delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=*&branch=[% current_branch %]" id="unset"><i class="fa fa-undo"></i> Unset</a>
508 [% IF ( show_branch_cat_rule_form ) %]
509 <div id="holds-policy-by-patron-category" class="container">
510 <h3>[% IF humanbranch %]Checkout limit by patron category for [% Branches.GetName( humanbranch ) %][% ELSE %]Default checkout limit by patron category[% END %]</h3>
511 <p>For this library, you can specify the maximum number of loans that
512 a patron of a given category can make, regardless of the item type.
514 <p>If the total amount loanable for a given patron category is left blank,
515 no limit applies, except possibly for a limit you define for a specific item type.
517 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
518 <input type="hidden" name="op" value="add-branch-cat" />
519 <input type="hidden" name="branch" value="[% current_branch %]"/>
522 <th>Patron category</th>
523 <th>Total current checkouts allowed</th>
524 <th>Total current on-site checkouts allowed</th>
527 [% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
528 [% UNLESS ( loop.odd ) %]
529 <tr class="highlight">
533 <td>[% IF ( branch_cat_rule_loo.default_humancategorycode ) %]
536 [% branch_cat_rule_loo.humancategorycode %]
539 <td>[% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %]
542 [% branch_cat_rule_loo.maxissueqty %]
545 <td>[% IF ( branch_cat_rule_loo.unlimited_maxonsiteissueqty ) %]
548 [% branch_cat_rule_loo.maxonsiteissueqty %]
553 <a class="btn btn-mini delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=[% branch_cat_rule_loo.categorycode %]&branch=[% current_branch %]"><i class="fa fa-trash"></i> Delete</a>
559 <select name="categorycode">
560 [% FOREACH patron_category IN patron_categories%]
561 <option value="[% patron_category.categorycode %]">[% patron_category.description %]</option>
565 <td><input name="maxissueqty" size="3" /></td>
566 <td><input name="maxonsiteissueqty" size="3" /></td>
567 <td class="actions"><button type="submit" class="btn btn-mini"><i class="fa fa-plus"></i> Add</td>
574 <div id="refund-lost-item-fee-on-return" class="container">
575 [% IF current_branch == '*' %]
576 <h3>Default lost item fee refund on return policy</h3>
578 <h3>Lost item fee refund on return policy for [% Branches.GetName(current_branch) %]</h3>
580 <p>Specify the default policy for lost item fees on return.
582 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
583 <input type="hidden" name="op" value="mod-refund-lost-item-fee-rule" />
584 <input type="hidden" name="branch" value="[% current_branch %]" />
587 <th>Refund lost item fee</th>
592 <select name="refund">
593 [#% Default branch %#]
594 [% IF ( current_branch == '*' ) %]
595 [% IF ( refundLostItemFeeRule.refund ) %]
596 <option value="1" selected="selected">
602 [% IF ( not refundLostItemFeeRule.refund ) %]
603 <option value="0" selected="selected">
610 [#% Branch-specific %#]
611 [% IF ( not refundLostItemFeeRule ) %]
612 <option value="*" selected="selected">
616 [% IF defaultRefundRule %]
622 [% IF ( not refundLostItemFeeRule ) %]
623 <option value="1">Yes</option>
624 <option value="0">No</option>
626 [% IF ( refundLostItemFeeRule.refund ) %]
627 <option value="1" selected="selected">
633 [% IF ( not refundLostItemFeeRule.refund ) %]
634 <option value="0" selected="selected">
645 <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
653 <div id="holds-policy-by-item-type" class="container">
654 <h3>[% IF humanbranch %]Holds policy by item type for [% Branches.GetName( humanbranch ) %][% ELSE %]Default holds policy by item type[% END %]</h3>
656 For this library, you can edit rules for given itemtypes, regardless
657 of the patron's category.
660 Currently, this means hold policies.
661 The various policies have the following effects:
664 <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
665 <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
666 <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
668 <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</br />
669 <strong>Important: </strong>The policies are based on the patron's home library, not the library where the hold is being placed.
672 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
673 <input type="hidden" name="op" value="add-branch-item" />
674 <input type="hidden" name="branch" value="[% current_branch %]"/>
679 <th>Hold pickup library match</th>
680 <th>Return policy</th>
683 [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
684 [% UNLESS ( loop.odd ) %]
685 <tr class="highlight">
689 <td>[% IF ( branch_item_rule_loo.default_translated_description ) %]
692 [% branch_item_rule_loo.translated_description %]
695 <td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
697 [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %]
703 <td>[% IF ( branch_item_rule_loo.hold_fulfillment_policy == 'any' ) %]
705 [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'homebranch' ) %]
707 [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'holdingbranch' ) %]
708 item's holding library
711 <td>[% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %]
713 [% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %]
714 Item returns to issuing branch
715 [% ELSIF ( branch_item_rule_loo.returnbranch == 'noreturn' ) %]
718 Error - unknown option
722 <a class="btn btn-mini delete" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&itemtype=[% branch_item_rule_loo.itemtype %]&branch=[% current_branch %]"><i class="fa fa-trash"></i> Delete</a>
728 <select name="itemtype">
729 [% FOREACH itemtypeloo IN itemtypeloop %]
730 <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
735 <select name="holdallowed">
736 <option value="2">From any library</option>
737 <option value="1">From home library</option>
738 <option value="0">No holds allowed</option>
742 <select name="hold_fulfillment_policy">
747 <option value="homebranch">
751 <option value="holdingbranch">
752 item's holding library
757 <select name="returnbranch">
758 <option value="homebranch">Item returns home</option>
759 <option value="holdingbranch">Item returns to issuing library</option>
760 <option value="noreturn">Item floats</option>
763 <td class="actions"><button type="submit" class="btn btn-mini"><i class="fa fa-plus"></i> Add</button></td>
772 [% INCLUDE 'admin-menu.inc' %]
775 [% INCLUDE 'intranet-bottom.inc' %]