Bug 13697: Syspref to not add a fee when a patron changes to a category with enrolment fee

By default this syspref is "Do" to keep the previous behaviour.

Test plan :

1/ create 2 categories (A & B). B with enrolment fee
2/ create a patron in category A
3/ change the patron category from A to B
4/ check that the patron has an enrolment fee to pay

Apply the patch

1/ create a new patron in category A
2/ change the patron category from A to B.
3/ check that the patron has an enrolment fee to pay
4/ change the system preference 'FeeOnChangePatronCategory' to 'Don't';
5/ create a new patron in category A
6/ change the patron category from A to B
7/ check that the patron has no enrolment fee to pay

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Christophe Croullebois 2015-02-11 14:46:47 +01:00 committed by Tomas Cohen Arazi
parent 8749411abd
commit 079de81c10
4 changed files with 20 additions and 1 deletions

View file

@ -683,7 +683,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 ) {
AddEnrolmentFeeIfNeeded( $data{categorycode}, $data{borrowernumber} );
if ( C4::Context->preference('FeeOnChangePatronCategory') ) {
AddEnrolmentFeeIfNeeded( $data{categorycode}, $data{borrowernumber} );
}
}
# If NorwegianPatronDBEnable is enabled, we set syncstatus to something that a

View file

@ -130,6 +130,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('ExtendedPatronAttributes','0',NULL,'Use extended patron IDs and attributes','YesNo'),
('FacetLabelTruncationLength','20',NULL,'Specify the facet max length in OPAC','Integer'),
('FacetMaxCount','20',NULL,'Specify the max facet count for each category','Integer'),
('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is added','YesNo')
('FilterBeforeOverdueReport','0','','Do not run overdue report until filter selected','YesNo'),
('FineNotifyAtCheckin','0',NULL,'If ON notify librarians of overdue fines on the items they are checking in.','YesNo'),
('finesCalendar','noFinesWhenClosed','ignoreCalendar|noFinesWhenClosed','Specify whether to use the Calendar in calculating duedates and fines','Choice'),

View file

@ -10776,6 +10776,16 @@ if ( CheckVersion($DBversion) ) {
SetVersion ($DBversion);
}
$DBversion = "3.19.00.XXX";
if ( CheckVersion($DBversion) ) {
$dbh->do(q{
INSERT INTO `systempreferences` (`variable`, `value`, `options`, `explanation`, `type`)
VALUES ('FeeOnChangePatronCategory','1','','If set, when a patron changes to a category with enrolment fee, a fee is 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);
}
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.

View file

@ -159,3 +159,9 @@ Patrons:
yes: Do
no: "Don't"
- search the Norwegian national patron database after a local search result was found.
-
- pref: FeeOnChangePatronCategory
choices:
yes: Do
no: "Don't"
- add a fee when a patron changes to a category with enrolment fee.