Bug 21284: ILS-DI: Allow GetPatronInfo to tell if a loaned item is on hold by someone...
authorMatthias Meusburger <matthias.meusburger@biblibre.com>
Fri, 27 Apr 2018 14:22:28 +0000 (16:22 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Sat, 11 Nov 2023 01:14:34 +0000 (15:14 -1000)
commit1b4cd9eeaad48e890fc86f073114beecca0e6b31
tree9c8ed39b8bbd1a228e91714239c58811ff1d029a
parent619b31706a7a3011f57f9f4c4fe2a0801c7f7994
Bug 21284: ILS-DI: Allow GetPatronInfo to tell if a loaned item is on hold by someone else.

This patch adds two new entries in the loans section of GetPatronInfo response:

 - itemonhold: number of holds on this specific item.
 - recordonhold: number of holds on the record.

It allows an ILS-DI client to know if a loaned item is already on hold by someone else, and how many holds there are.

Test plan:
1. Apply the patch.
2. Enable the ILS-DI system preference.
3. Check out an item for a patron and make sure there no other holds at either an item or record level.
4. Check that the new itemonhold and recordonhold entries displayed are equal to zero (example: http://127.0.0.1:8080/cgi-bin/koha/ilsdi.pl?service=GetPatronInfo&patron_id=19&show_contact=0&show_loans=1).
5. Add either a record or item level hold for the record used in step 2.
6. Check that itemonhold and recordonhold values are incremented accordingly.
   Note: a hold at an item level counts as a hold at a record level, but not vice-versa.
7. Run the tests and make sure they pass: prove t/db_dependent/ILSDI_Services.t
8. Sign-off!

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit d1d5811279fe6a2c8fc0953142fffe3adc9f249b)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/ILSDI/Services.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt
t/db_dependent/ILSDI_Services.t