Koha::CirculationRules - Koha CirculationRule Object set class
This structure describes the possible rules that may be set, and what scopes they can be set at.
Any attempt to set a rule with a nonsensical scope (for instance,
setting the patron_maxissueqty
for a branchcode and itemtype),
is an error.
my $effective_rule = Koha::CirculationRules->get_effective_rule( { rule_name => $name, categorycode => $categorycode, itemtype => $itemtype, branchcode => $branchcode } );
Return the effective rule object for the rule associated with the criteria passed.
my $effective_rule_value = Koha::CirculationRules->get_effective_rule_value( { rule_name => $name, categorycode => $categorycode, itemtype => $itemtype, branchcode => $branchcode } );
Return the effective value for the rule associated with the criteria passed.
This is a cached method so should be used in preference to get_effective_rule where possible to aid performance.
Delete a set of circulation rules, needed for cleaning up when deleting issuingrules
Clone a set of circulation rules to another branch
my $returnbranch = Koha::CirculationRules->get_return_branch_policy($item);
Returns the branch to use for returning the item based on the item type, and a branch selected via CircControlReturnsBranch.
The return value is the branch to which to return the item. Possible values: noreturn: do not return, let item remain where checked in (floating collections) homebranch: return to item's home branch holdingbranch: return to issuer branch
This searches branchitemrules in the following order: * Same branchcode and itemtype * Same branchcode, itemtype '*' * branchcode '*', same itemtype * branchcode '*' and itemtype '*'
my $can_place_a_hold_at_item_level = Koha::CirculationRules->get_opacitemholds_policy( { patron => $patron, item => $item } );
Return 'Y' or 'F' if the patron can place a hold on this item according to the issuing rules and the "Item level holds" (opacitemholds). Can be 'N' - Don't allow, 'Y' - Allow, and 'F' - Force
my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy({ item => $item, patron => $patron });
my $lost_proc_refund_policy = Koha::CirculationRules->get_lostreturn_policy( { return_branch => $return_branch, item => $item } );
lostreturn return values are:
processing return return values are:
Return rules that allow article requests, optionally filtered by patron categorycode. Use with care; see guess_article_requestable_itemtypes.
Return item types in a hashref that are likely possible to be 'article requested'. Constructed by an intelligent guess in the issuing rules (see article_requestable_rules). Note: pref ArticleRequestsLinkControl overrides the algorithm. Optional parameters: categorycode. Note: the routine is used in opac-search to obtain a reasonable estimate within performance borders (not looking at all items but just using default itemtype). Also we are not looking at the branchcode here, since home or holding branch of the item is leading and branch may be unknown too (anonymous opac session).
Return the value for daysmode defined in the circulation rules. If not defined (or empty string), the value of the system preference useDaysMode is returned