Bug 25690: Remove duplicated logic in SIP2 checkouts
authorJoonas Kylmälä <joonas.kylmala@helsinki.fi>
Wed, 17 Feb 2021 12:17:36 +0000 (14:17 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 8 Mar 2021 15:35:52 +0000 (16:35 +0100)
commitf85de0b71ce5d469a5129b63a46f4e62b0e6c616
tree2a6b10f061e9502647b082ad69e1943872153538
parentdfd1d58f6787ea19d38fff939523243c2de9a5e5
Bug 25690: Remove duplicated logic in SIP2 checkouts

Because AllowItemsOnHoldCheckoutSIP only affects the checkoutability
of non-attached, i.e. RESERVED holds in SIP2 we can therefore use the
common code from CanBookBeIssued and ignore only the RESERVED confirmation
message case in SIP2 checkout code.

This slightly changes the checkout error message given for "In
processing" holds that someone other than the holdee tries to
checkout. Otherwise there is no logic changes. The message that this
changes is "Item is on hold for another patron." vs. now "Item cannot
be issued: $confirmation". It is easier to create follow-up patch to
properly add INPROCESSING confirmation to CanBookBeIssued and then
show correct message based on the CanBookBeIssued return value.

To test:
 1) Apply all patches from bug 25690 to get latest Transaction.t version
 2) prove t/db_dependent/SIP/Transaction.t => passes

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 338ba1d7692c1f75af7b0fb75eb5aac00a04a3df)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
C4/SIP/ILS/Transaction/Checkout.pm