@@ -, +, @@ are updated /on return --- C4/Circulation.pm | 4 +++- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ .../prog/en/modules/admin/preferences/circulation.pref | 7 +++++++ 4 files changed, 23 insertions(+), 1 deletion(-) --- a/C4/Circulation.pm +++ a/C4/Circulation.pm @@ -1785,7 +1785,9 @@ sub AddReturn { } if ($borrowernumber) { - if($issue->{'overdue'}){ + if( C4::Context->preference('CalculateFinesOnReturn') && $issue->{'overdue'}){ + # we only need to calculate and change the fines if we want to do that on return + # Should be on for hourly loans my ( $amount, $type, $unitcounttotal ) = C4::Overdues::CalcFine( $item, $borrower->{categorycode},$branch, $datedue, $today ); $type ||= q{}; if ( $amount > 0 && ( C4::Context->preference('finesMode') eq 'production' )) { --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -424,3 +424,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES(' INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPAC','0','','If on, and a patron is logged into the OPAC, items from his or her home library will be emphasized and shown first in search results and item details.','YesNo'); INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('HighlightOwnItemsOnOPACWhich','PatronBranch','PatronBranch|OpacURLBranch','Decides which branch''s items to emphasize. If PatronBranch, emphasize the logged in user''s library''s items. If OpacURLBranch, highlight the items of the Apache var BRANCHCODE defined in Koha''s Apache configuration file.','Choice'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UniqueItemFields', 'barcode', 'Space-separated list of fields that should be unique (used in acquisition module for item creation). Fields must be valid SQL column names of items table', '', 'Free'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6778,6 +6778,18 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do( + q{ +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo'); +} + ); + print +"Upgrade to $DBversion done (Bug 10120 - Fines on item return controlled by a systempreference)\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 @@ -319,6 +319,13 @@ Circulation: yes: Block no: "Don't block" - returning of items that have been withdrawn. + - + - pref: CalculateFinesOnReturn + choices: + yes: Do + no: "Don't" + - calculate and update overdue charges when an item is returned. + -
NOTE If you are doing hourly loans then you should have this on. Holds Policy: - - pref: AllowHoldPolicyOverride --