https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

--- Comment #5 from Magnus Enger <[email protected]> ---
In the static branch, the comment and the code agrees: 

            # If the number of holds is not above the threshold, we can stop
here
            if ( $holds->count() <= $decreaseLoanHighHoldsValue ) {
                return $return_data;
            }

It says "If the number of holds is not above the threshold" and we are testing
that "$holds->count() is less than or equal to $decreaseLoanHighHoldsValue",
which is the same as "$holds->count() is not above
$decreaseLoanHighHoldsValue". 

But in the "dynamic" branch, the comment and the code does not agree: 

            # If the number of holds is less than the count of items we have
            # plus the number of holds allowed above that count, we can stop
here
            if ( $holds->count() <= $threshold ) {
                return $return_data;
            }

The comment says "If the number of holds is less than the count of items", but
we are testing "$holds->count() <= $threshold", which is "the number of holds
is less than *or equal to* the count of items". There is also this comment: 

            # dynamic means X more than the number of holdable items on the
record

So again, it says "more than", not "more than or equal to". 

I also tested this again. I set these sysprefs:

decreaseLoanHighHolds
decreaseLoanHighHoldsDuration
decreaseLoanHighHoldsValue
decreaseLoanHighHoldsControl

so I had: "Enable the reduction of loan period to [7] days for high demand
items with more than [1] holds [over the number of holdable items on the
record]."

Then I placed four holds on a record with one item. 

- Check out to the first patron in the list of four holds => loan time
decreased 
- Check the item in, ignore the next hold
- Check out to the patron that is first in the list of three holds now => loan
time NOT decreased
- Check the item in, ignore the next hold

So, when checking out to a patron when there are three holds, the loan time is
not decreased. As far as I can tell, this is wrong. 

Then I applied the patch and made two more holds on the record, for a total of
four. 

- Check out to the first patron in the list of four holds => loan time
decreased 
- Check the item in, ignore the next hold
- Check out to the patron that is first in the list of three holds now => loan
time decreased
- Check the item in, ignore the next hold
- Check out to the patron that is first in the list of two holds => loan time
NOT decreased

As far as I can tell, this is correct. The sysprefs read "items with *more
than* [1] holds [over the number of holdable items on the record]". I have 1
holdable item and decreaseLoanHighHoldsValue adds 1 to that, for a threshold of
2. So when the number of holds on the record (2) equals that threshold, the
loan time is not decreased. But when the number of holds (3 or 4) exceeds the
threshold, the loan time is decreased.

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
[email protected]
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to