From 28e93c443a2348f1f9e454544d7657bea04de7d9 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 24 Apr 2012 09:05:36 -0400 Subject: [PATCH] Bug 7189 - preference to control if returning lost items gives refund Right now when you return an item that was lost the patron's card is credited with the lost fee, but not all libraries refund lost fees and sometimes the fee is refunded after the patron has paid for it, causing all kinds of financial issues. Adds the syspref RefundLostItemFeeOnReturn to control whether returning a lost item refunds the fee charged for losing that item. Enabled by default to maintain Koha's current functionality. --- C4/Circulation.pm | 4 +++- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 8 ++++++++ .../en/modules/admin/preferences/circulation.pref | 6 ++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index ca2e94d..9ba235c 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -1069,7 +1069,9 @@ sub AddIssue { ## If item was lost, it has now been found, reverse any list item charges if neccessary. if ( $item->{'itemlost'} ) { - _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); + if ( C4::Context->preference('RefundLostItemFeeOnReturn' ) ) { + _FixAccountForLostAndReturned( $item->{'itemnumber'}, undef, $item->{'barcode'} ); + } } ModItem({ issues => $item->{'issues'}, diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 6a3735d..fbf87df 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -374,4 +374,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('OPACShowUnusedAuthorities','1','','Show authorities that are not being used in the OPAC.','YesNo'); 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('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lst item is returned.', NULL, 'YesNo'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4da22e7..62ab69b 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -5213,6 +5213,7 @@ if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { SetVersion($DBversion); } +<<<<<<< HEAD $DBversion = "3.09.00.001"; if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { $dbh->do("ALTER TABLE borrower_attribute_types MODIFY category_code VARCHAR( 1 ) NULL DEFAULT NULL"); @@ -5452,6 +5453,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,explanation,options,type) VALUES('RefundLostItemFeeOnReturn', '1', 'If enabled, the lost item fee charged to a borrower will be refunded when the lst item is returned.', NULL, 'YesNo')"); + print "Upgrade to $DBversion done ( Add system preference RefundLostItemFeeOnReturn )\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref index e07fc0d..b3e9acd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref @@ -393,6 +393,12 @@ Circulation: test: Calculate (but only for mailing to the admin) production: Calculate and charge - fines (when misc/cronjobs/fines.pl is being run). + - + - pref: RefundLostItemFeeOnReturn + choices: + yes: Refund + no: "Don't refund" + - lost item fees charged to a borrower when the lost item is returned. Self Checkout: - - pref: ShowPatronImageInWebBasedSelfCheck -- 1.7.2.5