<<

NAME

Koha::CirculationRules - Koha CirculationRule Object set class

API

Class Methods

rule_kinds

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.

get_effective_rule

  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.

get_effective_rule_value

  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.

get_effective_rules

set_rule

set_rules

delete

Delete a set of circulation rules, needed for cleaning up when deleting issuingrules

clone

Clone a set of circulation rules to another branch

get_return_branch_policy

  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 '*'

get_opacitemholds_policy

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

get_onshelfholds_policy

    my $on_shelf_holds = Koha::CirculationRules->get_onshelfholds_policy({ item => $item, patron => $patron });

get_lostreturn_policy

  my $lost_proc_refund_policy = Koha::CirculationRules->get_lostreturn_policy( { return_branch => $return_branch, item => $item } );

lostreturn return values are:

'0' - Do not refund
'refund' - Refund the lost item charge
'restore' - Refund the lost item charge and restore the original overdue fine
'charge' - Refund the lost item charge and charge a new overdue fine

processing return return values are:

'0' - Do not refund
'refund' - Refund the lost item processing charge
'restore' - Refund the lost item processing charge and restore the original overdue fine
'charge' - Refund the lost item processing charge and charge a new overdue fine

article_requestable_rules

    Return rules that allow article requests, optionally filtered by
    patron categorycode.

    Use with care; see guess_article_requestable_itemtypes.

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).

get_effective_daysmode

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

type

object_class

<<