Bug 27204: Fix end boundary index, never return results for non-existant accountlines
authorKyle M Hall <kyle@bywatersolutions.com>
Fri, 11 Dec 2020 12:13:12 +0000 (07:13 -0500)
committerFridolin Somers <fridolin.somers@biblibre.com>
Fri, 5 Feb 2021 15:40:55 +0000 (16:40 +0100)
commit0ebfff111dcecca92deffb36fd62e58e0a9e3bba
treea3802d3373d77cfe3aea03bf9eb1afeca84dc133
parentbf1563d86de6270add390042047e4c0bd825f2fb
Bug 27204: Fix end boundary index, never return results for non-existant accountlines

There are two primary issues I've identified with requesting line items
for fees via SIP:

1) The end boundary is incorrect. For example, if send a request with a
BP ( starting item) of 1, and a BQ (end item) of 1, I should get just
the first item. Instead I will get two items

2) Our SIP server does not check bounds. For example, if I have 3 fines,
but I send a BP of 1 and a BQ of 5, I will get back 5 AVs, two of
them being "empty" because the patron only has 3 accountlines!

Test Plan:
1) Apply the unit test patch
2) prove t/db_dependent/SIP/Patron.t
3) Note the failures
4) Apply the second patch
5) prove t/db_dependent/SIP/Patron.t
6) All tests should pass!

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 0a5232412fee9a9811b7354c8ea98ee889eaee3c)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/SIP/ILS/Patron.pm