Koha/circ
Jonathan Druart 4d8489efba Bug 14045: Add specific quotas to on-site checkouts
This patch set adds the ability to defined independent quotas for on-site
checkouts.
This will be done using the circulation rules matrix where a new column
“Current on-site checkouts allow” will be added.

This feature is going to use the same method as the existing fields maxissueqty
("Current checkouts allowed"), the new fields will be added to the
different tables (see the "DB changes" patch) and will be named
maxonsiteissueqty (for consistency).

In order to keep the existing behavior and to let more flexibility,
a new system preference is added (ConsiderOnSiteCheckoutsAsNormalCheckouts).
This syspref will let the liberty to the library to decide if an on-site
checkout should be considered as a "normal" checkout or not.

To keep the existing behavior, the syspref will be disabled (i.e. an on-site
checkout is considered as a normal checkout) and the number of on-site
checkouts will be the same as the number of checkout (maxissueqty ==
maxonsiteissueqty).

Technically:
There are only very few tests for the Circulation module, and the 2
subroutines impacted by this patch set were not tested at all.
It is necessary to introduce non-regression tests for this area.
The 2 subroutines are: C4::Circulation::GetBranchBorrowerCircRule
and C4::Circulation::TooMany (only called by
C4::Circulation::CanBookBeIssued, so we will take the liberty to change
the prototype to raise a better warning to the end user).

Test plan:
I. Confirm there is no regression and the existing behavior is kept
 0/ Let the syspref disabled
 1/ Set a rule to limit to 2 the number of checkouts allowed
 2/ Do a normal checkout
 3/ Do an on-site checkout
 4/ Try to checkout (on-site or normal) an item again.
 You should not be allowed.

II. Test the new feature - pref disabled
 0/ Let the syspref disabled
 1/ Set a rule to limit to 2 the number of checkouts allowed and to 1
 the number of on-site checkouts allowed.
 2/ Do an on-site checkout
 3/ Try to do another one, you should not be allowed to do it.
 4/ A normal checkout should pass successfully
Note that it does not make sense to have the number of on-site checkouts
alowed > number of checkouts allowed.

III. Test the new feature - pref enabled
 0/ Enable the syspref
Now an on-site checkout is *not* counted as a normal checkout.
This means you can have the number of on-site checkouts > number of
checkouts allowed.
 1/ Set the values you want for the 2 types of checkouts (normal vs
on-site).
 2/ Even if a patron has reached the maximum of checkouts allowed, he
 will be allowed to do a on-site checkout (vice versa).

IV. Stress the developper
 Using the different configurations available in the circulation matrix,
 try to find one where the checkout is allowed and not should be.

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Nicolas Legrand <nicolas.legrand@bulac.fr>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
2015-10-13 11:13:22 -03:00
..
add_message.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
bookcount.pl Bug 14890: Simplify processing to display a date with hours 2015-10-08 10:59:05 -03:00
branchoverdues.pl Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
branchtransfers.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
circulation-home.pl Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
circulation.pl Bug 14045: Add specific quotas to on-site checkouts 2015-10-13 11:13:22 -03:00
del_message.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
hold-transfer-slip.pl Bug 13482: Prevent race condition on printing a ReserveSlip 2015-04-22 16:32:15 -03:00
offline-mf.pl Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
offline.pl Bug 11944: use CGI( -utf8 ) everywhere 2015-01-13 13:07:21 -03:00
on-site_checkouts.pl Bug 11201: Add a in-house use list pages 2015-03-31 11:30:55 -03:00
overdue.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
pendingreserves.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
renew.pl Bug 12066: New renew page in staff client doesn't record branch in statistics 2015-06-01 10:56:53 -03:00
reserveratios.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
returns.pl Bug 14842: Wrong call to GetBranchItemRule 2015-10-02 11:06:39 -03:00
selectbranchprinter.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
stats.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
transfer-slip.pl Bug 9978: Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:38 -03:00
transferstoreceive.pl Bug 13813: Remove deprecated module C4::Dates from system 2015-09-18 12:40:56 -03:00
view_holdsqueue.pl Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
waitingreserves.pl Bug 13813: Remove deprecated module C4::Dates from system 2015-09-18 12:40:56 -03:00
ypattrodue-attr-search-authvalue.pl Bug 9978: (followup) Replace license header with the correct license (GPLv3+) 2015-04-20 09:59:43 -03:00
ysearch.pl Bug 13822: Patron autocomplete search is severly limited 2015-05-14 11:11:09 -03:00