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)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 8 Nov 2023 14:41:34 +0000 (11:41 -0300)
commitd1d5811279fe6a2c8fc0953142fffe3adc9f249b
tree340c95ed51767b462c7ac0a51fa7b2662eb7d4b2
parent07a4446f2f3fcbb22bd41a90f21e808e1c57eadc
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>
C4/ILSDI/Services.pm
koha-tmpl/opac-tmpl/bootstrap/en/modules/ilsdi.tt
t/db_dependent/ILSDI_Services.t