Bug 18317: Allow check out of already checked out items through SIP

This patch allows checkouts to be processed via SIP even when
the item is already checked out to a user.

Test plan:
0) Apply the patch
1) koha-sip --stop kohadev
2) koha-sip --start kohadev
3) misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkout --patron koha --item 39999000001310
4) misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkout --patron 23529000035676 --item 39999000001310
5) Note the output includes "AFItem checked out to another patron"
6) Enable system preference "AllowItemsOnLoanCheckoutSIP"
7) misc/sip_cli_emulator.pl -a localhost -p 6001 -l CPL -su term1 -sp term1 -m checkout --patron 23529000035676 --item 39999000001310
8) Note the output no longer includes "AFItem checked out to another patron" and the item has been checked out to patron 23529000035676

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
David Cook 2021-07-19 04:16:44 +00:00 committed by Katrin Fischer
parent a6457c14aa
commit 8c561d950f
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
4 changed files with 15 additions and 1 deletions

View file

@ -20,6 +20,8 @@ use C4::SIP::ILS::Transaction::Hold;
use C4::SIP::ILS::Transaction::Renew;
use C4::SIP::ILS::Transaction::RenewAll;
use C4::Context; #BZ 18317
my %supports = (
'magnetic media' => 1,
'security inhibit' => 0,
@ -161,6 +163,7 @@ sub checkout {
$circ->screen_msg("Invalid Item");
}
elsif ( $item->{borrowernumber}
&& ! C4::Context->preference('AllowItemsOnLoanCheckoutSIP') #BZ 18317
&& !_ci_cardnumber_cmp( $item->{borrowernumber}, $patron->borrowernumber ) )
{
$circ->screen_msg("Item checked out to another patron");

View file

@ -88,7 +88,9 @@ sub do_checkout {
{
$self->screen_msg("Item is on hold for another patron.");
$noerror = 0;
} elsif ( $confirmation eq 'ISSUED_TO_ANOTHER' ) {
} elsif ($confirmation eq 'ISSUED_TO_ANOTHER' and C4::Context->preference("AllowItemsOnLoanCheckoutSIP")) { #BZ 18317
next;
} elsif ($confirmation eq 'ISSUED_TO_ANOTHER' and ! C4::Context->preference("AllowItemsOnLoanCheckoutSIP")) { #BZ 18317
$self->screen_msg("Item already checked out to another patron. Please return item for check-in.");
$noerror = 0;
last;

View file

@ -34,6 +34,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('AllowHoldPolicyOverride','0',NULL,'Allow staff to override hold policies when placing holds','YesNo'),
('AllowHoldsOnDamagedItems','1','','Allow hold requests to be placed on damaged items','YesNo'),
('AllowHoldsOnPatronsPossessions','1',NULL,'Allow holds on records that patron have items of it','YesNo'),
('AllowItemsOnLoanCheckoutSIP','0','','Do not generate ISSUED_TO_ANOTHER warning when checking out items already checked out to someone else via SIP. This allows self checkouts for those items.','YesNo'),
('AllowItemsOnHoldCheckoutSCO','0','','Do not generate RESERVE_WAITING and RESERVED warning in the SCO module when checking out items reserved to someone else. This allows self checkouts for those items.','YesNo'),
('AllowItemsOnHoldCheckoutSIP','0','','Do not generate RESERVED warning when checking out items reserved to someone else via SIP. This allows self checkouts for those items.','YesNo'),
('AllowMultipleCovers','0','1','Allow multiple cover images to be attached to each bibliographic record.','YesNo'),

View file

@ -226,6 +226,14 @@ Circulation:
- checkouts of items reserved to someone else via SIP checkout messages.
- If allowed do not generate RESERVED warning.
- This allows self checkouts for those items. If using the holds queue items with pending holds will be marked as "unavailable" if this set to "Don't allow".
-
- pref: AllowItemsOnLoanCheckoutSIP
choices:
1: Allow
0: "Don't allow"
- checkouts of items already checked out to someone else via SIP checkout messages.
- If allowed do not generate ISSUED_TO_ANOTHER warning.
- This allows self checkouts for those items.
-
- pref: AllowItemsOnHoldCheckoutSCO
choices: