From fb9e4f255f01021279ba64fb0923f2c10f2b8793 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Tue, 14 Oct 2025 13:01:17 +0300 Subject: [PATCH] Bug 22322: Handle setting transfer status correctly If one checked in an item which has a hold and which should be put in transfer, reason for transfer was set as "ResFound". This has been replaced with "Reserve" and using wrong reason parameter lead to error "The reason parameter is mandatory". Also if wrong transfer was detected, SCO would fail with error since branch where item should be transfered couldn't be determined just using the old transfers branchcode. To test: 1. Apply this patch. 2. Find an item which is checked out and has holds for a patron in different library. 3. Return item via SCO check in from SCO main page. => Item should be checked in succesfully. 4. Find an item which is in transit from a branch A to B and check it out from branch C. => Koha shouldn't fail on error. Also fix QA tool issues. Sponsored-by: Koha-Suomi Oy --- .../bootstrap/en/modules/sco/sco-main.tt | 110 +++++++++--------- opac/sco/sco-main.pl | 5 +- 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt index d610862ad0..846cf7ebc6 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/sco/sco-main.tt @@ -319,46 +319,46 @@ [% END %]
-
+

Check out

[% INCLUDE 'csrf-token.inc' %]
Log in to your account -
- [% IF ( Koha.Preference('SelfCheckoutByLogin') ) %] -
-
[% PROCESS login_label for="patronlogin" %]
-
- -
-
- -
-
- -
-
- -
+
+ [% IF ( Koha.Preference('SelfCheckoutByLogin') ) %] +
+
[% PROCESS login_label for="patronlogin" %]
+
+
- - [% ELSE %] -
-
- -
-
- -
-
- -
+
+
- - [% END %] -
- +
+ +
+
+ +
+
+ + [% ELSE %] +
+
+ +
+
+ +
+
+ +
+
+ + [% END %] +
+ [% FOREACH INPUT IN INPUTS %] [% END %] @@ -368,34 +368,34 @@
-
+

Check in

[% INCLUDE 'csrf-token.inc' %]
-
-
-
- -
-
- [% IF ( returned == 1 || returned == 0 || empty_return ) %] - - [% ELSE %] - - [% END %] -
-
- -
+
+
+
+ +
+
+ [% IF ( returned == 1 || returned == 0 || empty_return ) %] + + [% ELSE %] + + [% END %] +
+
+
- - [% FOREACH INPUT IN INPUTS %] - - [% END %] -
- + + [% FOREACH INPUT IN INPUTS %] + + [% END %] + +
+
diff --git a/opac/sco/sco-main.pl b/opac/sco/sco-main.pl index 53a274fb30..efc4803735 100755 --- a/opac/sco/sco-main.pl +++ b/opac/sco/sco-main.pl @@ -207,7 +207,7 @@ if ( ( $op eq "cud-sco_entry_checkin" ) || ( $patron && $op eq "cud-returnbook" if ($diff_branch_send) { ModReserveAffect( $itemnumber, $resborrower, $diff_branch_send, $reserve_id ); - ModItemTransfer( $itemnumber, $branch, $resbranch, 'ResFound' ); + ModItemTransfer( $itemnumber, $branch, $resbranch, 'Reserve' ); } else { my $set_transit = C4::Context->preference('RequireSCCheckInBeforeNotifyingPickups'); ModReserveAffect( $itemnumber, $resborrower, $set_transit, $reserve_id ); @@ -219,8 +219,9 @@ if ( ( $op eq "cud-sco_entry_checkin" ) || ( $patron && $op eq "cud-returnbook" if ( $messages->{'WrongTransfer'} ) { my $item = Koha::Items->find( $messages->{'WrongTransferItem'} ); my $old_transfer = $item->get_transfer; + my $to_library = Koha::Libraries->find( $old_transfer->tobranch ); my $new_transfer = $item->request_transfer( - { to => $old_transfer->tobranch, reason => $old_transfer->reason, replace => 'WrongTransfer' } ); + { to => $to_library, reason => $old_transfer->reason, replace => 'WrongTransfer' } ); } } -- 2.34.1