From 94057cd932d6aa4a287652e17fe0535ff7b8735f Mon Sep 17 00:00:00 2001 From: Christophe Croullebois Date: Wed, 11 Feb 2015 14:46:47 +0100 Subject: [PATCH] Bug 13697 : Option to do not add a fee, if the patron changes to a category with enrolment fee --- C4/Members.pm | 2 ++ installer/data/mysql/updatedatabase.pl | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/C4/Members.pm b/C4/Members.pm index 6f95b94..1cec21f 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -811,7 +811,9 @@ sub ModMember { # If the patron changes to a category with enrollment fee, we add a fee if ( $data{categorycode} and $data{categorycode} ne $old_categorycode ) { + if (C4::Context->preference('FeeOnChangePatronCategory') == 0){ AddEnrolmentFeeIfNeeded( $data{categorycode}, $data{borrowernumber} ); + } } # If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index dab1c62..654fad1 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -9759,6 +9759,13 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "3.19.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('FeeOnChangePatronCategory','0','If set, when the patron changes to a category with enrolment fee, a fee is not added','','YesNo')"); + print "Upgrade to $DBversion done (Bug 13697 - Option to don't add a fee, if the patron changes to a category with enrolment fee)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) -- 1.7.9.5