Bug 15532: Add ability to allow only items whose home/holding branch matches the...
authorKyle M Hall <kyle@bywatersolutions.com>
Sat, 19 Dec 2015 11:34:03 +0000 (11:34 +0000)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 29 Apr 2016 09:49:07 +0000 (09:49 +0000)
commit456348aba9a13413b0409f11d21d5f0133f498fe
treeaa2bb669b5ece4b579d2f29159e0559df901dec5
parent2026be47fd79fb15f1e9fb83be34403e8eb18079
Bug 15532: Add ability to allow only items whose home/holding branch matches the hold's pickup branch to fill a given hold

Some libraries would like to be able to limit hold filling to items that
match the pickup library for a hold based on the item's home or holding
library. The patron's home library should not affect whether a patron
can place the hold, instead the hold will only be fillable when an item
matching the pickup location becomes available.

Test Plan:
1) Apply this patch
2) Run updatedatabase.pl
3) Note the new "Hold pickup library match" rules for "checkout, hold,
   and return policy" and for "holds policy by item type"
4) Set the policy to "item's holding library"
5) Place a hold where the item's holding branch does not match
   the pickup branch
6) Check in the item
7) Note it is not trapped for the hold
8) Update the item's holding branch to match the pickup branch
8) Check in the item
9) Note the item is trapped for the hold
10) Repeat steps 4-9 but for home branch instead

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>
Works as described

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
C4/Circulation.pm
C4/HoldsQueue.pm
C4/Reserves.pm
admin/smart-rules.pl
installer/data/mysql/atomicupdate/hold_fulfillment_policy.sql [new file with mode: 0644]
installer/data/mysql/kohastructure.sql
koha-tmpl/intranet-tmpl/prog/en/modules/admin/smart-rules.tt
t/db_dependent/Holds/HoldFulfillmentPolicy.t [new file with mode: 0755]
t/db_dependent/HoldsQueue.t