1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha › Administration › Circulation and fine rules</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript">
9 var cancel = confirm(_("Are you sure you want to cancel your changes?"));
10 if ( !cancel ) return;
11 $('#default-circulation-rules td').removeClass('highlighted-row');
12 var edit_row = $("#edit_row");
13 $(edit_row).find("input").each(function(){
14 var type = $(this).attr("type");
15 if (type != "button" && type != "submit" ) {
17 $(this).removeAttr("disabled");
19 if ( type == "checkbox" ) {
20 $(this).attr('checked', false);
23 $(edit_row).find("select").removeAttr("disabled");
24 $(edit_row).find("select option:first").attr("selected", "selected");
25 $(edit_row).find("td:last input[name='clear']").remove();
28 var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone.");
30 $(document).ready(function() {
31 $(".delete").on("click",function(){
32 return confirmDelete(MSG_CONFIRM_DELETE);
35 $('#cap_fine_to_replacement_price').on('change', function(){
36 $('#overduefinescap').prop('disabled', $(this).is(':checked') );
38 $('#selectlibrary').find("input:submit").hide();
39 $('#branch').change(function() {
40 $('#selectlibrary').submit();
42 $(".editrule").click(function(){
43 if ( $(edit_row).find("input[type='text'][value!='']").length > 0 ) {
44 var edit = confirm(_("Are you sure you want to edit another rule?"));
45 if (!edit) return false;
47 $('#default-circulation-rules td').removeClass('highlighted-row');
48 $(this).parent().parent().find("td").each(function (i) {
49 $(this).addClass('highlighted-row');
51 itm = itm.replace(/^\s*|\s*$/g,'');
52 var current_column = $("#edit_row td:eq("+i+")");
54 // specific processing for the Hard due date column
55 var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
57 if (typeof select_value === 'undefined'){
60 input_value = itm.split(' ')[1];
62 $(current_column).find("input[type='text']").val(input_value);
63 $(current_column).find("select").val(select_value);
64 } else if ( i == 12 ) {
65 // specific processing for cap_fine_to_replacement_price
66 var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
67 $('#cap_fine_to_replacement_price').attr('checked', cap_fine_to_replacement_price.is(':checked') );
68 $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
70 $(current_column).find("input[type='text']").val(itm);
71 // select the corresponding option
72 $(current_column).find("select option").each(function(){
73 opt = $(this).text().toLowerCase();
74 opt = opt.replace(/^\s*|\s*$/g,'');
75 if ( opt == itm.toLowerCase() ) {
76 $(this).attr('selected', 'selected');
79 if ( i == 0 || i == 1 ) {
80 // Disable the 2 first columns, we cannot update them.
81 var val = $(current_column).find("select option:selected").val();
82 var name = "categorycode";
86 // Remove potential previous input added
87 $(current_column).find("input").remove();
88 $(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
89 } else if ( i == 2 || i == 3 ) {
90 // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
91 // The value is "Unlimited" (or an equivalent translated string)
92 // an it should be set to an empty string
93 if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
94 $(current_column).find("input[type='text']").val("");
99 $("#default-circulation-rules tr:last td:eq(0) select").attr('disabled', 'disabled');
100 $("#default-circulation-rules tr:last td:eq(1) select").attr('disabled', 'disabled');
107 <body id="admin_smart-rules" class="admin">
108 [% INCLUDE 'header.inc' %]
109 [% INCLUDE 'cat-search.inc' %]
111 <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>
113 <div id="doc3" class="yui-t1">
118 <h1 class="parameters">
119 [% IF ( humanbranch ) %]
120 Defining circulation and fine rules for "[% humanbranch %]"
122 Defining circulation and fine rules for all libraries
126 <p>The rules are applied from most specific to less specific, using the first found in this order:</p>
128 <li>same library, same patron type, same item type</li>
129 <li>same library, same patron type, all item types</li>
130 <li>same library, all patron types, same item type</li>
131 <li>same library, all patron types, all item types</li>
132 <li>default (all libraries), same patron type, same item type</li>
133 <li>default (all libraries), same patron type, all item types</li>
134 <li>default (all libraries), all patron types, same item type</li>
135 <li>default (all libraries), all patron types, all item types</li>
137 <p>To modify a rule, create a new one with the same patron type and item type.</p>
140 <form method="get" action="/cgi-bin/koha/admin/smart-rules.pl" id="selectlibrary">
142 <select name="branch" id="branch" style="width:20em;">
143 <option value="*">All libraries</option>
144 [% FOREACH branchloo IN branchloop %]
145 [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option>[% ELSE %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]
149 [% IF ( definedbranch ) %]<form action="/cgi-bin/koha/admin/clone-rules.pl" method="post"><label
150 for="tobranch"><strong>Clone these rules to:</strong></label> <input type="hidden" name="frombranch" value="[% current_branch %]" />
151 <select name="tobranch" id="tobranch">[% FOREACH branchloo IN branchloop %]<option value="[% branchloo.value %]">[% branchloo.branchname %]</option>[% END %]</select> <input type="submit" value="Clone" /></form>[% END %]
153 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
154 <input type="hidden" name="op" value="add" />
155 <input type="hidden" name="branch" value="[% current_branch %]"/>
156 <table id="default-circulation-rules">
159 <th>Patron category</th>
161 <th>Current checkouts allowed</th>
162 <th>Current on-site checkouts allowed</th>
165 <th>Hard due date</th>
167 <th>Fine charging interval</th>
168 <th>When to charge</th>
169 <th>Fine grace period</th>
170 <th>Overdue fines cap (amount)</th>
171 <th>Cap fine at replacement price</th>
172 <th>Suspension in days (day)</th>
173 <th>Max. suspension duration (day)</th>
174 <th>Renewals allowed (count)</th>
175 <th>Renewal period</th>
176 <th>No renewal before</th>
177 <th>Automatic renewal</th>
178 <th>Holds allowed (count)</th>
179 <th>On shelf holds allowed</th>
180 <th>Item level holds</th>
181 <th>Rental discount (%)</th>
186 [% FOREACH rule IN rules %]
187 <tr id="row_[% loop.count %]">
188 <td>[% IF ( rule.default_humancategorycode ) %]
191 [% rule.humancategorycode %]
194 <td>[% IF rule.default_translated_description %]
197 [% rule.translated_description %]
200 <td>[% IF ( rule.unlimited_maxissueqty ) %]
203 [% rule.maxissueqty %]
206 <td>[% IF rule.unlimited_maxonsiteissueqty %]
209 [% rule.maxonsiteissueqty %]
212 <td>[% rule.issuelength %]</td>
214 [% rule.lengthunit %]
217 [% IF ( rule.hardduedate ) %]
218 [% IF ( rule.hardduedatebefore ) %]
219 before [% rule.hardduedate %]
220 <input type="hidden" name="hardduedatecomparebackup" value="-1" />
221 [% ELSIF ( rule.hardduedateexact ) %]
222 on [% rule.hardduedate %]
223 <input type="hidden" name="hardduedatecomparebackup" value="0" />
224 [% ELSIF ( rule.hardduedateafter ) %]
225 after [% rule.hardduedate %]
226 <input type="hidden" name="hardduedatecomparebackup" value="1" />
232 <td>[% rule.fine %]</td>
233 <td>[% rule.chargeperiod %]</td>
234 <td>[% IF rule.chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
235 <td>[% rule.firstremind %]</td>
236 <td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
238 [% IF rule.cap_fine_to_replacement_price %]
239 <input type="checkbox" checked="checked" disabled="disabled" />
241 <input type="checkbox" disabled="disabled" />
244 <td>[% rule.finedays %]</td>
245 <td>[% rule.maxsuspensiondays %]</td>
246 <td>[% rule.renewalsallowed %]</td>
247 <td>[% rule.renewalperiod %]</td>
248 <td>[% rule.norenewalbefore %]</td>
250 [% IF ( rule.auto_renew ) %]
256 <td>[% rule.reservesallowed %]</td>
258 [% IF rule.onshelfholds == 1 %]
260 [% ELSIF rule.onshelfholds == 2 %]
265 <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
266 <td>[% rule.rentaldiscount %]</td>
268 <a href="#" class="editrule btn btn-mini"><i class="fa fa-pencil"></i> Edit</a>
269 <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>
275 <select name="categorycode" id="categorycode">
276 <option value="*">All</option>
277 [% FOREACH categoryloo IN categoryloop %]
278 <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
283 <select name="itemtype" id="matrixitemtype" style="width:13em;">
284 <option value="*">All</option>
285 [% FOREACH itemtypeloo IN itemtypeloop %]
286 <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
290 <td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
291 <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
292 <td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
294 <select name="lengthunit" id="lengthunit">
295 <option value="days" selected="selected">Days</option>
296 <option value="hours">Hours</option>
300 <select name="hardduedatecompare" id="hardduedatecompare">
301 <option value="-1">Before</option>
302 <option value="0">Exactly on</option>
303 <option value="1">After</option>
305 <input type="text" size="10" id="hardduedate" name="hardduedate" value="[% hardduedate %]" class="datepicker" />
306 <div class="hint">[% INCLUDE 'date-format.inc' %]</div>
308 <td><input type="text" name="fine" id="fine" size="4" /></td>
309 <td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td>
311 <select name="chargeperiod_charge_at" id="chargeperiod_charge_at">
312 <option value="0">End of interval</option>
313 <option value="1">Start of interval</option>
316 <td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
317 <td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td>
318 <td><input type="checkbox" name="cap_fine_to_replacement_price" id="cap_fine_to_replacement_price" /></td>
319 <td><input type="text" name="finedays" id="fined" size="3" /> </td>
320 <td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td>
321 <td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
322 <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
323 <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td>
325 <select name="auto_renew" id="auto_renew">
326 <option value="no" selected>No</option>
327 <option value="yes">Yes</option>
330 <td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
332 <select name="onshelfholds" id="onshelfholds">
333 <option value="1">Yes</option>
334 <option value="0">If any unavailable</option>
335 <option value="2">If all unavailable</option>
339 <select id="opacitemholds" name="opacitemholds">
340 <option value="N">Don't allow</option>
341 <option value="Y">Allow</option>
342 <option value="F">Force</option>
345 <td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
347 <input type="hidden" name="branch" value="[% current_branch %]"/>
348 <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
349 <button name="cancel" onclick="clear_edit();return false;" class="btn btn-mini"><i class="fa fa-undo"></i> Clear</button>
354 <th>Patron category</th>
356 <th>Current checkouts allowed</th>
357 <th>Current on-site checkouts allowed</th>
360 <th>Hard due date</th>
362 <th>Fine charging interval</th>
363 <th>Charge when?</th>
364 <th>Fine grace period</th>
365 <th>Overdue fines cap (amount)</th>
366 <th>Cap fine at replacement price</th>
367 <th>Suspension in days (day)</th>
368 <th>Max. suspension duration (day)</th>
369 <th>Renewals allowed (count)</th>
370 <th>Renewal period</th>
371 <th>No renewal before</th>
372 <th>Automatic renewal</th>
373 <th>Holds allowed (count)</th>
374 <th>On shelf holds allowed</th>
375 <th>Item level holds</th>
376 <th>Rental discount (%)</th>
377 <th colspan="2"> </th>
384 <div id="defaults-for-this-library" class="container">
385 <h3>Default checkout, hold and return policy[% IF ( humanbranch ) %] for [% humanbranch %][% END %]</h3>
386 <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>
387 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
388 <input type="hidden" name="op" value="set-branch-defaults" />
389 <input type="hidden" name="branch" value="[% current_branch %]"/>
393 <th>Total current checkouts allowed</th>
394 <th>Total current on-site checkouts allowed</th>
396 <th>Hold pickup library match</th>
397 <th>Return policy</th>
401 <td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
402 <td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
403 <td><input type="text" name="maxonsiteissueqty" size="3" value="[% default_maxonsiteissueqty %]"/></td>
405 <select name="holdallowed">
406 [% IF ( default_holdallowed_any ) %]
407 <option value="2" selected="selected">
413 [% IF ( default_holdallowed_same ) %]
414 <option value="1" selected="selected">
420 [% IF ( default_holdallowed_none ) %]
421 <option value="0" selected="selected">
430 <select name="hold_fulfillment_policy">
431 [% IF default_hold_fulfillment_policy == 'any' %]
432 <option value="any" selected="selected">
441 [% IF default_hold_fulfillment_policy == 'homebranch' %]
442 <option value="homebranch" selected="selected">
446 <option value="homebranch">
451 [% IF default_hold_fulfillment_policy == 'holdingbranch' %]
452 <option value="holdingbranch" selected="selected">
453 item's holding library
456 <option value="holdingbranch">
457 item's holding library
463 <select name="returnbranch">
464 [% IF ( default_returnbranch == 'homebranch' ) %]
465 <option value="homebranch" selected="selected">
467 <option value="homebranch">
471 [% IF ( default_returnbranch == 'holdingbranch' ) %]
472 <option value="holdingbranch" selected="selected">
474 <option value="holdingbranch">
476 Item returns to issuing library
478 [% IF ( default_returnbranch == 'noreturn' ) %]
479 <option value="noreturn" selected="selected">
481 <option value="noreturn">
488 <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
489 <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>
495 [% IF ( show_branch_cat_rule_form ) %]
496 <div id="holds-policy-by-patron-category" class="container">
497 <h3>[% IF humanbranch %]Checkout limit by patron category for [% humanbranch %][% ELSE %]Default checkout limit by patron category[% END %]</h3>
498 <p>For this library, you can specify the maximum number of loans that
499 a patron of a given category can make, regardless of the item type.
501 <p>If the total amount loanable for a given patron category is left blank,
502 no limit applies, except possibly for a limit you define for a specific item type.
504 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
505 <input type="hidden" name="op" value="add-branch-cat" />
506 <input type="hidden" name="branch" value="[% current_branch %]"/>
509 <th>Patron category</th>
510 <th>Total current checkouts allowed</th>
511 <th>Total current on-site checkouts allowed</th>
514 [% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
515 [% UNLESS ( loop.odd ) %]
516 <tr class="highlight">
520 <td>[% IF ( branch_cat_rule_loo.default_humancategorycode ) %]
523 [% branch_cat_rule_loo.humancategorycode %]
526 <td>[% IF ( branch_cat_rule_loo.unlimited_maxissueqty ) %]
529 [% branch_cat_rule_loo.maxissueqty %]
532 <td>[% IF ( branch_cat_rule_loo.unlimited_maxonsiteissueqty ) %]
535 [% branch_cat_rule_loo.maxonsiteissueqty %]
540 <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>
546 <select name="categorycode">
547 [% FOREACH categoryloo IN categoryloop %]
548 <option value="[% categoryloo.categorycode %]">[% categoryloo.description %]</option>
552 <td><input name="maxissueqty" size="3" /></td>
553 <td><input name="maxonsiteissueqty" size="3" /></td>
554 <td class="actions"><button type="submit" class="btn btn-mini"><i class="fa fa-plus"></i> Add</td>
560 <div id="holds-policy-by-item-type" class="container">
561 <h3>[% IF humanbranch %]Holds policy by item type for [% humanbranch %][% ELSE %]Default holds policy by item type[% END %]</h3>
563 For this library, you can edit rules for given itemtypes, regardless
564 of the patron's category.
567 Currently, this means hold policies.
568 The various policies have the following effects:
571 <li><strong>From any library:</strong> Patrons from any library may put this item on hold. <cite>(default if none is defined)</cite></li>
572 <li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
573 <li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
575 <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</br />
576 <strong>Important: </strong>The policies are based on the patron's home library, not the library where the hold is being placed.
579 <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
580 <input type="hidden" name="op" value="add-branch-item" />
581 <input type="hidden" name="branch" value="[% current_branch %]"/>
586 <th>Hold pickup library match</th>
587 <th>Return policy</th>
590 [% FOREACH branch_item_rule_loo IN branch_item_rule_loop %]
591 [% UNLESS ( loop.odd ) %]
592 <tr class="highlight">
596 <td>[% IF ( branch_item_rule_loo.default_translated_description ) %]
599 [% branch_item_rule_loo.translated_description %]
602 <td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
604 [% ELSIF ( branch_item_rule_loo.holdallowed_same ) %]
610 <td>[% IF ( branch_item_rule_loo.hold_fulfillment_policy == 'any' ) %]
612 [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'homebranch' ) %]
614 [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'holdingbranch' ) %]
615 item's holding library
618 <td>[% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %]
620 [% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %]
621 Item returns to issuing branch
622 [% ELSIF ( branch_item_rule_loo.returnbranch == 'noreturn' ) %]
625 Error - unknown option
629 <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>
635 <select name="itemtype">
636 [% FOREACH itemtypeloo IN itemtypeloop %]
637 <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
642 <select name="holdallowed">
643 <option value="2">From any library</option>
644 <option value="1">From home library</option>
645 <option value="0">No holds allowed</option>
649 <select name="hold_fulfillment_policy">
654 <option value="homebranch">
658 <option value="holdingbranch">
659 item's holding library
664 <select name="returnbranch">
665 <option value="homebranch">Item returns home</option>
666 <option value="holdingbranch">Item returns to issuing library</option>
667 <option value="noreturn">Item floats</option>
670 <td class="actions"><button type="submit" class="btn btn-mini"><i class="fa fa-plus"></i> Add</button></td>
679 [% INCLUDE 'admin-menu.inc' %]
682 [% INCLUDE 'intranet-bottom.inc' %]