[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-05-24 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

--- Comment #5 from Magnus Enger  ---
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
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-05-13 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

pierre.ge...@biblibre.com changed:

   What|Removed |Added

 CC||pierre.ge...@biblibre.com

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-04-12 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

Marcel de Rooy  changed:

   What|Removed |Added

 Status|Signed Off  |Failed QA

--- Comment #4 from Marcel de Rooy  ---
Please note the static branch:

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

And as I read the original code, I think that it does what the pref says.

 # 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 ) {
+if ( $holds->count() < $threshold ) {
 return $return_data;
 }

So if you have 1 holdable item and pref = 1, than we should check if
holds->count <= 2. In that case you do not exceed. If it is 3, than the holds
count is more than 1 PLUS the number of holdable items (1) on the record.

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-04-12 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

Marcel de Rooy  changed:

   What|Removed |Added

Version|22.11   |master
   Assignee|koha-b...@lists.koha-commun |mag...@libriotech.no
   |ity.org |
 QA Contact|testo...@bugs.koha-communit |m.de.r...@rijksmuseum.nl
   |y.org   |
 CC||m.de.r...@rijksmuseum.nl

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-04-08 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

Philip Orr  changed:

   What|Removed |Added

 Attachment #163481|0   |1
is obsolete||

--- Comment #3 from Philip Orr  ---
Created attachment 164495
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=164495&action=edit
Bug 34902: decreaseLoanHighHolds does not reduce loan period

See the bug for a description of the problem.

Settings:
- decreaseLoanHighHolds = Enable
- decreaseLoanHighHoldsDuration = 7
- decreaseLoanHighHoldsValue = 1
- decreaseLoanHighHoldsControl = over the number of holdable
  items on the record
- decreaseLoanHighHoldsIgnoreStatuses = [none selcted]

Set a default loan period of 28 days under Administration >
Circulation and fine rules

To reproduce:
- Find a record with one item
- Add three holds on the record, for three different patrons
- Check out the item to the first patron on the waiting list
- Verify that the item is issued without any shortened loan time

To test:
- Return the loan you made above, and ignore the holds on the record
- Add another hold to the record
- Apply the patch
- Restart all the things
- Check out the item to the first patron on the waiting list
- Verify that there is now a warning about a shortened loan time

Signed-off-by: Philip Orr 

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-04-08 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

Philip Orr  changed:

   What|Removed |Added

 Status|Needs Signoff   |Signed Off

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-03-19 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

--- Comment #2 from Magnus Enger  ---
Created attachment 163481
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=163481&action=edit
Bug 34902: decreaseLoanHighHolds does not reduce loan period

See the bug for a description of the problem.

Settings:
- decreaseLoanHighHolds = Enable
- decreaseLoanHighHoldsDuration = 7
- decreaseLoanHighHoldsValue = 1
- decreaseLoanHighHoldsControl = over the number of holdable
  items on the record
- decreaseLoanHighHoldsIgnoreStatuses = [none selcted]

Set a default loan period of 28 days under Administration >
Circulation and fine rules

To reproduce:
- Find a record with one item
- Add three holds on the record, for three different patrons
- Check out the item to the first patron on the waiting list
- Verify that the item is issued without any shortened loan time

To test:
- Return the loan you made above, and ignore the holds on the record
- Add another hold to the record
- Apply the patch
- Restart all the things
- Check out the item to the first patron on the waiting list
- Verify that there is now a warning about a shortened loan time

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-03-19 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

Magnus Enger  changed:

   What|Removed |Added

   Patch complexity|--- |Small patch
 Status|NEW |Needs Signoff

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2024-03-19 Thread bugzilla-daemon--- via Koha-bugs
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

Magnus Enger  changed:

   What|Removed |Added

 CC||mag...@libriotech.no

--- Comment #1 from Magnus Enger  ---
The description of the relevant syspres says: 

[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].

So we should reduce the loan period for items with *more than* [1] holds over
the number of holdable items. 

The scenario is that a patron is in the library to pick up a book that has been
on hold for them, and we need to consider the holds that are left, after this
patron checks out their loan. Should the loan period of this loan be made
shorter, or not? 

So if there is

- 1 holdable item and 1 remaining hold, we should not reduce the loan period
(this is *equal to* the number of holdable items + 1, but not *more than*)

- 1 holdable item and 2 remaining holds, we should reduce the loan period
(because this is *more than* the limit we have set)

But the code looks like this now:

my $threshold = $items_count + $decreaseLoanHighHoldsValue;

# 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;
}

So with 1 item and decreaseLoanHighHoldsValue = 1 we get a $threshold of 2. But
this is then compared with a "more than or equal" to the number of remaining
holds, meaning that both with 1 and 2 remaining holds, the loan period is not
shortened. But it should be shortened when there are two remaining holds. So
the comparison should be "more than", not "more than or equal". Patch coming.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2023-09-25 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

Lisette Scheer  changed:

   What|Removed |Added

   Severity|enhancement |minor
 CC||lisette.scheer@bywatersolut
   ||ions.com

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/


[Koha-bugs] [Bug 34902] decreaseLoanHighHolds does not reduce loan period

2023-09-24 Thread bugzilla-daemon
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34902

Eric Phetteplace  changed:

   What|Removed |Added

 CC||pnavarr...@cca.edu

-- 
You are receiving this mail because:
You are watching all bug changes.
___
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
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/