<title>Koha › Administration › Circulation and fine rules</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
+[% USE Branches %]
<script type="text/javascript">
//<![CDATA[
var type = $(this).attr("type");
if (type != "button" && type != "submit" ) {
$(this).val("");
- $(this).removeAttr("disabled");
+ $(this).prop('disabled', false);
+ }
+ if ( type == "checkbox" ) {
+ $(this).prop('checked', false);
}
});
- $(edit_row).find("select").removeAttr("disabled");
+ $(edit_row).find("select").prop('disabled', false);
$(edit_row).find("select option:first").attr("selected", "selected");
$(edit_row).find("td:last input[name='clear']").remove();
}
+var MSG_CONFIRM_DELETE = _("Are you sure you want to delete this rule? This cannot be undone.");
+
$(document).ready(function() {
+ $(".delete").on("click",function(){
+ return confirmDelete(MSG_CONFIRM_DELETE);
+ });
+
+ $('#cap_fine_to_replacement_price').on('change', function(){
+ $('#overduefinescap').prop('disabled', $(this).is(':checked') );
+ });
$('#selectlibrary').find("input:submit").hide();
$('#branch').change(function() {
$('#selectlibrary').submit();
itm = $(this).text();
itm = itm.replace(/^\s*|\s*$/g,'');
var current_column = $("#edit_row td:eq("+i+")");
- if ( i != 5 ) {
+ if ( i == 6 ) {
+ // specific processing for the Hard due date column
+ var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
+ var input_value = '';
+ if (typeof select_value === 'undefined'){
+ select_value = '-1';
+ }else {
+ input_value = itm.split(' ')[1];
+ }
+ $(current_column).find("input[type='text']").val(input_value);
+ $(current_column).find("select").val(select_value);
+ } else if ( i == 12 ) {
+ // specific processing for cap_fine_to_replacement_price
+ var cap_fine_to_replacement_price = $(this).find("input[type='checkbox']");
+ $('#cap_fine_to_replacement_price').prop('checked', cap_fine_to_replacement_price.is(':checked') );
+ $('#overduefinescap').prop('disabled', cap_fine_to_replacement_price.is(':checked') );
+ } else {
$(current_column).find("input[type='text']").val(itm);
// select the corresponding option
$(current_column).find("select option").each(function(){
- if ( $(this).text().toLowerCase() == itm.toLowerCase() ) {
+ opt = $(this).text().toLowerCase();
+ opt = opt.replace(/^\s*|\s*$/g,'');
+ if ( opt == itm.toLowerCase() ) {
$(this).attr('selected', 'selected');
}
});
// Remove potential previous input added
$(current_column).find("input").remove();
$(current_column).append("<input type='hidden' name='"+name+"' value='"+val+"' />");
- } else if ( i == 2 ) {
- // If the value is not an integer for "Current checkouts allowed"
+ } else if ( i == 2 || i == 3 ) {
+ // If the value is not an integer for "Current checkouts allowed" or "Current on-site checkouts allowed"
// The value is "Unlimited" (or an equivalent translated string)
// an it should be set to an empty string
if( !((parseFloat(itm) == parseInt(itm)) && !isNaN(itm)) ) {
$(current_column).find("input[type='text']").val("");
}
}
- } else {
- // specific processing for the Hard due date column
- var select_value = $(this).find("input[type='hidden'][name='hardduedatecomparebackup']").val();
- var input_value = '';
- if (typeof select_value === 'undefined'){
- select_value = '-1';
- }else {
- input_value = itm.split(' ')[1];
- }
- $(current_column).find("input[type='text']").val(input_value);
- $(current_column).find("select").val(select_value);
}
});
- $("#default-circulation-rules tr:last td:eq(0) select").attr('disabled', 'disabled');
- $("#default-circulation-rules tr:last td:eq(1) select").attr('disabled', 'disabled');
+ $("#default-circulation-rules tr:last td:eq(0) select").prop('disabled', true);
+ $("#default-circulation-rules tr:last td:eq(1) select").prop('disabled', true);
return false;
});
});
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
<input type="hidden" name="op" value="add" />
- <input type="hidden" name="branch" value="[% branch %]"/>
+ <input type="hidden" name="branch" value="[% current_branch %]"/>
<table id="default-circulation-rules">
<thead>
<tr>
<th>Patron category</th>
<th>Item type</th>
<th>Current checkouts allowed</th>
+ <th>Current on-site checkouts allowed</th>
<th>Loan period</th>
<th>Unit</th>
<th>Hard due date</th>
<th>Fine amount</th>
<th>Fine charging interval</th>
- <th>Fine grace period (day)</th>
- <th>Overdue Fines Cap ($)</th>
+ <th>When to charge</th>
+ <th>Fine grace period</th>
+ <th>Overdue fines cap (amount)</th>
+ <th>Cap fine at replacement price</th>
<th>Suspension in days (day)</th>
+ <th>Max. suspension duration (day)</th>
<th>Renewals allowed (count)</th>
+ <th>Renewal period</th>
+ <th>No renewal before</th>
+ <th>Automatic renewal</th>
<th>Holds allowed (count)</th>
+ <th>On shelf holds allowed</th>
+ <th>Item level holds</th>
<th>Rental discount (%)</th>
- <th colspan="2"> </th>
+ <th>Actions</th>
</tr>
</thead>
<tbody>
[% FOREACH rule IN rules %]
- [% UNLESS ( loop.odd ) %]
- <tr class="highlight" id="row_[% loop.count %]">
- [% ELSE %]
<tr id="row_[% loop.count %]">
- [% END %]
<td>[% IF ( rule.default_humancategorycode ) %]
<em>All</em>
[% ELSE %]
[% rule.humancategorycode %]
[% END %]
</td>
- <td>[% IF ( rule.default_humanitemtype ) %]
+ <td>[% IF rule.default_translated_description %]
<em>All</em>
[% ELSE %]
- [% rule.humanitemtype %]
+ [% rule.translated_description %]
[% END %]
</td>
<td>[% IF ( rule.unlimited_maxissueqty ) %]
[% rule.maxissueqty %]
[% END %]
</td>
+ <td>[% IF rule.unlimited_maxonsiteissueqty %]
+ Unlimited
+ [% ELSE %]
+ [% rule.maxonsiteissueqty %]
+ [% END %]
+ </td>
<td>[% rule.issuelength %]</td>
<td>
[% rule.lengthunit %]
</td>
<td>[% rule.fine %]</td>
<td>[% rule.chargeperiod %]</td>
+ <td>[% IF rule.chargeperiod_charge_at %]Start of interval[% ELSE %]End of interval[% END %]</td>
<td>[% rule.firstremind %]</td>
<td>[% rule.overduefinescap FILTER format("%.2f") %]</td>
+ <td>
+ [% IF rule.cap_fine_to_replacement_price %]
+ <input type="checkbox" checked="checked" disabled="disabled" />
+ [% ELSE %]
+ <input type="checkbox" disabled="disabled" />
+ [% END %]
+ </td>
<td>[% rule.finedays %]</td>
+ <td>[% rule.maxsuspensiondays %]</td>
<td>[% rule.renewalsallowed %]</td>
+ <td>[% rule.renewalperiod %]</td>
+ <td>[% rule.norenewalbefore %]</td>
+ <td>
+ [% IF ( rule.auto_renew ) %]
+ Yes
+ [% ELSE %]
+ No
+ [% END %]
+ </td>
<td>[% rule.reservesallowed %]</td>
+ <td>
+ [% IF rule.onshelfholds == 1 %]
+ Yes
+ [% ELSIF rule.onshelfholds == 2 %]
+ If all unavailable
+ [% ELSE %]
+ If any unavailable
+ [% END %]</td>
+ <td>[% IF rule.opacitemholds == 'F'%]Force[% ELSIF rule.opacitemholds == 'Y'%]Allow[% ELSE %]Don't allow[% END %]</td>
<td>[% rule.rentaldiscount %]</td>
- <td><a href="#" class="editrule">Edit</a></td>
- <td>
- <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete&itemtype=[% rule.itemtype %]&categorycode=[% rule.categorycode %]&branch=[% rule.current_branch %]">Delete</a>
+ <td class="actions">
+ <a href="#" class="editrule btn btn-mini"><i class="fa fa-pencil"></i> Edit</a>
+ <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>
</td>
</tr>
[% END %]
<select name="itemtype" id="matrixitemtype" style="width:13em;">
<option value="*">All</option>
[% FOREACH itemtypeloo IN itemtypeloop %]
- <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
+ <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
[% END %]
</select>
</td>
<td><input type="text" name="maxissueqty" id="maxissueqty" size="3" /></td>
+ <td><input type="text" name="maxonsiteissueqty" id="maxonsiteissueqty" size="3" /></td>
<td><input type="text" name="issuelength" id="issuelength" size="3" /> </td>
<td>
<select name="lengthunit" id="lengthunit">
- <option value="days" selected>Days</option>
+ <option value="days" selected="selected">Days</option>
<option value="hours">Hours</option>
</select>
</td>
</td>
<td><input type="text" name="fine" id="fine" size="4" /></td>
<td><input type="text" name="chargeperiod" id="chargeperiod" size="2" /></td>
+ <td>
+ <select name="chargeperiod_charge_at" id="chargeperiod_charge_at">
+ <option value="0">End of interval</option>
+ <option value="1">Start of interval</option>
+ </select>
+ </td>
<td><input type="text" name="firstremind" id="firstremind" size="2" /> </td>
<td><input type="text" name="overduefinescap" id="overduefinescap" size="6" /> </td>
+ <td><input type="checkbox" name="cap_fine_to_replacement_price" id="cap_fine_to_replacement_price" /></td>
<td><input type="text" name="finedays" id="fined" size="3" /> </td>
+ <td><input type="text" name="maxsuspensiondays" id="maxsuspensiondays" size="3" /> </td>
<td><input type="text" name="renewalsallowed" id="renewalsallowed" size="2" /></td>
+ <td><input type="text" name="renewalperiod" id="renewalperiod" size="3" /></td>
+ <td><input type="text" name="norenewalbefore" id="norenewalbefore" size="3" /></td>
+ <td>
+ <select name="auto_renew" id="auto_renew">
+ <option value="no" selected>No</option>
+ <option value="yes">Yes</option>
+ </select>
+ </td>
<td><input type="text" name="reservesallowed" id="reservesallowed" size="2" /></td>
+ <td>
+ <select name="onshelfholds" id="onshelfholds">
+ <option value="1">Yes</option>
+ <option value="0">If any unavailable</option>
+ <option value="2">If all unavailable</option>
+ </select>
+ </td>
+ <td>
+ <select id="opacitemholds" name="opacitemholds">
+ <option value="N">Don't allow</option>
+ <option value="Y">Allow</option>
+ <option value="F">Force</option>
+ </select>
+ </td>
<td><input type="text" name="rentaldiscount" id="rentaldiscount" size="2" /></td>
- <td colspan="2">
+ <td class="actions">
<input type="hidden" name="branch" value="[% current_branch %]"/>
- <input type="submit" value="Save" class="submit" />
- <input type="button" name="cancel" value="Clear" onclick="clear_edit();return false;" />
+ <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
+ <button name="cancel" onclick="clear_edit();return false;" class="btn btn-mini"><i class="fa fa-undo"></i> Clear</button>
</td>
</tr>
+ <tfoot>
+ <tr>
+ <th>Patron category</th>
+ <th>Item type</th>
+ <th>Current checkouts allowed</th>
+ <th>Current on-site checkouts allowed</th>
+ <th>Loan period</th>
+ <th>Unit</th>
+ <th>Hard due date</th>
+ <th>Fine amount</th>
+ <th>Fine charging interval</th>
+ <th>Charge when?</th>
+ <th>Fine grace period</th>
+ <th>Overdue fines cap (amount)</th>
+ <th>Cap fine at replacement price</th>
+ <th>Suspension in days (day)</th>
+ <th>Max. suspension duration (day)</th>
+ <th>Renewals allowed (count)</th>
+ <th>Renewal period</th>
+ <th>No renewal before</th>
+ <th>Automatic renewal</th>
+ <th>Holds allowed (count)</th>
+ <th>On shelf holds allowed</th>
+ <th>Item level holds</th>
+ <th>Rental discount (%)</th>
+ <th colspan="2"> </th>
+ </tr>
+ </tfoot>
</tbody>
</table>
</form>
<tr>
<th> </th>
<th>Total current checkouts allowed</th>
+ <th>Total current on-site checkouts allowed</th>
<th>Hold policy</th>
+ <th>Hold pickup library match</th>
<th>Return policy</th>
- <th> </th>
- <th> </th>
+ <th>Actions</th>
</tr>
<tr>
<td><em>Defaults[% UNLESS ( default_rules ) %] (not set)[% END %]</em></td>
<td><input type="text" name="maxissueqty" size="3" value="[% default_maxissueqty %]"/></td>
+ <td><input type="text" name="maxonsiteissueqty" size="3" value="[% default_maxonsiteissueqty %]"/></td>
<td>
<select name="holdallowed">
[% IF ( default_holdallowed_any ) %]
</option>
</select>
</td>
+ <td>
+ <select name="hold_fulfillment_policy">
+ [% IF default_hold_fulfillment_policy == 'any' %]
+ <option value="any" selected="selected">
+ any library
+ </option>
+ [% ELSE %]
+ <option value="any">
+ any library
+ </option>
+ [% END %]
+
+ [% IF default_hold_fulfillment_policy == 'homebranch' %]
+ <option value="homebranch" selected="selected">
+ item's home library
+ </option>
+ [% ELSE %]
+ <option value="homebranch">
+ item's home library
+ </option>
+ [% END %]
+
+ [% IF default_hold_fulfillment_policy == 'holdingbranch' %]
+ <option value="holdingbranch" selected="selected">
+ item's holding library
+ </option>
+ [% ELSE %]
+ <option value="holdingbranch">
+ item's holding library
+ </option>
+ [% END %]
+ </select>
+ </td>
<td>
<select name="returnbranch">
[% IF ( default_returnbranch == 'homebranch' ) %]
</option>
</select>
</td>
- <td><input type="submit" value="Save" class="submit" /></td>
- <td>
- <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=*&branch=[% current_branch %]">Unset</a>
+ <td class="actions">
+ <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
+ <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>
</td>
</tr>
</table>
<tr>
<th>Patron category</th>
<th>Total current checkouts allowed</th>
+ <th>Total current on-site checkouts allowed</th>
<th> </th>
</tr>
[% FOREACH branch_cat_rule_loo IN branch_cat_rule_loop %]
[% branch_cat_rule_loo.maxissueqty %]
[% END %]
</td>
- <td>
- <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-cat&categorycode=[% branch_cat_rule_loo.categorycode %]&branch=[% current_branch %]">Delete</a>
+ <td>[% IF ( branch_cat_rule_loo.unlimited_maxonsiteissueqty ) %]
+ Unlimited
+ [% ELSE %]
+ [% branch_cat_rule_loo.maxonsiteissueqty %]
+ [% END %]
+ </td>
+
+ <td class="actions">
+ <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>
</td>
</tr>
[% END %]
</select>
</td>
<td><input name="maxissueqty" size="3" /></td>
- <td><input type="submit" value="Add" class="submit" /></td>
+ <td><input name="maxonsiteissueqty" size="3" /></td>
+ <td class="actions"><button type="submit" class="btn btn-mini"><i class="fa fa-plus"></i> Add</td>
</tr>
</table>
</form>
</div>
[% END %]
+
+ <div id="refund-lost-item-fee-on-return" class="container">
+ [% IF current_branch == '*' %]
+ <h3>Default lost item fee refund on return policy</h3>
+ [% ELSE %]
+ <h3>Lost item fee refund on return policy for [% Branches.GetName(current_branch) %]</h3>
+ [% END %]
+ <p>Specify the default policy for lost item fees on return.
+ </p>
+ <form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
+ <input type="hidden" name="op" value="mod-refund-lost-item-fee-rule" />
+ <input type="hidden" name="branch" value="[% current_branch %]" />
+ <table>
+ <tr>
+ <th>Refund lost item fee</th>
+ <th> </th>
+ </tr>
+ <tr>
+ <td>
+ <select name="refund">
+ [#% Default branch %#]
+ [% IF ( current_branch == '*' ) %]
+ [% IF ( refundLostItemFeeRule.refund ) %]
+ <option value="1" selected="selected">
+ [% ELSE %]
+ <option value="1">
+ [% END %]
+ Yes
+ </option>
+ [% IF ( not refundLostItemFeeRule.refund ) %]
+ <option value="0" selected="selected">
+ [% ELSE %]
+ <option value="0">
+ [% END %]
+ No
+ </option>
+ [% ELSE %]
+ [#% Branch-specific %#]
+ [% IF ( not refundLostItemFeeRule ) %]
+ <option value="*" selected="selected">
+ [% ELSE %]
+ <option value="*">
+ [% END %]
+ [% IF defaultRefundRule %]
+ Use default (Yes)
+ [% ELSE %]
+ Use default (No)
+ [% END %]
+ </option>
+ [% IF ( not refundLostItemFeeRule ) %]
+ <option value="1">Yes</option>
+ <option value="0">No</option>
+ [% ELSE %]
+ [% IF ( refundLostItemFeeRule.refund ) %]
+ <option value="1" selected="selected">
+ [% ELSE %]
+ <option value="1">
+ [% END %]
+ Yes
+ </option>
+ [% IF ( not refundLostItemFeeRule.refund ) %]
+ <option value="0" selected="selected">
+ [% ELSE %]
+ <option value="0">
+ [% END %]
+ No
+ </option>
+ [% END %]
+ [% END %]
+ </select>
+ </td>
+ <td class="actions">
+ <button type="submit" class="btn btn-mini"><i class="fa fa-save"></i> Save</button>
+ </td>
+ </td>
+ </tr>
+ </table>
+ </form>
+ </div>
+
<div id="holds-policy-by-item-type" class="container">
<h3>[% IF humanbranch %]Holds policy by item type for [% humanbranch %][% ELSE %]Default holds policy by item type[% END %]</h3>
<p>
<li><strong>From home library:</strong> Only patrons from the item's home library may put this book on hold.</li>
<li><strong>No holds allowed:</strong> No patron may put this book on hold.</li>
</ul>
- <p>
- Note that if the system preference
- <code>AllowHoldPolicyOverride</code> is enabled, these policies can
- be overridden by your circulation staff. Also, these policies are
- based on the patron's home library, <em>not</em> the library where the hold is being placed..
+ <p><strong>Note: </strong>If the system preference 'AllowHoldPolicyOverride' is enabled, these policies can be overridden by your circulation staff.</br />
+ <strong>Important: </strong>The policies are based on the patron's home library, not the library where the hold is being placed.
</p>
<form method="post" action="/cgi-bin/koha/admin/smart-rules.pl">
<tr>
<th>Item type</th>
<th>Hold policy</th>
+ <th>Hold pickup library match</th>
<th>Return policy</th>
<th> </th>
</tr>
[% ELSE %]
<tr>
[% END %]
- <td>[% IF ( branch_item_rule_loo.default_humanitemtype ) %]
+ <td>[% IF ( branch_item_rule_loo.default_translated_description ) %]
<em>Default</em>
[% ELSE %]
- [% branch_item_rule_loo.humanitemtype %]
+ [% branch_item_rule_loo.translated_description %]
[% END %]
</td>
<td>[% IF ( branch_item_rule_loo.holdallowed_any ) %]
No holds allowed
[% END %]
</td>
+ <td>[% IF ( branch_item_rule_loo.hold_fulfillment_policy == 'any' ) %]
+ any library
+ [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'homebranch' ) %]
+ item's home library
+ [% ELSIF ( branch_item_rule_loo.hold_fulfillment_policy == 'holdingbranch' ) %]
+ item's holding library
+ [% END %]
+ </td>
<td>[% IF ( branch_item_rule_loo.returnbranch == 'homebranch' ) %]
Item returns home
[% ELSIF ( branch_item_rule_loo.returnbranch == 'holdingbranch' ) %]
Error - unknown option
[% END %]
</td>
- <td>
- <a class="button" href="/cgi-bin/koha/admin/smart-rules.pl?op=delete-branch-item&itemtype=[% branch_item_rule_loo.itemtype %]&branch=[% current_branch %]">Delete</a>
+ <td class="actions">
+ <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>
</td>
</tr>
[% END %]
<td>
<select name="itemtype">
[% FOREACH itemtypeloo IN itemtypeloop %]
- <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.description %]</option>
+ <option value="[% itemtypeloo.itemtype %]">[% itemtypeloo.translated_description %]</option>
[% END %]
</select>
</td>
<option value="0">No holds allowed</option>
</select>
</td>
+ <td>
+ <select name="hold_fulfillment_policy">
+ <option value="any">
+ any library
+ </option>
+
+ <option value="homebranch">
+ item's home library
+ </option>
+
+ <option value="holdingbranch">
+ item's holding library
+ </option>
+ </select>
+ </td>
<td>
<select name="returnbranch">
<option value="homebranch">Item returns home</option>
<option value="noreturn">Item floats</option>
</select>
</td>
- <td><input type="submit" value="Add" class="submit" /></td>
+ <td class="actions"><button type="submit" class="btn btn-mini"><i class="fa fa-plus"></i> Add</button></td>
</tr>
</table>
</form>