Enhancement 7144: Floating Collections (per branch/itemtype)
authorIan Walls <ian.walls@bywatersolutions.com>
Mon, 12 Dec 2011 17:15:35 +0000 (12:15 -0500)
committerPaul Poulain <paul.poulain@biblibre.com>
Wed, 21 Mar 2012 09:28:26 +0000 (10:28 +0100)
commitd92c595dc434b4761f358ce370f6579d1ca98153
tree6329f2d0d8409f637d74aedd7bac4b3b446c84ea
parentd266ccb81f7fa64d9a12ff20ca5b4e9388c3302c
Enhancement 7144: Floating Collections (per branch/itemtype)

Adds support for Floating Collections (i.e. items that don't automatically return
home when checked in at another branch) on a per branchcode/itemtype basis.

This patch adds a new column (returnbranch) to the default_circ_rules, default_branch_item_rules,
default_branch_circ_rules and branch_item_rules tables, after the 'holdsallowed' column.  While
this is coded as a varchar(15), the only currently supported values are 'homebranch', 'holdingbranch',
'noreturn' and NULL.

On upgrade, the value of HomeOrHoldingBranchReturn is used to populate the global default (which is
stored in default_circ_rules.returnbranch).

To access this value, use C4::Circulation::GetBranchItemRule.  This subroutine is altered to supply
an additional key, "returnbranch", containing this value (or 'homebranch' as a default).  No existing
usage of GetBranchItemRule should need to be modified.

The use of HomeOrHoldingBranchReturn is removed in AddReturn to instead use this subroutine.  This will
determine, on a more granular level, where the item should be transferred, after all is said and done.  If
'noreturn' is specified, then the material will remain at the branch doing the checking in.

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Passes prove t xt t/db_dependent

I was able to make this feature work as advertised.
As noted above, if you want a floating rule applied across all branches, adding a single default rule won't suffice, you'll need to add the rule to all branches. That issue is not related to the functioning of *this* patch however.
C4/Circulation.pm
admin/smart-rules.pl
installer/data/mysql/atomicupdate/bug_7144-add-returnbranch-to-branch-item-issuing-rules.pl [new file with mode: 0644]
installer/data/mysql/kohastructure.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt