Bug 15486: Extend CanItemBeReserved so it handles daily holds limits
authorTomas Cohen Arazi <tomascohen@theke.io>
Wed, 19 Jul 2017 21:14:19 +0000 (18:14 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Wed, 24 Oct 2018 13:24:05 +0000 (13:24 +0000)
commitfb0ab55fd09457a4d7559d2af9774de9456bb2f2
treee491e5be5653de97acf3d67241170fb6c16b9cc5
parentdad1324b1b25ac018dad84176537c298edffa75d
Bug 15486: Extend CanItemBeReserved so it handles daily holds limits

This patch implements the required changes in
C4::Reserves::CanItemBeReserved so it implements a daily limit on holds.

It returns the 'tooManyReservesToday' string if the policy doesn't allow
placing the hold. It returns 'OK' (current behaviour) otherwise.

To test:
- Run:
  $ sudo koha-shell kohadev
 k$ cd kohaclone
 k$ prove t/db_dependent/Holds.t
=> FAIL: Tests fail because the error condition is not making
CanItemBeReserved return the desired error code.
- Apply this patch
- Run:
 k$ prove t/db_dependent/Holds.t
=> SUCCESS: Tests pass!
- Sign off :-D

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
C4/Reserves.pm