@@ -, +, @@ 1) Apply this patch 2) Run updatedatabase.pl 3) Ensure that ReturnItemWhenTransferred is enabled 4) Check an item out to a borrower 5) Transfer the item to another library 6) Verify the item was returned and removed from the patron's issues 7) Disable ReturnItemWhenTransferred 8) Check an item out to a borrower 9) Transfer the item to another library --- C4/Circulation.pm | 8 +++++- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 22 ++++++++++++++++++++ .../en/modules/admin/preferences/circulation.pref | 7 ++++++ 4 files changed, 36 insertions(+), 2 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -339,8 +339,12 @@ sub transferbook { # check if it is still issued to someone, return it... if ($issue->{borrowernumber}) { - AddReturn( $barcode, $fbr ); - $messages->{'WasReturned'} = $issue->{borrowernumber}; + if ( C4::Context->preference('ReturnItemWhenTransferred') ) { + AddReturn( $barcode, $fbr ); + $messages->{'WasReturned'} = $issue->{borrowernumber}; + } else { + $messages->{'NotReturned'} = $issue->{borrowernumber}; + } } # find reserves..... --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -427,3 +427,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowHoldNotes',0,'Show hold notes on OPAC','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); +INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('ReturnItemWhenTransferred','1',NULL,'If enabled, items will be automatically returned when transferred. If disabled, items will not be returned when transferred, and if the item is checked out to a patron, it will remain checked out.','YesNo'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6983,6 +6983,28 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ( SetVersion($DBversion); } +$DBversion = "3.13.00.XXX"; +if(CheckVersion($DBversion)) { + $dbh->do( + q{ + INSERT INTO systempreferences ( + variable, + value, + options, + explanation, + type + ) VALUES ( + 'ReturnItemWhenTransferred', + '1', + NULL , + 'If enabled, items will be automatically returned when transferred. If disabled, items will not be returned when transferred, and if the item is checked out to a patron, it will remain checked out.', + 'YesNo' + ) + } + ); + print "Upgrade to $DBversion done (Bug 10378 - Enable checked out items to be transferred without returning them)\n"; + SetVersion($DBversion); +} =head1 FUNCTIONS --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -557,3 +557,10 @@ Circulation: yes: Use no: "Don't use" - course reserves + Transfers Policy: + - + - pref: ReturnItemWhenTransferred + choices: + yes: "Do" + no: "Don't" + - automatically check in items when they are transferred. --