Bug 16272: Specific case when switching an on-site checkout to a regular checkout
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Apr 2016 20:42:11 +0000 (21:42 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 9 Sep 2016 11:43:56 +0000 (11:43 +0000)
commitfe563f591102ce54ddcceed443cf8b32d88adf0f
tree3ab3f6d22653430dd2e2325283a6132d63ca9e75
parente018b69dca6e702c4abd2fd58e6e99868eada9aa
Bug 16272: Specific case when switching an on-site checkout to a regular checkout

In the case on-site checkouts are considered as a regular checkout in issuing
rules (i.e. ConsiderOnSiteCheckoutsAsNormalCheckouts is on):
When after the on-site checkout the maximum limit of checkouts is
reached and the patron wants to switch an on-site checkout to a regular
checkout, the C4::Circulation::TooMany subroutine will return a
TOO_MANY_CHECKOUTS error.
To avoid that, we need to allow an extra checkout in this subroutine.

Test plan:
0/ Switch ConsiderOnSiteCheckoutsAsNormalCheckouts and
SwitchOnSiteCheckouts on
1/ In the issuing rules, set the total number of checkouts (maxissueqty)
to 2 and the number of on-site checkouts to 2 (maxonsiteissueqty)
2/ Check 2 items out ticking the 'on-site checkout' checkbox
3/ Check one of these items out, to automatically switch it to a regular
checkout
=> The checkout should be allowed.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
C4/Circulation.pm
t/db_dependent/Circulation/SwitchOnSiteCheckouts.t