Bug 42700: hold_items in SIP patron info should contain all holds, not just waiting

Some 3rd party SIP clients calculate the number of holds ready
for pickup as:

  holds ready for pickup = hold_items - unavail_holds

Right now this can produce a negative number since hold_items
contains only waiting holds.

This patch makes hold_items contain all of the patron's holds,
so hold_items - unavail_holds correctly gives the count of holds
ready to be picked up.

Test Plan:
1) Apply the first patch only
2) prove t/db_dependent/SIP/Patron.t
3) Note the new "hold_items counts all holds" subtest fails
4) Apply this patch
5) prove t/db_dependent/SIP/Patron.t
6) Note the tests pass!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Aleisha Amohia <aleisha@catalyst.net.nz>
Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
Kyle M Hall 2026-05-28 09:10:34 -04:00 committed by Pedro Amorim
parent d8cf6da3a2
commit eb57856091
No known key found for this signature in database
GPG Key ID: 06B75BA7F3894D55
1 changed files with 1 additions and 1 deletions

View File

@ -168,7 +168,7 @@ sub new {
screen_msg => 'Greetings from Koha. ' . $kp->{opacnote} . $fines_msg,
print_line => '',
items => [],
hold_items => $flags->{WAITING}->{itemlist},
hold_items => $patron->holds->unblessed,
overdue_items => $flags->{ODUES}->{itemlist},
too_many_overdue => $circ_blocked,
fine_items => [],