@@ -, +, @@ borrower's record on the borrower's record. --- C4/Circulation.pm | 2 +- circ/returns.pl | 11 +---------- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../en/modules/admin/preferences/circulation.pref | 7 +++++++ 5 files changed, 17 insertions(+), 11 deletions(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1602,7 +1602,7 @@ sub AddReturn { if ( $item->{'wthdrawn'} ) { # book has been cancelled $messages->{'wthdrawn'} = 1; - $doreturn = 0; + $doreturn = 0 if C4::Context->preference("BlockReturnOfWithdrawnItems"); } # case of a return of document (deal with issues and holdingbranch) --- a/circ/returns.pl +++ a/circ/returns.pl @@ -291,15 +291,6 @@ if ($barcode) { $input{duedate} = 0; $returneditems{0} = $barcode; $riduedate{0} = 0; - if ( $messages->{'wthdrawn'} ) { - $input{withdrawn} = 1; - $input{borrowernumber} = 'Item Cancelled'; # FIXME: should be in display layer ? - $riborrowernumber{0} = 'Item Cancelled'; - } - else { - $input{borrowernumber} = ' '; # This seems clearly bogus. - $riborrowernumber{0} = ' '; - } push( @inputloop, \%input ); } } @@ -444,7 +435,7 @@ foreach my $code ( keys %$messages ) { } elsif ( $code eq 'wthdrawn' ) { $err{withdrawn} = 1; - $exit_required_p = 1; + $exit_required_p = 1 if C4::Context->preference("BlockReturnOfWithdrawnItems"); } elsif ( ( $code eq 'IsPermanent' ) && ( not $messages->{'ResFound'} ) ) { if ( $messages->{'IsPermanent'} ne $userenv_branch ) { --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -375,3 +375,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free'); +INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -5536,6 +5536,13 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +$DBversion ="3.09.00.XXX"; +if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo');"); + print "Upgrade to $DBversion done (Add system preference IntranetSlipPrinterJS))\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -254,6 +254,13 @@ Circulation: alert: "display a message" nothing : "do nothing" - . + Checkin Policy: + - + - pref: BlockReturnOfWithdrawnItems + choices: + yes: Block + no: "Don't block" + - returning of items that have been withdrawn. Holds Policy: - - pref: AllowHoldPolicyOverride --